mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 23:49:06 +08:00
sensor_calibration: respect board rotation even if uncalibrated
- fixes https://github.com/PX4/PX4-Autopilot/issues/16873
This commit is contained in:
parent
e2563388eb
commit
69bd3ecf95
@ -220,8 +220,14 @@ void Accelerometer::ParametersUpdate()
|
||||
|
||||
void Accelerometer::Reset()
|
||||
{
|
||||
_rotation.setIdentity();
|
||||
_rotation_enum = ROTATION_NONE;
|
||||
if (_external) {
|
||||
set_rotation(ROTATION_NONE);
|
||||
|
||||
} else {
|
||||
// internal sensors follow board rotation
|
||||
set_rotation(GetBoardRotation());
|
||||
}
|
||||
|
||||
_offset.zero();
|
||||
_scale = Vector3f{1.f, 1.f, 1.f};
|
||||
_thermal_offset.zero();
|
||||
|
||||
@ -205,8 +205,14 @@ void Gyroscope::ParametersUpdate()
|
||||
|
||||
void Gyroscope::Reset()
|
||||
{
|
||||
_rotation.setIdentity();
|
||||
_rotation_enum = ROTATION_NONE;
|
||||
if (_external) {
|
||||
set_rotation(ROTATION_NONE);
|
||||
|
||||
} else {
|
||||
// internal sensors follow board rotation
|
||||
set_rotation(GetBoardRotation());
|
||||
}
|
||||
|
||||
_offset.zero();
|
||||
_thermal_offset.zero();
|
||||
|
||||
|
||||
@ -207,8 +207,14 @@ void Magnetometer::ParametersUpdate()
|
||||
|
||||
void Magnetometer::Reset()
|
||||
{
|
||||
_rotation.setIdentity();
|
||||
_rotation_enum = ROTATION_NONE;
|
||||
if (_external) {
|
||||
set_rotation(ROTATION_NONE);
|
||||
|
||||
} else {
|
||||
// internal sensors follow board rotation
|
||||
set_rotation(GetBoardRotation());
|
||||
}
|
||||
|
||||
_offset.zero();
|
||||
_scale.setIdentity();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user