qgroundcontrol
qgroundcontrol copied to clipboard
NEW: MavLink FTP binary parameter download (APM)
Ardupilot vehicles support the download of parameters via MavLink FTP which is much faster and possibly more robust for low bandwidth radio links with a higher packet loss rate like RFD868 compared to the existing conventional mavlink parameter download.
The proposed implementation is based on the existing ftp download system which exists in qgc. I added the parameter file parser which then adds the parameters to the fact system. If the ftp parameter download fails, the conventional download is used. For existing vehicles which do not support ftp at all, this results in two additional initial request timeouts. If the vehicle supports ftp but not the parameterfile like px4 vehicles, the overhead are two messages.
The Ardupilot parameterfile read response as today responds with a fixed 1 MByte file size as the parameterfile is build on the fly and it is not possible to predict the filesize before the transfer starts, because the filesize depends on the used block size. This mismatch between actual transmitted filesize and indicated filesize will result in failure in the current qgc ftp implementation. Therefore I added an additional option to ignore the filesize which is indicated in the mavlink response. As the progress bar is based on the indicated filesize I added PR https://github.com/ArduPilot/ardupilot/pull/21744 to Ardupilot for a better filesize estimation.
I tested the implementation with the current Arduplane SITL simulation on a Mac with a simulated 64kBit/s link with 30ms delay and a packet loss rate of 5%. I used the packet filtering and dummynet system on MacOS.
sudo pfctl -E
sudo pfctl -f ./pf.conf
=== pf.conf ===
dummynet in proto udp from any to any port 14550 pipe 1
dummynet out proto udp from any port 14550 to any pipe 2
===
sudo dnctl pipe 1 config bw 64Kbit/s delay 30 plr 0.05
sudo dnctl pipe 2 config bw 64Kbit/s delay 30 plr 0.05
The conventional parameter download takes 130 seconds while the ftp parameter download takes 5 seconds. You can see the comparison in this video https://vimeo.com/751000899.
@tridge, @DonLakeFlyer: I added the option to disable the filesize check in the QGC ftp client. At first I wanted to fix the filesize response in Ardupilot but after thinking about it I agree that it is pretty complicated given the special padding design to avoid parameter value corruption during the on-the-fly generation for volatile parameters. The implementation now is not restricted to Ardupilot. If PX4 have any plans to implement this it would work right away.