0
$\begingroup$

Rosanswers logo

Hi, all,

I am trying to get my hokuyo laser node to work with hector_slam to produce realtime SLAM. I have installed hokuyo_node and the laser seems working properly. I also completed the hector_slam tutorial using the "Team_Hector_..bag" file. However, when I rosrun hokuyo_node and hector_slam(through a launch file), I just can't get it right. My launch file settings are as follows:

Then I went back to rerun the hector_slam tutorial, I use rxgraph to check what the nodes/topics are. Then, I found that a "/play node" (play back of the *.bag file in the tutorial) publish a '/tf' topic and "/hector_mapping" node subscribe to it. If I just rosrun hokuyo_node, then the "/hokuyo_node" just publish the '/scan' topic. I guess the problem is here. Can anyone elaborate a little more on this '/tf' and how to resolve it when using real laser scanners? THANKS A LOT.


Originally posted by BenMa on ROS Answers with karma: 76 on 2012-08-02

Post score: 1


Original comments

Comment by Messi on 2013-06-08:
please share your launch file, i have a same problem too.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Yes, the problem is related to tf not being available. To get an overview of how tf works you can have a look at the following links:

TF tutorials

Hector SLAM setup tutorial

The easiest option to make it work is manually starting a tf publisher that publishes the needed transform from the base_link that you want to have localized to the laser scanner frame. This can be done by adding the following to a launch file:

  <node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 50" />

/edit: This is assuming you have set the hector_mapping parameters like this:

  <param name="pub_map_odom_transform" value="true"/>
  <param name="map_frame" value="map" />
  <param name="base_frame" value="base_link" />
  <param name="odom_frame" value="base_link" />

Originally posted by Stefan Kohlbrecher with karma: 24361 on 2012-08-02

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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