forked from Archive/PX4-Autopilot
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:
parent
ca9af1ca9e
commit
7001d90d84
|
@ -87,7 +87,8 @@ public:
|
||||||
// Compute sensor offset from bias (board frame)
|
// Compute sensor offset from bias (board frame)
|
||||||
matrix::Vector3f BiasCorrectedSensorOffset(const matrix::Vector3f &bias) const
|
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();
|
bool ParametersLoad();
|
||||||
|
|
|
@ -91,7 +91,8 @@ public:
|
||||||
// Compute sensor offset from bias (board frame)
|
// Compute sensor offset from bias (board frame)
|
||||||
matrix::Vector3f BiasCorrectedSensorOffset(const matrix::Vector3f &bias) const
|
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();
|
bool ParametersLoad();
|
||||||
|
|
|
@ -89,7 +89,8 @@ public:
|
||||||
// Compute sensor offset from bias (board frame)
|
// Compute sensor offset from bias (board frame)
|
||||||
matrix::Vector3f BiasCorrectedSensorOffset(const matrix::Vector3f &bias) const
|
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();
|
bool ParametersLoad();
|
||||||
|
|
Loading…
Reference in New Issue