mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 12:43:33 +08:00
sensor_calibration: refactor and centralize calibration slot logic
- centralize logic for selecting a preferred calibration slot - automatically use existing calibration slot if it exists, otherwise find first available slot, with a preference for a requested index - existing commander calibration methods rewrite all calibration slots to match current sensor ordering
This commit is contained in:
@@ -69,7 +69,7 @@ bool PreFlightCheck::accelerometerCheck(orb_advert_t *mavlink_log_pub, vehicle_s
|
||||
calibration_valid = true;
|
||||
|
||||
} else {
|
||||
calibration_valid = (calibration::FindCalibrationIndex("ACC", device_id) >= 0);
|
||||
calibration_valid = (calibration::FindCurrentCalibrationIndex("ACC", device_id) >= 0);
|
||||
}
|
||||
|
||||
if (!calibration_valid) {
|
||||
|
||||
@@ -68,7 +68,7 @@ bool PreFlightCheck::gyroCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &
|
||||
calibration_valid = true;
|
||||
|
||||
} else {
|
||||
calibration_valid = (calibration::FindCalibrationIndex("GYRO", device_id) >= 0);
|
||||
calibration_valid = (calibration::FindCurrentCalibrationIndex("GYRO", device_id) >= 0);
|
||||
}
|
||||
|
||||
if (!calibration_valid) {
|
||||
|
||||
@@ -70,7 +70,7 @@ bool PreFlightCheck::magnetometerCheck(orb_advert_t *mavlink_log_pub, vehicle_st
|
||||
calibration_valid = true;
|
||||
|
||||
} else {
|
||||
calibration_valid = (calibration::FindCalibrationIndex("MAG", device_id) >= 0);
|
||||
calibration_valid = (calibration::FindCurrentCalibrationIndex("MAG", device_id) >= 0);
|
||||
}
|
||||
|
||||
if (!calibration_valid) {
|
||||
|
||||
Reference in New Issue
Block a user