mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 17:23:34 +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:
@@ -50,7 +50,17 @@ namespace calibration
|
||||
* @param device_id
|
||||
* @return int8_t Valid calibration index on success, -1 otherwise
|
||||
*/
|
||||
int8_t FindCalibrationIndex(const char *sensor_type, uint32_t device_id);
|
||||
int8_t FindCurrentCalibrationIndex(const char *sensor_type, uint32_t device_id);
|
||||
|
||||
/**
|
||||
* @brief Find sensor's calibration index if it exists, otherwise select an available slot.
|
||||
*
|
||||
* @param sensor_type Calibration parameter abbreviated sensor string ("ACC", "GYRO", "MAG")
|
||||
* @param device_id
|
||||
* @param preferred_index preferred index (optional)
|
||||
* @return int8_t Valid calibration index on success, -1 otherwise
|
||||
*/
|
||||
int8_t FindAvailableCalibrationIndex(const char *sensor_type, uint32_t device_id, int8_t preferred_index = -1);
|
||||
|
||||
/**
|
||||
* @brief Get sensor calibration parameter value.
|
||||
|
||||
Reference in New Issue
Block a user