mirror of https://github.com/ArduPilot/ardupilot
AP_Motors: tradheli - add support to determine below mid collective
This commit is contained in:
parent
613af0aeec
commit
9a9c88829e
|
@ -130,6 +130,9 @@ public:
|
||||||
// accessor to get the takeoff collective flag signifying that current collective is greater than collective required to indicate takeoff
|
// accessor to get the takeoff collective flag signifying that current collective is greater than collective required to indicate takeoff
|
||||||
bool get_takeoff_collective() const { return _heliflags.takeoff_collective; }
|
bool get_takeoff_collective() const { return _heliflags.takeoff_collective; }
|
||||||
|
|
||||||
|
// accessor to get the takeoff collective flag signifying that current collective is greater than collective required to indicate takeoff
|
||||||
|
bool get_below_mid_collective() const { return _heliflags.below_mid_collective; }
|
||||||
|
|
||||||
// support passing init_targets_on_arming flag to greater code
|
// support passing init_targets_on_arming flag to greater code
|
||||||
bool init_targets_on_arming() const override { return _heliflags.init_targets_on_arming; }
|
bool init_targets_on_arming() const override { return _heliflags.init_targets_on_arming; }
|
||||||
|
|
||||||
|
@ -241,6 +244,7 @@ protected:
|
||||||
uint8_t servo_test_running : 1; // true if servo_test is running
|
uint8_t servo_test_running : 1; // true if servo_test is running
|
||||||
uint8_t land_complete : 1; // true if aircraft is landed
|
uint8_t land_complete : 1; // true if aircraft is landed
|
||||||
uint8_t takeoff_collective : 1; // true if collective is above 30% between H_COL_MID and H_COL_MAX
|
uint8_t takeoff_collective : 1; // true if collective is above 30% between H_COL_MID and H_COL_MAX
|
||||||
|
uint8_t below_mid_collective : 1; // true if collective is below H_COL_MID
|
||||||
} _heliflags;
|
} _heliflags;
|
||||||
|
|
||||||
// parameters
|
// parameters
|
||||||
|
|
|
@ -552,6 +552,13 @@ void AP_MotorsHeli_Dual::move_actuators(float roll_out, float pitch_out, float c
|
||||||
limit.throttle_lower = true;
|
limit.throttle_lower = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// updates below mid collective flag
|
||||||
|
if (collective_out <= _collective_mid_pct) {
|
||||||
|
_heliflags.below_mid_collective = true;
|
||||||
|
} else {
|
||||||
|
_heliflags.below_mid_collective = false;
|
||||||
|
}
|
||||||
|
|
||||||
// updates takeoff collective flag based on 50% hover collective
|
// updates takeoff collective flag based on 50% hover collective
|
||||||
update_takeoff_collective_flag(collective_out);
|
update_takeoff_collective_flag(collective_out);
|
||||||
|
|
||||||
|
|
|
@ -230,6 +230,13 @@ void AP_MotorsHeli_Quad::move_actuators(float roll_out, float pitch_out, float c
|
||||||
limit.throttle_lower = true;
|
limit.throttle_lower = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// updates below mid collective flag
|
||||||
|
if (collective_out <= _collective_mid_pct) {
|
||||||
|
_heliflags.below_mid_collective = true;
|
||||||
|
} else {
|
||||||
|
_heliflags.below_mid_collective = false;
|
||||||
|
}
|
||||||
|
|
||||||
// updates takeoff collective flag based on 50% hover collective
|
// updates takeoff collective flag based on 50% hover collective
|
||||||
update_takeoff_collective_flag(collective_out);
|
update_takeoff_collective_flag(collective_out);
|
||||||
|
|
||||||
|
|
|
@ -417,6 +417,14 @@ void AP_MotorsHeli_Single::move_actuators(float roll_out, float pitch_out, float
|
||||||
if (_heliflags.landing_collective && collective_out < _collective_mid_pct && !_heliflags.in_autorotation) {
|
if (_heliflags.landing_collective && collective_out < _collective_mid_pct && !_heliflags.in_autorotation) {
|
||||||
collective_out = _collective_mid_pct;
|
collective_out = _collective_mid_pct;
|
||||||
limit.throttle_lower = true;
|
limit.throttle_lower = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// updates below mid collective flag
|
||||||
|
if (collective_out <= _collective_mid_pct) {
|
||||||
|
_heliflags.below_mid_collective = true;
|
||||||
|
} else {
|
||||||
|
_heliflags.below_mid_collective = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// updates takeoff collective flag based on 50% hover collective
|
// updates takeoff collective flag based on 50% hover collective
|
||||||
|
|
Loading…
Reference in New Issue