0
$\begingroup$

Rosanswers logo

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 :)


Originally posted by acp on ROS Answers with karma: 556 on 2011-12-05

Post score: 1


Original comments

Comment by acp on 2011-12-06:
yes mainly of all them, but I cant figure it out, I need help.

Comment by Eric Perko on 2011-12-05:
Have you gone through all of the beginner tutorials as well as the tf tutorials?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by DimitriProsser with karma: 11163 on 2011-12-06

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by alfa_80 on 2012-01-24:
@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?

Comment by acp on 2011-12-06:
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.

$\endgroup$

Your Answer

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