From bd8937642fe5b1326073e8c0e8b7d7fe47bf8fd3 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 23 Aug 2021 19:27:50 -0400 Subject: [PATCH] lib/sensor_calibration: only warn if external rotation resetting - this also happens with the actual default parameter value (-1) --- src/lib/sensor_calibration/Accelerometer.cpp | 4 ++-- src/lib/sensor_calibration/Gyroscope.cpp | 4 ++-- src/lib/sensor_calibration/Magnetometer.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/sensor_calibration/Accelerometer.cpp b/src/lib/sensor_calibration/Accelerometer.cpp index a33494fb1d..4344952894 100644 --- a/src/lib/sensor_calibration/Accelerometer.cpp +++ b/src/lib/sensor_calibration/Accelerometer.cpp @@ -173,8 +173,8 @@ void Accelerometer::ParametersUpdate() if (_external) { if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) { - PX4_ERR("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none", - SensorString(), _device_id, _calibration_index, rotation_value); + PX4_WARN("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none", + SensorString(), _device_id, _calibration_index, rotation_value); rotation_value = ROTATION_NONE; SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value); } diff --git a/src/lib/sensor_calibration/Gyroscope.cpp b/src/lib/sensor_calibration/Gyroscope.cpp index 8a0eca4466..44dfa64ca9 100644 --- a/src/lib/sensor_calibration/Gyroscope.cpp +++ b/src/lib/sensor_calibration/Gyroscope.cpp @@ -158,8 +158,8 @@ void Gyroscope::ParametersUpdate() if (_external) { if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) { - PX4_ERR("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none", - SensorString(), _device_id, _calibration_index, rotation_value); + PX4_WARN("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none", + SensorString(), _device_id, _calibration_index, rotation_value); rotation_value = ROTATION_NONE; SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value); } diff --git a/src/lib/sensor_calibration/Magnetometer.cpp b/src/lib/sensor_calibration/Magnetometer.cpp index d54c2ce7e5..b7d7855bc9 100644 --- a/src/lib/sensor_calibration/Magnetometer.cpp +++ b/src/lib/sensor_calibration/Magnetometer.cpp @@ -158,8 +158,8 @@ void Magnetometer::ParametersUpdate() if (_external) { if ((rotation_value >= ROTATION_MAX) || (rotation_value < 0)) { - PX4_ERR("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none", - SensorString(), _device_id, _calibration_index, rotation_value); + PX4_WARN("External %s %" PRIu32 " (%" PRId8 ") invalid rotation %" PRId32 ", resetting to rotation none", + SensorString(), _device_id, _calibration_index, rotation_value); rotation_value = ROTATION_NONE; SetCalibrationParam(SensorString(), "ROT", _calibration_index, rotation_value); }