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

[MJX] how to get body.id given body.name #1400

Closed
Kallinteris-Andreas opened this issue Feb 5, 2024 · 3 comments
Closed

[MJX] how to get body.id given body.name #1400

Kallinteris-Andreas opened this issue Feb 5, 2024 · 3 comments
Labels
question Request for help or information

Comments

@Kallinteris-Andreas
Copy link

Hi,

I'm a maintainer of Gymnasium & the project manager of Gymnasium-Robotics, and I'm trying to use MuJoCo-MJX for "prototyping MJX-based RL environments in Gymnasium, Gymnasium-Robotics, Metaworld, MO-Gymnasium".

I want the ID of a body part while knowing its name

with mujoco you can get the ID of a body part with:

data.body("torso").id

how can I do the same thing with MJX

Thanks!

@Kallinteris-Andreas Kallinteris-Andreas added the question Request for help or information label Feb 5, 2024
@Kallinteris-Andreas Kallinteris-Andreas changed the title [MJX] how to map body.name to body.tid [MJX] how to map body.name to body.id Feb 5, 2024
@Kallinteris-Andreas Kallinteris-Andreas changed the title [MJX] how to map body.name to body.id [MJX] how to get body.id given body.name Feb 5, 2024
@btaba
Copy link
Collaborator

btaba commented Feb 5, 2024

Hi @Kallinteris-Andreas , for now you can use MuJoCo to get the id, and then use the id with MJX. Check out the colab where the BarkourEnv has examples of this

@varadVaidya
Copy link

hi @Kallinteris-Andreas , I am also in the process of converting my current custom MuJoCo Gymnasium environment to use MJX.
If possible can you share or point to a Minimal working example for such workflow. I am currently trying to take inspiration from MjxEnv in brax (as in the colab tutorial), but would love to see some other examples as well

@Kallinteris-Andreas
Copy link
Author

@varadVaidya Keep it is WIP, but you could check out Farama-Foundation/Gymnasium#834

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Request for help or information
Projects
None yet
Development

No branches or pull requests

3 participants