mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-09 07:10:35 +08:00
sensors: minor IMU bias saving updates
- sensors/vehicle_imu: reset learned cal on any calibration change during parameter update - sensors/vehicle_imu: cleanup logic estimated bias -> calibration offset saving - don't invalidate saved calibration (the point is to keep the last valid) - remove old debug code, etc - sensors/vehicle_imu: notify parameter changes if accel or gyro calibration has changed - lib/sensor_calibration: add calibrated() and calibration_index() getters, keep Accelerometer/Gyroscope/Magnetometer in sync
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2020-2021 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2020-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -60,10 +60,6 @@ void Accelerometer::set_device_id(uint32_t device_id, bool external)
|
||||
set_external(external);
|
||||
_device_id = device_id;
|
||||
|
||||
if (_device_id != 0) {
|
||||
_calibration_index = FindCalibrationIndex(SensorString(), _device_id);
|
||||
}
|
||||
|
||||
ParametersUpdate();
|
||||
SensorCorrectionsUpdate(true);
|
||||
}
|
||||
@@ -166,6 +162,10 @@ void Accelerometer::set_rotation(Rotation rotation)
|
||||
|
||||
void Accelerometer::ParametersUpdate()
|
||||
{
|
||||
if (_device_id != 0) {
|
||||
_calibration_index = FindCalibrationIndex(SensorString(), _device_id);
|
||||
}
|
||||
|
||||
if (_calibration_index >= 0) {
|
||||
|
||||
// CAL_ACCx_ROT
|
||||
|
||||
Reference in New Issue
Block a user