Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Robot Support #365

Open
wants to merge 78 commits into
base: main
Choose a base branch
from

Conversation

JBVAkshaya
Copy link

@JBVAkshaya JBVAkshaya commented Feb 19, 2025

Changes Made

Multi-Robot support for Gazebo with SITL in ROS 2

Simulation Overview:

We use Ardusub SITL to establish a simulation pipeline that is close to real world setup for hardware-software integration. Ardusub SITL enables running this firmware in simulation to test software modules for control and motion planning. SITL helps to establish a working pipeline which can be easily ported to actual hardware. We use Gazebo as the flight dynamic model (FDM) that simulates the robot and onboard sensor in different environment conditions and configurations.

Gazebo_with_SITL_in_ROS

Simulator Implementation Details:

Ardupilot plugin for Gazebo utilizes internal simulation APIs to retrieve robot’s current state and execute vehicle commands. It communicates to the ArduSub SITL over UDP using IP protocol.

Intricate details for multi-robot application:

  1. ArdupilotPlugin is loaded in the gazebo.xacro file. All the sensors and actuators are configured inside the plugin body.
  2. FDM out and FDM in ports are defined inside the plugin body to allocate ports for sending telemetry data and receiving actuator commands. Same port numbers are assigned on the SITL side to receive and send data respectively.

Ardusub SITL can be thought of as a virtual FCU. It is a sandwich module that communicates with both the Ardupilot gazebo plugin and ROS topics using MAVROS. mavros_node is a container node that launches mavros_router and uas_node. It is configured for individual robot using a configuration file.

Intricate details for multi-robot application:

  1. tgt_system represents the system id of the SITL and is unique for each robot. Same parameter is encoded as SYSID_THISMAV in ardusub SITL. Both these parameters have to match.
  2. Given the simulation is setup on single machine, all the ports for different robots have to be unique. For SITL, a block of 10 ports is reserved for a single robot and default starting port for TCP connection is 5760. Similarly, we are required to set unique fdm_out and fdm_in ports.
  3. We encode the FCU_URL to define the connection with SITL in mavros.
  4. Let us say n is set by --instances/-I. Then the starting port address for connect is set as base port + 10*n
  5. GCS_URL is used to define a connect to the external GCS in mavros. When using this mavros enables communication between SITL (FCU) and GCS first by converting mavlink message to ros message and then converting it back to mavlink message as GCS understands mavlink messages. mavproxy is used for enabling this.

Multi-Robot Simulation Parameter setup:

Gazebo:
Setup fdm_in and fdm_out while loading Ardupilot plugin.

  • Rob 1:fdm_in = 9002, fdm_out=9003
  • Rob 2: fdm_in = 9012, fdm_out=9013

Mavros:

  • Rob_1: fcu_url : "tcp://localhost:5760”, gcs_url: “”, tgt_system: 1
  • Rob_2: fcu_url : "tcp://localhost:5770”, gcs_url: “”, tgt_system: 2

SITL:
ardusub -S -w -M JSON --defaults $(var ardusub_params_file) -I$(var ardusub_instance) --sysid $(var sysid_thismav) --home 44.65870,-124.06556,0.0,270.0

  • Rob 1: ardusub_instance=0, sysid_thismav=1. Here connection address for tcp will be set to 5760 + 10*0=5760
  • Rob 2: ardusub_instance=1, sysid_thismav=2. Here connection address for tcp will be set to 5760 + 10*1=5770

References:

  1. Multi-robot mavros: https://github.com/Intelligent-Quads/iq_tutorials/blob/master/docs/multi_mavros_drones.md
  2. Multi-robot swarm: https://github.com/Intelligent-Quads/iq_tutorials/blob/master/docs/swarming_ardupilot.md
  3. Ardusub SITL: https://github.com/ArduPilot/ardupilot/tree/master/ArduSub
  4. Ardusub SITL Bluerov Heavy params: https://github.com/ArduPilot/ardupilot/blob/master/Tools/Frame_params/Sub/bluerov2-heavy-4_0_0.params
  5. Gazebo - SITL - GCS Architecture: https://gazebosim.org/api/gazebo/3/ardupilot.html

Testing

Tested on iron. Teleop for multi-robot working fine.

evan-palmer and others added 30 commits June 28, 2023 18:01
…Decision-Making-Lab#105)

(cherry picked from commit 1d25643)

Co-authored-by: Evan Palmer <evanp922@gmail.com>
Robotic-Decision-Making-Lab#122)

* Cleaned up Docker pipelines (Robotic-Decision-Making-Lab#121)

* Cleaned up Dockerfile and added new user entrypoints

* Fixed robot pipeline to support building for arm64

* Updated devcontainer configurations to use latest changes

* Testing pipelines

* Removed testing branch from pipelines

* Precommit

* Resolved pr comments

(cherry picked from commit 11807c8)

# Conflicts:
#	.devcontainer/nouveau/devcontainer.json
#	.devcontainer/nvidia/devcontainer.json
#	.github/ISSUE_TEMPLATE/config.yaml
#	.github/workflows/ci.yaml

* Fixed backport

* Fixed config merge conflict

---------

Co-authored-by: Evan Palmer <evanp922@gmail.com>
…obotic-Decision-Making-Lab#124)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 96d5854)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Lab#128) (Robotic-Decision-Making-Lab#133)

Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 28862b2)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…aking-Lab#129) (Robotic-Decision-Making-Lab#135)

Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](docker/setup-qemu-action@v2.2.0...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 8d2cc5b)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…aking-Lab#130) (Robotic-Decision-Making-Lab#137)

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.1 to 5.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v4.1.1...v5.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 714a253)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…-Lab#131) (Robotic-Decision-Making-Lab#139)

