This repository contains the following package:
- mapping_bot: A 4-wheeled skid-steer drive robot equipped with a RGBD camera and a Hokuyo lidar in a Gazebo environment. The generated graph is stored inside the
databases
directory and can be used afterwards for localization.rtabmapviz
is used for visualization during SLAM, whilerviz
is used during localization. The robot is controlled with theteleop_twist_keyboard
package.
The source code is released under an MIT license.
Author/Maintainer: George Sotirchos
The mapping-bot package has been tested under ROS Kinetic in a docker container on Ubuntu 20.04 (see Running in Docker section). This is experimental, personal project code, and possibly subject to frequent changes with any need for explanation disclaimed.
The generated database file (~500MB) containing the above graph can be downloaded from the following link:
https://drive.google.com/file/d/1b5pvZWY5gWn9cGNwS4kvx6GS7iLyPiKr/view?usp=sharing
Note: the numbered white cubes are not detected by the laser scan because their models contained no <collision>
elements.
To build from source, with ROS Kinetic on Ubuntu 16.04, clone the latest version from this repository into your catkin workspace and compile the package with the following commands:
mkdir -p /catkin_ws/src
cd catkin_ws/src
git clone https://github.com/gsotirchos/mapping-bot
cd ../
rosdep install --from-paths . --ignore-src
catkin_make
# place the downloaded database file at ./src/mapping-bot/mapping_bot/databases/rtabmap.db
Install Docker.
Spin up a container with GUI forwarding for X11 applications:
docker run \
-ti \
--rm \
--network=host \
--env="DISPLAY" \
--env QT_X11_NO_MITSHM=1 \
--device=/dev/dri:/dev/dri \
--volume="$HOME/.Xauthority:/root/.Xauthority:rw" \
--name ros-container \
mjenz/ros-kinetic-desktop-full \
bash
This downloads the mjenz/ros-kinetic-desktop-full
image from mjenz's Docker repository, indicates that it requires an interactive terminal (-t
, -i
), gives it a name (--name
), removes it after you exit the container (--rm
), sets the required environment variables (--env
) and access to local resources (--device
, --volume
) to be able to launch graphical applications (Gazebo, RViz, rqt_graph, etc.), and runs a command (bash
).
Now, continue with the instructions from the Building section.
-
Start the Gazebo environment containing the robot:
roslaunch mapping_bot world.launch
-
Start the
teleop_twist_keyboard
node:roslaunch mapping_bot teleop.launch
-
Start the
rtabmap
andrtabmapviz
nodes in SLAM mode:roslaunch mapping_bot mapping.launch
Alternatively, start the
rtabmap
andrtabmapviz
nodes in localization mode:roslaunch mapping_bot localization.launch
-
mapping_bot/launch/world.launch: A Gazebo simulation is opened and a 4-wheeled skid-steer drive robot equipped with an RGBD camera and a Hokuyo lidar is spawned in an office environment.
-
mapping_bot/launch/mapping.launch: Starts the
rtabmap
node for SLAM, and thertabmapviz
node for visualization. -
mapping_bot/launch/localization.launch: Starts the
rtabmap
node for localization, and therviz
node for visualization.Arguments:
-
rviz
: Whether to launch an RViz window.
Default:true
-
move_base
: Whether to start amove_base
node.
Default:false
-
Following are the rtabmap
's published and subscribed topics of main interest for the current application.
-
/map
(nav_msgs/OccupancyGrid)Mapping Occupancy grid generated with laser scans. Remapped from
grid_map
.
-
/rgb/image_raw
(sensor_msgs/Image)Image from the camera. Remapped from
rgb/image
. -
/rgb/camera_info
(sensor_msgs/CameraInfo)RGB Camera metadata.
-
/depth/image_raw
(sensor_msgs/Image)Depth measurements from the camera. Remapped from
depth/image
. -
/scan
(sensor_msgs/LaserScan)Laser scan stream. Remapped from
scan
.
Please report bugs and request features using the Issue Tracker.
ROS: http://www.ros.org
RTAB-Map's ROS package: https://github.com/introlab/rtabmap_ros
move_base ROS package (ROS Navigation stack): https://github.com/ros-planning/navigation
teleop_twist_keyboard ROS package: https://github.com/ros-teleop/teleop_twist_keyboard