Multi-UAV standard_vtol Hardware in the loop simulation

I wanted to simulate multi-uav (standard_vtol model) in HITL.
Step 1. Modify in single_vehicle model.

Step 2. Modify multi vehicle model.

I have changed the launch file to simulate the model. To work step by step, at first i simulated 10 standard_vtol model in SITL mode and it worked well.

Step for HITL mode (5 Vehicles):

I had followed all steps mentioned on the website. Next, I connected pixhawk board uploaded with firmware (make px4_fmu-v3_default upload) and then connected 5 of them through USB hub.

I configured the QGC for hitl (HIL standard_vtol) model. I followed all the step on the website and used following commands.

(1). DONT_RUN=1 make px4_sitl gazebo_standard_vtol

(2). source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default

(3). export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd):$(pwd)/Tools/sitl_gazebo

(4). roslaunch px4 multi_uav_mavros_vtol_sitl_sdf.launch
Gazebo launches 5 vehicles.


(1). QGC showing connection to all model but GPS position for only Vehicle 1 and not for rest four.

(2). The model with position on QGC is in manual flight mode and not starting the mission.

My Assunption:

I thought, It is communicating to vehicle through dev/ttyACMO,

so I added four more in QGC ttyACM1 to ttyACM4 and in model file






and again followed the procedures mentioned above.

It still did not work.

What can I modify in the codes to run multiple standard_vtol model in Hardware-in-the-Loop simlation.?

I have never tried HITL with multiple vehicles, so I don’t know if it would work. I also would expect to run into USB bandwidth troubles, I’m usually happy if one HITL instance works properly :slightly_smiling_face:.
Is there a reason you’re using HITL and not SITL?

The other thing I suggest you look at is what messages arrive in QGC using the MAVLink inspector. Also, check the console output (or logfile output of Gazebo) of the 5 vehicles to check if anything is different.

Hello. I am also intrested in testing the multi quadrotor. I heard that the multiple quadrotor can work in HITL, is that true? what could be done to implement it? If we want to add some high level control algorithms by calling the offboard API to control the px4 low leverl controller, can I test it by using mutil SITL and how to implement it? Thank you!@JulianOes

Thanks for your prompt reply. I shall look into the direction of communication overhead.

Hi JulianOes!,

The main reason for using multi-uav HITL is Simulation of multi-agent formation.

If you can guide me towards simulating atleast 3 it would be helpful.

Thanks and Regards,


And why can’t you use SITL for that?

The algorithm for controlling the Fixed-wing vehicle is different than the one in px4 firmware, I am using lower level controller of px4 and wanted to test this new algorithm. It is implemented using companion computer(Raspberry Pi). Also, the formation algorithm I wanted to test for real flights right away once HITL mode is tested.

Aha, in this case you would have to hook up the RPi to the SITL computer to simulate your setup.