AP_InertialSensor: save only gyro calibration

When we are initializing the gyro and then saving the calibration we are
also saving the calibration values for the accelerometers. Right now
this is non-problematic, but we want to check that the ID of the
accelerometer corresponds to the ID of the sensor detected. If we also
save accel calibrations we would actually override the ID of the
accelerometer.

Rename the method to _save_gyro_calibration() and save only on gyro
values.
This commit is contained in:
Lucas De Marchi 2016-09-03 21:18:09 -03:00 committed by Andrew Tridgell
parent f81dba2100
commit bbb9bfa95e
2 changed files with 4 additions and 6 deletions

View File

@ -683,7 +683,7 @@ AP_InertialSensor::init_gyro()
_init_gyro();
// save calibration
_save_parameters();
_save_gyro_calibration();
}
// accelerometer clipping reporting
@ -986,11 +986,9 @@ AP_InertialSensor::_init_gyro()
}
// save parameters to eeprom
void AP_InertialSensor::_save_parameters()
void AP_InertialSensor::_save_gyro_calibration()
{
for (uint8_t i=0; i<INS_MAX_INSTANCES; i++) {
_accel_scale[i].save();
_accel_offset[i].save();
_gyro_offset[i].save();
}
}

View File

@ -272,8 +272,8 @@ private:
bool _calculate_trim(const Vector3f &accel_sample, float& trim_roll, float& trim_pitch);
// save parameters to eeprom
void _save_parameters();
// save gyro calibration values to eeprom
void _save_gyro_calibration();
// backend objects
AP_InertialSensor_Backend *_backends[INS_MAX_BACKENDS];