mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 08:38:53 +08:00
cal: transpose rotation instead of computing inverse
This is equivalent for an orthonormal matrix
This commit is contained in:
committed by
Mathieu Bresciani
parent
03c7e7aa08
commit
b5f011a31f
@@ -88,7 +88,7 @@ public:
|
||||
matrix::Vector3f BiasCorrectedSensorOffset(const matrix::Vector3f &bias) const
|
||||
{
|
||||
// updated calibration offset = existing offset + bias rotated to sensor frame and unscaled
|
||||
return _offset + (_rotation.I() * bias).edivide(_scale);
|
||||
return _offset + (_rotation.T() * bias).edivide(_scale);
|
||||
}
|
||||
|
||||
bool ParametersLoad();
|
||||
|
||||
@@ -85,14 +85,14 @@ public:
|
||||
|
||||
inline matrix::Vector3f Uncorrect(const matrix::Vector3f &corrected_data) const
|
||||
{
|
||||
return (_rotation.I() * corrected_data) + _thermal_offset + _offset;
|
||||
return (_rotation.T() * corrected_data) + _thermal_offset + _offset;
|
||||
}
|
||||
|
||||
// Compute sensor offset from bias (board frame)
|
||||
matrix::Vector3f BiasCorrectedSensorOffset(const matrix::Vector3f &bias) const
|
||||
{
|
||||
// updated calibration offset = existing offset + bias rotated to sensor frame
|
||||
return _offset + (_rotation.I() * bias);
|
||||
return _offset + (_rotation.T() * bias);
|
||||
}
|
||||
|
||||
bool ParametersLoad();
|
||||
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
matrix::Vector3f BiasCorrectedSensorOffset(const matrix::Vector3f &bias) const
|
||||
{
|
||||
// updated calibration offset = existing offset + bias rotated to sensor frame and unscaled
|
||||
return _offset + (_scale.I() * _rotation.I() * bias);
|
||||
return _offset + (_scale.I() * _rotation.T() * bias);
|
||||
}
|
||||
|
||||
bool ParametersLoad();
|
||||
|
||||
Reference in New Issue
Block a user