Running multiple SITL instances - rcS startup script

I need to run 2 or more independent PX4 SITL at the same time. After running the first one with make px4_sitl gazebo command, I tried to run the second one at another terminal and it killed the first one automatically before starting the new process. I don’t want to run multi vehicle, just 2 px4 SITL app to test my algorithm for a redundant system. Do I have to edit the rcS script or the Cmakefile to allow me running more than one flight stack simultaneously? I’m changing the communication ports between PX4 SITL and simulator at the file PX4-Autopilot/rcS at master · PX4/PX4-Autopilot · GitHub because I want the mavlink messages go through an intermediate program where I can do the selection before they get in the simulator. Will I have more conflicts at rcS or cmake file to make this work?

There are instructions to run multiple SITL instances in Multi-Vehicle Simulation with Gazebo | PX4 User Guide

1 Like

I already read the PX4-Autopilot/gazebo_sitl_multiple_run.sh at main · PX4/PX4-Autopilot · GitHub script and I have one doubt.
Where is this command defined on that binary fine: “/bin/px4” [line 37]?
I understand the arguments but I can’t find out where is the source file with the function defined to receive the arguments.

Thanks for the help! :slight_smile: