TradHeli: init targets when entering acro

This commit is contained in:
Randy Mackay 2014-01-30 21:45:01 +09:00 committed by Andrew Tridgell
parent fdf41219ca
commit 164bd10ef0

View File

@ -7,6 +7,8 @@
// heli_acro_init - initialise acro controller
static bool heli_acro_init(bool ignore_checks)
{
// clear stabilized rate errors
attitude_control.init_targets();
return true;
}
@ -16,6 +18,12 @@ static void heli_acro_run()
{
int16_t target_roll, target_pitch, target_yaw;
// if not armed or main rotor not up to full speed clear stabilized rate errors
// unlike multicopters we do not set throttle (i.e. collective pitch) to zero so the swash servos move
if(!motors.armed() || !motors.motor_runup_complete()) {
attitude_control.init_targets();
}
// To-Do: add support for flybarred helis
// convert the input to the desired body frame rate