0
$\begingroup$

Rosanswers logo

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.


Originally posted by Rick Armstrong on ROS Answers with karma: 567 on 2017-09-10

Post score: 0


Original comments

Comment by ahendrix on 2017-09-10:
I think this will work but I'm not certain.

Comment by Rick Armstrong on 2017-09-10:
After looking at the source, I think so, too. I'll post my result after I get it working (or don't) :)

Comment by gvdhoorn on 2017-09-11:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Stefan Kohlbrecher with karma: 24361 on 2017-09-11

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2017-09-11:
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.

Comment by Stefan Kohlbrecher on 2017-09-12:
Arg, I actually meant robot_state_publisher and mistyped. Fixed now.

Comment by Rick Armstrong on 2017-09-17:
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).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.