sp-sophia-labs / turtlebot4_multi_sim

2 stars 0 forks source link

turtlebot_sim_test

Tentative to launch multiple turtlebot4 in simulation with correct namespacing. This code is tested for Ubuntu 20.04 and ROS2 Galactic. This code includes forked submodules for rclcpp, gz_ros2_control, ros2_control and ros2_controllers

clone

Use the following to clone the entire repo with submodules: git clone --recursive https://github.com/sp-sophia-labs/turtlebot4_sim_test.git

Alternatively you can clone normally and run git submodule update -r --init in the root directory of the project

install

make install

build

make build

If you are building on a weaker machine, it's recommended to build packages sequentially to avoid problems

make safe_build

run

Create3

source install/setup.bash

Launch the world and the first create3 instance: ros2 launch irobot_create_ignition_bringup create3_ignition.launch.py namespace:=robot_0 robot_name:=robot_zero

Alternatively, launching the robot without namespaces is still available: ros2 launch irobot_create_ignition_bringup create3_ignition.launch.py

(Optional) For weaker machines, you can spawn create3 in an empty world: ros2 launch irobot_create_ignition_bringup create3_ignition.launch.py world:=empty

In a separate terminal, spawn another create3 instance with different name, namespace and pose: ros2 launch irobot_create_ignition_bringup create3_spawn.launch.py namespace:=robot_1 robot_name:=robot_one y:=1 You can change the x, y, z param to spawn the robot where needed

Once the gazebo simulation has started, you can modify the Create3 HMI field to reflect on the new robot name. It defaults to "create3" This will correctly map the Create3 simulated button to one of your robots

TurtleBot4

source install/setup.bash

Launch the world and the first create3 instance: ros2 launch turtlebot4_ignition_bringup ignition.launch.py namespace:=robot_0 robot_name:=robot_zero

Alternatively, launching the robot without namespaces is still available: ros2 launch turtlebot4_ignition_bringup ignition.launch.py

In a separate terminal, spawn another create3 instance with different name, namespace and pose: ros2 launch turtlebot4_ignition_bringup turtlebot4_spawn.launch.py namespace:=robot_1 robot_name:=robot_one y:=1 You can change the x, y, z param to spawn the robot where needed

Once the gazebo simulation has started, you can modify the Turtlebot4 HMI field to reflect on the new robot name. It defaults to "turtlebot4" This will correctly map the Turtlebot simulated button and interface to one of your robots. Leds should light up and the interface should display the usual options

Known issues