-
Notifications
You must be signed in to change notification settings - Fork 258
Example2
Edit: You can use the customized LeGO-LOAM to save the mapping result in the dump format readable from interactive_slam. The mapping result will be written to /tmp/dump
after running run.launch
.
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)
cd catkin_ws/src
git clone https://github.com/RobustFieldAutonomyLab/LeGO-LOAM.git
git clone https://github.com/koide3/odometry_saver.git
*** 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
rosrun interactive_slam odometry2graph
Menubar -> File -> Open -> ROS -> Choose /tmp/odometry
You can tweak parameters to change the keyframe interval and downsampling resolution:
(downsample_resolution=0.1, keyframe_delta_x=2.0)
*** Note: Too many and dense keyframes affect the following map correction processing speed ***
Menubar -> File -> Save -> Choose the destination directory
You can open and edit the created graph with interactive_slam. See Example1.