Skip to content

Added Con[V]ex Hull and Shad[O]ws Rendering - #7

Merged
rohanpsingh merged 6 commits into
rohanpsingh:mainfrom
rohit-kumar-j:simple-linkage-example
Jun 19, 2022
Merged

Added Con[V]ex Hull and Shad[O]ws Rendering#7
rohanpsingh merged 6 commits into
rohanpsingh:mainfrom
rohit-kumar-j:simple-linkage-example

Conversation

@rohit-kumar-j

@rohit-kumar-j rohit-kumar-j commented Jun 10, 2022

Copy link
Copy Markdown
Contributor

from deepmind/mujoco/discussions/336

Normal Convex Hull
No Shadows Shadows

@rohit-kumar-j rohit-kumar-j changed the title Added Convex Hull Rendering with "V" Added Con[V]ex Hull and Shad[O]ws Rendering Jun 10, 2022
@rohanpsingh

Copy link
Copy Markdown
Owner

Hi @rohit-kumar-j
Thanks for the PR.

This PR fails with the following:

AttributeError: 'MujocoViewer' object has no attribute 'callbacks'

Is it because I didn't merge PR #5 yet?
If yes, could you please make it work with the main? Then, I'll make the changes for putting the callbacks in a separate file myself.

@rohit-kumar-j

rohit-kumar-j commented Jun 13, 2022

Copy link
Copy Markdown
Contributor Author

Made the changes. It should work now. Sorry about that. Callbacks were not ready yet.

Comment thread mujoco_viewer/mujoco_viewer.py Outdated
self._transparent = False
self._contacts = False
self._joints = False
self._shadows = False

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

self._shadows = True
since shadows are ON by default

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated: f5a39c1

Comment thread mujoco_viewer/mujoco_viewer.py Outdated
self.vopt.flags[
mujoco.mjtVisFlag.mjVIS_CONVEXHULL
] = self._convex_hull_rendering
self._convex_hull_rendering = not self._convex_hull_rendering

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This line should come before setting the vopt flags

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This is the correct order:

            self._convex_hull_rendering = not self._convex_hull_rendering
            self.vopt.flags[
                mujoco.mjtVisFlag.mjVIS_CONVEXHULL
            ] = self._convex_hull_rendering

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated: 23c7cea

@rohanpsingh
rohanpsingh merged commit 0339b11 into rohanpsingh:main Jun 19, 2022
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