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

robot_state_publisher tf missing frames

asked 2012-03-20 12:24:14 -0500

kmaroney gravatar image

I currently have a node publishing /joint_states messages with a urdf loaded to the param server.

When running the robot_state_publisher, I get the following output: (snapshot of ~88 Hz published message)

transforms: []
      seq: 0
        secs: 1332281271
        nsecs: 616639689
      frame_id: /robot_j4
    child_frame_id: /robot_tool_plate
        x: -0.045
        y: -0.3
        z: 0.0
        x: 0.707106781185
        y: 0.0
        z: 0.0
        w: 0.707106781188

The published joint_states message is (snapshot of 100 Hz published message):

  seq: 19372
    secs: 1332281452
    nsecs: 512223606
  frame_id: ''
name: ['robot_j1', 'robot_j2', 'robot_j3', 'robot_j4', 'robot_j5', 'robot_j6', 'robot_j7']
position: [0.021256590917843883, -2.0106822865351295, -0.024265641198750076, 3.1044362300610073, 0.18289162692677774, -0.089429498510240221, 0.042228138233154626]
velocity: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.05145228488671999]
effort: [-7.8622921298201127e-17, 15.941268784846988, -0.24966792233529578, -4.0081856483693521, -0.043474127200907126, -0.20694576889532121, -0.00066716196395994474]

I have checked the correctness of the urdf with the parser, and can verify that the urdf is correctly loaded on the param server with name: robot_description. The transform that it is publishing (robot_j4 -> robot_tool_plate) is a fixed joint, aka robot_state_publisher is not publishing any moveable joints.

Also, the urdf that I have loaded is a configuration with only four joints (robot_j1, robot_j2, robot_j3, robot_j4). Does the urdf have to directly correlate the published joint_states?

The joint_state messages are being published at 100Hz, is this too fast for the robot_state_publisher?


edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted

answered 2012-03-20 15:12:05 -0500

weiin gravatar image

The tutorial does state that "A source that publishes the joint positions" is required by robot_state_publisher. I've also gotten "missing moveable joints transforms" when I launched robot_state_publisher without launching joint_state_publisher.

I don't quite understand why you would not want urdf to correlate to published joint states. The urdf describes the robot. Wouldn't you want to describe the robot completely (with all joints and links)?

I think the publishing frequency is just limited by your computing speed. The robot_state_publisher would take the latest states available anyway. (I'm using 20Hz, and my simple 2 wheel robot runs fine)

edit flag offensive delete link more


I am sure that my robot is publishing /joint_states (sensor_msgs/JointState). This covers the source of the joint position publishing. The reasoning for the urdf discrepancy is because my robot has multiple configurations, this configuration allows me to avoid redundant messages.

kmaroney gravatar image kmaroney  ( 2012-03-20 15:21:49 -0500 )edit

I ran my code again, launching only robot_state_publisher and joint_state_publisher. It does seem that the moveable joints are not published all the time. But rosrun tf view_frames would show all joints being published.

weiin gravatar image weiin  ( 2012-03-20 16:04:18 -0500 )edit

From the tutorial above, "The map with joints does not contain all the joints that exist in the kinematic model. Note that it is okay for the map to contain extra joints that are not part of the kinematic model." could explain this (urdf discrepancy should not be an issue then)

weiin gravatar image weiin  ( 2012-03-20 16:06:30 -0500 )edit

I think we may be zeroing in on the issue.. When running rosrun tf view_frames, it does not show all of the joints, only the two previously published. I will keep looking into this and report back.

kmaroney gravatar image kmaroney  ( 2012-03-21 03:08:34 -0500 )edit

It would be useful if you could attach the tree representation of your urdf description, and of your tf tree. You can use the commands "rosrun urdf_parser urdf_to_graphiz your_urdf.xml" and "rosrun tf view_frames" to generate pdf files that show the tree structure.

Wim gravatar image Wim  ( 2012-03-26 07:25:42 -0500 )edit

Did you find the answer? I have the same issue!

McMurdo gravatar image McMurdo  ( 2014-07-01 05:38:50 -0500 )edit

answered 2015-08-19 18:38:00 -0500

iBot gravatar image

I had the same issue with my own URDF model and finally I could solve it. The robot_state_publisher needs basically only two information to run:

  1. A URDF model in XML format on the parameter server. The default parameter is: /robot_description
  2. A msg of the type sensor_msgs::JointState on the topic /joint_states

I found this information in the FAQ of tf

The important information I forgot first by sending out my /joint_state msg is the timestamp in the msg header! Without the time information the robot_state_publisher is not able to calculate the tf frames for the moving joints. Inside of the code this means the following for me:

// Setup the publisher for the /joint_states msg
ros::Publisher pub_js = nh.advertise<sensor_msgs::JointState>("/joint_states", 100);    
sensor_msgs::JointState msg;            // Create an object of the sensor_msgs::JointState"My_Joint_Name");    // This must be the joint_name that is used inside of the URDF file
msg.position.push_back(0.0);            // Set a value for this joint

msg.header.stamp = ros::Time::now();    // Stamp this message with the actual time
pub_js.publish(msg);                    // Publish the message

I hope this will solve your problem as well!

edit flag offensive delete link more


This comment solved my problem! Did not realize the JointState frame_ids needed to match. Thank you!!

rikkimelissa gravatar image rikkimelissa  ( 2015-10-13 22:49:22 -0500 )edit

answered 2021-10-10 02:20:56 -0500

acenturyandabit gravatar image

I've been playing around with a model with some actuated joints and some non-actuated joints. As far as I'm aware, robot_state_publisher does not publish info for non-actuated joints, while joint_state_publisher does.

edit flag offensive delete link more

answered 2012-03-27 22:27:08 -0500

OptiX gravatar image

I've got the same problem, I spawned the model on gazebo but when I run "rosrun tf tf_echo /end_link /base_link" it only finds the last two links connected with a fixed joints and ones with moveable joints are not found. When I run tf view_frames it also shows the same two links. Please let me know when you find the solution. Thanks

edit flag offensive delete link more


Did you find the answer? I have the same issue!

Hunterx gravatar image Hunterx  ( 2018-10-21 09:11:03 -0500 )edit

Question Tools



Asked: 2012-03-20 12:24:14 -0500

Seen: 3,492 times

Last updated: Oct 10 '21