joint_state_publisher reading only one joint from robot/joint_state
I'm attempting to write my robot state to joint_state_publisher to be viewed in RVIZ, but joint_state_publisher is only reading one joint from each message. How do I get joint_state_publisher to update the entire state?
My node my_robot_simulator is publishing jointState messages at 10hz to topic /my_robot/joint_states, which is read by joint_state_publisher (also running at 10Hz). Each message contains seven joint state values.
example:
header:
seq: 210
stamp:
secs: 1571243618
nsecs: 169618145
frame_id: ''
name: [j1, j2, j3, j4, j5, j6, j7]
position: [0.25346757744592685, 0.25346757744592685, 0.25346757744592685, 0.25346757744592685, 0.25346757744592685, 0.25346757744592685, 0.03767337887229634]
velocity: []
effort: []
But joint_state_publisher only updates j4. The other six joints never get updated. If each jointState message contains only one joint, then joint_state_publisher updates that joint as expected. But if I publish joint states one at a time at 70Hz, joint_state_publisher only manages to read a few of them, maybe 20%.
Is there some incorrect syntax in my messages? Is it a timing issue? It seems like we should be able to do just about anything at 10Hz. How do I get joint_state_publisher to update the entire robot, and not just one joint?
Without seeing code (ie: the code that populates your
JointState
msgs) it's going to be hard to say anything.Let's not focus on the publication rate so much, as that is most likely completely irrelevant here.
There isn't anything technically wrong with what you are trying to do... but why do you even need a
joint_state_publisher
. Might it be easier to run arobot_state_publisher
and remap it'sjoint_states
topic to listen tomy_robot/joint_states
? At the very least, this could help with debugging. @gvdhoorn is correct that seeing the code publishing themy_robot/joint_states
topic would be helpful, but it could also be helpful to see a launch file or set of command line commands to see how you've configured therobot_state_publisher
andjoint_state_publisher