Skip to content

Fix: Set MuJoCo arena memory to 64M in lab_sim scene#597

Merged
JWhitleyWork merged 1 commit into
mainfrom
fix/mujoco-increase-arena-size
Apr 24, 2026
Merged

Fix: Set MuJoCo arena memory to 64M in lab_sim scene#597
JWhitleyWork merged 1 commit into
mainfrom
fix/mujoco-increase-arena-size

Conversation

@JWhitleyWork
Copy link
Copy Markdown
Member

Summary

  • Sets memory="64M" on the <size> element of src/lab_sim/description/scene.xml so MuJoCo 3.6.0 can keep all contact/constraint rows during grasping instead of silently dropping them.

  • Fixes the flaky-CI regression on main tracked in PickNikRobotics/moveit_pro#18534:

    Objective Pre-fix status
    Pick April Tag Labeled Object always fails
    Push Button With a Trajectory sometimes fails
    ML Segment Point Cloud sometimes fails
    MPC Pose Tracking Static Point Cloud Avoidance with Sphere Down Sample sometimes fails
    MPC Pose Tracking With Static Sphere Point Cloud Avoidance sometimes fails
    Playback Square Trajectory sometimes fails

Why

MuJoCo 3.2.7 → 3.6.0 (bundled in MoveIt Pro main since PickNikRobotics/moveit_pro@6eedef8) changed how the constraint-solver arena is sized. In 3.2.7 the arena grew on demand. From 3.3+ it is statically sized at model compile time from the <size memory="..."/> attribute; when memory is absent MuJoCo falls back to a conservative heuristic (roughly 15 MB for this scene).

lab_sim/description/scene.xml never set memory. With 11 free-joint bodies (6 tubes, 5 bottles), the UR5e + Robotiq 2f85 with condim=4 friction contacts, and the gripper closing on an object, the heuristic arena overflows — MuJoCo emits mjWARN_CNSTRFULL ("Insufficient arena memory for the number of constraints generated") and drops constraint rows. Dropped friction/contact constraints produce exactly the reported failures: objects sliding through the gripper, incorrect push forces, and unstable trajectory playback.

The v9.2 branch is unaffected because it still ships MuJoCo 3.2.7, which grew the arena on demand.

Test plan

  • Built overlay_ws (moveit_pro) and user_ws (this repo) inside the dev container.
  • Launched agent_robot.app with MOVEIT_CONFIG_PACKAGE=lab_sim and confirmed You can start planning now!.
  • Ran the previously-failing Objectives via ros2 action send_goal /do_objective:
    • Pick April Tag Labeled ObjectSUCCEEDED
    • Push Button With a TrajectorySUCCEEDED
    • Playback Square TrajectorySUCCEEDED
    • MPC Pose Tracking With Static Sphere Point Cloud AvoidanceSUCCEEDED
  • Confirmed zero mjWARN_CNSTRFULL lines in the backend log and no MUJOCO_LOG.TXT was written during the run.
  • Watch the integration-test-in-studio-container CI job on this PR to confirm the full lab_sim Objective suite passes.

A matching release-notes entry will land in moveit_pro alongside this PR so downstream users know when they might need the same change in their own scene.xml.

🤖 Generated with Claude Code

…erflow

MuJoCo 3.3+ stopped growing the contact/constraint arena dynamically.
Without an explicit <size memory="..."/>, scene.xml falls back to a
conservative heuristic (~15 MB) that overflows during grasping, emits
mjWARN_CNSTRFULL ("Insufficient arena memory for the number of
constraints generated"), and silently drops constraint rows.

That surfaced as the flakiness reported in
PickNikRobotics/moveit_pro#18534:

  - Pick April Tag Labeled Object (always)
  - Push Button With a Trajectory (sometimes)
  - ML Segment Point Cloud (sometimes)
  - MPC Pose Tracking Static PC Avoidance with Sphere Down Sample (sometimes)
  - MPC Pose Tracking With Static Sphere PC Avoidance (sometimes)
  - Playback Square Trajectory (sometimes)

v9.2 is unaffected because it still ships MuJoCo 3.2.7, which grew the
arena on demand.

Verified locally with agent_robot.app MOVEIT_CONFIG_PACKAGE=lab_sim:
Pick April Tag Labeled Object, Push Button With a Trajectory, Playback
Square Trajectory, and MPC Pose Tracking With Static Sphere Point Cloud
Avoidance all SUCCEED and no mjWARN_CNSTRFULL is emitted.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@JWhitleyWork JWhitleyWork marked this pull request as ready for review April 24, 2026 18:09
@JWhitleyWork JWhitleyWork self-assigned this Apr 24, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the lab_sim MuJoCo scene configuration to prevent MuJoCo 3.6.0 constraint-solver arena overflows during grasping by explicitly setting the model arena memory size.

Changes:

  • Add an explanatory comment describing why the arena size must be set for MuJoCo 3.3+ behavior.
  • Set <size ... memory="64M" /> in src/lab_sim/description/scene.xml to avoid mjWARN_CNSTRFULL and dropped constraints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JWhitleyWork
Copy link
Copy Markdown
Member Author

This does resolve an issue but not all of the issues introduced by the MuJoCo 3.6.0 upgrade so I'm force-merging this and will address the remaining issues in another PR.

@JWhitleyWork JWhitleyWork merged commit 3475b63 into main Apr 24, 2026
8 of 9 checks passed
@JWhitleyWork JWhitleyWork deleted the fix/mujoco-increase-arena-size branch April 24, 2026 19:00
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.

3 participants