Multiple drone connect via mavros on same network

I have two drones, In each drone pixhawk is connected to companion computer via FTDI cable both running mavros with different system ID. before I use the following to connect my GCS with single drone

export ROS_MASTER_URI=http://drone_ip:11311
export ROS_IP=my_gcs_ip

now I have two ros master running at

export ROS_MASTER_URI=http://drone_1_ip:11311
export ROS_MASTER_URI=http://drone_2_ip:11311

How can I connect both drone to my GCS and show both drones ros topics

The ROS_MASTER setting seems to be incorrect.
And, as far as I know, the connection of multi-drone in MAVROS can be divided into SYS_ID.

<arg name="gcs_url" default="" />
<arg name="tgt_system" default="1" />

I think you just need to initiate one ros master.
If youre working with 2 drones and 1 GCS, means that you’re running 3 ros systems. So your configuration could be like this.

Example:

  • Drone1 ip: 192.168.0.2
  • Drone2 ip: 192.168.0.3
  • GCS ip: 192.168.0.4

You can initiate the ros master in GCS, and inside it, do,

export ROS_MASTER_URI=http://192.168.0.4:11311
export ROS_IP=192.168.0.4

In drone 1:

export ROS_MASTER_URI=http://192.168.0.4:11311 (GCS ip)
export ROS_IP=192.168.0.2

In drone 2:

export ROS_MASTER_URI=http://192.168.0.4:11311 (GCS ip)
export ROS_IP=192.168.0.3

Since both drone are working with same topic name, you need to set a namespace for both. Let say for drone 1, “drone1”, and for drone 2, “drone2”, the mavros topic will be,

/drone1/mavros/local_position/pose
/drone2/mavros/local_position/pose

First i think the same. But due to wifi or telemetry connection I can’t go with this architecture