mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 00:03:33 +08:00
Navigator: remove MIS_LTRMIN_ALT param, and use new param MIS_LND_ABRT_ALT for landing abort
MIS_LTRMIN_ALt was used to limit the go-to altitude of a LOITER_TO_ALT (not the exit altitude, but the altitude that the vehicle went to to fly to WP), and during landing abort to climb to at least this altitude. The min entry altitude of LOITER_TO_ALT I remove with this commit, while for the min alt during abort I added the new parameter MIS_LND_ABRT_ALT. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Daniel Agar
parent
ed39eb4672
commit
0941ae7579
@@ -1436,15 +1436,14 @@ Mission::cruising_speed_sp_update()
|
||||
void
|
||||
Mission::do_abort_landing()
|
||||
{
|
||||
// Abort FW landing
|
||||
// first climb out then loiter over intended landing location
|
||||
// Abort FW landing, loiter above landing site in at least MIS_LND_ABRT_ALT
|
||||
|
||||
if (_mission_item.nav_cmd != NAV_CMD_LAND) {
|
||||
return;
|
||||
}
|
||||
|
||||
const float alt_landing = get_absolute_altitude_for_item(_mission_item);
|
||||
const float alt_sp = math::max(alt_landing + _navigator->get_loiter_min_alt(),
|
||||
const float alt_sp = math::max(alt_landing + _navigator->get_landing_abort_min_alt(),
|
||||
_navigator->get_global_position()->alt);
|
||||
|
||||
// turn current landing waypoint into an indefinite loiter
|
||||
@@ -1469,10 +1468,10 @@ Mission::do_abort_landing()
|
||||
publish_navigator_mission_item(); // for logging
|
||||
_navigator->set_position_setpoint_triplet_updated();
|
||||
|
||||
mavlink_log_info(_navigator->get_mavlink_log_pub(), "Holding at %d m above landing.\t",
|
||||
mavlink_log_info(_navigator->get_mavlink_log_pub(), "Holding at %d m above landing waypoint.\t",
|
||||
(int)(alt_sp - alt_landing));
|
||||
events::send<float>(events::ID("mission_holding_above_landing"), events::Log::Info,
|
||||
"Holding at {1:.0m_v} above landing", alt_sp - alt_landing);
|
||||
"Holding at {1:.0m_v} above landing waypoint", alt_sp - alt_landing);
|
||||
|
||||
// reset mission index to start of landing
|
||||
if (_land_start_available) {
|
||||
|
||||
@@ -732,15 +732,7 @@ MissionBlock::mission_item_to_position_setpoint(const mission_item_s &item, posi
|
||||
break;
|
||||
|
||||
case NAV_CMD_LOITER_TO_ALT:
|
||||
|
||||
// initially use current altitude, and switch to mission item altitude once in loiter position
|
||||
if (_navigator->get_loiter_min_alt() > 0.f) { // ignore _param_loiter_min_alt if smaller than 0
|
||||
sp->alt = math::max(_navigator->get_global_position()->alt,
|
||||
_navigator->get_home_position()->alt + _navigator->get_loiter_min_alt());
|
||||
|
||||
} else {
|
||||
sp->alt = _navigator->get_global_position()->alt;
|
||||
}
|
||||
sp->alt = _navigator->get_global_position()->alt;
|
||||
|
||||
// FALLTHROUGH
|
||||
case NAV_CMD_LOITER_TIME_LIMIT:
|
||||
|
||||
@@ -72,21 +72,6 @@ PARAM_DEFINE_FLOAT(MIS_TAKEOFF_ALT, 2.5f);
|
||||
*/
|
||||
PARAM_DEFINE_INT32(MIS_TKO_LAND_REQ, 0);
|
||||
|
||||
/**
|
||||
* Minimum Loiter altitude
|
||||
*
|
||||
* This is the minimum altitude the system will always obey. The intent is to stay out of ground effect.
|
||||
* set to -1, if there shouldn't be a minimum loiter altitude
|
||||
*
|
||||
* @unit m
|
||||
* @min -1
|
||||
* @max 80
|
||||
* @decimal 1
|
||||
* @increment 0.5
|
||||
* @group Mission
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(MIS_LTRMIN_ALT, -1.0f);
|
||||
|
||||
/**
|
||||
* Maximal horizontal distance from home to first waypoint
|
||||
*
|
||||
@@ -172,3 +157,16 @@ PARAM_DEFINE_FLOAT(MIS_YAW_ERR, 12.0f);
|
||||
* @group Mission
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(MIS_PD_TO, 5.0f);
|
||||
|
||||
/**
|
||||
* Landing abort min altitude
|
||||
*
|
||||
* Minimum altitude above landing point that the vehicle will climb to after an aborted landing.
|
||||
* Then vehicle will loiter in this altitude until further command is received.
|
||||
* Only applies to fixed-wing vehicles.
|
||||
*
|
||||
* @unit m
|
||||
* @min 0
|
||||
* @group Mission
|
||||
*/
|
||||
PARAM_DEFINE_INT32(MIS_LND_ABRT_ALT, 30);
|
||||
|
||||
@@ -304,7 +304,7 @@ public:
|
||||
void geofence_breach_check(bool &have_geofence_position_data);
|
||||
|
||||
// Param access
|
||||
float get_loiter_min_alt() const { return _param_mis_ltrmin_alt.get(); }
|
||||
int get_landing_abort_min_alt() const { return _param_mis_lnd_abrt_alt.get(); }
|
||||
float get_takeoff_min_alt() const { return _param_mis_takeoff_alt.get(); }
|
||||
int get_takeoff_land_required() const { return _para_mis_takeoff_land_req.get(); }
|
||||
float get_yaw_timeout() const { return _param_mis_yaw_tmt.get(); }
|
||||
@@ -447,12 +447,12 @@ private:
|
||||
(ParamFloat<px4::params::NAV_TRAFF_A_RADM>) _param_nav_traff_a_radm, /**< avoidance Distance Manned*/
|
||||
|
||||
// non-navigator parameters: Mission (MIS_*)
|
||||
(ParamFloat<px4::params::MIS_LTRMIN_ALT>) _param_mis_ltrmin_alt,
|
||||
(ParamFloat<px4::params::MIS_TAKEOFF_ALT>) _param_mis_takeoff_alt,
|
||||
(ParamInt<px4::params::MIS_TKO_LAND_REQ>) _para_mis_takeoff_land_req,
|
||||
(ParamFloat<px4::params::MIS_YAW_TMT>) _param_mis_yaw_tmt,
|
||||
(ParamFloat<px4::params::MIS_YAW_ERR>) _param_mis_yaw_err,
|
||||
(ParamFloat<px4::params::MIS_PD_TO>) _param_mis_payload_delivery_timeout,
|
||||
(ParamFloat<px4::params::LNDMC_ALT_MAX>) _param_lndmc_alt_max
|
||||
(ParamFloat<px4::params::LNDMC_ALT_MAX>) _param_lndmc_alt_max,
|
||||
(ParamInt<px4::params::MIS_LND_ABRT_ALT>) _param_mis_lnd_abrt_alt
|
||||
)
|
||||
};
|
||||
|
||||
@@ -336,14 +336,7 @@ void RTL::set_rtl_item()
|
||||
switch (_rtl_state) {
|
||||
case RTL_STATE_CLIMB: {
|
||||
|
||||
// do not use LOITER_TO_ALT for rotary wing mode as it would then always climb to at least MIS_LTRMIN_ALT,
|
||||
// even if current climb altitude is below (e.g. RTL immediately after take off)
|
||||
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
|
||||
_mission_item.nav_cmd = NAV_CMD_WAYPOINT;
|
||||
|
||||
} else {
|
||||
_mission_item.nav_cmd = NAV_CMD_LOITER_TO_ALT;
|
||||
}
|
||||
_mission_item.nav_cmd = NAV_CMD_LOITER_TO_ALT;
|
||||
|
||||
_mission_item.lat = gpos.lat;
|
||||
_mission_item.lon = gpos.lon;
|
||||
|
||||
Reference in New Issue
Block a user