Browse Source

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.
sbg
Julian Oes 5 years ago committed by Daniel Agar
parent
commit
5f2abb66a4
  1. 5
      test/mavsdk_tests/autopilot_tester.cpp

5
test/mavsdk_tests/autopilot_tester.cpp

@ -112,6 +112,11 @@ void AutopilotTester::wait_until_ready() @@ -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()

Loading…
Cancel
Save