Skip to content

Add MujocoBehaviorsLoader and mujoco_objectives to all robot configs#543

Merged
marioprats merged 5 commits intomainfrom
add-mujoco-objectives-to-all-configs
Mar 31, 2026
Merged

Add MujocoBehaviorsLoader and mujoco_objectives to all robot configs#543
marioprats merged 5 commits intomainfrom
add-mujoco-objectives-to-all-configs

Conversation

@davetcoleman
Copy link
Copy Markdown
Member

@davetcoleman davetcoleman commented Mar 25, 2026

Summary

Add MujocoBehaviorsLoader and mujoco_objectives library path to MuJoCo-enabled robot configs, enabling the Reset Simulation feature in the UI for all MuJoCo sim configs.

Changes per config:

  • Add mujoco_objectives entry pointing to moveit_pro_objectives/objectives/mujoco
  • Add MujocoBehaviorsLoader to behavior_loader_plugins (only for configs that don't inherit it)
  • Add mujoco_keyframe: "default" to hardware params where missing
  • Add/fix default keyframe in scene.xml where missing or broken

Testing status

Config Status Notes
hangar_sim ✅ Tested Added MujocoBehaviorsLoader + mujoco_objectives
april_tag_sim ✅ Tested Added mujoco_objectives + fixed keyframe qpos (was 82 values, model needs 57). Inherits MujocoBehaviorsLoader from lab_sim.
dual_arm_sim ✅ Tested
factory_sim ✅ Tested Added default keyframe to scene.xml
grinding_sim ✅ Tested
kitchen_sim ✅ Tested Renamed keyframe from "home" to "default"
lab_sim ✅ Tested
kinova_sim ✅ Tested Already had MujocoBehaviorsLoader on main
space_satellite_sim ✅ Tested Fixed: removed broken behavior_loader_plugins override that replaced inherited loaders from kinova_sim
space_satellite_sim_camera_cal ✅ Tested Fixed: same override issue as space_satellite_sim

Configs NOT changed

Config Reason
lunar_sim ❌ Reset Simulation not working — needs further investigation
multi_arm_sim 🚫 Uses mock/mimic sim, not MuJoCo — MujocoBehaviorsLoader not applicable

Key learnings

  • Configs using based_on_package (e.g., april_tag_simlab_sim, space_satellite_simkinova_sim) should not add a behavior_loader_plugins section unless they need to extend the list — adding one overrides the inherited loaders entirely.
  • Keyframe qpos values must exactly match the model's total DOF count (nq). The old april_tag_sim keyframe had 82 values from a previous model revision; the current model needs 57.

Test plan

  • Verify Reset Simulation works in the UI for each tested config
  • Verify no regressions in objective execution
  • CI passes

🤖 Generated with Claude Code

@davetcoleman davetcoleman added this to the 10.0.0 milestone Mar 25, 2026
@davetcoleman davetcoleman requested a review from marioprats March 25, 2026 13:03
@davetcoleman davetcoleman marked this pull request as ready for review March 25, 2026 13:18
@marioprats
Copy link
Copy Markdown

I tested this in factory_sim, and the Mujoco Objectives show up, and also the menu button to "Reset Simulation".
But unfortunately Mujoco doesn't define a "default" keyframe, so for things to work we would have to define a "default" Mujoco keyframe in all the configs as well :(

@marioprats
Copy link
Copy Markdown

I think this is still missing adding the "default" keyframe to the Mujoco scene.xml, i.e. all scene.xml files need to have a keyframe section, with a "default" keyframe, like this:

@davetcoleman davetcoleman force-pushed the add-mujoco-objectives-to-all-configs branch from ed5ab1a to b41613d Compare March 30, 2026 18:52
…onfigs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davetcoleman davetcoleman force-pushed the add-mujoco-objectives-to-all-configs branch from b41613d to 2099665 Compare March 30, 2026 18:54
@davetcoleman
Copy link
Copy Markdown
Member Author

@marioprats i tested running 1 objective in every robot_config, then ran reset sim, and it all worked

@marioprats
Copy link
Copy Markdown

Perfect, thanks!

@marioprats marioprats merged commit 15fd5b0 into main Mar 31, 2026
5 checks passed
@marioprats marioprats deleted the add-mujoco-objectives-to-all-configs branch March 31, 2026 08:47
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.

2 participants