# Mutiple publishers to /joint\_states

**URL:** <https://forum.ubiquityrobotics.com/t/mutiple-publishers-to-joint-states/441>\
**Category:** Uncategorized\
**Created:** [January 17, 2020, 3:31pm UTC](https://forum.ubiquityrobotics.com/t/mutiple-publishers-to-joint-states/441 "2020-01-17T15:31:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorne](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@lorne](https://forum.ubiquityrobotics.com/u/lorne)\
**Post date:** [January 17, 2020, 3:31pm UTC](https://forum.ubiquityrobotics.com/t/mutiple-publishers-to-joint-states/441/1 "2020-01-17T15:31:39Z")

</div>

Hello again everyone.  
I am using the simple navigation demo along with Rviz and I see that I have a motor node as well as a joint state publisher rapidly publishing the position of the wheels. I think this is at least partially responsible for my jump odometry.  
here is a bit of the output from a joint state echo  
—  
header:  
seq: 39402  
stamp:  
secs: 1579273101  
nsecs: 96893072  
frame\_id: ‘’  
name: [left\_wheel\_joint, right\_wheel\_joint]  
position: [0.0, 0.0]  
velocity: []  
effort: []  
—  
header:  
seq: 77270  
stamp:  
secs: 1579273101  
nsecs: 105594830  
frame\_id: ‘’  
name: [left\_wheel\_joint, right\_wheel\_joint]  
position: [1.7558821305122247, 0.04877450362533963]  
velocity: [0.0, 0.0]  
effort: [0.0, 0.0]  
—  
header:  
seq: 77271  
stamp:  
secs: 1579273101  
nsecs: 155600655  
frame\_id: ‘’  
name: [left\_wheel\_joint, right\_wheel\_joint]  
position: [1.7558821305122247, 0.04877450362533963]  
velocity: [0.0, 0.0]  
effort: [0.0, 0.0]  
—  
header:  
seq: 39403  
stamp:  
secs: 1579273101  
nsecs: 197216033  
frame\_id: ‘’  
name: [left\_wheel\_joint, right\_wheel\_joint]  
position: [0.0, 0.0]  
velocity: []  
effort: []  
—  
header:  
seq: 77272  
stamp:  
secs: 1579273101  
nsecs: 205617574  
frame\_id: ‘’  
name: [left\_wheel\_joint, right\_wheel\_joint]  
position: [1.7558821305122247, 0.04877450362533963]  
velocity: [0.0, 0.0]  
effort: [0.0, 0.0]  
–  
what is the best way to deal with this?

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [January 19, 2020, 9:18am UTC](https://forum.ubiquityrobotics.com/t/mutiple-publishers-to-joint-states/441/2 "2020-01-19T09:18:44Z")

</div>

Is the information you seek not in topic /tf?

In /tf you will see odometry info with frame\_id that varies based on the ‘point of view’ if you will.

So with simple nav running in /tf you will see frames\_ids like this:

frame\_id What is this  
map This is the robot position in the map as determined by localization

odom This is the robot position based on wheel position that started at 0,0 on initialization

base\_link This is the position of the wheels relative to the robot itself so not of much value

The motor node is concerned with publishing relative to the odom frame because it knows the history of the wheels.

To peel off just specific frame\_id such as frame\_id of map only from /tf use this sort of syntax  
rostopic echo --filter “m.transforms[0].header.frame\_id == ‘map’” /tf

What is the end goal of what information about the robot you want in terms of the wheels? Is it position? that you can get from /tf using either the odom or the map frame. You get xy position and then for rotation you get that in a quaternion

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [January 19, 2020, 9:32am UTC](https://forum.ubiquityrobotics.com/t/mutiple-publishers-to-joint-states/441/3 "2020-01-19T09:32:27Z")

</div>

I should have mentioned that I do see the issue you are concerned about and will follow up. I see that frame\_id is blank in the /joint\_state publications and there are two different sequence numbers going on with different positions. I also see that both the nodes publish to the /joint\_state topic. Agree, odd especially without a unique frame\_id.

Thanks for pointing that out, I will dig a bit on that and the other info I pointed out was to help you solve your requirements using other topics if that works for now.

---

<div class="post-metadata">

**Author:** ![rohbotics](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/rohbotics/32/222_2.png) [@rohbotics](https://forum.ubiquityrobotics.com/u/rohbotics)\
**Post date:** [January 22, 2020, 3:50am UTC](https://forum.ubiquityrobotics.com/t/mutiple-publishers-to-joint-states/441/4 "2020-01-22T03:50:09Z")

</div>

Looking into this. It seems like we don’t even need joint\_state\_publisher running for our use case.

I created a PR to fix it: [https://github.com/UbiquityRobotics/magni\_robot/pull/107](https://github.com/UbiquityRobotics/magni_robot/pull/107)

Rohan

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [January 22, 2020, 4:48am UTC](https://forum.ubiquityrobotics.com/t/mutiple-publishers-to-joint-states/441/5 "2020-01-22T04:48:57Z")

</div>

I have reviewed and tested the change.  
As far as Beta users of the nav2D branches this change once merged to the main codebranch will have to be brought into magni\_robot nav2D branch.  
Should this be needed faster, please contact me offline Lorne and I can explain how to get this change for your system. Thanks
