mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 21:23:35 +08:00
removed unneccessary includes, eliminated namespace on math, changed date
changed a comment reverted a file back to master
This commit is contained in:
@@ -520,7 +520,7 @@ MissionBlock::mission_item_to_position_setpoint(const mission_item_s &item, posi
|
||||
|
||||
// if already flying (armed and !landed) treat TAKEOFF like regular POSITION
|
||||
if ((_navigator->get_vstatus()->arming_state == vehicle_status_s::ARMING_STATE_ARMED)
|
||||
&& !_navigator->get_land_detected()->landed && !_navigator->get_land_detected()->maybe_landed) {
|
||||
&& !_navigator->get_land_detected()->landed) {
|
||||
|
||||
sp->type = position_setpoint_s::SETPOINT_TYPE_POSITION;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013-2017 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2013-2018 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -40,13 +40,6 @@
|
||||
#include "rtl.h"
|
||||
#include "navigator.h"
|
||||
|
||||
#include <cfloat>
|
||||
|
||||
#include <mathlib/mathlib.h>
|
||||
#include <systemlib/mavlink_log.h>
|
||||
|
||||
using math::max;
|
||||
using math::min;
|
||||
|
||||
static constexpr float DELAY_SIGMA = 0.01f;
|
||||
|
||||
@@ -73,11 +66,11 @@ void
|
||||
RTL::on_activation()
|
||||
{
|
||||
if (_navigator->get_land_detected()->landed) {
|
||||
// For safety reasons don't go into RTL if landed or currently in landing.
|
||||
// For safety reasons don't go into RTL if landed.
|
||||
_rtl_state = RTL_STATE_LANDED;
|
||||
|
||||
} else if (_navigator->get_position_setpoint_triplet()->current.type == position_setpoint_s::SETPOINT_TYPE_LAND) {
|
||||
// Do not go into full RTL if already performing a land.
|
||||
// Skip straight to land if already performing a land.
|
||||
_rtl_state = RTL_STATE_LAND;
|
||||
|
||||
} else if ((rtl_type() == RTL_LAND) && _navigator->on_mission_landing()) {
|
||||
@@ -143,7 +136,7 @@ RTL::set_rtl_item()
|
||||
const float home_dist = get_distance_to_next_waypoint(home.lat, home.lon, gpos.lat, gpos.lon);
|
||||
|
||||
// Compute the return altitude.
|
||||
float return_alt = max(home.alt + _param_return_alt.get(), gpos.alt);
|
||||
float return_alt = math::max(home.alt + _param_return_alt.get(), gpos.alt);
|
||||
|
||||
// We are close to home, limit climb to min.
|
||||
if (home_dist < _param_rtl_min_dist.get()) {
|
||||
@@ -151,7 +144,7 @@ RTL::set_rtl_item()
|
||||
}
|
||||
|
||||
// Compute the loiter altitude.
|
||||
const float loiter_altitude = min(home.alt + _param_descend_alt.get(), gpos.alt);
|
||||
const float loiter_altitude = math::min(home.alt + _param_descend_alt.get(), gpos.alt);
|
||||
|
||||
switch (_rtl_state) {
|
||||
case RTL_STATE_CLIMB: {
|
||||
@@ -248,7 +241,7 @@ RTL::set_rtl_item()
|
||||
_mission_item.yaw = home.yaw;
|
||||
_mission_item.loiter_radius = _navigator->get_loiter_radius();
|
||||
_mission_item.acceptance_radius = _navigator->get_acceptance_radius();
|
||||
_mission_item.time_inside = max(_param_land_delay.get(), 0.0f);
|
||||
_mission_item.time_inside = math::max(_param_land_delay.get(), 0.0f);
|
||||
_mission_item.autocontinue = autoland;
|
||||
_mission_item.origin = ORIGIN_ONBOARD;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user