From 4b8eee279a101f6f3f475974e6d151da1115ad76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 13 Sep 2023 15:10:39 +0200 Subject: [PATCH] fix FirmwarePlugin: increase arming timeout to 1.5s As the arming flag is set from the heartbeat received at 1Hz, we need to wait a bit longer than 1s. The 1s timeout sometimes led to this error message when trying to start a mission: "Unable to start mission: Vehicle rejected arming." Fixes https://github.com/PX4/PX4-Autopilot/issues/22042 --- src/FirmwarePlugin/FirmwarePlugin.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FirmwarePlugin/FirmwarePlugin.cc b/src/FirmwarePlugin/FirmwarePlugin.cc index 574f261..35d44b2 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.cc +++ b/src/FirmwarePlugin/FirmwarePlugin.cc @@ -949,8 +949,8 @@ bool FirmwarePlugin::_armVehicleAndValidate(Vehicle* vehicle) // Only try arming the vehicle a single time. Doing retries on arming with a delay can lead to safety issues. vehicle->setArmed(true, false /* showError */); - // Wait 1000 msecs for vehicle to arm - for (int i=0; i<10; i++) { + // Wait 1500 msecs for vehicle to arm (waiting for the next heartbeat) + for (int i = 0; i < 15; i++) { if (vehicle->armed()) { vehicleArmed = true; break;