Skip to content
Permalink
Browse files

Version 3.0.5

observation space updated; get_observation_clipped() added
  • Loading branch information
smsong committed Aug 5, 2019
1 parent 01ab6ba commit 12fc66c84750c6691db9164b9e5ecb7b30ecf6b5
Showing with 8 additions and 4 deletions.
  1. +7 −3 osim/env/osim.py
  2. +1 −1 setup.py
@@ -438,9 +438,9 @@ class L2M2019Env(OsimEnv):
obs_body_space[:,[17 + x for x in [0, 44]]] = np.array([[-5*np.pi, 5*np.pi]]).transpose() # (r, l) joint: (+) hip extension
obs_body_space[:,[18 + x for x in [0, 44]]] = np.array([[-5*np.pi, 5*np.pi]]).transpose() # (r, l) joint: (+) knee extension
obs_body_space[:,[19 + x for x in [0, 44]]] = np.array([[-5*np.pi, 5*np.pi]]).transpose() # (r, l) joint: (+) ankle extension (plantarflexion)
obs_body_space[:,[20 + x for x in list(range(0, 33, 3)) + list(range(44, 77, 3))]] = np.array([[0, 2]]).transpose() # (r, l) muscle forces, normalized to maximum isometric force
obs_body_space[:,[21 + x for x in list(range(0, 33, 3)) + list(range(44, 77, 3))]] = np.array([[0, 2]]).transpose() # (r, l) muscle lengths, normalized to optimal length
obs_body_space[:,[22 + x for x in list(range(0, 33, 3)) + list(range(44, 77, 3))]] = np.array([[-20, 20]]).transpose() # (r, l) muscle velocities, normalized to optimal length per second
obs_body_space[:,[20 + x for x in list(range(0, 33, 3)) + list(range(44, 77, 3))]] = np.array([[0, 3]]).transpose() # (r, l) muscle forces, normalized to maximum isometric force
obs_body_space[:,[21 + x for x in list(range(0, 33, 3)) + list(range(44, 77, 3))]] = np.array([[0, 3]]).transpose() # (r, l) muscle lengths, normalized to optimal length
obs_body_space[:,[22 + x for x in list(range(0, 33, 3)) + list(range(44, 77, 3))]] = np.array([[-50, 50]]).transpose() # (r, l) muscle velocities, normalized to optimal length per second

def get_model_key(self):
return self.model
@@ -691,6 +691,10 @@ def get_observation(self):
res.append(obs_dict[leg][MUS]['v'])
return res

def get_observation_clipped(self):
obs = self.get_observation()
return np.clip(obs, self.observation_space.low, self.observation_space.high)

def get_observation_space_size(self):
return 339

@@ -7,7 +7,7 @@

# This provides the variable `__version__`.
# execfile('opensim/version.py')
__version__ = "3.0.4"
__version__ = "3.0.5"

setup(name='osim-rl',
version=__version__,

0 comments on commit 12fc66c

Please sign in to comment.
You can’t perform that action at this time.