Skip to content

Commit

Permalink
Lol forgot to actually commit my changes
Browse files Browse the repository at this point in the history
  • Loading branch information
goobta committed Feb 8, 2021
1 parent bbe6b2b commit 880691f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 7 additions & 4 deletions gym_solo/envs/solo8_base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ class Solo8BaseEnv(ABC, gym.Env):
"""Solo 8 abstract base environment."""
metadata = {'render.modes': ['rgb_array']}

def __init__(self, config: configs.Solo8BaseConfig, use_gui: bool):
def __init__(self, config: configs.Solo8BaseConfig, use_gui: bool,
normalize_observations: bool = False):
"""Create a solo8 env.
Args:
config (configs.Solo8BaseConfig): The SoloConfig. Defaults to None.
use_gui (bool): Whether or not to show the pybullet GUI. Defaults to
False.
use_gui (bool): Whether or not to show the pybullet GUI.
normalize_observation (bool): Normalize the observations? Defaults to
True
"""
self.config = config

Expand All @@ -45,7 +47,8 @@ def __init__(self, config: configs.Solo8BaseConfig, use_gui: bool):
self.plane = self.client.loadURDF('plane.urdf')
self.load_bodies()

self.obs_factory = obs.ObservationFactory(self.client)
self.obs_factory = obs.ObservationFactory(self.client,
normalize=normalize_observations)
self.reward_factory = rewards.RewardFactory(self.client)
self.termination_factory = terms.TerminationFactory()

Expand Down
6 changes: 4 additions & 2 deletions gym_solo/envs/solo8v2vanilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ class Solo8VanillaEnv(Solo8BaseEnv):
Note that the model corresponds to the solo8v2.
"""
def __init__(self, use_gui: bool = False, realtime: bool = False,
config=None, normalize_actions=False, **kwargs):
config=None, normalize_actions: bool = False,
normalize_observations: bool = False, **kwargs):
"""Create a solo8 env"""
self._realtime = realtime
self._normalize = normalize_actions
super().__init__(config or Solo8VanillaConfig(), use_gui)
super().__init__(config or Solo8VanillaConfig(), use_gui,
normalize_observations=normalize_observations)

@property
def action_space(self) -> gym.Space:
Expand Down

0 comments on commit 880691f

Please sign in to comment.