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

Change default topic name of joint_state_broadcaster?

asked 2022-01-23 13:57:58 -0500

a.g gravatar image

I am trying to use moveit2 in ROS2. However in my application, I would like to change the default topic name of /joint_states (published by the joint_state_broadcaster) to a custom name without using relay, since another node in my setup is publishing to /joint_states.

Below is the panda_ros_controllers.yaml file that I am using. How would I change the published topic name for joint_state_broadcaster to something else?

controller_manager:
  ros__parameters:
    update_rate: 100  # Hz

    panda_arm_controller:
      type: joint_trajectory_controller/JointTrajectoryController

    panda_hand_controller:
      type: position_controllers/GripperActionController

    joint_state_broadcaster:
      type: joint_state_broadcaster/JointStateBroadcaster


panda_arm_controller:
  ros__parameters:
    command_interfaces:
      - position
    state_interfaces:
      - position
      - velocity
    joints:
      - panda_joint1
      - panda_joint2
      - panda_joint3
      - panda_joint4
      - panda_joint5
      - panda_joint6
      - panda_joint7

panda_hand_controller:
  ros__parameters:
    joint: panda_finger_joint1
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-01-23 23:01:43 -0500

cst0 gravatar image

updated 2022-01-24 07:59:24 -0500

Having more than one publisher on /joint_states is totally fine as long as there is only one source of information for a particular joint. It's very common for the /joint_states topic to have one message containing information about joints 1-3 followed by another message containing joints 4-6. So it shouldn't be necessary to do this, unless you have a case where you have more than one node publishing about the same joint (in which case that's a different problem) or you have more than one robot in your setup and so there needs to be some differentiation by topic (in which case you should be using namespacing).

Either way, the easiest way to get namespacing going here will be in your launch files. You can also remap topics in the same file. Take a look at the wiki here for ROS1 or here for ROS 2.

edit flag offensive delete link more

Comments

Please note: the OP tagged this ros2. You link to the ROS 1 wiki.

gvdhoorn gravatar image gvdhoorn  ( 2022-01-24 02:47:46 -0500 )edit

Thanks for the catch, I've updated with an additional link.

cst0 gravatar image cst0  ( 2022-01-24 07:59:43 -0500 )edit

Thank you this helped a lot!

a.g gravatar image a.g  ( 2022-01-24 11:59:05 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-01-23 13:57:58 -0500

Seen: 301 times

Last updated: Jan 24 '22