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

Support user-defined cameras in mujoco.loaders #133

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Conversation

flferretti
Copy link
Collaborator

@flferretti flferretti commented Apr 3, 2024

This pull request will add support for user-defined cameras when using a mujoco.loaders instance. In particular, the user is required to pass a dictionary or a list of dictionaries containing 5 attributes, e.g.:

camera = dict(
    name="cartpole_camera",
    mode="fixed",
    pos="3.954 3.533 2.343",
    xyaxes="-0.594 0.804 -0.000 -0.163 -0.120 0.979",
    fovy="60",
)

The camera can be then used inside the visualizers passing the argument camera_name.

recorder.record_frame(camera_name="cartpole_camera")

📚 Documentation preview 📚: https://jaxsim--133.org.readthedocs.build//133/

@flferretti flferretti self-assigned this Apr 3, 2024
@flferretti flferretti marked this pull request as ready for review April 3, 2024 13:40
Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

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

The solution unpacking a dict is quite fragile, but for the moment it works fine.

src/jaxsim/mujoco/loaders.py Outdated Show resolved Hide resolved
@traversaro
Copy link
Contributor

fyi @CarlottaSartore @giotherobot @siddharthdeore that could be interested in this, xref: robotology/icub-models#155 .

@flferretti flferretti merged commit 546e91f into main Apr 3, 2024
20 of 21 checks passed
@flferretti flferretti deleted the flferretti-patch-1 branch April 3, 2024 14:45
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.

None yet

3 participants