mavlink: fix boot complete without lockstep

Without lockstep the actual monotonic clock of the host computer is
used. Therefore, this time is likely much more than 20 seconds and the
check if the boot complete happened in time will fail immediately.

Therefore, it probably makes more sense to count the time from the first
mavlink creation.
This commit is contained in:
Julian Oes
2019-10-10 08:58:34 +02:00
committed by Lorenz Meier
parent ea35923d3a
commit 307dc3e32d
3 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -2529,7 +2529,7 @@ MavlinkReceiver::Run()
// make sure mavlink app has booted before we start processing anything (parameter sync, etc)
while (!_mavlink->boot_complete()) {
if (hrt_absolute_time() > 20_s) {
if (hrt_elapsed_time(&_mavlink->get_first_start_time()) > 20_s) {
PX4_ERR("system boot did not complete in 20 seconds");
_mavlink->set_boot_complete();
}