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

Allow loading variants for MuJoCo descriptions #76

Merged

Conversation

fabinsch
Copy link
Contributor

Hi @stephane-caron ,

thanks for this nice library to load a bunch of robot models with different frameworks. Lately I was trying some mujoco models and I had a quick fix locally to load the scene.xml (which was more useful in my case).

I saw #74 and also #62 and thought that a minimal adaptation allowing for both could be the change proposed in this PR.
This adds a variant keyword, that I set the scene by default. If a robot has no scene.xml, it will still just load the pure robot model as define in each specific file per robot. With this solution, we do not have to modify every single file but I am very open to changes and happy to integrate your remarks.

@coveralls
Copy link

coveralls commented Apr 22, 2024

Pull Request Test Coverage Report for Build 8786290992

Details

  • 6 of 15 (40.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.9%) to 97.702%

Changes Missing Coverage Covered Lines Changed/Added Lines %
robot_descriptions/loaders/mujoco.py 6 15 40.0%
Totals Coverage Status
Change from base Build 8784910518: -0.9%
Covered Lines: 978
Relevant Lines: 1001

💛 - Coveralls

Copy link
Member

@stephane-caron stephane-caron left a comment

Choose a reason for hiding this comment

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

Thank you for this feature that can be immediately useful to MuJoCo users 👍 I suggest we roll it in a backward-compatible manner with v1.10+, then have a more advanced variant mechanism for v2.

robot_descriptions/loaders/mujoco.py Outdated Show resolved Hide resolved
@stephane-caron stephane-caron force-pushed the mj_load_scene_variants branch from 029218c to 8c6abf7 Compare April 22, 2024 13:32
@kevinzakka
Copy link
Contributor

Just chiming in that I disagree that scene should be the default.

@stephane-caron
Copy link
Member

Just chiming in that I disagree that scene should be the default.

Yes, this was the original proposal but we have changed it in f609695. Now the PR is backward compatible and one should pass variant="scene" explicitly to load the scene.

@stephane-caron stephane-caron changed the title Load scene by default for mj models and allow variants Allow loading variants for MuJoCo descriptions Apr 23, 2024
@stephane-caron stephane-caron merged commit f1a1086 into robot-descriptions:main Apr 24, 2024
11 checks passed
@stephane-caron
Copy link
Member

Thank you for this contribution @fabinsch 😃

@kevinzakka
Copy link
Contributor

Thank you @fabinsch and @stephane-caron!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants