When editing scene.xml files (adding/removing bodies with joints), the <keyframe> section's qpos attribute must have exactly the number of values matching the model's total degrees of freedom. A mismatch causes ros2_control_node to crash with:
Error: keyframe 0: invalid qpos size, expected length <N>
Each joint type contributes to qpos:
- freejoint: 7 values (x, y, z, qw, qx, qy, qz)
- hinge/slide: 1 value each
- ball: 4 values (quaternion)
After adding or removing bodies with joints, remove the keyframe and let MuJoCo use body pos= attributes for initial positions.
Refer to docs.picknik.ai for MuJoCo configuration guides:
- Physics Simulator Setup — creating scene.xml from URDF, camera/sensor setup, mesh conversion, MuJoCo Interactive Viewer
- config.yaml Reference —
hardwaresection forpicknik_mujoco_ros/MujocoSystemplugin configuration - Simulator Keyframes Setup — defining keyframes in scene.xml,
ResetMujocoKeyframeBehavior - Optimize Model Meshes — MuJoCo enforces 1-200,000 faces per STL
- Simulation Troubleshooting — physics parameters, grip stability, mass/inertia errors, rendering issues
Every objective XML file must include a MetadataFields block inside the TreeNodesModel section. The validate_objectives CI check will fail without it.
<TreeNodesModel>
<SubTree ID="My Objective Name">
<MetadataFields>
<Metadata runnable="true" />
<Metadata subcategory="Category Name" />
</MetadataFields>
</SubTree>
</TreeNodesModel>runnable— set to"true"for top-level objectives the user can run,"false"for subtrees only called by other objectivessubcategory— groups the objective in the UI (e.g.,"AprilTag","Grasping","MuJoCo Simulation")