mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-10 01:28:53 +08:00
framework: added dead-reckon rtl to the failsafe framework
This commit is contained in:
@@ -421,18 +421,22 @@
|
||||
"description": "RTL"
|
||||
},
|
||||
"7": {
|
||||
"name": "dead_reckon_rtl",
|
||||
"description": "Dead Reckoning RTL"
|
||||
},
|
||||
"8": {
|
||||
"name": "land",
|
||||
"description": "Land"
|
||||
},
|
||||
"8": {
|
||||
"9": {
|
||||
"name": "descend",
|
||||
"description": "Descend"
|
||||
},
|
||||
"9": {
|
||||
"10": {
|
||||
"name": "disarm",
|
||||
"description": "disarm"
|
||||
},
|
||||
"10": {
|
||||
"11": {
|
||||
"name": "terminate",
|
||||
"description": "terminate"
|
||||
}
|
||||
|
||||
@@ -571,6 +571,15 @@ void FailsafeBase::getSelectedAction(const State &state, const failsafe_flags_s
|
||||
|
||||
returned_state.cause = Cause::Generic;
|
||||
|
||||
// fallthrough
|
||||
case Action::DeadReckonRTL:
|
||||
if (modeCanRun(status_flags, vehicle_status_s::NAVIGATION_STATE_AUTO_RTL_DR)) {
|
||||
selected_action = Action::DeadReckonRTL;
|
||||
break;
|
||||
}
|
||||
|
||||
returned_state.cause = Cause::Generic;
|
||||
|
||||
// fallthrough
|
||||
case Action::Land:
|
||||
if (modeCanRun(status_flags, vehicle_status_s::NAVIGATION_STATE_AUTO_LAND)) {
|
||||
@@ -671,6 +680,8 @@ uint8_t FailsafeBase::modeFromAction(const Action &action, uint8_t user_intended
|
||||
|
||||
case Action::RTL: return vehicle_status_s::NAVIGATION_STATE_AUTO_RTL;
|
||||
|
||||
case Action::DeadReckonRTL: return vehicle_status_s::NAVIGATION_STATE_AUTO_RTL_DR;
|
||||
|
||||
case Action::Land: return vehicle_status_s::NAVIGATION_STATE_AUTO_LAND;
|
||||
|
||||
case Action::Descend: return vehicle_status_s::NAVIGATION_STATE_DESCEND;
|
||||
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
|
||||
Hold,
|
||||
RTL,
|
||||
DeadReckonRTL,
|
||||
Land,
|
||||
Descend,
|
||||
Disarm,
|
||||
@@ -105,6 +106,8 @@ public:
|
||||
|
||||
case Action::RTL: return "RTL";
|
||||
|
||||
case Action::DeadReckonRTL: return "Dead Reckoning RTL";
|
||||
|
||||
case Action::Land: return "Land";
|
||||
|
||||
case Action::Descend: return "Descend";
|
||||
|
||||
Reference in New Issue
Block a user