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

transform Laser Scan To PointCloud

asked 2011-12-05 22:25:23 -0600

acp gravatar image

updated 2014-01-28 17:10:56 -0600

ngrennan gravatar image

Dear people,

I want to transform laser to point cloud and then see it in rviz.

I have the following code hokuyo_listener_cu.cpp

I have also a tf_broadcaster.cpp that broadcast a transformation from base_link to base_laser.

when I run hokuyo_listener.cpp I get the error:

what(): Frame id /laser does not exist! Frames (3): Frame /base_laser exists with parent /base_link. Frame /base_link exists with parent NO_PARENT.

Here I have difficulties to really interpret the function

transformLaserScanToPointCloud("base_link", *scan, cloud, tfListener_);

1.-How base_link shall be declare?

2.-and how tfListener_ will get the tf transform?

well, maybe are a very basic questions, but well, I dont get it :) any help will be appreciate it :)

edit retag flag offensive close merge delete


Have you gone through all of the beginner tutorials as well as the tf tutorials?
Eric Perko gravatar image Eric Perko  ( 2011-12-05 22:43:21 -0600 )edit
yes mainly of all them, but I cant figure it out, I need help.
acp gravatar image acp  ( 2011-12-05 23:37:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-12-05 23:37:13 -0600

DimitriProsser gravatar image

The error that you are getting says that you are trying to perform a transform to/from a frame that does not exist. This is most likely because your laser topic contains a frame_id named "/laser", but your static transform publisher is publishing a transform from "base_laser" instead. You need to make sure that the frame_id on this incoming message is correct.

The string "base_link" in transformLaserScanToPointCloud is the frame_id that you want to transform the cloud into. This is simply declared by you based on what you want to do. There is no default value.

edit flag offensive delete link more


Hi, In advance thank you for your advise, I made it work now, I can manipulate every single laser ray position and visualize it in ROS.
acp gravatar image acp  ( 2011-12-06 01:55:04 -0600 )edit
@acp: If you try to change "base_link" parameter in transformLaserScanToPointCloud function call with the one with "/" (i mean like this "/base_link"), will there be any difference? is it working as well?
alfa_80 gravatar image alfa_80  ( 2012-01-24 21:49:05 -0600 )edit

Question Tools


Asked: 2011-12-05 22:25:23 -0600

Seen: 2,278 times

Last updated: Dec 05 '11