mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 22:33:34 +08:00
Avoid waypoint following during backtransition which can lead to strong banking (#22642)
* avoid waypoint following during backtransition - if vehicle overshoots transition, make controller track the prev/current waypoint line, this avoids large banking maneuvers that delay the transition further Signed-off-by: RomanBapst <bapstroman@gmail.com> * navigator: use SETPOINT_TYPE_LAND as setpoint type for VTOL_LAND waypoints such that fixed wing position controller can distinguish from other types Signed-off-by: RomanBapst <bapstroman@gmail.com> * FixedWingPositionControl: split vtol backtransition logic into separate method Signed-off-by: RomanBapst <bapstroman@gmail.com> * review changes Signed-off-by: RomanBapst <bapstroman@gmail.com> * prevent loiter when approaching vtol backtransition and invalidate previous waypoint during mission landing Signed-off-by: RomanBapst <bapstroman@gmail.com> * removed unused parameter Signed-off-by: RomanBapst <bapstroman@gmail.com> * small renaming of transition mode Signed-off-by: RomanBapst <bapstroman@gmail.com> --------- Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -574,10 +574,6 @@ void MissionBase::handleLanding(WorkItemType &new_work_item_type, mission_item_s
|
||||
set_vtol_transition_item(&_mission_item, vtol_vehicle_status_s::VEHICLE_VTOL_STATE_MC);
|
||||
|
||||
new_work_item_type = WorkItemType::WORK_ITEM_TYPE_MOVE_TO_LAND_AFTER_TRANSITION;
|
||||
|
||||
// make previous setpoint invalid, such that there will be no prev-current line following
|
||||
// if the vehicle drifted off the path during back-transition it should just go straight to the landing point
|
||||
_navigator->reset_position_setpoint(pos_sp_triplet->previous);
|
||||
}
|
||||
|
||||
} else if (needs_to_land) {
|
||||
|
||||
@@ -110,7 +110,8 @@ MissionBlock::is_mission_item_reached_or_completed()
|
||||
|
||||
if (int(_mission_item.params[0]) == 3) {
|
||||
// transition to RW requested, only accept waypoint if vehicle state has changed accordingly
|
||||
return _navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING;
|
||||
return _navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING
|
||||
&& !_navigator->get_vstatus()->in_transition_mode;
|
||||
|
||||
} else if (int(_mission_item.params[0]) == 4) {
|
||||
// transition to FW requested, only accept waypoint if vehicle state has changed accordingly
|
||||
|
||||
@@ -310,6 +310,7 @@ void RtlDirect::set_rtl_item()
|
||||
dest.alt = loiter_altitude;
|
||||
|
||||
setMoveToPositionMissionItem(_mission_item, dest, rtl_heading_mode);
|
||||
_navigator->reset_position_setpoint(pos_sp_triplet->previous);
|
||||
|
||||
_rtl_state = RTLState::LAND;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user