Multi-Vehicle Simulation with Gazebo, within a docker

I have successfully ran ROS2 off-board example, within a ROS2-dashing docker(gazebo gui doesn’t run though, i don’t know why).

Now i am trying to run multi-vehicle inside the docker.
I first build the sitl,
open up two micrortps agent in two separate terminals. using
micrortps_agent -t UDP -r 2020 -s 2019
micrortps_agent -t UDP -r 2022 -s 2021

and then run the command
./Tools/ -t px4_sitl_rtps -m iris -l rtps -n 2


a list of ports/connections appear, but then they disappear soon.(see attached screenshot).

if i run
ros2 launch px4_ros_com
on a separate terminal, Received sensor combined data appears as long as the multiple run script is running…

so my question is, why don’t i continuously get data? is there something i am doing wrong here?

and a secondary question could be how to fix gazebo gui …these are the relevant messages for gazebo gui when i run the multiple sitl gazebo script

[Err] [] Can't open display: :0
[Wrn] [] Unable to create X window. Rendering will be disabled
[Wrn] [] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose.

gazebo gui doesn’t run though, i don’t know why

As a side note, have you exported the DISPLAY env variable and set the /tmp/.X11-unix folder?
See Calling Docker Manually from documentation regarding and example that “makes the simulation GUI available from inside the container

I had to do the xhost+ before starting the docker. gui works now, thanks

any idea why do ports close in multi simulation?

What ports?
Do they close when/under what circumstances?

Please be more specific detailing you issue.

At any case for networking issues, it’s advised to look at network traffic captures, using wireshark or tcpdump. That way you’ll see exactly what’s going on with your packets…

So i did manage to get a gazebo simulation running, two drones appear on the gazebo simulation.
Now i am trying to do offboard control for multiple drones.
It says here that


In order to communicate with a specific instance of PX4 using ROS2, you must use the -n <namespace> option. For example, running micrortps_agent -t UDP -r 2020 -s 2019 -n vhcl0 will result in the agent publishing all its topics with the namespace prefix /vhcl0. You can then subscribe and publish to just that vehicle’s topics.

how do i get the name of the drones that are in the simulation?

Great! But for the benefit of other community members, could you please describe what you did to solve your issue?

Again for the benefit of other community members, please don’t keep adding new different questions to this same post.
By reading this post’s subject it’s hard to imagine that inside it Iĺl find a solution to having the names of the drones…
Start a new post with the new question instead. Thanks.

I am trying to run multi vehicle simulation with gazebo also. I followed the offboard example. The offboard behavior works only for the first vehicle, for the others it seems that micrortps bridge is not working.
Is it the case for you ?

Thank you