lib/sensor_calibration: BiasCorrectedSensorOffset() don't incorporate thermal offsets

- the thermal offsets are an optional correction applied to the raw data, so when updating an existing calibration offset with new learned bias we don't want this incorporated
This commit is contained in:
Daniel Agar 2023-02-06 10:55:17 -05:00
parent e153d1defc
commit 661eb2adb4
3 changed files with 6 additions and 3 deletions

View File

@ -87,7 +87,8 @@ public:
// Compute sensor offset from bias (board frame)
matrix::Vector3f BiasCorrectedSensorOffset(const matrix::Vector3f &bias) const
{
return (_rotation.I() * bias).edivide(_scale) + _thermal_offset + _offset;
// updated calibration offset = existing offset + bias rotated to sensor frame and unscaled
return _offset + (_rotation.I() * bias).edivide(_scale);
}
bool ParametersLoad();

View File

@ -91,7 +91,8 @@ public:
// Compute sensor offset from bias (board frame)
matrix::Vector3f BiasCorrectedSensorOffset(const matrix::Vector3f &bias) const
{
return (_rotation.I() * bias) + _thermal_offset + _offset;
// updated calibration offset = existing offset + bias rotated to sensor frame
return _offset + (_rotation.I() * bias);
}
bool ParametersLoad();

View File

@ -89,7 +89,8 @@ public:
// Compute sensor offset from bias (board frame)
matrix::Vector3f BiasCorrectedSensorOffset(const matrix::Vector3f &bias) const
{
return _scale.I() * _rotation.I() * bias + _offset;
// updated calibration offset = existing offset + bias rotated to sensor frame and unscaled
return _offset + (_scale.I() * _rotation.I() * bias);
}
bool ParametersLoad();