mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
mission: when land start marker present, look for loiter to altitude item
instead of using the previous waypoint as landing target - the previous waypoint could be miles away Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -398,16 +398,18 @@ Mission::find_mission_land_start()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// first check for DO_LAND_START marker
|
if (missionitem.nav_cmd == NAV_CMD_DO_LAND_START) {
|
||||||
if ((missionitem.nav_cmd == NAV_CMD_DO_LAND_START) && (missionitem_prev.nav_cmd == NAV_CMD_WAYPOINT)) {
|
|
||||||
|
|
||||||
_land_start_available = true;
|
_land_start_available = true;
|
||||||
_land_start_index = i;
|
_land_start_index = i;
|
||||||
// the DO_LAND_START marker contains no position sp, so take them from the previous mission item
|
}
|
||||||
_landing_lat = missionitem_prev.lat;
|
|
||||||
_landing_lon = missionitem_prev.lon;
|
if (_land_start_available && (missionitem.nav_cmd == NAV_CMD_LOITER_TO_ALT)) {
|
||||||
_landing_alt = missionitem_prev.altitude_is_relative ? missionitem_prev.altitude +
|
// use the loiter to altitude item of the mission landing as target landing location
|
||||||
_navigator->get_home_position()->alt : missionitem_prev.altitude;
|
_landing_lat = missionitem.lat;
|
||||||
|
_landing_lon = missionitem.lon;
|
||||||
|
_landing_alt = missionitem.altitude_is_relative ? missionitem.altitude +
|
||||||
|
_navigator->get_home_position()->alt : missionitem.altitude;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// if no DO_LAND_START marker available, also check for VTOL_LAND or normal LAND
|
// if no DO_LAND_START marker available, also check for VTOL_LAND or normal LAND
|
||||||
|
|||||||
Reference in New Issue
Block a user