Robotics StackExchange | Archived questions

Why multiple of gazebo_ros_control are not allowed?

I have one robot model but I need to use two instances of gazebo_ros_control as follows

<robot name="husky" xmlns:xacro="http://ros.org/wiki/xacro">
     ......
     <gazebo>
       <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
          <robotNamespace>$(arg robot_namespace)</robotNamespace>
          <legacyModeNS>true</legacyModeNS>
       </plugin>
    </gazebo>
    .....

    <gazebo>
          <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
             <robotNamespace>/ur5</robotNamespace>
             <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
             <legacyModeNS>true</legacyModeNS>
         </plugin>
    </gazebo>

  </robot>

The yaml file is

husky_joint_publisher:
  type: "joint_state_controller/JointStateController"
  publish_rate: 50

husky_velocity_controller:
  type: "diff_drive_controller/DiffDriveController"
  left_wheel: ['front_left_wheel', 'rear_left_wheel']
  right_wheel: ['front_right_wheel', 'rear_right_wheel']
  publish_rate: 50
  .....

ur5:
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 500 

  # Velocity Controllers ----------------------------
  joints_group_velocity_controller:
    type: velocity_controllers/JointGroupVelocityController
    joints:
       - shoulder_pan_joint
       - shoulder_lift_joint
       - elbow_joint
       - wrist_1_joint
       - wrist_2_joint
       - wrist_3_joint

In this case, one copy of gazebo_ros_control overwrites the other. My question is is possible to have different joints update to different parts of the same robot?

Asked by CroCo on 2023-06-29 19:45:10 UTC

Comments

Answers