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 Cyphal UAV HITL simulation right now. The following features are required:
- the ability to disable board sensors
inno_vtol
custom airframe (for VTOL simulation only),- few Cyphal related fixes,
- Cyphal gps, mag, baro and other sensors implementation.
It is recommended to use the custom branch: pr-cyphal.
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 pr-cyphal
git submodule update --init --recursive
make clean
make distclean
make px4_fmu-v5_cyphal upload
An autopilot for HITL mode configuration requires several steps such as:
- disable few preflight checks,
- disable onboard sensors,
- configure Cyphal related part including registers,
- calibrate sensors.
The simplest way is to just call a python script based on pymavlink that handles everything.
Warning! The script below will reset all your autopilot parameters. If you need them, don't forget to save.
cd scripts/setup
./px4_cyphal.py
Open QGroundControl. If the simulation is connected, the vehicle should be Ready To Fly
. You should see: