From e6b9b2f2bdc43bec95e8b85db919b018cd4e33c3 Mon Sep 17 00:00:00 2001 From: Griswald Brooks Date: Tue, 5 May 2026 17:23:06 -0400 Subject: [PATCH] fix(factory_sim): 18180 Pick and Place Brackets sim setup and tool-handling cartesian fixes Addresses two distinct bugs surfaced in the factory_sim package by PickNikRobotics/moveit_pro#18180. 1. Bracket spawn-position errors at sim reset. in description/scene.xml interacts badly with MuJoCo 3.2.7's keyframe parser, silently corrupting the first replica's qpos slot -- bracket-0-0 lands under the pedestal on every reset. MuJoCo 3.3.5 hard-errors on the same input ("Keyframe 'default' has invalid qpos size, got 48, should be 13"). Fix replaces with three explicit blocks of per-bracket geometry files. 2. Tool-handling cartesian rejections at the holder. Two cartesian motions in the suction-gripper subtrees deterministi- cally land link_6 at the suction_gripper world object (depth = 0): - Pick Up Tool from Holder's +0.10m approach push. - Place Tool in Tool Holder's 0.35m post-detach Retract. The pair link_6 <-> suction_gripper has no ACM entry (default NEVER), so the planner rejects both segments. Previously masked by 's non-deterministic IK ordering. Fix opts each segment out of environment-collision checks; the cartesian paths are purely vertical along tool0 Z, so wrist swings into other env are precluded by the path itself. Plus three small simulator-side fixes folded in (keyframe qpos row order corrected to match MuJoCo's body compile order; default joint path tolerance bumped to 0.65 to clear joint-6 deviation against the 0.6 limit; MuJoCo arena bumped from 15M to 64M to prevent contact- constraint overflow during the place phase, which had been segfaulting ros2_control_node via the viewer's next sync). Edits: - description/scene.xml -- keyframe qpos rows reordered; block replaced with three explicit s; arena bumped to 64M. - description/bracket_collision_geometry_{0,1,2}.xml -- new per-bracket geometry files referenced by the includes. - config/control/picknik_fanuc.ros2_control.yaml -- default_path_- tolerance bumped to 0.65. - objectives/pick_up_tool_from_holder.xml -- ignore_environment_- collisions="true" on the +0.10m SetupMTCMoveAlongFrameAxis; SetupMTCIgnoreCollisionsBetweenObjects(link_5;link_6;suction_- gripper) added matching the sibling subtree pattern. - objectives/retract.xml -- parameterized ignore_environment_- collisions as a new input port with default "false" so existing call sites keep their hardcoded behavior; threaded through to the underlying SetupMTCMoveAlongFrameAxis. - objectives/place_tool_in_tool_holder.xml -- passes ignore_- environment_collisions="true" at its 0.35m Retract call site so the post-detach retreat clears the same depth = 0 contact. Refs PickNikRobotics/moveit_pro#18180 Co-Authored-By: Claude Opus 4.7 (1M context) --- .../control/picknik_fanuc.ros2_control.yaml | 2 +- .../bracket_collision_geometry_0.xml | 553 ++++++++++++++++++ .../bracket_collision_geometry_1.xml | 553 ++++++++++++++++++ .../bracket_collision_geometry_2.xml | 553 ++++++++++++++++++ src/factory_sim/description/scene.xml | 28 +- .../objectives/pick_up_tool_from_holder.xml | 8 +- .../objectives/place_tool_in_tool_holder.xml | 7 +- src/factory_sim/objectives/retract.xml | 3 +- 8 files changed, 1692 insertions(+), 15 deletions(-) create mode 100644 src/factory_sim/description/bracket_collision_geometry_0.xml create mode 100644 src/factory_sim/description/bracket_collision_geometry_1.xml create mode 100644 src/factory_sim/description/bracket_collision_geometry_2.xml diff --git a/src/factory_sim/config/control/picknik_fanuc.ros2_control.yaml b/src/factory_sim/config/control/picknik_fanuc.ros2_control.yaml index d6d3a08cf..ae9a63c13 100644 --- a/src/factory_sim/config/control/picknik_fanuc.ros2_control.yaml +++ b/src/factory_sim/config/control/picknik_fanuc.ros2_control.yaml @@ -81,7 +81,7 @@ joint_trajectory_admittance_controller: # provide the gravity vector in the base frame. gravity_vector: [0.0, 0.0, -9.8] # Default maximum joint-space deviation accepted along the trajectory, if not specified in the goal message. - default_path_tolerance: 0.6 + default_path_tolerance: 0.65 # Default maximum joint-space deviation accepted at the trajectory end-point, if not specified in the goal message. default_goal_tolerance: 0.05 # Default maximum absolute force torque readings allowed from the force torque sensor along each Cartesian space diff --git a/src/factory_sim/description/bracket_collision_geometry_0.xml b/src/factory_sim/description/bracket_collision_geometry_0.xml new file mode 100644 index 000000000..1809bfc36 --- /dev/null +++ b/src/factory_sim/description/bracket_collision_geometry_0.xml @@ -0,0 +1,553 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/factory_sim/description/bracket_collision_geometry_1.xml b/src/factory_sim/description/bracket_collision_geometry_1.xml new file mode 100644 index 000000000..e85d60022 --- /dev/null +++ b/src/factory_sim/description/bracket_collision_geometry_1.xml @@ -0,0 +1,553 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/factory_sim/description/bracket_collision_geometry_2.xml b/src/factory_sim/description/bracket_collision_geometry_2.xml new file mode 100644 index 000000000..28b6b7470 --- /dev/null +++ b/src/factory_sim/description/bracket_collision_geometry_2.xml @@ -0,0 +1,553 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/factory_sim/description/scene.xml b/src/factory_sim/description/scene.xml index 8a75412ab..e3778f581 100644 --- a/src/factory_sim/description/scene.xml +++ b/src/factory_sim/description/scene.xml @@ -4,6 +4,8 @@ + + @@ -234,13 +236,17 @@ - - - - - - - + + + + @@ -414,20 +420,20 @@ - + - - + + + - + diff --git a/src/factory_sim/objectives/retract.xml b/src/factory_sim/objectives/retract.xml index 2b332672e..8eed459e3 100644 --- a/src/factory_sim/objectives/retract.xml +++ b/src/factory_sim/objectives/retract.xml @@ -24,7 +24,7 @@ acceleration_scale="0.5" axis_x="0.000000" axis_y="0.000000" - ignore_environment_collisions="false" + ignore_environment_collisions="{ignore_environment_collisions}" planning_group_name="manipulator" velocity_scale="0.5" task="{mtc_task}" @@ -44,6 +44,7 @@ +