- ROS Melodic
- Gazebo 9
- RViz
- Teleop twist keyboard
- Hector SLAM
- GMapping
- RTAB-Map
- AMCL
- Map server
- PGM Map Creator
- Clone this repo inside the
src
folder of a catkin workspace with the PGM Map Creator submodule:git clone --recurse-submodules https://github.com/hungarianrobot/Project-2-Mapping
- Install
libignition-math2-dev
andprotobuf-compiler
to compile the map creator:sudo apt-get install libignition-math2-dev protobuf-compiler
- Build workspace:
catkin_make
- Source environment:
source devel/setup.bash
- Start the Gazebo simulation:
roslaunch hurba_mapping world.launch
- Start the teleop package:
roslaunch hurba_mapping teleop.launch
- Start RViz and open the
basic_view.rviz
configuration. - Drive the robot inside the simulated environment. Note: this time the robot is omnidirectional instead of the previous diff drive!
- Successfully build PGM Map Creator.
- Copy the
building.world
Gazebo world file intosrc/pgm_map_creator/world/
folder. - Add
<plugin filename="libcollision_map_creator.so" name="collision_map_creator"/>
before the</world>
tag. - Run Gazebo server with:
gzserver src/pgm_map_creator/world/building.world
. - Save the map with PGM Map Creator:
roslaunch pgm_map_creator request_publisher.launch
. - Copy the saved
map.pgm
to maps folder of themy_robot
package and create amap.yaml
with default values (seehurba_mapping/maps
folder).
- Start the Hector SLAM:
roslaunch hurba_mapping hector_slam.launch
- Start the teleop package:
roslaunch hurba_mapping teleop.launch
- Start the GMapping package:
roslaunch hurba_mapping gmapping_slam.launch
- Start the teleop package:
roslaunch hurba_mapping teleop.launch
- Start the RTAB-Map package:
roslaunch hurba_mapping rtab_map_slam.launch
- Start the teleop package:
roslaunch hurba_mapping teleop.launch
Un-comment the rtabmapviz
node in the rtab_map_slam.launch
file. In the visualizer tool of RTAB-Map we can see the RGBD pointcloud of the environment:
After the mapping is done we can evaluate the database with RTAB-Map's database viewer, that can be started with the following command:
rtabmap-databaseViewer ~/catkin_ws/src/Project-2-Mapping/hurba_mapping/maps/database/rtabmap.db
Once open, we will need to add some windows to get a better view of the relevant information, so:
- Say yes to using the database parameters
- View -> Constraint View
- View -> Graph View
We can check the number of loop closures during the mapping using the bottom left information:
(283, 0, 29, 0, 0, 0, 0, 0, 0) Links(N, NM, G, LS, LT, U, P, LM, GR)
Where G means the number of Global Loop Closures. The codes stand for the following: Neighbor
, Neighbor Merged
, Global Loop closure
, Local loop closure by space
, Local loop closure by time
, User loop closure
, and Prior link
.
tree -L 3
├── README.md
├── documentation
│ ├── database.png
│ ├── frames.png
│ ├── gazebo.png
│ ├── gmapping.png
│ ├── hector.png
│ ├── rosgraph.png
│ ├── rtabmap.png
│ ├── rtabmapviz.png
│ └── rviz.png
├── hurba_mapping
│ ├── CMakeLists.txt
│ ├── launch
│ │ ├── amcl_localization.launch
│ │ ├── gmapping_slam.launch
│ │ ├── hector_slam.launch
│ │ ├── robot_description.launch
│ │ ├── rtab_map_slam.launch
│ │ ├── teleop.launch
│ │ └── world.launch
│ ├── maps
│ │ ├── database
│ │ ├── map_hector.yaml
│ │ ├── map.pgm
│ │ └── map.yaml
│ ├── meshes
│ │ ├── chassis.dae
│ │ ├── chassis.SLDPRT
│ │ ├── chassis.STEP
│ │ ├── hokuyo.dae
│ │ ├── wheel.dae
│ │ ├── wheel.SLDPRT
│ │ └── wheel.STEP
│ ├── package.xml
│ ├── rviz
│ │ ├── amcl.rviz
│ │ ├── basic_view.rviz
│ │ ├── gmapping_slam.rviz
│ │ ├── hector_slam.rviz
│ │ └── rtab_slam.rviz
│ ├── urdf
│ │ ├── hurba_mecanum.gazebo
│ │ └── hurba_mecanum.xacro
│ └── worlds
│ ├── basic_world.world
│ ├── building.model
│ ├── building.world
│ └── empty.world
└── pgm_map_creator
├── CMakeLists.txt
├── launch
│ └── request_publisher.launch
├── LICENSE
├── maps
│ ├── example_map.pgm
│ └── map.pgm
├── msgs
│ ├── CMakeLists.txt
│ └── collision_map_request.proto
├── package.xml
├── README.md
├── src
│ ├── collision_map_creator.cc
│ └── request_publisher.cc
└── world
├── building.world
├── MyWorld.world
└── udacity_mtv