-
Notifications
You must be signed in to change notification settings - Fork 124
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
AntMuJoCoEnv-v0 contains many unnecessary states. #66
Comments
I was just about to ask about the root cause of this issue. This is the line:
I'm reasonably familiar with pybullet, but not at all with mujoco so if someone could tell me what |
Ok a quick update According to this thread it does seem possible to get the forces, at least in C, hopefully these methods are callable in python also. @benelot are you accepting pull requests? If so I will try and find something that will work. Also any idea as to why the shape is (14, 6)? My best guess is that the ant has 14 body parts and the contact force vector is of length 6, but I'm really not sure. |
When building all the envs, I firstly wanted them to comply with the observation sizes of the original mujoco envs. This is why I added 0s to the observation values I know to make it the same length. Then I intended to find all the missing observation values in mujoco to find the corresponding ones in pybullet, but I could not find any description of those at all! Check it out here: https://github.com/openai/gym/blob/c8a659369d98706b3c98b84b80a34a832bbdc6c0/gym/envs/mujoco/ant.py#L35 If anybody finds out what crfc_ext is in mujoco and what it corresponds to in pybullet, I am happy to help you work all this out. |
I absolutely accept pull requests. |
Contact points? Maybe then it is similar to the ant in roboschool that I ported here as well. There is also some contact point related stuff there if I remember well. |
Btw, these missing observations are all over the place in the mujoco code.If you are eager, talented and interested to figure out what they are, I am really happy to help if I can, as I somehow was not able to figure it out at the time. |
Sure I'll definitely have a dig around for these contact points, can't commit to all the other missing values, but if I have some extra time I will look for them. I do see foot contact points here
But as this is only for 4 feet I don't think it would give us the correct shape. I think I would need to have a proper dig around the mujoco code to see why the array is the shape that it is, which I will do tomorrow or the next day :) |
111-dim observation space z (height) of the Torso -> 1 orientation (quarternion x,y,z,w) of the Torso -> 4 8 Joiint angles -> 8 3-dim directional velocity and 3-dim angular velocity -> 3+3=6 8 Joint velocity -> 8 External forces (force x,y,z + torque x,y,z) applied to the CoM of each link (Ant has 14 links: ground+torso+12(3links for 4legs) for legs -> (3+3)*(14)=84 I found this in https://enginius.tistory.com/734 Is it helpful to fill in the exact state? |
@seolhokim thanks, this is super helpful! I should have some time later today to see if I can work out how to get those external forces in pybullet :) |
@sash-a Oh I forgot to tag you. I believe you can do that! Thank you! :) |
Sounds great. In a future refactoring, these foot contact calculations could then go into a "mujoco layer" that is able to generate appropriate observations for all types of robots in environments such that replacing mujoco with open source is more achievable in the future. @seolhokim The initial intent of this project was to replace Mujoco implemented openai gym envs with open source software. Therefore I try to reproduce everything this entails, thus also the exact/approximate observational state. We will not get to the level where we get the exact same responses to the same actions taken in both mujoco or pybullet, but I hope we get as close as to let mujoco trained agents run in pybullet and they achieve similar performance. |
I'm pretty sure I've found what we're looking for although it doesn't look like it's going to work. According to the docs we would need a torque sensor on the joints, which I think means we would have to modify the xml assets and I'm not too sure if that's a good idea. The method is If you want to have a look for yourself I put up a quick way to use this method in this commit ca7ab78 |
The crfc_ext are the contact forces. But Mujoco 2.0 has issues with those and is just returning zeros (openai/gym#1541) |
I think we can remove many states after a certain index, what do you think?
The text was updated successfully, but these errors were encountered: