ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to define multiple hardware interfaces for ros2 control in the xacro

asked 2023-05-05 07:45:53 -0600

guidout gravatar image

I'm not sure how to define multiple hardware interfaces and assign the right joints. Does this work?

<ros2_control name="RealRobot" type="system">
   <hardware>
       <plugin>steering_hardware/SteeringHardware</plugin>
   </hardware>
   <joint name="steering_joint">
       <command_interface name="position"/>
       <state_interface name="velocity"/>
       <state_interface name="position"/>
   </joint>
   <hardware>
       <plugin>wing_hardware/WingHardware</plugin>
   </hardware>
   <joint name="wing_joint">
       <command_interface name="velocity"/>
       <state_interface name="velocity"/>
       <state_interface name="position"/>
   </joint>
</ros2_control>

I'm getting an error when launching the controller manager but I don't know if it's related to this, so I want to make sure this piece is correct at least.

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-05 19:19:17 -0600

guidout gravatar image

updated 2023-05-06 11:38:13 -0600

I believe the way you have multiple hardware interfaces is just to have multiple ros2_control tags like so:

<ros2_control name="SteeringHarware" type="system">
   <hardware>
       <plugin>steering_hardware/SteeringHardware</plugin>
   </hardware>
   <joint name="steering_joint">
       <command_interface name="position"/>
       <state_interface name="velocity"/>
       <state_interface name="position"/>
   </joint>
</ros2_control>

<ros2_control name="WingHarware" type="system">
   <hardware>
       <plugin>wing_hardware/WingHardware</plugin>
   </hardware>
   <joint name="wing_joint">
       <command_interface name="velocity"/>
       <state_interface name="velocity"/>
       <state_interface name="position"/>
   </joint>
</ros2_control>

This works for me, but if anybody sees an issue with this, please comment.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2023-05-05 07:45:53 -0600

Seen: 837 times

Last updated: May 06 '23