Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in chasetag for reset_type='random' #67

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions myosuite/envs/myo/myochallenge/chasetag_v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ def _setup(self,
**kwargs,
):
self._setup_convenience_vars()
self.reset_type = reset_type
self.maxTime = 20
self.win_distance = win_distance
self.grf_sensor_names = ['r_foot', 'r_toes', 'l_foot', 'l_toes']
self.opponent = ChallengeOpponent(sim=self.sim, rng=self.np_random, probabilities=opponent_probabilities, min_spawn_distance = min_spawn_distance)
self.success_indicator_sid = self.sim.model.site_name2id("opponent_indicator")
super()._setup(obs_keys=obs_keys,
weighted_reward_keys=weighted_reward_keys,
reset_type=reset_type,
**kwargs
)
self.init_qpos[:] = self.sim.model.key_qpos[0]
Expand Down Expand Up @@ -294,7 +294,7 @@ def viewer_setup(self, *args, **kwargs):

def _get_randomized_initial_state(self):
# randomly start with flexed left or right knee
if self.self.np_random.uniform() < 0.5:
if self.np_random.uniform() < 0.5:
qpos = self.sim.model.key_qpos[2].copy()
qvel = self.sim.model.key_qvel[2].copy()
else:
Expand All @@ -305,7 +305,7 @@ def _get_randomized_initial_state(self):
# but dont change height or rot state
rot_state = qpos[3:7]
height = qpos[2]
qpos[:] = qpos[:] + self.self.np_random.normal(0, 0.02, size=qpos.shape)
qpos[:] = qpos[:] + self.np_random.normal(0, 0.02, size=qpos.shape)
qpos[3:7] = rot_state
qpos[2] = height
return qpos, qvel
Expand Down