-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Support MuJoCo 1.5 #767
Support MuJoCo 1.5 #767
Conversation
@@ -8,9 +8,9 @@ def __init__(self): | |||
utils.EzPickle.__init__(self) | |||
|
|||
def _step(self, action): | |||
xposbefore = self.model.data.qpos[0, 0] | |||
xposbefore = self.sim.data.qpos[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that qpos
lists joint angles. In half_cheetah.xml
, it looks like the first joint is "rootx", a slide joint that should give displacement in the x direction. So qpos[0]
should give the desired value.
vel_penalty = 1e-3 * v1**2 + 5e-3 * v2**2 | ||
alive_bonus = 10 | ||
r = (alive_bonus - dist_penalty - vel_penalty)[0] | ||
r = alive_bonus - dist_penalty - vel_penalty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why alive_bonus - dist_penalty - vel_penalty
used to be an array. Please double check if I broke something here.
|
||
def get_body_xmat(self, body_name): | ||
idx = self.model.body_names.index(six.b(body_name)) | ||
return self.model.data.xmat[idx].reshape((3, 3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods don't have obvious implementations in mujoco 1.5 and they aren't used anywhere so I deleted them.
@gdb would someone review this change? this one adds support for mujuco_py@1.5. |
@lobachevzky Does your GLFW in MuJoCo 1.5 close on calling |
@aravind0706 My pull request does not support closing on What is your use case? I have never had to close a window programmatically (usually I use my good old mouse). |
I'm currently looking into getting this PR merged. I have benchmarked your changes with PPO to ensure that they are not broken and not much harder or easier to learn than before. This looks very good overall. I'm just slightly concerned about |
Could you please bump the versions of all MuJoCo environments (e.g. |
I've moved your commits over to #834 and made the necessary version bumps myself. Closing this since further progress will be tracked in the new PR. Thank you so much for this contribution! |
To test these changes, I checked that gym ran on all mujoco environments and that rendering works. Also, I have been working on a custom environment using these changes for about a month with no problems. That said, I cannot swear that these changes don't break anything so I certainly welcome any feedback.