How to run hector_slam with bag file of laser scanner?
Hi, I record laser scanner data by "rosbag record" option. When I want to run hector_slam with the bag file I faced some errors. I use these commands to run:
rosmake hector_slam
roslaunch hector_slam_launch tutorial.launch
rosbag play test.bag --clock
and in the tab that tutorial.launch run, this error appear repeatedly:
Trajectory Server: Transform from /map to scanmatcher_frame failed: "map" passed to lookupTransform argument target_frame does not exist.
And also the output of "rosbag info filename.bag" was:
path: 2014-04-02-19-53-59.bag
version: 2.0
duration: 9:40s (580s)
start: Apr 02 2014 19:54:00.22 (1396452240.22)
end: Apr 02 2014 20:03:40.50 (1396452820.50)
size: 12.8 MB
messages: 6412
compression: none [17/17 chunks]
types: diagnostic_msgs/DiagnosticArray [3cfbeff055e708a24c3d946a5c8139cd]
dynamic_reconfigure/Config [958f16a05573709014982821e6822580]
dynamic_reconfigure/ConfigDescription [757ce9d44ba8ddd801bb30bc456f946f]
rosgraph_msgs/Log [acffd30cd6b6de30f120938c17c593fb]
sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369]
topics: /diagnostics 579 msgs : diagnostic_msgs/DiagnosticArray
/hokuyo_node/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/hokuyo_node/parameter_updates 1 msg : dynamic_reconfigure/Config
/rosout 6 msgs : rosgraph_msgs/Log (2 connections)
/scan 5825 msgs : sensor_msgs/LaserScan
How can I solve this problem.?
What does `rosbag info test.bag` output? (edit your question to include the output)
It seems that the trajectory server complains, because the transform is not published. I don't know how hector mapping works, but I would disable the trajectory server and first look into how to get he mapping part to work.
I.e. make sure all the necessary topics and parameters are there. You can use rxgraph / rqt_graph to check that rosbag is connected to the mapping node on the laser topics.
Actually I cant understand that which topics and parameter it exactly needs! I can run the bag file example that provided by hector darmstad. I am sure it is not my problem with laser device or hector slam package. It relates to parameters that bag file needs.
Two immediate candidates you might need are the Odometry, the IMU info and the /tf topic, which are both included in the bag file. I think hector mapping can work without IMU, but maybe needs some form of odometry still?
Moreover you might need to edit the launch files / parameters to account for your setup, i.e. topic and tf-frame names.
Have you followed this tutorial closely? http://wiki.ros.org/hector_slam/Tutorials/SettingUpForYourRobot It discusses how to set up your parameters with and without odometry.
Yes, I followed this tutorial before. I can solve that problem. It was related to tf setting. Now I face another problem! During process in hector_slam I visit this message a lot: SearchDir angle change too And it appears a lot and make problem for matching the data to map.