lib/sensor_calibration: check param save success and comment helpers

This commit is contained in:
Daniel Agar
2020-09-13 21:00:40 -04:00
parent ac732cdeba
commit 04214a347e
5 changed files with 78 additions and 28 deletions
+51 -4
View File
@@ -38,16 +38,63 @@
namespace calibration
{
/**
* @brief Find sensor's calibration index if it exists.
*
* @param sensor_type Calibration parameter abbreviated sensor string ("ACC", "GYRO", "MAG")
* @param device_id
* @return int8_t Valid calibration index on success, -1 otherwise
*/
int8_t FindCalibrationIndex(const char *sensor_type, uint32_t device_id);
/**
* @brief Get sensor calibration parameter value.
*
* @param sensor_type Calibration parameter abbreviated sensor string ("ACC", "GYRO", "MAG")
* @param cal_type Calibration parameter abbreviated type ("OFF", "SCALE", "ROT", "PRIO")
* @param instance
* @return int32_t The calibration value.
*/
int32_t GetCalibrationParam(const char *sensor_type, const char *cal_type, uint8_t instance);
int SetCalibrationParam(const char *sensor_type, const char *cal_type, uint8_t instance, int32_t value);
/**
* @brief Set a single calibration paramter.
*
* @param sensor_type Calibration parameter abbreviated sensor string ("ACC", "GYRO", "MAG")
* @param cal_type Calibration parameter abbreviated type ("OFF", "SCALE", "ROT", "PRIO")
* @param instance Calibration index (0 - 3)
* @param value int32_t parameter value
* @return true if the parameter name was valid and value saved successfully, false otherwise.
*/
bool SetCalibrationParam(const char *sensor_type, const char *cal_type, uint8_t instance, int32_t value);
/**
* @brief Get the Calibration Params Vector 3f object
*
* @param sensor_type Calibration parameter abbreviated sensor string ("ACC", "GYRO", "MAG")
* @param cal_type Calibration parameter abbreviated type ("OFF", "SCALE", "ROT", "PRIO")
* @param instance Calibration index (0 - 3)
* @return matrix::Vector3f Vector of calibration values.
*/
matrix::Vector3f GetCalibrationParamsVector3f(const char *sensor_type, const char *cal_type, uint8_t instance);
int SetCalibrationParamsVector3f(const char *sensor_type, const char *cal_type, uint8_t instance,
matrix::Vector3f values);
/**
* @brief Set the Calibration Params Vector 3f object
*
* @param sensor_type Calibration parameter abbreviated sensor string ("ACC", "GYRO", "MAG")
* @param cal_type Calibration parameter abbreviated type ("OFF", "SCALE", "ROT", "PRIO")
* @param instance Calibration index (0 - 3)
* @param values Vector of calibration values x, y, z.
* @return true if the parameter name was valid and all values saved successfully, false otherwise.
*/
bool SetCalibrationParamsVector3f(const char *sensor_type, const char *cal_type, uint8_t instance,
matrix::Vector3f values);
/**
* @brief Get the overall board rotation, including level adjustment.
*
* @return matrix::Dcmf
*/
matrix::Dcmf GetBoardRotation();
} // namespace calibration