Skip to content

Commit

Permalink
Merge pull request #19 from KOSASIH/deepsource-transform-b1219433
Browse files Browse the repository at this point in the history
style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf
  • Loading branch information
KOSASIH committed May 11, 2024
2 parents 627b44b + 3a6645a commit 9818abb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions models/simulation/simulation_environment.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Import necessary libraries
import time

import gym
import pybullet as p
import time
import pybullet_data

# Define a class for simulation environments


class SimulationEnvironment:
def __init__(self, config_path):
# Load configuration from file
with open(config_path) as f:
config = json.load(f)
config = json.load(f)
self.config = config

# Initialize the simulation environment
self.simulation = gym.make(self.config['simulation']['name'])
self.simulation = gym.make(self.config["simulation"]["name"])

def reset(self):
# Reset the simulation environment
Expand All @@ -38,5 +41,5 @@ def setup_pybullet(self):
p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.setGravity(0, 0, -10)
p.setTimeStep(1./240.)
p.setTimeStep(1.0 / 240.0)
p.setRealTimeSimulation(1)

0 comments on commit 9818abb

Please sign in to comment.