mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 21:43:34 +08:00
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:
@@ -143,6 +143,22 @@ void AutopilotTester::set_height_source(AutopilotTester::HeightSource height_sou
|
||||
}
|
||||
}
|
||||
|
||||
void AutopilotTester::set_rc_loss_exception(AutopilotTester::RcLossException mask)
|
||||
{
|
||||
switch (mask) {
|
||||
case RcLossException::Mission:
|
||||
CHECK(_param->set_param_int("COM_RCL_EXCEPT", 1 << 0) == Param::Result::Success);
|
||||
break;
|
||||
|
||||
case RcLossException::Hold:
|
||||
CHECK(_param->set_param_int("COM_RCL_EXCEPT", 1 << 1) == Param::Result::Success);
|
||||
break;
|
||||
|
||||
case RcLossException::Offboard:
|
||||
CHECK(_param->set_param_int("COM_RCL_EXCEPT", 1 << 2) == Param::Result::Success);
|
||||
}
|
||||
}
|
||||
|
||||
void AutopilotTester::arm()
|
||||
{
|
||||
const auto result = _action->arm();
|
||||
|
||||
Reference in New Issue
Block a user