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

robot_state_publisher design: multiple publishers on /joint_states ok?

asked 2017-09-10 19:16:17 -0500

Rick Armstrong gravatar image

Is robot_state_publisher designed to handle multiple sources of /joint_state information? For example, let's say I have the R2D2-like robot from this tutorial. If I have one node publishing the state of the 'periscope' on /joint_states, and another node publishing the rest of the joints, also on /joint_states, will robot_state_publisher do the right thing? (i.e., 'merge' the /joint_state messages?).

I'm currently studying the source code to definitively figure this out, but I see that others have asked this in the past, so I figured I'd raise the issue again.

edit retag flag offensive close merge delete


I think this will work but I'm not certain.

ahendrix gravatar image ahendrix  ( 2017-09-10 22:22:23 -0500 )edit

After looking at the source, I think so, too. I'll post my result after I get it working (or don't) :)

Rick Armstrong gravatar image Rick Armstrong  ( 2017-09-10 22:44:59 -0500 )edit

Yes. This is designed to work like this afaik.

An alternative could be to use joint_state_publisher with the source_list argument. It will merge all JointState msgs on the specified topics and publish a single representative one.

gvdhoorn gravatar image gvdhoorn  ( 2017-09-11 01:10:57 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-09-11 04:48:20 -0500

updated 2017-09-12 17:05:33 -0500

Yes, this definitely works, we've been using different robots with different nodes contributing to joint states and all getting fed into one robot_state_publisher for years.

edit flag offensive delete link more


Minor perhaps, but @Rick Armstrong describes a setup where multiple JointState publishers feed a single robot_state_publisher. Having a single joint_state_publisher merge multiple JointState msgs into a single one (via source_list) is slightly different.

gvdhoorn gravatar image gvdhoorn  ( 2017-09-11 06:22:07 -0500 )edit

Arg, I actually meant robot_state_publisher and mistyped. Fixed now.

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2017-09-12 17:06:34 -0500 )edit

Side note for fellow dunces: if you forget to populate JointState.header.timestamp before publishing, robot_state_publisher will quietly drop your JointState messages (unless you set ignore_timestamp to true).

Rick Armstrong gravatar image Rick Armstrong  ( 2017-09-17 20:34:11 -0500 )edit

Question Tools



Asked: 2017-09-10 19:16:17 -0500

Seen: 1,536 times

Last updated: Sep 12 '17