mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 01:33:33 +08:00
apply vtol_force_vtol
remove debug output
This commit is contained in:
@@ -436,6 +436,12 @@ Mission::set_mission_items()
|
||||
|
||||
if (item_contains_position(&_mission_item)) {
|
||||
|
||||
/* force vtol land */
|
||||
if(_mission_item.nav_cmd == NAV_CMD_LAND && _param_force_vtol.get()
|
||||
&& !_navigator->get_vstatus()->is_rotary_wing){
|
||||
_mission_item.nav_cmd = NAV_CMD_VTOL_LAND;
|
||||
}
|
||||
|
||||
/* we have a new position item so set previous position setpoint to current */
|
||||
set_previous_pos_setpoint();
|
||||
|
||||
|
||||
@@ -110,15 +110,12 @@ MissionBlock::is_mission_item_reached()
|
||||
case NAV_CMD_DO_VTOL_TRANSITION:
|
||||
/*
|
||||
* We wait half a second to give the transition command time to propagate.
|
||||
* As soon as the timeout is over or when we're in transition mode let the mission continue.
|
||||
* Then monitor the transition status for completion.
|
||||
*/
|
||||
if (hrt_absolute_time() - _action_start > 500000 &&
|
||||
!_navigator->get_vstatus()->in_transition_mode) {
|
||||
_action_start = 0;
|
||||
|
||||
printf("transition reached \n");
|
||||
return true;
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ void Standard::update_vtol_state()
|
||||
|
||||
} else if (_vtol_schedule.flight_mode == TRANSITION_TO_MC) {
|
||||
// transition to MC mode if transition time has passed
|
||||
// XXX: base this on XY hold velocity of MC
|
||||
if (hrt_elapsed_time(&_vtol_schedule.transition_start) >
|
||||
(_params_standard.back_trans_dur * 1000000.0f)) {
|
||||
_vtol_schedule.flight_mode = MC_MODE;
|
||||
|
||||
Reference in New Issue
Block a user