mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 03:03:34 +08:00
Skip VTOL_TAKEOFF mission item when in fixed wing mode (#19985)
* mission: skip VTOL_TAKEOFF mission item when in fixed wing mode Signed-off-by: RomanBapst <bapstroman@gmail.com> * mission: added better comment regarding skipping VTOL Takeoff in fw mode Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -820,15 +820,10 @@ Mission::set_mission_items()
|
|||||||
} else if (_mission_item.nav_cmd == NAV_CMD_VTOL_TAKEOFF
|
} else if (_mission_item.nav_cmd == NAV_CMD_VTOL_TAKEOFF
|
||||||
&& _work_item_type == WORK_ITEM_TYPE_DEFAULT
|
&& _work_item_type == WORK_ITEM_TYPE_DEFAULT
|
||||||
&& new_work_item_type == WORK_ITEM_TYPE_DEFAULT) {
|
&& new_work_item_type == WORK_ITEM_TYPE_DEFAULT) {
|
||||||
|
// if the vehicle is already in fixed wing mode then the current mission item
|
||||||
|
// will be accepted immediately and the work items will be skipped
|
||||||
|
_work_item_type = WORK_ITEM_TYPE_TAKEOFF;
|
||||||
|
|
||||||
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
|
|
||||||
/* haven't transitioned yet, trigger vtol takeoff logic below */
|
|
||||||
_work_item_type = WORK_ITEM_TYPE_TAKEOFF;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
/* already in fixed-wing, go to waypoint */
|
|
||||||
_mission_item.nav_cmd = NAV_CMD_WAYPOINT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ignore yaw here, otherwise it might yaw before heading_sp_update takes over */
|
/* ignore yaw here, otherwise it might yaw before heading_sp_update takes over */
|
||||||
_mission_item.yaw = NAN;
|
_mission_item.yaw = NAN;
|
||||||
|
|||||||
@@ -129,6 +129,13 @@ MissionBlock::is_mission_item_reached()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NAV_CMD_VTOL_TAKEOFF:
|
||||||
|
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case NAV_CMD_DELAY:
|
case NAV_CMD_DELAY:
|
||||||
// Set reached flags directly such that only the delay time is considered
|
// Set reached flags directly such that only the delay time is considered
|
||||||
_waypoint_position_reached = true;
|
_waypoint_position_reached = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user