For HITL simulation you need the following hardware:
- Any autopilot that supports PX4 flight stack (tested on cuav v5+)
- CAN-sniffer (for example RaccoonLab sniffer).
An example of connection is shown below:
The autopilot and sniffer should be connected via any CAN bus.
PX4 doesn't fully support the DroneCAN UAV HITL simulation right now. The following features are required:
- the ability to disable board sensors
inno_vtol
custom airframe (for VTOL simulation only).
It is recommended to use one of the following custom branches:
It is expected that you already familiar with PX4, have everything installed according to the official PX4 instruction.
To build and upload the firmware in HITL mode run:
cd PX4-Autopilot
git checkout <branch_with_dronecan_hitl>
git submodule update --init --recursive
make clean
make distclean
make px4_fmu-v5_default upload
When the firmware is uploaded, you need to properly configure your parameters.
You need to:
- (for HITL) disable few preflight checks related to the USB connection and the battery
- (for HITL) disable all onboard sensors (it is possible only on custom firmware version)
- configure control,
- and other things.
The easiest way is to simply load the parameters from the file.
- Run QGC, load the corresponded params into your vehicle and accept all changes
- If your QGC application terminated unexpectedly, just run it again
- Restart your vehicle via QGC
You need to load the parameters and reboot the vehicle twice!
After second parameters load, the vehicle should be completely configured.
Run gui_tool
and check messages.
After restarting check correspondences of your airframe.
If the simulation is connected, the vehicle should be Ready To Fly
.