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

Fixing missing number of steps check #435

Merged

Conversation

reginald-mclean
Copy link
Collaborator

In the original repo, the do_simulation function in the modified mujoco env had a check for the maximum number of steps per env. This was added back in now that Meta-World uses the Mujoco Env in Gymnasium

@reginald-mclean
Copy link
Collaborator Author

@pseudo-rnd-thoughts actually, do you have any thoughts about removing this value error and returning truncated=True? That way we don't need to wrap any Meta-World environment in a TimeLimit wrapper or keep track of the number of steps.

@@ -459,6 +459,8 @@ def step(self, action):
assert len(action) == 4, f"Actions should be size 4, got {len(action)}"
self.set_xyz_action(action[:3])
self.do_simulation([action[-1], -action[-1]], n_frames=self.frame_skip)
if getattr(self, 'curr_path_length', 0) > self.max_path_length:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using 'getattr' for this?

@pseudo-rnd-thoughts
Copy link
Member

I'm a bit confused on the structure of the metaworld environments, is there a technical description anywhere?

@reginald-mclean
Copy link
Collaborator Author

I copied the code that got removed from the modified MuJoco env to the Sawyer base class. We can remove this value error if we set truncated=True when the max number of steps has been hit? Unfortunately I don't think there's any great documentation on the environments themselves

@reginald-mclean
Copy link
Collaborator Author

@pseudo-rnd-thoughts I removed the use of getattr

@reginald-mclean reginald-mclean merged commit 15f269b into Farama-Foundation:master Aug 9, 2023
2 of 5 checks passed
@reginald-mclean reginald-mclean deleted the fixingNumbersteps branch August 9, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants