This repository provides the necessary setup, scripts, and commands to launch and operate the Concert robot in a simulated environment. The setup includes Gazebo simulation, SLAM, and Navigation in ROS 2 (Robot Operating System 2). Below are detailed instructions for building the Docker image, launching the robot, enabling navigation, running SLAM, saving/loading maps, and following waypoints.
Ensure you have the following installed:
- Docker and Docker Compose:
- To install, follow the appropriate instructions for Docker and Docker Compose on Ubuntu.
-
Build the Docker Image:
docker-compose build
-
Run the Docker Container:
docker-compose up -d
Before launching the Concert robot model, set the required environment variable to specify the resource path for Gazebo:
export GZ_SIM_RESOURCE_PATH=/home/user/data/forest_ws/ros_src/concert_description/concert_gazebo/models
To launch the Concert robot model in the default Gazebo world, execute the following command:
ros2 launch concert_gazebo modular.launch.py velodyne:=true
This command launches the Concert robot in a simulated Gazebo environment with a Velodyne LiDAR sensor enabled.
To open RViz for visualizing sensor data, the robot's position, and the environment in 3D, use the following command:
rviz2 --ros-args -p use_sim_time:=true
To start the odometry process, which helps the robot estimate its position and movement:
ros2 launch concert_odometry_ros2 concert_odometry.launch.py
To convert PointCloud data to LaserScan and fuse multiple LaserScans into a single /scan
topic, use:
ros2 launch concert_navigation master_lidar_conversion_fuse.launch.py
This script converts the PointCloud data from the 3D LiDAR into a 2D LaserScan format suitable for SLAM and navigation.
To start mapping the environment using the SLAM Toolbox and automatically save the map:
ros2 launch concert_navigation master_mapping_slam_saver.launch.py
Once you've completed mapping, save the generated map using the nav2_map_server
package:
ros2 run nav2_map_server map_saver_cli -f maps/myworld
This will save the map in the maps/
directory under the filename myworld
. Adjust the path and file name as needed.
After completing the map creation, start the navigation stack by initializing localization using AMCL (Adaptive Monte Carlo Localization) to position the robot within the known map:
ros2 launch concert_localization localization.launch.py
This command enables AMCL, allowing the robot to localize itself in the previously created map.
To enable obstacle-avoiding path planning and navigate the Concert robot on the built map:
ros2 launch concert_navigation path_planner.launch.py
For autonomous navigation while building a map simultaneously, use the SLAM Toolbox with its localization feature and the navigation stack. This setup enables the robot to explore the environment, build the map, and navigate autonomously.
-
Start SLAM Toolbox with Navigation Enabled:
ros2 launch concert_navigation master_mapping_slam_saver.launch.py
-
Activate the Navigation Stack: After launching SLAM Toolbox, ensure that the navigation stack is enabled to allow for obstacle-avoiding path planning. Use the following command:
ros2 launch concert_navigation path_planner.launch.py
For 3D mapping, Concert uses RTAB-Map, which allows real-time 3D mapping and localization. Since Concert has two 3D PointCloud sensors, you will also need to fuse their data.
- Fuse the 3D PointClouds:
To fuse the data from the two 3D PointCloud sensors, use the following command:
ros2 launch concert_navigation master_cloud_multi_merger.launch.py
- Launch RTAB-Map for 3D Mapping:
Use the following command to start the RTAB-Map process:
ros2 launch concert_mapping rtab_vlp16.launch.py
To save the fused PointCloud data into .pcd
files for later use:
ros2 launch concert_mapping pointcloud_to_pcd_launch.py
The resulting .pcd
files will be stored in the specified directory concert_mapping/pointclouds/
.
To load the saved .pcd
file and use it as the PointCloud source:
ros2 launch concert_mapping pcd_to_pointcloud.launch.py
This replaces the live sensor data with the pre-saved PointCloud data, enabling operations using previously captured environments.