Draft concept for injecting ros2_control hardware system #1
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.
This PR is inspired by the discussion on UniversalRobots#52 about further factoring out
ros2_control
here.To allow maintaining the changes to
<hardware>
that are currently supported with conditional switching and many parameters that only apply to specific hardware implementations, I'm suggesting here to inject the<hardware>
dependency from a top-level.urdf.xacro
as a block param.In
ur_macro.xacro
as it exists now, many of the numerous parameters required find their way into the conditional ROS 2 Control hardware definition, for example here for the real robot.In this PR I tried to keep the conditional switching behavior in
ur.urdf.xacro
, so I define several optional<hardware>
blocks there and pass them in to thexacro:ur_ros2_control
macro as the block parameterros2_control_hardware
.However, I imagine that this responsibility falling to consumer packages that use the
ur_description
macros instead, which would remove many parameters fromur_description
calls, while keeping a single point of responsibility for loading and applying kinematics, physical, visual, joint limits, and other parameters that are more generic across real and fake hardware and simulations.I made a simple example for
ur_simulation_gazebo
on my fork here.A similar thing could be done inside
ur_robot_driver
, with aur_real_robot.urdf.xacro
, and maybeur_description
by itself would allow optionally instantiating amock_system/GenericSystem
.I opened this PR to illustrate my suggestion, but it currently mixes in some work to pass through joint dynamics properties to fix broken joints in Gazebo ClassicHappy to split that out later if this approach is of interest.