Copter: reset ahrs gyro drift after gyro calibration

This commit is contained in:
Randy Mackay 2014-10-28 20:23:18 +09:00
parent 95538d2992
commit 7b4cd9ee37
2 changed files with 7 additions and 0 deletions

View File

@ -1113,6 +1113,8 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
if (packet.param1 == 1) {
// gyro offset calibration
ins.init_gyro();
// reset ahrs gyro bias
ahrs.reset_gyro_drift();
result = MAV_RESULT_ACCEPTED;
}
if (packet.param3 == 1) {

View File

@ -320,6 +320,11 @@ static void startup_ground(bool force_gyro_cal)
report_ins();
#endif
// reset ahrs gyro bias
if (force_gyro_cal) {
ahrs.reset_gyro_drift();
}
// setup fast AHRS gains to get right attitude
ahrs.set_fast_gains(true);