Skip to content

Example2

koide3 edited this page Oct 17, 2019 · 12 revisions

In this example, we create a map with odometry data generated from a rosbag file using LeGO-LOAM.

Example rosbag file: hdl_400.bag.tar.gz (about 900MB)

Generating odometry data

*** Note: You need to edit "utility.h" in LeGO-LOAM to adapt it to your sensor. ***

Launch odometry_saver:

roslaunch odometry_saver online.launch dst_directory:=/tmp/odometry points_topic:=/velodyne_points odom_topic:=/integrated_to_init endpoint_frame:=base_link origin_frame:=map
  • dst_directory: Destination directory
  • points_topic: Point cloud topic
  • odom_topic: Odometry topic (nav_msgs/Odometry)
  • endpoint_frame: Odometry endpoint TF frame
  • origin_frame: Odometry origin TF frame

Launch LeGO-LOAM and start playing rosbag:

roslaunch lego_loam run.launch
rosbag play --clock hdl_400.bag

After finishing to play back the rosbag, press Ctrl+C to terminate odometry_saver and LeGO-LOAM. You'll see odometry data in the destination directory.

/tmp/odometry
├── 1570513628_110666000.pcd
├── 1570513628_110666000.odom
├── 1570513628_161063000.pcd
├── 1570513628_161063000.odom
├── 1570513628_211459000.pcd
├── 1570513628_211459000.odom

Generate graph data from odometry

rosrun interactive_slam odometry2graph
File -> Open -> ROS -> Choose /tmp/odometry

Screenshot_20191017_105630 png

You can tweak parameters to change the keyframe interval and downsampling resolution: Screenshot_20191017_105657 png (downsample_resolution=0.1, keyframe_delta_x=2.0)
*** Note: Too many and dense keyframes affect the following map correction processing speed ***

Save graph data

File -> Save -> Choose the destination directory

You can open and correct the created graph with interactive_slam. See Example1.

Clone this wiki locally