mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
lib/sensor_calibration: only warn if external rotation resetting
- this also happens with the actual default parameter value (-1)
This commit is contained in:
@@ -173,8 +173,8 @@ void Accelerometer::ParametersUpdate()
|
|||||||
|
|
||||||
if (_external) {
|
if (_external) {
|
||||||
if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) {
|
if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) {
|
||||||
PX4_ERR("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none",
|
PX4_WARN("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none",
|
||||||
SensorString(), _device_id, _calibration_index, rotation_value);
|
SensorString(), _device_id, _calibration_index, rotation_value);
|
||||||
rotation_value = ROTATION_NONE;
|
rotation_value = ROTATION_NONE;
|
||||||
SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value);
|
SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ void Gyroscope::ParametersUpdate()
|
|||||||
|
|
||||||
if (_external) {
|
if (_external) {
|
||||||
if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) {
|
if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) {
|
||||||
PX4_ERR("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none",
|
PX4_WARN("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none",
|
||||||
SensorString(), _device_id, _calibration_index, rotation_value);
|
SensorString(), _device_id, _calibration_index, rotation_value);
|
||||||
rotation_value = ROTATION_NONE;
|
rotation_value = ROTATION_NONE;
|
||||||
SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value);
|
SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ void Magnetometer::ParametersUpdate()
|
|||||||
|
|
||||||
if (_external) {
|
if (_external) {
|
||||||
if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) {
|
if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) {
|
||||||
PX4_ERR("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none",
|
PX4_WARN("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none",
|
||||||
SensorString(), _device_id, _calibration_index, rotation_value);
|
SensorString(), _device_id, _calibration_index, rotation_value);
|
||||||
rotation_value = ROTATION_NONE;
|
rotation_value = ROTATION_NONE;
|
||||||
SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value);
|
SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user