0
$\begingroup$

Rosanswers logo

I have a Gazebo-Ros simulation where I use a range laser to get scans which is working properly and I am able to use the autonomous navigation on a simulated environment. Now I wanted to use a kinect as a sensor to get scans using the depthimage to laserscan node to substitute the range laser. After simulating this kinect, including all the different config files, nodes... I am able to read the scans after the cloudthrottle, so I think I have much of it correctly configured, but I am having problems with the tf's tranformations for this simulated kinect, when I try to read the topic inside rviz I can not get the transform between /map and the kinect frame I publish, I think is only a matter of not publishing the right tf transform for the kinect or maybe I need another I am not aware of. Right now for this kinect I only publish a static transform for the output frame id (depth_cam) to base_link

After remapping the output frame topic to /camera_depth

< node pkg="tf" type="static_transform_publisher" name "depth_cam_tf" args="0 -0.02 0 0 0 0 /base_link /camera_depth >

output from tf tf_monitor

RESULTS: for all Frames

Frames:

Frame: /Pioneer3AT/Sonar_1 published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499152 Max Delay: 0

Frame: /Pioneer3AT/base_link published by /Pioneer3AT_Gazebo Average Delay: -0.0493165 Max Delay: 0

Frame: /Pioneer3AT/camera_depth published by /depth_cam_tf Average Delay: -0.0996457 Max Delay: 0

Frame: /Pioneer3AT/front_left_axle published by /Pioneer3AT_tf_broadcaster Average Delay: -0.0492777 Max Delay: 0

Frame: /Pioneer3AT/front_left_hub published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499125 Max Delay: 0

Frame: /Pioneer3AT/front_left_wheel published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499122 Max Delay: 0

Frame: /Pioneer3AT/front_right_axle published by /Pioneer3AT_tf_broadcaster Average Delay: -0.0492735 Max Delay: 0

Frame: /Pioneer3AT/front_right_hub published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499119 Max Delay: 0

Frame: /Pioneer3AT/front_right_wheel published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499117 Max Delay: 0

Frame: /Pioneer3AT/front_sonar published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499114 Max Delay: 0

Frame: /Pioneer3AT/laserscan published by /Pioneer3AT_laserscan_tf Average Delay: -0.0326276 Max Delay: 0

Frame: /Pioneer3AT/odom published by /Pioneer3AT/amcl Average Delay: -0.494709 Max Delay: 0

Frame: /Pioneer3AT/rear_left_axle published by /Pioneer3AT_tf_broadcaster Average Delay: -0.0492701 Max Delay: 0

Frame: /Pioneer3AT/rear_left_hub published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499111 Max Delay: 0

Frame: /Pioneer3AT/rear_left_wheel published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499108 Max Delay: 0

Frame: /Pioneer3AT/rear_right_axle published by /Pioneer3AT_tf_broadcaster Average Delay: -0.0492668 Max Delay: 0

Frame: /Pioneer3AT/rear_right_hub published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499105 Max Delay: 0

Frame: /Pioneer3AT/rear_right_wheel published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499102 Max Delay: 0

Frame: /Pioneer3AT/rear_sonar published by /Pioneer3AT_tf_broadcaster Average Delay: -0.4991 Max Delay: 0

Frame: /Pioneer3AT/top_plate published by /Pioneer3AT_tf_broadcaster Average Delay: -0.499128 Max Delay: 0

All Broadcasters:

Node: /Pioneer3AT/amcl 18.6052 Hz, Average Delay: -0.494709 Max Delay: 0

Node: /Pioneer3AT_Gazebo 48.0592 Hz, Average Delay: -0.0493165 Max Delay: 0

Node: /Pioneer3AT_laserscan_tf 30.4796 Hz, Average Delay: -0.0326276 Max Delay: 0

Node: /Pioneer3AT_tf_broadcaster 30.6156 Hz, Average Delay: -0.347374 Max Delay: 0

Node: /depth_cam_tf 10.343 Hz, Average Delay: -0.0996457 Max Delay: 0

The output of view_frames -> frames.pdf looks like something like that (only focused on the path I have the problem with)

1 /Pioneer3AT/map

Broadcaster: / Pioneer3AT/ amcl Average rate: 13.292 Hz Most recent transform: -0.451 sec old Buffer length: 4.890 sec

2 /Pioneer3AT/odom

Broadcaster: /Pioneer3AT_Gazebo Average rate: 45.346 Hz Most recent transform: -0.050 sec old Buffer length: 4.940 sec

3 /Pioneer3AT/base_link

Broadcaster: /depth_cam_tf Average rate: 870.036 Hz Most recent transform: -0.001 sec old Buffer length: 4.953 sec

4 /Pioneer3AT/camera_depth

It seems like the transforms are being made at the same time, but if I read the topics I get the following differences in the time stamp:

-For the pose topic for amcl which we could use for time reference:

header: seq: 2 stamp: secs: 1373456584 nsecs: 703128239 frame_id: /Pioneer3AT/map

-For the laserscan from a normal laser ranger, which works correctly and I can use to navigate

header: seq: 4820 stamp: secs: 1373456596 nsecs: 611743996 frame_id: /Pioneer3AT/laserscan

-But for the laserscan created from the kinect:

header: seq: 906 stamp: ** secs: 162** nsecs: 648000000 frame_id: /Pioneer3AT/camera_depth

It looks like this topic has a wrong time stamp compared with the rest.

I know now, that part of the topics are using ROS time for the time stamp and the topics from the simulation in Gazebo are using on the other hand Gazebo's time.

Gazebo is not publishing in the /clock topic. I have /use_sim_time set to "true". Is there anything else needed to publish Gazebo's clock?

I would appreciate any ideas.


Originally posted by agonzamart on ROS Answers with karma: 88 on 2013-07-08

Post score: 1


Original comments

Comment by lindzey on 2013-07-13:
I think that you'll be more likely to get answers if you make your question more readable. Use the markdown format, add line breaks to the tf_monitor output, maybe even include a link to an uploaded copy of frames.pdf

Comment by agonzamart on 2013-07-13:
Gazebo is not publishing in the /clock topic. I have /use_sim_time set to "true". Is there anything else needed to publish Gazebo's clock? Thats the simpler I could thought. I wanted to upload the frames.pdf but I do not have enough Karma to do so, that's why I had to do it that way.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

ROS includes some great command-line tools for debugging tf. I suspect that tf's view_frames will help you quickly discover what transforms you're missing. (on groovy, simply run view_frames from the command line. For earlier ROS versions, use rosrun tf view_frames)

If this doesn't allow you to figure it out, you should edit your question with more details about your setup.


Originally posted by lindzey with karma: 1780 on 2013-07-08

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by agonzamart on 2013-07-08:
I tried to use tf view_frames, because I am using groovy and seems like view_frames is not implemented. I have had this same problem previously working with Ros, the error seems to be that my messages for the tf transform depth_camera are removed because they are too old.

Comment by agonzamart on 2013-07-08:
I updated the question with the tf_monitor output.

Comment by lindzey on 2013-07-08:
(I updated my answer to reflect usage of view_frames on different ROS distros)

Comment by agonzamart on 2013-07-10:
I realized how view_frames worked in groovy, it is not updated in the wiki and I was used to call it as a rosrun as in the older versions. But thank you for your answer. I will update with the output of view_frames but it seems that everything is connected, so I am still searching for what is wrong.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.