Rosanswers logo

I want to write a driver for laser scanner and publish data on /scan topic. I write this code for initializing:

    sensor_msgs::LaserScan laser_data;

and put my data on ranges array.

I can see laser data in Rviz but when i used it for hector_slam , It's not worked and I saw this error:

[ INFO] [1395750671.645863427]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.

[ERROR] [1395750671.815635459]: Trajectory Server: Transform from /map to scanmatcher_frame failed: "map" passed to lookupTransform argument target_frame does not exist

another warning that i saw in Rviz in Global Status box is :

No tf data. Actual error: Fixed Frame [laser] does not exist

This is my tf_tree when run hector_slam:

image description

When i try with urg_node , hector_slam worked correctly. This is the tf tree with urg_node:

image description

I used a Hokuyo 04LX laser scanner.

Does anyone has any suggestion about this problem?

Thank you

Originally posted by mr.karimi on ROS Answers with karma: 52 on 2014-03-25

Post score: 0

Original comments

Comment by BennyRe on 2014-03-25:
This sounds more like a TF problem than an implementation problem of your driver. Investigate your TF tree and so on.

Comment by timm on 2014-03-27:
Is the TF broadcaster "/base_to_laser_broadcaster" the same in both cases? Is it a tf static_transform_publisher or a node you wrote yourself? Can you try to increase the publish rate for /base_to_laser_broadcaster?

Comment by MiNiBot on 2015-11-14:
I also got problem like this. Is there anyone can solve this? Thank a Lot


1 Answer 1


Rosanswers logo

I´d suspect that the frame_id you use is different from the one used when using the hokuyo_driver, as the transform error says that there is no connection from the laser to the base_frame. If you´re sure you didn´t change any other parts of your robot system, doing a "rostopic echo" on your scans and comparing the output for both the hokuyo_driver and your own driver should show you the difference (if any). If at all possible, I´d suggest using the existing driver however.

Originally posted by Stefan Kohlbrecher with karma: 24361 on 2014-03-25

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by mr.karimi on 2014-03-26:
I checked "rostopic echo" but there is no difference between my program and urg_node.

yes ,you're right.i should use existing drivers but in my situation i think i don't have another choice.

Comment by mr.karimi on 2014-03-26:
I want to connect the laser scanner to an embedded board that doesn't have ros and send laser data through udp. I have another program in ROS that receive udp data and publish as LaserScan topic.


Your Answer

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