Move to the OpenAI mujoco bindings for better visualization #65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NEW
With the code in this repo, we can use the OpenAI python bindings for mujoco, which use the native mujoco visualizer. It is much better than the current osg visualizer and allows textures, lighting variations, shadows etc.
ISSUES
When running vision-based tasks, there is a small visualizer window for every condition, and two large windows apart from that. One of the two large windows give you the "robot" view, so that you get a better view of what the robot is doing, while the other window can be used for panning/zooming to look around. There is only a single (large) window when doing non-vision stuff. I have tried turning the small windows invisible, but it results in blank images, and I do not yet know a fix for that.
You will see the following two lines in
agent_mjc.py
Ideally, we should not need the above lines, but without them, the images that I get for policy learning are blank. I am looking for a way to fix this.
Changes to hyperparams.py
I tested the following examples: reacher_vision, mjc_example, mjc_badmm_example. mjc_peg_images seems to be throwing some tensorflow errors, so it has not been tested. Convergence is a bit slower for the reacher (presumably because of a slightly higher quality visualization), but it learns to perform the task in a reasonable number of iterations (~8). I have made changes to all the
hyperparams.py
files that use mujoco, and these changes are:You now need to specify the camera position in a slightly different fashion (a lookat point, distance, and azimuthal and elevations angles).
The
pos_body_offset
argument now needs to be a list of lists, so that we can apply different displacements to different objects for every condition. The older version ofagent_mjc
just applied the same displacement everywhere.have not tested mjc_mdgps_example since it uses caffe - I can change it to use Tensorflow and test though (have tested mdgps on the reacher though).
Feedback
There's a probably a lot that can be fixed/improved here, so I welcome all kinds of feedback. Thanks!
More
I will probably add a pushing task in the repo sometime in the future which will have textures etc.