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

joint_state_publisher reading only one joint from robot/joint_state

asked 2019-10-16 12:20:29 -0600

travisLlado gravatar image

updated 2019-10-16 14:20:13 -0600

jayess gravatar image

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?

edit retag flag offensive close merge delete

Comments

Without seeing code (ie: the code that populates your JointState msgs) it's going to be hard to say anything.

Is it a timing issue? It seems like we should be able to do just about anything at 10Hz.

Let's not focus on the publication rate so much, as that is most likely completely irrelevant here.

gvdhoorn gravatar image gvdhoorn  ( 2019-10-16 14:46:21 -0600 )edit

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 a robot_state_publisher and remap it's joint_states topic to listen to my_robot/joint_states? At the very least, this could help with debugging. @gvdhoorn is correct that seeing the code publishing the my_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 the robot_state_publisher and joint_state_publisher

jarvisschultz gravatar image jarvisschultz  ( 2019-10-16 14:54:22 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-17 14:19:39 -0600

travisLlado gravatar image

updated 2019-10-17 14:23:12 -0600

Initially I tried writing directly to robot_state_publisher, but for some reason that caused my URDF to fall apart (all robot links would appear at the origin) so I wrote to joint_state_publisher instead and that worked somewhat. After I finished writing my joint_state test node, I switched it back to write directly to robot_state_publisher again instead of joint_state_publisher and now everything works perfectly. I don't know what the problem was.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-10-16 11:57:37 -0600

Seen: 542 times

Last updated: Oct 17 '19