mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 15:53:56 -04:00
Copter: acro uses 0 to 1 throttle and sets desired spool state
This commit is contained in:
parent
f56ff4d564
commit
2180514dde
@ -10,7 +10,7 @@
|
|||||||
bool Copter::acro_init(bool ignore_checks)
|
bool Copter::acro_init(bool ignore_checks)
|
||||||
{
|
{
|
||||||
// if landed and the mode we're switching from does not have manual throttle and the throttle stick is too high
|
// if landed and the mode we're switching from does not have manual throttle and the throttle stick is too high
|
||||||
if (motors.armed() && ap.land_complete && !mode_has_manual_throttle(control_mode) && (g.rc_3.control_in > get_non_takeoff_throttle())) {
|
if (motors.armed() && ap.land_complete && !mode_has_manual_throttle(control_mode) && (get_pilot_desired_throttle(channel_throttle->control_in) > get_non_takeoff_throttle())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// set target altitude to zero for reporting
|
// set target altitude to zero for reporting
|
||||||
@ -24,10 +24,11 @@ bool Copter::acro_init(bool ignore_checks)
|
|||||||
void Copter::acro_run()
|
void Copter::acro_run()
|
||||||
{
|
{
|
||||||
float target_roll, target_pitch, target_yaw;
|
float target_roll, target_pitch, target_yaw;
|
||||||
int16_t pilot_throttle_scaled;
|
float pilot_throttle_scaled;
|
||||||
|
|
||||||
// if motors not running reset angle targets
|
// if not armed set throttle to zero and exit immediately
|
||||||
if(!motors.armed() || ap.throttle_zero) {
|
if (!motors.armed() || ap.throttle_zero || !motors.get_interlock()) {
|
||||||
|
motors.set_desired_spool_state(AP_MotorsMulticopter::DESIRED_SPIN_WHEN_ARMED);
|
||||||
attitude_control.set_throttle_out_unstabilized(0,true,g.throttle_filt);
|
attitude_control.set_throttle_out_unstabilized(0,true,g.throttle_filt);
|
||||||
// slow start if landed
|
// slow start if landed
|
||||||
if (ap.land_complete) {
|
if (ap.land_complete) {
|
||||||
@ -36,6 +37,8 @@ void Copter::acro_run()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
motors.set_desired_spool_state(AP_MotorsMulticopter::DESIRED_THROTTLE_UNLIMITED);
|
||||||
|
|
||||||
// convert the input to the desired body frame rate
|
// convert the input to the desired body frame rate
|
||||||
get_pilot_desired_angle_rates(channel_roll->control_in, channel_pitch->control_in, channel_yaw->control_in, target_roll, target_pitch, target_yaw);
|
get_pilot_desired_angle_rates(channel_roll->control_in, channel_pitch->control_in, channel_yaw->control_in, target_roll, target_pitch, target_yaw);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user