Repository navigation
Conversation
The presets describe whole assemblies, not components, so they no longer live inside a product directory. Move the V1 and V2 files unchanged into presets/v1 and presets/v2, and point the two product entries, the display launch file and the tests at the new location. All 60 shipped preset expansions (six V1 and six V2 presets across the default, grasp-frame, real-hardware and CAN combinations) are byte-identical before and after the move.
Introduce assets/common/robot.xacro with the openarm_robot macro. It loads a package-level preset, runs the existing component assembly, applies the CAN defaults and overrides, emits ros2_control and leaves component_descriptions in the caller scope for the preview tools. Add urdf/openarm.urdf.xacro as the shared entry and reduce the two product entries to thin wrappers: they keep their arguments, defaults and validation, translate a short preset name into v1/ or v2/, and call the same macro. The driver version is now taken from the arm component product instead of the entry argument, OpenArmHW rejects unknown products, and the unused robot-level config_root chain is gone. All 60 shipped preset expansions stay byte-identical through the wrappers, and the wrappers, the shared entry, the release artifacts and the V2 defaults agree on every preset.
The display launch file now always expands urdf/openarm.urdf.xacro. It accepts a full preset identifier, completes a short name from arm_type, and keeps the historical default selection when no preset is given; the resolved identifier is the only thing used downstream. Install the preset tree and the shared entry, and export the release URDFs from the shared entry with full preset identifiers. The archive step now writes the generated files into the existing urdf directory instead of renaming it. Verified from an installed package: the shared entry expands every preset, the legacy entries still expand, ros2 launch opens the Cell preview with its preset view and 90 degree elbow pose, and ros2 launch with a short V1 name resolves to v1/left_arm.
stevenaya
force-pushed
the
refactor/common-robot-entry
branch
from
November 11, 2026 10:41
ae47303 to
50504c4
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dependency
Stacked on #131 (
feat/v2-cell-description). Until #131 lands the diff also shows the Cell assets it adds; nothing here modifies them, and the diff shrinks by itself once #131 is merged.What
Whole-assembly presets described an assembly, not a product, but lived inside each product directory and were reachable only through that product's entry. Move them to a package-level
presets/tree and add one shared entry.assets/robot/openarm_v1.0/config/robot_presets/presets/v1/assets/robot/openarm_v2.0/config/robot_presets/presets/v2/urdf/openarm.urdf.xacroassets/common/robot.xacro(openarm_robot)presets/v1andpresets/v2are preset groups only; they do not constrain component products.Structure
assets/common/robot.xacroloads a preset, runs the existing assembly, applies the CAN defaults and overrides, emitsros2_controland leavescomponent_descriptionsin the caller scope soscripts/preview_config.pycan resolve final joint names from the same expansion.urdf/openarm.urdf.xacroonly declares arguments and calls that macro. Its defaults follow V2:robot_preset:=v2/default_bimanual,ros2_control:=true,use_fake_hardware:=true, pluscan_interface,left_can_interface,right_can_interfaceandcan_fd.v1/orv2/, and call the same macro. No include-and-override trick is used.openarm_v1.0→v10,openarm_v2.0→v20) instead of the entry argument. OpenArmHW rejects an unknown product instead of defaulting to V2; custom plugins are unaffected.config_rootparameter chain is removed; the component-levelconfig_rootis untouched.describe_component/emit_componentinterfaces and the automaticurdf/component.xacroloading are unchanged.Assembly name
Each preset declares the URDF robot name under
robot.name:The common macro exposes that name to the shared entry and both legacy wrappers. Entries no longer hardcode it. V1 presets retain
openarm, while V2 presets retainopenarm_v20, preserving the existing generated names.robot.namedoes not change root-frame, link or joint naming.Packaging and calls
CMakeLists.txtinstallspresets/and the shared entry only, so locally generated URDFs underurdf/are not swept in..gitignorestill ignores generated files in that directory and tracks the entry. The release workflow exports from the shared entry with full preset identifiers, and the archive step now writes generated files into the existingurdf/directory instead of renaming it.Verification
openarm; V2, including Cell, emitsopenarm_v20. A custom preset name is also reflected by both the shared and legacy entry.robot.name; no test functions or cases added.autopep8andcmake-formatclean.v1/default_bimanual(26 links),v1/default_single(13),v2/default_bimanual(34) andv2/cell_bimanual(36); legacy entries still expand from the install.ros2 launch … robot_preset:=v2/cell_bimanualopens the Cell with its preset camera andjoint4 = 1.5708;arm_type:=v10 robot_preset:=left_armresolves tov1/left_arm.Not included
No mesh, mass, inertia, limit or mirror changes; no new component interface or preset dispatch field; no preset inheritance or external loading; the legacy entries and
arm_only.rvizare kept; ROS and Isaac repositories are untouched. The threename_mapping.yamlremovals and the matching ignore rule belong to #134 and are not part of this branch.