mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
commander: add orbit state handling
This commit is contained in:
@@ -294,8 +294,9 @@ main_state_transition(const vehicle_status_s &status, const main_state_t new_mai
|
||||
break;
|
||||
|
||||
case commander_state_s::MAIN_STATE_AUTO_FOLLOW_TARGET:
|
||||
case commander_state_s::MAIN_STATE_ORBIT:
|
||||
|
||||
/* FOLLOW only implemented in MC */
|
||||
/* Follow and orbit only implemented for multicopter */
|
||||
if (status.is_rotary_wing) {
|
||||
ret = TRANSITION_CHANGED;
|
||||
}
|
||||
@@ -586,6 +587,19 @@ bool set_nav_state(vehicle_status_s *status, actuator_armed_s *armed, commander_
|
||||
|
||||
break;
|
||||
|
||||
case commander_state_s::MAIN_STATE_ORBIT:
|
||||
/* require local position */
|
||||
if (status->engine_failure) {
|
||||
status->nav_state = vehicle_status_s::NAVIGATION_STATE_AUTO_LANDENGFAIL;
|
||||
|
||||
} else if (is_armed && check_invalid_pos_nav_state(status, old_failsafe, mavlink_log_pub, status_flags, false, false)) {
|
||||
// nothing to do - everything done in check_invalid_pos_nav_state
|
||||
|
||||
} else {
|
||||
status->nav_state = vehicle_status_s::NAVIGATION_STATE_ORBIT;
|
||||
}
|
||||
break;
|
||||
|
||||
case commander_state_s::MAIN_STATE_AUTO_TAKEOFF:
|
||||
|
||||
/* require local position */
|
||||
|
||||
Reference in New Issue
Block a user