This is a project to timely export the trajectory in a SLAM project to a .txt file in TUM format.
Ubuntu 64-bit 18.04 or 20.04. ROS Melodic or Noetic. ROS Installation
Because the coordinate system naming of the SLAM system may be different, this needs to be changed.
trajectorysave.cpp lines 26 and 28 :
Change "/camera_init"
and "/aft_mapped"
to the new coordinate system.
You can view the coordinate system of the current SLAM system through the following command:
rosrun rqt_tf_tree rqt_tf_tree
Clone the repository and catkin_make:
cd ~/save_traj/src
git clone https://github.com/Zjj587/Trajectory_saving_for_SLAM.git
cd ../
catkin_make
source devel/setup.bash
To run Example, you need to install and configure Point-LIO and evo. And no need to change the code.
# termianl 1: run Foint-LIO
roslaunch point_lio mapping_avia.launch
# terminal 2: run save_traj_as_tum
rosrun test_pkg save_traj_as_tum
# terminal 3: play data
rosbag play yourbag.bag
After running:
cd ~/save_traj
evo_traj tum test.txt -p
Thanks to Point-LIO and evo code authors. The major codes in this repository are borrowed from their efforts.