Skip to content

Commit 5f2abb6

Browse files
julianoesdagar
authored andcommitted
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.
1 parent 4ad7ea6 commit 5f2abb6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/mavsdk_tests/autopilot_tester.cpp

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

117122
void AutopilotTester::wait_until_ready_local_position_only()

0 commit comments

Comments
 (0)