From 5bbe23cf2887da09ea90988edc3882842a2ab230 Mon Sep 17 00:00:00 2001 From: Yue Yin Date: Sun, 8 Jun 2025 21:21:10 +0900 Subject: [PATCH] refactor: separate robot and control xacros (#22) # Summary The previous URDF directory structure used has a chained call from **openarm.urdf.xacro** -> **openarm.xacro** -> **openarm.ros2_control.xacro**. **openarm.xacro** takes both robot hardware description and control/communication configuration arguments but the file content is only about robot description. # Changes Made - Renamed **openarm.xacro** to **openarm.robot.xacro**. This file now contains only the robot's hardware description, including links, joints, visuals, and inertial properties. - **openarm.control.xacro** handles all ROS 2 control configurations, including hardware interfaces, joint interfaces, and CAN device setup. - Updated openarm.urdf.xacro (entry point)Calls both **openarm.robot.xacro** and **openarm.control.xacro**. This change should separates responsibilities and arguments for each subsystem. Have tested with bringup scripts for both single-arm and bimanual configurations. --- .../urdf/openarm_bimanual.urdf | 303 ++++----- .../urdf/openarm_bimanual.urdf.xacro | 23 +- .../{openarm.xacro => openarm.robot.xacro} | 629 +++++++++--------- .../urdf/openarm.ros2_control.xacro | 6 - openarm_description/urdf/openarm.urdf | 159 ++--- openarm_description/urdf/openarm.urdf.xacro | 18 +- 6 files changed, 582 insertions(+), 556 deletions(-) rename openarm_description/urdf/{openarm.xacro => openarm.robot.xacro} (94%) diff --git a/openarm_bimanual_description/urdf/openarm_bimanual.urdf b/openarm_bimanual_description/urdf/openarm_bimanual.urdf index 815d385..fa82676 100644 --- a/openarm_bimanual_description/urdf/openarm_bimanual.urdf +++ b/openarm_bimanual_description/urdf/openarm_bimanual.urdf @@ -1,8 +1,23 @@ - + + @@ -156,81 +171,6 @@ - - - - - openarm_hardware/OpenArmHW - right_ - can0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -514,81 +454,6 @@ - - - - - openarm_hardware/OpenArmHW - left_ - can1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -869,4 +734,140 @@ + + + openarm_hardware/OpenArmHW + right_ + can0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + openarm_hardware/OpenArmHW + left_ + can1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openarm_bimanual_description/urdf/openarm_bimanual.urdf.xacro b/openarm_bimanual_description/urdf/openarm_bimanual.urdf.xacro index 705299b..096607a 100644 --- a/openarm_bimanual_description/urdf/openarm_bimanual.urdf.xacro +++ b/openarm_bimanual_description/urdf/openarm_bimanual.urdf.xacro @@ -16,7 +16,16 @@ --> - + + + + + + + + + + @@ -27,18 +36,26 @@ - + - + + + + + + + + + diff --git a/openarm_description/urdf/openarm.xacro b/openarm_description/urdf/openarm.robot.xacro similarity index 94% rename from openarm_description/urdf/openarm.xacro rename to openarm_description/urdf/openarm.robot.xacro index cca28e9..fdb687e 100644 --- a/openarm_description/urdf/openarm.xacro +++ b/openarm_description/urdf/openarm.robot.xacro @@ -1,317 +1,312 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openarm_description/urdf/openarm.ros2_control.xacro b/openarm_description/urdf/openarm.ros2_control.xacro index 0d01383..069fcc8 100644 --- a/openarm_description/urdf/openarm.ros2_control.xacro +++ b/openarm_description/urdf/openarm.ros2_control.xacro @@ -92,12 +92,6 @@ - - diff --git a/openarm_description/urdf/openarm.urdf b/openarm_description/urdf/openarm.urdf index af81118..a38f872 100644 --- a/openarm_description/urdf/openarm.urdf +++ b/openarm_description/urdf/openarm.urdf @@ -1,8 +1,23 @@ - + + @@ -13,81 +28,6 @@ - - - - - openarm_hardware/OpenArmHW - - can0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -363,4 +303,71 @@ + + + mock_components/GenericSystem + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openarm_description/urdf/openarm.urdf.xacro b/openarm_description/urdf/openarm.urdf.xacro index e092c00..98f2e0a 100644 --- a/openarm_description/urdf/openarm.urdf.xacro +++ b/openarm_description/urdf/openarm.urdf.xacro @@ -15,11 +15,23 @@  limitations under the License. --> + + + + + + + + + + + + + + + - - -