Skip to content

Commit ba63e88

Browse files
authored
Merge pull request #247 from elladyr/fix_loco_obs
BUGFIX: Fix mc24 loco obs helper functions
2 parents d0a667b + 0f6b1e4 commit ba63e88

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

myosuite/envs/myo/myochallenge/run_track_v0.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ def get_obs_dict(self, sim):
178178
obs_dict['terrain'] = np.array([self.terrain_type])
179179

180180
# proprioception
181-
obs_dict['internal_qpos'] = self.get_internal_qpos() #sim.data.qpos[7:].copy()
182-
obs_dict['internal_qvel'] = self.get_internal_qvel() #sim.data.qvel[6:].copy() * self.dt
181+
obs_dict['internal_qpos'] = self.get_internal_qpos()
182+
obs_dict['internal_qvel'] = self.get_internal_qvel()
183183
obs_dict['grf'] = self._get_grf().copy()
184184
obs_dict['socket_force'] = self._get_socket_force().copy()
185185
obs_dict['torso_angle'] = self.sim.data.body('pelvis').xquat.copy()
@@ -533,6 +533,7 @@ def get_internal_qpos(self):
533533
counter = 0
534534
for jnt in self.biological_jnt:
535535
temp_qpos[counter] = self.sim.data.joint(jnt).qpos[0].copy()
536+
counter+=1
536537
return temp_qpos
537538

538539
def get_internal_qvel(self):
@@ -543,6 +544,7 @@ def get_internal_qvel(self):
543544
counter = 0
544545
for jnt in self.biological_jnt:
545546
temp_qvel[counter] = self.sim.data.joint(jnt).qvel[0].copy()
547+
counter+=1
546548
return temp_qvel * self.dt
547549

548550
def muscle_lengths(self):
@@ -553,6 +555,7 @@ def muscle_lengths(self):
553555
counter = 0
554556
for jnt in self.biological_act:
555557
temp_len[counter] = self.sim.data.actuator(jnt).length[0].copy()
558+
counter+=1
556559
return temp_len
557560

558561
def muscle_forces(self):
@@ -563,6 +566,7 @@ def muscle_forces(self):
563566
counter = 0
564567
for jnt in self.biological_act:
565568
temp_frc[counter] = self.sim.data.actuator(jnt).force[0].copy()
569+
counter+=1
566570

567571
return np.clip(temp_frc / 1000, -100, 100)
568572

@@ -574,6 +578,7 @@ def muscle_velocities(self):
574578
counter = 0
575579
for jnt in self.biological_act:
576580
temp_vel[counter] = self.sim.data.actuator(jnt).velocity[0].copy()
581+
counter+=1
577582

578583
return np.clip(temp_vel, -100, 100)
579584

0 commit comments

Comments
 (0)