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

robot_state_publisher electric issue

asked 2011-10-30 23:08:45 -0600

gajan gravatar image

updated 2011-10-31 08:48:19 -0600

Hi,

I moved from Diamondback to Electric and I have some issues with the robot_state_publisher. Simply put the problem is: /tf published does not contain all the frames. Note that this was working well on diamondback.

To elaborate: /joint_state are published @100Hz from an Orocos component and one of them looks like the following.

header: 
  seq: 30197
  stamp: 
    secs: 0
    nsecs: 0
  frame_id: arm_0_link
name: ['arm_1_joint', 'arm_2_joint', 'arm_3_joint', 'arm_4_joint', 'arm_5_joint', 'arm_6_joint', 'arm_7_joint']
position: [0.85575544023703909, -0.60253893146418169, 0.69191502336820099, -0.69900108242376158, -0.69835294705758466, -0.10636135673431404, -0.29402346125214407]
velocity: []
effort: []

The /tf published by the joint_state_publisher(in electric) is the following:

header: 
  seq: 0
  stamp: 
    secs: 1320055266
    nsecs: 436124783
  frame_id: /base_link
child_frame_id: /arm_0_link
transform: 
  translation: 
    x: 0.0
    y: 0.0
    z: 0.01
  rotation: 
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0

All the other Frames are missing.

This is my launch file:

<launch>

  <!-- Load arm into parameter server -->
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find re_kuka)/description/robots/lbr.urdf.xacro'" />

  <!-- State publisher -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" >
  </node>

  <node pkg="rviz" type="rviz" output="screen" name="rviz" />
</launch>

FYI:

  • I don't see any parsing errors when I launch. I checked the urdf file using:

    demoelec@totoro:~$rosrun xacro xacro.py /home/demoelec/ros/stacks/trajectory-generator/re_kuka/description/robots/lbr.urdf.xacro > lbr.urdf
    demoelec@totoro:~$ rosrun urdf check_urdf lbr.urdf
    robot name is: lbr
    ---------- Successfully Parsed XML ---------------
    root Link: base_link has 1 child(ren)
        child(1):  arm_0_link
            child(1):  arm_1_link
                child(1):  arm_2_link
                    child(1):  arm_3_link
                        child(1):  arm_4_link
                            child(1):  arm_5_link
                                child(1):  arm_6_link
                                    child(1):  arm_7_link
    
  • robot_state_publisher is running and corresponding topics were published

    demoelec@totoro:~$ rosnode ping /robot_state_publisher rosnode: node is [/robot_state_publisher] pinging /robot_state_publisher with a timeout of 3.0s xmlrpc reply from http://totoro:38288/ time=0.640869ms

    demoelec@totoro:~$ rostopic hz joint_states subscribed to [/joint_states] average rate: 100.008 min: 0.009s max: 0.010s std dev: 0.00013s window: 98

    demoelec@totoro:~$ rostopic hz tf subscribed to [/tf] average rate: 50.040 min: 0.019s max: 0.021s std dev: 0.00049s window: 49

To reproduce:

git clone git@github.com:IDSCETHZurich/trajectory-generator.git
roscd re_kuka/launch (no need to rosmake)
rosbag play ./joint_states.bag -l 
roslaunch ./visualize.launch

I would appreciate any help/hints solving this.

Best Regards, Gajan

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2011-10-31 10:46:33 -0600

fergs gravatar image

I notice your joint_states has an emtpy time stamp, and inside robot_state_publisher there is a line like:

if (state->header.stamp >= last_published + publish_interval_){

So.. you probably need to get Orocos to publish a valid timestamp.

edit flag offensive delete link more

Comments

Thank you ! Adding the time stamp simply solved it !
gajan gravatar image gajan  ( 2011-10-31 20:00:42 -0600 )edit
0

answered 2012-03-28 00:41:17 -0600

OptiX gravatar image

Hi, if I may ask where do you publish a valid timestamp? I have the same problem? Thank you

edit flag offensive delete link more

Comments

timestamps are found in the header of the message.

fergs gravatar image fergs  ( 2012-07-20 23:35:32 -0600 )edit

Question Tools

Stats

Asked: 2011-10-30 23:08:45 -0600

Seen: 500 times

Last updated: Mar 28 '12