Improve offboard failsafe (#18160)

* state_machine_helper: improve offboard failsafe

* state_machine_helper: add missing parameter to set_link_loss_nav_state

* state_machine_helper: fix no rc and offboard reason

* Fix offboard test by enabling rcl_except

* mavros_test fix offboard_posctl_test with rcl_except

* autopilot_tester make RcLossException bits explicit

Co-authored-by: Julian Oes <julian@oes.ch>

* autopilot_tester change rcl_except to rc_loss_exception

Co-authored-by: Julian Oes <julian@oes.ch>

* autopilot_tester fix rc_loss_exception renaming errors

Co-authored-by: Julian Oes <julian@oes.ch>
This commit is contained in:
benjinne
2021-09-08 18:19:53 +02:00
committed by GitHub
co-authored by Julian Oes
parent 686bcff8a7
commit 06a91ec752
6 changed files with 79 additions and 5 deletions
@@ -42,6 +42,7 @@ TEST_CASE("Offboard takeoff and land", "[multicopter][offboard]")
tester.connect(connection_url);
tester.wait_until_ready();
tester.store_home();
tester.set_rc_loss_exception(AutopilotTester::RcLossException::Offboard);
tester.arm();
std::chrono::seconds goto_timeout = std::chrono::seconds(90);
tester.offboard_goto(takeoff_position, 0.1f, goto_timeout);
@@ -60,6 +61,7 @@ TEST_CASE("Offboard position control", "[multicopter][offboard]")
tester.connect(connection_url);
tester.wait_until_ready();
tester.store_home();
tester.set_rc_loss_exception(AutopilotTester::RcLossException::Offboard);
tester.arm();
std::chrono::seconds goto_timeout = std::chrono::seconds(120);
tester.offboard_goto(takeoff_position, 0.1f, goto_timeout);