mavsdk_tests: add workaround to prevent failsafe

This workaround should fix the test failure where we disarm before
taking off because we accidentally switched to failsafe mode right
before taking off because we were still in Manual mode and not Hold yet.
This commit is contained in:
Julian Oes 2020-07-15 13:47:22 +02:00 committed by Daniel Agar
parent 4ad7ea6c1a
commit 5f2abb66a4

View File

@ -112,6 +112,11 @@ void AutopilotTester::wait_until_ready()
std::cout << "Waiting for system to be ready" << std::endl;
CHECK(poll_condition_with_timeout(
[this]() { return _telemetry->health_all_ok(); }, std::chrono::seconds(20)));
// FIXME: workaround to prevent race between PX4 switching to Hold mode
// and us trying to arm and take off. If PX4 is not in Hold mode yet,
// our arming presumably triggers a failsafe in manual mode.
std::this_thread::sleep_for(std::chrono::seconds(1));
}
void AutopilotTester::wait_until_ready_local_position_only()