2️Perception

In order to create a map with multiple robots, multirobot-map-merge package is required. Follow the instructions below instead of Launching Simulation World section of this page to operate multiple TurtleBot3.

  1. Install necessary package

    $ sudo apt-get install ros-kinetic-multirobot-map-merge
  2. Load multiple TurtleBot3 in TurtleBot3 House. These loaded turtlebot3s are set initial position and orientation.

    $ roslaunch turtlebot3_gazebo multi_turtlebot3.launch
  3. Launch SLAM for each TurtleBot3

    $ ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_slam turtlebot3_gmapping.launch set_base_frame:=tb3_0/base_footprint set_odom_frame:=tb3_0/odom set_map_frame:=tb3_0/map
    $ ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_slam turtlebot3_gmapping.launch set_base_frame:=tb3_1/base_footprint set_odom_frame:=tb3_1/odom set_map_frame:=tb3_1/map
    $ ROS_NAMESPACE=tb3_2 roslaunch turtlebot3_slam turtlebot3_gmapping.launch set_base_frame:=tb3_2/base_footprint set_odom_frame:=tb3_2/odom set_map_frame:=tb3_2/map
  4. Merge map data from each TurtleBot3

    $ roslaunch turtlebot3_gazebo multi_map_merge.launch
  5. Launch RViz

    $ rosrun rviz rviz -d `rospack find turtlebot3_gazebo`/rviz/multi_turtlebot3_slam.rviz
  6. Operate each TurtleBot3

    $ ROS_NAMESPACE=tb3_0 rosrun turtlebot3_teleop turtlebot3_teleop_key
    $ ROS_NAMESPACE=tb3_1 rosrun turtlebot3_teleop turtlebot3_teleop_key
    $ ROS_NAMESPACE=tb3_2 rosrun turtlebot3_teleop turtlebot3_teleop_key
  7. Save the Map

    $ rosrun map_server map_saver -f ~/map

Last updated