Bumps [docker/login-action](https://github.com/docker/login-action) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@v2.2.0...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 8abca64)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ng-Lab#148) (Robotic-Decision-Making-Lab#149)

* Allowing gazebo_world_file arg to be passed in

* updating gazebo_world_file arg in launch file

* updating gazebo_world_file arg in launch file

* Pre-commit

---------

Co-authored-by: Evan Palmer <evanp922@gmail.com>
(cherry picked from commit 01b385d)

Co-authored-by: Tim Huff <89954856+timmarkhuff@users.noreply.github.com>
…-Lab#172) (Robotic-Decision-Making-Lab#173)

Bumps [docker/login-action](https://github.com/docker/login-action) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit c8e46b7)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…aking-Lab#175) (Robotic-Decision-Making-Lab#177)

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v5.3.0...v5.4.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 880a2d6)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#182) (Robotic-Decision-Making-Lab#184)

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 107fe4c)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…aking-Lab#179) (Robotic-Decision-Making-Lab#186)

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.4.0 to 6.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v5.4.0...v6.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 4efc645)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…obotic-Decision-Making-Lab#193) (Robotic-Decision-Making-Lab#194)

* Fixed ardusub_gazebo install and mavros configurations

* Remapped controller manager topic to robot state publisher topic

* Added missing gstreamer dependency

(cherry picked from commit 9ddb154)

Co-authored-by: Evan Palmer <evanp922@gmail.com>
…ng-Lab#196) (Robotic-Decision-Making-Lab#198)

(cherry picked from commit 531ed83)

Co-authored-by: Evan Palmer <evanp922@gmail.com>
mergify bot and others added 28 commits September 14, 2024 13:16
…on-Making-Lab#299) (Robotic-Decision-Making-Lab#306)

* Consolidated worlds into a single file

* Added water and sky textures to underwater world

* what

* Remove random change

(cherry picked from commit 5b34879)

Co-authored-by: Evan Palmer <evanp922@gmail.com>
…Lab#311) (Robotic-Decision-Making-Lab#313)

Bumps [express](https://github.com/expressjs/express) from 4.19.2 to 4.21.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](expressjs/express@4.19.2...4.21.0)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 49a0fa2)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) (Robotic-Decision-Making-Lab#317)

* Added message transforms

* Fixed launch file

* cleanup launch file

(cherry picked from commit 608e987)

Co-authored-by: Evan Palmer <evanp922@gmail.com>
…Decision-Making-Lab#320) (Robotic-Decision-Making-Lab#321)

* Fixed instances where old m2m api was used

* precommit

(cherry picked from commit 2d17d70)

Co-authored-by: Evan Palmer <evanp922@gmail.com>
…Lab#325) (Robotic-Decision-Making-Lab#326)

Bumps [docker/bake-action](https://github.com/docker/bake-action) from 5.7.0 to 5.9.0.
- [Release notes](https://github.com/docker/bake-action/releases)
- [Commits](docker/bake-action@v5.7.0...v5.9.0)

---
updated-dependencies:
- dependency-name: docker/bake-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 52a55f5)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…-Lab#329) (Robotic-Decision-Making-Lab#330)

Bumps [docker/bake-action](https://github.com/docker/bake-action) from 5.9.0 to 5.10.0.
- [Release notes](https://github.com/docker/bake-action/releases)
- [Commits](docker/bake-action@v5.9.0...v5.10.0)

---
updated-dependencies:
- dependency-name: docker/bake-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 52048dc)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…obotic-Decision-Making-Lab#334)

Bumps [cookie](https://github.com/jshttp/cookie) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `cookie` from 0.6.0 to 0.7.1
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](jshttp/cookie@v0.6.0...v0.7.1)

Updates `express` from 4.21.0 to 4.21.1
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md)
- [Commits](expressjs/express@4.21.0...4.21.1)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit af36d6f)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Lab#337) (Robotic-Decision-Making-Lab#338)

Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 10.9.1 to 10.9.3.
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](mermaid-js/mermaid@v10.9.1...v10.9.3)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit c598d42)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…sion-Making-Lab#340) (Robotic-Decision-Making-Lab#343)

Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](chimurai/http-proxy-middleware@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 86f394e)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Copy link

mergify bot commented Feb 19, 2025

This pull request is in conflict. Could you fix it @JBVAkshaya?

@evan-palmer
Copy link
Collaborator

Could you do a rebase off of main @JBVAkshaya? It looks like there are a lot of duplicate commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants