Launch one or more PX4 SITL vehicles in Gazebo from a single script.
sudo apt install tmux
chmod +x launch_*.pyAdd this to your ~/.bashrc (then open a new shell):
export PX4_Autopilot_Dir=~/PX4-Autopilot./launch_multi_atmos.pyEach vehicle runs in its own tmux window; the script prints the attach command when it's ready.
Each scenario script has a small CONFIG block at the top. Edit it to change the world, the tmux session name, or the vehicle list (names, models, poses):
WORLD = "kthspacelab"
SESSION = "atmos3_kth"
VEHICLES = [
Vehicle(name="snap", model="gz_atmos", pose=(1, 0, 0.2)),
Vehicle(name="crackle", model="gz_atmos", pose=(2, 0, 0.2)),
]To add a new model, edit px4_sitl_launcher.py and add it to both
MODEL_AUTOSTART and MODEL_BUILD.
./launch_multi_atmos.py --killROS 2 integration. In a separate terminal, run the XRCE-DDS agent:
micro-xrce-dds-agent udp4 -p 8888Each vehicle's topics then appear under its name, e.g. /snap/fmu/out/....
PX4 binary not found at .../build/<target>/bin/px4 — build the target it asks for:
cd $PX4_Autopilot_Dir
make px4_sitl_spacecraft # gz_atmos / gz_atmos_dual
make px4_sitl_uuv # gz_uuv_bluerov2_heavygz sim won't die after --kill:
pkill -9 -f 'gz sim'
pkill -9 -f 'bin/px4'
tmux kill-server