mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
sensor calibration: apply board level adjustment to external sensors (#16127)
- apply SENS_BOARD_{X,Y,Z}_OFF to external sensors to prevent unnecessary misalignment with internal IMU
This commit is contained in:
@@ -126,7 +126,9 @@ void Accelerometer::SensorCorrectionsUpdate(bool force)
|
||||
void Accelerometer::set_rotation(Rotation rotation)
|
||||
{
|
||||
_rotation_enum = rotation;
|
||||
_rotation = get_rot_matrix(rotation);
|
||||
|
||||
// always apply board level adjustments
|
||||
_rotation = Dcmf(GetSensorLevelAdjustment()) * get_rot_matrix(rotation);
|
||||
}
|
||||
|
||||
void Accelerometer::ParametersUpdate()
|
||||
@@ -151,8 +153,7 @@ void Accelerometer::ParametersUpdate()
|
||||
SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value);
|
||||
}
|
||||
|
||||
_rotation_enum = static_cast<Rotation>(rotation_value);
|
||||
_rotation = get_rot_matrix(_rotation_enum);
|
||||
set_rotation(static_cast<Rotation>(rotation_value));
|
||||
|
||||
} else {
|
||||
// internal, CAL_ACCx_ROT -1
|
||||
@@ -162,8 +163,8 @@ void Accelerometer::ParametersUpdate()
|
||||
SetCalibrationParam(SensorString(), "ROT", _calibration_index, -1);
|
||||
}
|
||||
|
||||
_rotation = GetBoardRotation();
|
||||
_rotation_enum = ROTATION_NONE;
|
||||
// internal sensors follow board rotation
|
||||
set_rotation(GetBoardRotation());
|
||||
}
|
||||
|
||||
// CAL_ACCx_PRIO
|
||||
|
||||
Reference in New Issue
Block a user