iRobotEducation / create3_sim

ROS 2 Simulation for the iRobot® Create® 3 Educational Robot
BSD 3-Clause "New" or "Revised" License
110 stars 56 forks source link

Draft: Namespace Support #189

Open sp-sophia-labs opened 2 years ago

sp-sophia-labs commented 2 years ago

Description

The goal of this PR is to enable namespacing of the create3 robot to be able to spawn multiple instances in the same simulation space without resorting to isolated networks

This PR is a reboot of this one: https://github.com/iRobotEducation/create3_sim/pull/176. Sorry for the duplicate. @hugo-tardiou has transitioned out of our team and I am taking over the project. Since the previous PR was linked to his personnal account, we are creating a new one here so that we can continue to update it correctly. We'll do our best to summarize past discussions in the checklist below

Type of change: new feature. This change does not fix any open issue

How has this been tested?

We have created a project with dependencies pointing to specific commits (submodules) here: https://github.com/sp-sophia-labs/turtlebot4_multi_sim (details in the dependency section below). Reviewers may clone the project and replicate exactly what we use for testing. You can follow the readme from the project or use the following:

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

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

Dependencies

We have modified other packages outside of create3_sim to be able to spawn multiple create3 in simulation with namespacing. Here is the list with a short description of the reasons for the changes:

We'll update the dependencies above according to how the other PRs are progressing

Checklist

alsora commented 1 year ago

Hi, I gave a quick look at the PR and besides some comments it looks good to me. We will need to test it thoroughly though.

sp-sophia-labs commented 1 year ago

@alsora Thank you for the review! I agree, it's a big one. Happy to lend a hand on the testing if it needs implementation. I'm still waiting for my changes to be merged to gz_ros2_control, and back-ported to galactic before we can test it properly. Don't hesitate to try this: https://github.com/sp-sophia-labs/turtlebot4_multi_sim in the meanwhile