Extracting model geometry #574
Replies: 7 comments 8 replies
-
Everything you need is in |
Beta Was this translation helpful? Give feedback.
-
Thanks, that worked for primitive geometry but I'm failing to locate filenames of the models referred in |
Beta Was this translation helpful? Give feedback.
-
The filenames have already been compiled away, but why do you need them? As I said, the geometry data is all in |
Beta Was this translation helpful? Give feedback.
-
I assume all 3-vectors and quaternions are within their parent inertial systems and need to be adjusted over their tree path? I've tried mjcModel mjtNum* body_pos; // position offset rel. to parent body (nbody x 3)
mjtNum* body_quat; // orientation offset rel. to parent body (nbody x 4)
mjtNum* body_ipos; // local position of center of mass (nbody x 3)
mjtNum* body_iquat; // local orientation of inertia ellipsoid (nbody x 4)
mjtNum* body_mass; // mass (nbody x 1) mjcData mjtNum* xpos; // Cartesian position of body frame (nbody x 3)
mjtNum* xquat; // Cartesian orientation of body frame (nbody x 4) Do these take into account initial pos and quat of the body? |
Beta Was this translation helpful? Give feedback.
-
How to extract visual geometry corresponding to a body? With this I can extract a list of geoms, but I'm unable to select one for rendering. // bodies
int* body_geomnum; // number of geoms (nbody x 1)
int* body_geomadr; // start addr of geoms; -1: no geoms (nbody x 1)
// geoms
int* geom_type; // geometric type (mjtGeom) (ngeom x 1)
int* geom_bodyid; // id of geom's body (ngeom x 1)
int* geom_group; // group for visibility (ngeom x 1) There's a <geom class="visual" mesh="trunk" material="carbonfibre"/> which doesn't seem to exist in geom_* properties of a model |
Beta Was this translation helpful? Give feedback.
-
Assuming geom's With geom's Is it safe to ignore geom's position and rotation corrections or am I missing something? this is https://github.com/deepmind/mujoco_menagerie/tree/main/unitree_a1 and aftermentioned example is https://github.com/stillonearth/bevy_mujoco/blob/main/python/a1.ipynb |
Beta Was this translation helpful? Give feedback.
-
A shameless plug. So artifact came out from this thread is bevy_mujoco, a plugin for Rust bevy engine. It's useful for tasks like novel environments and rapid prototyping. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to implement a basic MJCF model loader for a bevy game engine. For that I would need to extract geometry from a loaded model and export it to the engine. Can anyone point to a right direction or an example?
Beta Was this translation helpful? Give feedback.
All reactions