vtol_type: reset accel to pitch integrator

Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
RomanBapst 2021-04-26 07:53:53 +03:00 committed by Roman Bapst
parent cbf34109d1
commit f6a34e1e80
2 changed files with 6 additions and 0 deletions

View File

@ -140,6 +140,8 @@ void VtolType::update_mc_state()
_flag_idle_mc = set_idle_mc();
}
resetAccelToPitchPitchIntegrator();
VtolType::set_all_motor_state(motor_state::ENABLED);
// copy virtual attitude setpoint to real attitude setpoint
@ -157,6 +159,8 @@ void VtolType::update_fw_state()
_flag_idle_mc = !set_idle_fw();
}
resetAccelToPitchPitchIntegrator();
VtolType::set_alternate_motor_state(motor_state::DISABLED);
// copy virtual attitude setpoint to real attitude setpoint

View File

@ -313,6 +313,8 @@ private:
bool set_motor_state(const motor_state target_state, const int32_t channel_bitmap, const int value);
void resetAccelToPitchPitchIntegrator() { _accel_to_pitch_integ = 0.f; }
};
#endif