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

writing tf baselink -> laser

asked 2016-01-12 00:47:27 -0500

learner88 gravatar image


I wish to do a tf baselink->laser. I am using xvlidar and it give /scan. I followed the steps here: I managed to do it and it did churn out the sample output. How do I use the /scan data from the lidar and feed it to the tf?

Thank you.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-01-12 04:25:41 -0500

dfornas gravatar image

Your laser will output a point cloud or an array of points in a topic ("/scan" if I undestood you). This messages will have a frame_id (for example, "base_scan"). To use this points in your program you have to subscribe to this topic (see Basic Tutorials) and if you want to use your points with respect to the robot base you will have to publish the transformation from base_link to base_scan. It can be done with a a static transform publisher.

edit flag offensive delete link more

answered 2016-01-12 20:03:52 -0500

learner88 gravatar image

thank you dfornas. can I also ask what's the difference between doing the transformation from base_link to base_scan via code writing shown here: and versus just adding a static transform publisher?

edit flag offensive delete link more


I think you should write this as a comment to my answer next time. haha. A static transform publisher adds the relationship between those frame to TF tree so this way every other ROS program can obtain this relationship.

dfornas gravatar image dfornas  ( 2016-01-13 02:15:38 -0500 )edit

On the other hand, that code uses the information in TF (so it needs the static transformation also to be set) to transform the frame from the laser reference frame to the robot reference frame. With this the points info can be used properly. Do you get the difference?

dfornas gravatar image dfornas  ( 2016-01-13 02:18:18 -0500 )edit

yes i got it. thanks alot :)

learner88 gravatar image learner88  ( 2016-01-25 20:47:25 -0500 )edit

Question Tools

1 follower


Asked: 2016-01-12 00:47:27 -0500

Seen: 3,213 times

Last updated: Jan 12 '16