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

Change default topic name of joint_state_broadcaster?

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

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?

    update_rate: 100  # Hz

      type: joint_trajectory_controller/JointTrajectoryController

      type: position_controllers/GripperActionController

      type: joint_state_broadcaster/JointStateBroadcaster

      - position
      - position
      - velocity
      - panda_joint1
      - panda_joint2
      - panda_joint3
      - panda_joint4
      - panda_joint5
      - panda_joint6
      - panda_joint7

    joint: panda_finger_joint1
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-01-23 23:01:43 -0600

cst0 gravatar image

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

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


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

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

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

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

Thank you this helped a lot!

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

Question Tools

1 follower


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

Seen: 165 times

Last updated: Jan 24 '22