- Clone this repo inside the
src
folder of a catkin workspace:git clone https://github.com/hungarianrobot/Project-3-Navigation
- Build workspace:
catkin_make
- Source environment:
source devel/setup.bash
- Start the Gazebo simulation:
roslaunch hurba_navigation world.launch
- Start the teleop package:
roslaunch hurba_navigation teleop.launch
- Start RViz and open the
basic_view.rviz
configuration. - Drive the omnidirectional robot inside the simulated environment.
The localization uses the known map of the environment, so in the first step we have to prepare these maps. This repository already contains the saved map for AMCL and RTAB-Map in the hurba_navigation/maps/
folder.
Note: the RTAB-Map database is stored as Git LFS file.
- Start the GMapping package:
roslaunch hurba_navigation gmapping_slam.launch
- Start the teleop package:
roslaunch hurba_navigation teleop.launch
- Drive around the simulated world until you're satisfied with the resulted map.
- Save the map with the following ROS node:
rosrun map_server map_saver -f map
- This will save the map.pmg and map.yaml files to folder from which the command was executed.
- Start the RTAB-Map package:
roslaunch hurba_navigation rtab_map_slam.launch
- Start the teleop package:
roslaunch hurba_navigation teleop.launch
- Drive around the simulated world until you're satisfied with the resulted map.
- Exit the node with Ctrl+C and the database file will be saved to the location specified in the launchfile.
After the map was saved we can examine the database with RTAB-Map's database viewer, that can be started with the following command:
rtabmap-databaseViewer ~/catkin_ws/src/Project-3-Navigation/hurba_navigation/maps/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:
(311, 0, 9, 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
.
- Navigate to the
hurba_navigation
folder in thesrc
folder of the catkin_workspace:cd ~/catkin_ws/src/Project-3-Navigation/hurba_navigation/
- Execute the following script:
./scripts/launch_amcl_navigation.sh
- This will open 3 XTerm windows with specific timing.
- RViz, Gazebo world and AMCL localization
- move_base navigation
- keyboard teleoperation
- Localization will determine the robot's pose on the loaded map.
- Send a navigation goal and move_base will drive the robot to the desired location.
- Navigate to the
hurba_navigation
folder in thesrc
folder of the catkin_workspace:cd ~/catkin_ws/src/Project-3-Navigation/hurba_navigation/
- Execute the following script:
./scripts/launch_rtab_navigation.sh
- This will open 3 XTerm windows with specific timing.
- RViz, Gazebo world and RTAB-Map localization
- move_base navigation
- keyboard teleoperation
- Localization will determine the robot's pose on the loaded map.
- Send a navigation goal and move_base will drive the robot to the desired location.
To put RTAB-Map into localization mode we have to specify the following parameters in the launch file:
<!-- Put the robot into localization mode -->
<param name="Mem/IncrementalMemory" type="string" value="false"/>
<param name="Mem/InitWMWithAllNodes" type="string" value="true"/>
And we have to delete the following SLAM related parameter:
<!-- Set to false to avoid saving data when robot is not moving -->
<param name="Mem/NotLinkedNodesKept" type="string" value="false"/>
tree -L 3
.
├── README.md
├── documentation
│ ├── database.png
│ ├── gazebo.png
│ ├── map.png
│ └── rtabmap.png
└── hurba_navigation
├── CMakeLists.txt
├── config
│ ├── base_local_planner_params.yaml
│ ├── costmap_common_params.yaml
│ ├── global_costmap_params.yaml
│ └── local_costmap_params.yaml
├── launch
│ ├── amcl_localization.launch
│ ├── gmapping_slam.launch
│ ├── movebase_navigation.launch
│ ├── robot_description.launch
│ ├── rtab_map_localization.launch
│ ├── rtab_map_slam.launch
│ ├── teleop.launch
│ └── world.launch
├── maps
│ ├── map.pgm
│ ├── map.yaml
│ └── rtabmap.db
├── meshes
│ ├── chassis.dae
│ ├── chassis.SLDPRT
│ ├── chassis.STEP
│ ├── hokuyo.dae
│ ├── wheel.dae
│ ├── wheel.SLDPRT
│ └── wheel.STEP
├── package.xml
├── rviz
│ ├── amcl_navigation.rviz
│ ├── basic_view.rviz
│ ├── gmapping_slam.rviz
│ ├── rtab_navigation.rviz
│ └── rtab_slam.rviz
├── scripts
│ ├── launch_amcl_navigation.sh
│ └── launch_rtab_navigation.sh
├── urdf
│ ├── hurba_mecanum.gazebo
│ └── hurba_mecanum.xacro
└── worlds
├── basic_world.world
├── building.model
├── building.world
└── empty.world