mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
commander : add support for precision landing measurements
This commit is contained in:
committed by
Lorenz Meier
parent
d9b9b4407a
commit
f2dbb0ad3b
@@ -481,6 +481,15 @@ main_state_transition(struct vehicle_status_s *status, main_state_t new_main_sta
|
||||
|
||||
break;
|
||||
|
||||
case commander_state_s::MAIN_STATE_AUTO_PRECLAND:
|
||||
|
||||
/* need local and global position, and precision land only implemented for multicopters */
|
||||
if (status_flags->condition_local_position_valid && status_flags->condition_global_position_valid && status->is_rotary_wing) {
|
||||
ret = TRANSITION_CHANGED;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case commander_state_s::MAIN_STATE_OFFBOARD:
|
||||
|
||||
/* need offboard signal */
|
||||
@@ -849,6 +858,22 @@ bool set_nav_state(struct vehicle_status_s *status,
|
||||
|
||||
break;
|
||||
|
||||
case commander_state_s::MAIN_STATE_AUTO_PRECLAND:
|
||||
|
||||
/* must be rotary wing plus same requirements as normal landing */
|
||||
|
||||
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_AUTO_PRECLAND;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case commander_state_s::MAIN_STATE_OFFBOARD:
|
||||
|
||||
/* require offboard control, otherwise stay where you are */
|
||||
|
||||
Reference in New Issue
Block a user