Mutiple publishers to /joint_states

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?

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

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.

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

Rohan

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