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
How to get the auto-adjusted mesh pos/quat for visualization in RViz? #409
Comments
As it says in the docs, I believe this transformation (or rather the inverse of the transformation) lives in Let us know if this doesn't work for you. |
That geom_pos/quat tells me the transform from the body to the mesh frame, which isn't what I need. That's a combination of the transform from body to geom, and geom to mesh. I want that separately, specifically the transform from the geom frame to the mesh frame. Consider this simple 2m box, where the origin is at the corner, not the center. https://github.com/UM-ARM-Lab/link_bot/blob/master/dm_envs/meshes/box.stl If you put this in xml as |
Yep. But since you know the transform in the XML, you should be able to recover the vertex transform, right? We could add fields to the model (probably Is there anyone else here besides the OP who would like the raw vertex transform to be exposed? |
That's a good point, I had expected to be able to access the transform I put in the XML via either |
For now, my workaround has been to ensure I never use |
…os,quat}` Fixes #409 PiperOrigin-RevId: 564217402 Change-Id: I53ddeef4e343905021cd7852d548f6769c876474
Hi,
I'm a phd student and I'm trying to use MuJoCo for robotic manipulation.
I want to visualize the mujoco scene in rviz using Markers. I'm doing this by creaiting a MESH_RESOURCE marker, which loads from the STLs that mujoco loads. However, when I use the geom xpos/xmat to set the Marker pose in rviz, it is wrong. I think this is because mujoco automatically transforms meshes to be centered and have axis aligned inertia. However, I can't find anywhere in the python or C API where these transforms are exposed. It looks like user_mesh.cc is where these values are calculated, but they don't seem to be exposed anywhere. However, the docs suggest they are:
Here is an example STL we can use as reference:
https://github.com/UM-ARM-Lab/link_bot/blob/master/dm_envs/meshes/Drive56_mujoco.stl
If there's no way to access this info, a workaround would be to make a new version of the mesh that is already centered/rotated, but I'm not sure how to do that exactly the same way mujoco does. I tried it in meshlab, and sometimes it worked, but sometimes meshlab gave different results than mujoco for transform.
code for visualizer I'm working on:
https://github.com/UM-ARM-Lab/link_bot/blob/master/dm_envs/src/dm_envs/mujoco_visualizer.py
The text was updated successfully, but these errors were encountered: