We use different mode values (simple - slam - map) and accordingly, different RViz config files. Alltogether, it creates kind of a mess, but the logic is simple.
# Terminal 1
# echo $ROS_DISTRO
# galactic
#
# source /opt/ros/galactic/setup.bash
#
$ cd ~/SnowCron/ros_projects/harsh
$ colcon build --packages-select multi_bot_04
$ source install/setup.bash
# To run a single robot without SLAM or Map (robot name in code is set to ""):
$ ros2 launch multi_bot_04 multi_simulation_launch.py world:=src/worlds/maze_with_charger.sdf map:=src/maps/map.yaml keepout_mask:=src/maps/keepout_mask.yaml rviz_config_file:=src/multi_bot_04/rviz/simple_single.rviz mode:=simple






As I mentioned earlier, scripts are not yet changed to support multiple robots. This section is here for compatibility, but it will not work! I am going to fix it later.
Waypoints following and Docking to charger
To run these scripts, Terminal 1 should have our launch file started with "mode" equal "map", either for single robot configuration (robot name set to "") or in multi robot configuration. Just to remind you: it can be changed by commenting / uncommenting the following lines in multi_simulation_launch.py:
To run simple waypoint follower script for a single robot (robot name is ""):
# Terminal 3:
$ cd ~/SnowCron/ros_projects/harsh/src/multi_bot_04/multi_bot_04
$ python3 01_waypoint_follower.py
To run docker charging script for a single robot (robot name is ""):
# Terminal 3:
$ cd ~/SnowCron/ros_projects/harsh/src/multi_bot_04/multi_bot_04
$ python3 03_charger_docking.py
Finally, to run docker charging script on multiple (2) robots:
# Terminal 3:
$ cd ~/SnowCron/ros_projects/harsh/src/multi_bot_04/multi_bot_04
$ python3 04_charger_docking_obstacles_multi
