ROS package that collects and synchronizes data from following sensors: RGB-D Realsense camera, IMU and VICON motion camera system in order to create SLAM datasets. The package stores the data in a rosbag and it also can convert the rosbag in a SLAM dataset format, such as TUM dataset.
The synchorinization node works only if each topic have content.
This package was tested using:
- ROS-melodic and Ubuntu18.04.
- ROS-noetic and Ubuntu20.04.
install the realsense-viewer at : https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md
Run the following commands to install the dependencies:
sudo apt-get install ros-$ROS_DISTRO-realsense2-camera
sudo apt-get install ros-$ROS_DISTRO-openni-launch
mkdir rosbag image_dataset
After installed the dependencies and finish the compilation, make the following edits to the file:/opt/ros/melodic/share/realsense2_camera/launch/rs_rgbd.launch
- edit the "depth_width", "depth_height" of the depth image for 640,480 respectively.
- edit the "color_width", "color_height" of the rgb image for 640,480 respectively.
- edit the "color_fps" of the image for 30
- edit the "depth_fps" of the depth for 30
The synching executable can be run with the following command
On a terminal run:
roslaunch realsense2_camera rs_rgbd.launch
In a another terminal:
roslaunch slam_dataset_rospkg slam_rosbag_sync.launch
Once the synching executable is running, the following topics will be created
/camera/color/image_raw_sync
/camera/depth/image_rect_raw_sync
/imu/imu_sync
/vicon/pose_sync
Run the following command in another terminal to start recording the rosbag
rosbag record -O slam_dataset.bag /camera/color/image_raw_sync /camera/depth/image_rect_raw_sync /imu/imu_sync /vicon/pose_sync
This executable can be used standalone to collect synched data from realsense RGB-D camera or can convert the image data from the rosbag. You might need to have the topic names at the src/collect_sync.cpp
depending on your system.
To run it standalone, run in a terminal the realsense camera launch:
roslaunch realsense2_camera rs_rgbd.launch
And on another terminal run the data collection package, if you don't provide the dataset path the system will store the data on the current folder:
rosrun slam_dataset_rospkg collect_sync _dataset_path:=[DST_DATASET_PATH]
To convert a rosbag, run the rosbag play command:
rosbag play <PATH TO ROSBAG>
And run the same command in another terminal:
rosrun slam_dataset_rospkg collect_sync _param:=[DST_DATASET_PATH]
To run the package with camera visualization in parallel to the data acquisition, execute the following command:
roslaunch slam_dataset_rospkg slam_image_dataset.launch
To create a text file with the robots trajectory from a motion camera system, run the following command. You will need a terminal with roscore running and another terminal with your rosbag running as well. This will create a txt file with name ground_truth.txt
rosrun slam_dataset_rospkg gt_extractor _topic:=<topic Name>
To create a text file with the robots trajectory from a RealSense T265, run the following command. You will need a terminal with roscore running and another terminal with your rosbag running as well. This will create a txt file with name t265_odom.txt
rosrun slam_dataset_rospkg t265_odom _topic:=<topic Name>