This package contains a ROS wrapper for Intel's SLAM library. The realsense_ros_slam package provides a solution for SLAM as a ROS nodelet. It consumes the messages sent by the realsense_ros_camera nodelet, and publishes messages for the camera pose and occupancy map.
To use realsense_ros_slam, you need a mobile agent with a RealSense ZR300 camera.
- Ubuntu 16.04
- gcc 4.9.3
- libeigen3-dev
- libc++ dev
- Linux SDK
- librealsense_slam
camera/fisheye/image_raw
- Message type:
sensor_msgs::Image
- The fisheye image with timestamp
camera/depth/image_raw
- Message type:
sensor_msgs::Image
- The depth image with timestamp
camera/fisheye/camera_info
- Message type:
sensor_msgs::CameraInfo
- The intrinsics of the fisheye camera
camera/depth/camera_info
- Message type:
sensor_msgs::CameraInfo
- The intrinsics of the depth camera
camera/gyro/sample
- Message type:
sensor_msgs::Imu
- Gyroscope sample with timestamp
camera/accel/sample
- Message type:
sensor_msgs::Imu
- Accelerometer sample with timestamp
camera/gyro/imu_info
- Message type:
realsense_ros_camera::IMUInfo
- Gyroscope intrinsics, noise and bias variances
camera/accel/imu_info
- Message type:
realsense_ros_camera::IMUInfo
- Accelerometer intrinsics, noise and bias variances
camera/extrinsics/fisheye2imu
- Message type:
realsense_ros_camera::Extrinsics
- Fisheye to IMU extrinsics
camera/extrinsics/fisheye2depth
- Message type:
realsense_ros_camera::Extrinsics
- Fisheye to depth extrinsics
camera_pose
- Message type:
geometry_msgs::PoseStamped
- The raw camera pose, in the camera's coordinate system (right-handed, +x right, +y down, +z forward)
reloc_pose
- Message type:
geometry_msgs::PoseStamped
- The relocalized camera pose, in the camera's coordinate system. Published only when a relocalization has occurred.
pose2d
- Message type:
geometry_msgs::Pose2D
- The 2D camera pose, projected onto a plane corresponding to the occupancy map
tracking_accuracy
- Message type:
realsense_ros_slam::TrackingAccuracy
- The current 6DoF tracking accuracy (low/medium/high/failed). Currently
high
is not used.
map
- Message type:
nav_msgs::OccupancyGrid
- The occupancy map
trajectoryFilename
str::string
, default: 'trajectory.ppm'- The name of the trajectory file to output. The files will be saved in the realsense_ros_slam directory.
relocalizationFilename
str::string
, default: 'relocalization.bin'- The name of re-localization file to output. The files will be saved in the realsense_ros_slam directory.
occupancyFilename
str::string
, default: 'occupancy.bin'- The name of occupancy data file to output.
map_resolution
double
- Sets the size of the grid squares in the occupancy map, in meters.
hoi_min
double
- Sets the minimum height of interest for the occupancy map, in meters.
hoi_max
double
- Sets the maximum height of interest for the occupancy map, in meters.
doi_min
double
- Sets the minimum depth of interest for the occupancy map, in meters.
doi_max
double
- Sets the maximum depth of interest for the occupancy map, in meters.
realsense_ros_slam/reset
- Resets SLAM so that all subsequent poses are relative to the current position.
- Clears the occupancy map.
To run the slam engine:
$ cd catkin_ws
$ source devel/setup.bash
$ roslaunch realsense_ros_slam demo_slam.launch
To run the slam engine using a recorded bag file:
$ roslaunch realsense_ros_slam demo_slam_from_bag.launch bag_path:=~/test.bag
To record slam topics to a bag file:
$ roslaunch realsense_ros_slam record_bag_slam.launch
The bag file will be written to your home directory, with a timestamp appended.
To print the estimated pose messages, in another console window:
$ rostopic echo pose2d
The demo_slam.launch
and demo_slam_from_bag.launch
files will automatically start rviz using a configuration file located at launch/demo_settings.rviz
. The raw camera pose, occupancy map, and odometry are shown in rviz. The odometry message is only sent by the SLAM nodelet for demo purposes, since the pose2d
message cannot be displayed by rviz. The odometry message contains the same 2D pose that the pose2d
message does. This shows where the robot is located relative to the occupancy map.
The SLAM package can be tested with pre-recorded data using the provided ROS unit test. No physical camera needs to be present in order to run the test. The following steps can be used to build the unit test and download the pre-recorded ROS .bag data:
$ cd ~/catkin_ws
$ catkin_make -DREALSENSE_ENABLE_TESTING=On
$ rostest realsense_ros_slam slam.test
You will see the test execute on the command line as it builds a map from the input data, then the test passes with a "RESULT: SUCCESS" status.
Note: Depending on your internet connection speed, enabling 'REALSENSE_ENABLE_TESTING' can cause catkin_make to run for very long time (more than 5 minutes), as it downloads required pre-recorded .bag data.