mirror of https://github.com/ArduPilot/ardupilot
Copter: log event if pilot cancels land
Also add definition for throttle value that cancels land
This commit is contained in:
parent
8965185587
commit
2c5f9422d4
|
@ -395,6 +395,7 @@ private:
|
|||
float baro_climbrate; // barometer climbrate in cm/s
|
||||
LowPassFilterVector3f land_accel_ef_filter; // accelerations for land and crash detector tests
|
||||
|
||||
// filtered pilot's throttle input used to cancel landing if throttle held high
|
||||
LowPassFilterFloat rc_throttle_control_in_filter;
|
||||
|
||||
// 3D Location vectors
|
||||
|
|
|
@ -401,6 +401,9 @@
|
|||
#ifndef LAND_WITH_DELAY_MS
|
||||
# define LAND_WITH_DELAY_MS 4000 // default delay (in milliseconds) when a land-with-delay is triggered during a failsafe event
|
||||
#endif
|
||||
#ifndef LAND_CANCEL_TRIGGER_THR
|
||||
# define LAND_CANCEL_TRIGGER_THR 700 // land is cancelled by input throttle above 700
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Landing Detector
|
||||
|
|
|
@ -324,7 +324,8 @@ void Copter::auto_land_run()
|
|||
|
||||
// process pilot's input
|
||||
if (!failsafe.radio) {
|
||||
if((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > 0.7f*THR_MAX){
|
||||
if ((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > LAND_CANCEL_TRIGGER_THR){
|
||||
Log_Write_Event(DATA_LAND_CANCELLED_BY_PILOT);
|
||||
// exit land if throttle is high
|
||||
if (!set_mode(LOITER)) {
|
||||
set_mode(ALT_HOLD);
|
||||
|
|
|
@ -87,7 +87,8 @@ void Copter::land_gps_run()
|
|||
|
||||
// process pilot inputs
|
||||
if (!failsafe.radio) {
|
||||
if((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > 0.7f*THR_MAX){
|
||||
if ((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > LAND_CANCEL_TRIGGER_THR){
|
||||
Log_Write_Event(DATA_LAND_CANCELLED_BY_PILOT);
|
||||
// exit land if throttle is high
|
||||
if (!set_mode(LOITER)) {
|
||||
set_mode(ALT_HOLD);
|
||||
|
@ -155,7 +156,8 @@ void Copter::land_nogps_run()
|
|||
|
||||
// process pilot inputs
|
||||
if (!failsafe.radio) {
|
||||
if((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > 0.7f*THR_MAX){
|
||||
if ((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > LAND_CANCEL_TRIGGER_THR){
|
||||
Log_Write_Event(DATA_LAND_CANCELLED_BY_PILOT);
|
||||
// exit land if throttle is high
|
||||
if (!set_mode(LOITER)) {
|
||||
set_mode(ALT_HOLD);
|
||||
|
|
|
@ -267,7 +267,8 @@ void Copter::rtl_descent_run()
|
|||
|
||||
// process pilot's input
|
||||
if (!failsafe.radio) {
|
||||
if((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > 0.7f*THR_MAX){
|
||||
if ((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > LAND_CANCEL_TRIGGER_THR){
|
||||
Log_Write_Event(DATA_LAND_CANCELLED_BY_PILOT);
|
||||
// exit land if throttle is high
|
||||
if (!set_mode(LOITER)) {
|
||||
set_mode(ALT_HOLD);
|
||||
|
@ -362,7 +363,8 @@ void Copter::rtl_land_run()
|
|||
|
||||
// process pilot's input
|
||||
if (!failsafe.radio) {
|
||||
if((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > 0.7f*THR_MAX){
|
||||
if ((g.throttle_behavior & THR_BEHAVE_HIGH_THROTTLE_CANCELS_LAND) != 0 && rc_throttle_control_in_filter.get() > LAND_CANCEL_TRIGGER_THR){
|
||||
Log_Write_Event(DATA_LAND_CANCELLED_BY_PILOT);
|
||||
// exit land if throttle is high
|
||||
if (!set_mode(LOITER)) {
|
||||
set_mode(ALT_HOLD);
|
||||
|
|
|
@ -333,6 +333,7 @@ enum FlipState {
|
|||
#define DATA_ROTOR_RUNUP_COMPLETE 58 // Heli only
|
||||
#define DATA_ROTOR_SPEED_BELOW_CRITICAL 59 // Heli only
|
||||
#define DATA_EKF_ALT_RESET 60
|
||||
#define DATA_LAND_CANCELLED_BY_PILOT 61
|
||||
|
||||
// Centi-degrees to radians
|
||||
#define DEGX100 5729.57795f
|
||||
|
|
Loading…
Reference in New Issue