This package is dedicated to teaching and implementing various SLAM (Simultaneous Localization and Mapping) and mapping techniques. The package includes tools and nodes for generating and using maps in both 2D and 3D environments, utilizing TurtleBot3 and other robots in ROS 2 simulations.
-
lidar_to_grid.cpp - Converts LiDAR scan data to an occupancy grid format for mapping purposes.
-
occupancy_grid_pub.cpp - Publishes an occupancy grid map based on the robot's sensor inputs.
Note: File names might have changed since the initial lectures, as this represents the final form of the package as it evolved by the last lecture.
-
maze_tb3_bringup.launch.py - Initializes the TurtleBot3 in a simulated maze environment and sets up Gazebo, RViz, and the robot's sensors.
Purpose:
- To set up a complete simulation environment for TurtleBot3 in a maze world.
Command to run:
ros2 launch mapping maze_tb3_bringup.launch.py
-
map_loading_2d.launch.py - Launches the map server and RViz for visualizing a pre-built 2D map.
Purpose: - To load and visualize a 2D occupancy grid map using the map server in ROS 2.
Command to run:
ros2 launch mapping map_loading_2d.launch.py
-
maze_mapping_2d.launch.py - Launches the environment and SLAM process in a 2D maze world using TurtleBot3 and the
slam_toolbox
package.Purpose:
- To perform 2D SLAM in a maze environment using TurtleBot3.
Command to run:
ros2 launch mapping maze_mapping_2d.launch.py
-
maze_mapping_3d.launch.py - Sets up the TurtleBot3 in a 3D maze environment for SLAM using depth camera data and RTAB-Map.
Purpose:
- To perform 3D SLAM in a maze environment with a depth camera on TurtleBot3.
Command to run:
ros2 launch mapping maze_mapping_3d.launch.py
-
Occupancy Grid Mapping
- A technique that builds a 2D map by converting sensor data (like LiDAR) into a grid where each cell represents the probability of being occupied.
-
RTAB-Map
- A real-time appearance-based mapping tool that can perform SLAM in 3D environments using RGB-D or stereo cameras.
-
SLAM Toolbox
- A collection of tools for 2D SLAM, useful for real-time localization and mapping with 2D sensors like LiDAR.
-
Bring up TurtleBot3 in a Maze Environment:
ros2 launch mapping maze_tb3_bringup.launch.py
-
Load and Visualize a 2D Map:
ros2 launch mapping map_loading_2d.launch.py
-
Perform 2D SLAM in a Maze:
ros2 launch mapping maze_mapping_2d.launch.py ## Next terminal run driving node ros2 run teleop_twist_keyboard teleop_twist_keyboard
-
Perform 3D SLAM in a Maze:
## Requires Rtabmapping and change in turtlebot3 camera to depth ros2 launch mapping maze_mapping_3d.launch.py
The CMakeLists.txt file for the mapping
package includes the necessary configurations for building the package. Key components include:
- Executables:
lidar_to_grid
occupancy_grid_pub
Dependencies include rclcpp
, sensor_msgs
, nav_msgs
, and geometry_msgs
.