renamed IMUResetReason -> BNO08xResetReason IMUAccuracy ->

BNO08xAccuracy
This commit is contained in:
myles-parfeniuk 2024-11-16 10:12:26 -08:00
parent 413d7d4b55
commit 4b781f2d12
5 changed files with 69 additions and 65 deletions

View File

@ -30,7 +30,7 @@ class BNO08x
bool hard_reset(); bool hard_reset();
bool soft_reset(); bool soft_reset();
IMUResetReason get_reset_reason(); BNO08xResetReason get_reset_reason();
bool mode_sleep(); bool mode_sleep();
bool mode_on(); bool mode_on();
@ -96,17 +96,17 @@ class BNO08x
uint32_t get_time_stamp(); uint32_t get_time_stamp();
void get_magf(float& x, float& y, float& z, IMUAccuracy& accuracy); void get_magf(float& x, float& y, float& z, BNO08xAccuracy& accuracy);
float get_magf_X(); float get_magf_X();
float get_magf_Y(); float get_magf_Y();
float get_magf_Z(); float get_magf_Z();
IMUAccuracy get_magf_accuracy(); BNO08xAccuracy get_magf_accuracy();
void get_gravity(float& x, float& y, float& z, IMUAccuracy& accuracy); void get_gravity(float& x, float& y, float& z, BNO08xAccuracy& accuracy);
float get_gravity_X(); float get_gravity_X();
float get_gravity_Y(); float get_gravity_Y();
float get_gravity_Z(); float get_gravity_Z();
IMUAccuracy get_gravity_accuracy(); BNO08xAccuracy get_gravity_accuracy();
float get_roll(); float get_roll();
float get_pitch(); float get_pitch();
@ -116,25 +116,25 @@ class BNO08x
float get_pitch_deg(); float get_pitch_deg();
float get_yaw_deg(); float get_yaw_deg();
void get_quat(float& i, float& j, float& k, float& real, float& rad_accuracy, IMUAccuracy& accuracy); void get_quat(float& i, float& j, float& k, float& real, float& rad_accuracy, BNO08xAccuracy& accuracy);
float get_quat_I(); float get_quat_I();
float get_quat_J(); float get_quat_J();
float get_quat_K(); float get_quat_K();
float get_quat_real(); float get_quat_real();
float get_quat_radian_accuracy(); float get_quat_radian_accuracy();
IMUAccuracy get_quat_accuracy(); BNO08xAccuracy get_quat_accuracy();
void get_accel(float& x, float& y, float& z, IMUAccuracy& accuracy); void get_accel(float& x, float& y, float& z, BNO08xAccuracy& accuracy);
float get_accel_X(); float get_accel_X();
float get_accel_Y(); float get_accel_Y();
float get_accel_Z(); float get_accel_Z();
IMUAccuracy get_accel_accuracy(); BNO08xAccuracy get_accel_accuracy();
void get_linear_accel(float& x, float& y, float& z, IMUAccuracy& accuracy); void get_linear_accel(float& x, float& y, float& z, BNO08xAccuracy& accuracy);
float get_linear_accel_X(); float get_linear_accel_X();
float get_linear_accel_Y(); float get_linear_accel_Y();
float get_linear_accel_Z(); float get_linear_accel_Z();
IMUAccuracy get_linear_accel_accuracy(); BNO08xAccuracy get_linear_accel_accuracy();
int16_t get_raw_accel_X(); int16_t get_raw_accel_X();
int16_t get_raw_accel_Y(); int16_t get_raw_accel_Y();
@ -148,20 +148,20 @@ class BNO08x
int16_t get_raw_magf_Y(); int16_t get_raw_magf_Y();
int16_t get_raw_magf_Z(); int16_t get_raw_magf_Z();
void get_gyro_calibrated_velocity(float& x, float& y, float& z, IMUAccuracy& accuracy); void get_gyro_calibrated_velocity(float& x, float& y, float& z, BNO08xAccuracy& accuracy);
float get_gyro_calibrated_velocity_X(); float get_gyro_calibrated_velocity_X();
float get_gyro_calibrated_velocity_Y(); float get_gyro_calibrated_velocity_Y();
float get_gyro_calibrated_velocity_Z(); float get_gyro_calibrated_velocity_Z();
IMUAccuracy get_gyro_accuracy(); BNO08xAccuracy get_gyro_accuracy();
void get_uncalibrated_gyro(float& x, float& y, float& z, float& bx, float& by, float& bz, IMUAccuracy& accuracy); void get_uncalibrated_gyro(float& x, float& y, float& z, float& bx, float& by, float& bz, BNO08xAccuracy& accuracy);
float get_uncalibrated_gyro_X(); float get_uncalibrated_gyro_X();
float get_uncalibrated_gyro_Y(); float get_uncalibrated_gyro_Y();
float get_uncalibrated_gyro_Z(); float get_uncalibrated_gyro_Z();
float get_uncalibrated_gyro_bias_X(); float get_uncalibrated_gyro_bias_X();
float get_uncalibrated_gyro_bias_Y(); float get_uncalibrated_gyro_bias_Y();
float get_uncalibrated_gyro_bias_Z(); float get_uncalibrated_gyro_bias_Z();
IMUAccuracy get_uncalibrated_gyro_accuracy(); BNO08xAccuracy get_uncalibrated_gyro_accuracy();
void get_gyro_velocity(float& x, float& y, float& z); void get_gyro_velocity(float& x, float& y, float& z);
float get_gyro_velocity_X(); float get_gyro_velocity_X();

View File

@ -21,7 +21,7 @@ class BNO08xTestHelper
float quat_K; float quat_K;
float quat_real; float quat_real;
float quat_radian_accuracy; float quat_radian_accuracy;
IMUAccuracy quat_accuracy; BNO08xAccuracy quat_accuracy;
float gyro_vel_x; float gyro_vel_x;
float gyro_vel_y; float gyro_vel_y;
@ -30,7 +30,7 @@ class BNO08xTestHelper
float accel_x; float accel_x;
float accel_y; float accel_y;
float accel_z; float accel_z;
IMUAccuracy accel_accuracy; BNO08xAccuracy accel_accuracy;
} imu_report_data_t; } imu_report_data_t;
@ -132,7 +132,7 @@ class BNO08xTestHelper
if (report_data->quat_real != 1.0f) if (report_data->quat_real != 1.0f)
new_data = true; new_data = true;
if (report_data->quat_accuracy != IMUAccuracy::UNDEFINED) if (report_data->quat_accuracy != BNO08xAccuracy::UNDEFINED)
new_data = true; new_data = true;
if (report_data->quat_radian_accuracy != 0.0f) if (report_data->quat_radian_accuracy != 0.0f)
@ -182,7 +182,7 @@ class BNO08xTestHelper
if (report_data->accel_z != 0.0f) if (report_data->accel_z != 0.0f)
new_data = true; new_data = true;
if (report_data->accel_accuracy != IMUAccuracy::UNDEFINED) if (report_data->accel_accuracy != BNO08xAccuracy::UNDEFINED)
new_data = true; new_data = true;
return new_data; return new_data;

View File

@ -5,16 +5,17 @@
#include <driver/spi_master.h> #include <driver/spi_master.h>
/// @brief Sensor accuracy returned during sensor calibration /// @brief Sensor accuracy returned during sensor calibration
enum class IMUAccuracy enum class BNO08xAccuracy
{ {
LOW = 1, LOW = 1,
MED, MED,
HIGH, HIGH,
UNDEFINED UNDEFINED
}; };
using IMUAccuracy = BNO08xAccuracy; // legacy version compatibility
/// @brief Reason for previous IMU reset (returned by get_reset_reason()) /// @brief Reason for previous IMU reset (returned by get_reset_reason())
enum class IMUResetReason enum class BNO08xResetReason
{ {
UNDEFINED, ///< Undefined reset reason, this should never occur and is an error. UNDEFINED, ///< Undefined reset reason, this should never occur and is an error.
POR, ///< Previous reset was due to power on reset. POR, ///< Previous reset was due to power on reset.
@ -23,6 +24,7 @@ enum class IMUResetReason
EXT_RST, ///< Previous reset was due to external reset. EXT_RST, ///< Previous reset was due to external reset.
OTHER ///< Previous reset was due to power other reason. OTHER ///< Previous reset was due to power other reason.
}; };
using IMUResetReason = BNO08xResetReason; // legacy version compatibility
/// @brief IMU configuration settings passed into constructor /// @brief IMU configuration settings passed into constructor
typedef struct bno08x_config_t typedef struct bno08x_config_t
@ -71,4 +73,6 @@ typedef struct bno08x_config_t
, install_isr_service(install_isr_service) , install_isr_service(install_isr_service)
{ {
} }
} bno08x_config_t; } bno08x_config_t;
typedef bno08x_config_t imu_config_t; // legacy version compatibility

View File

@ -91,7 +91,7 @@ bool BNO08x::initialize()
if (!hard_reset()) if (!hard_reset())
return false; return false;
if (get_reset_reason() == IMUResetReason::UNDEFINED) if (get_reset_reason() == BNO08xResetReason::UNDEFINED)
{ {
ESP_LOGE(TAG, "Initialization failed, undefined reset reason returned after reset."); ESP_LOGE(TAG, "Initialization failed, undefined reset reason returned after reset.");
return false; return false;
@ -613,7 +613,7 @@ bool BNO08x::soft_reset()
* @return The reason for the most recent recent reset ( 1 = POR (power on reset), 2 = internal reset, 3 = watchdog * @return The reason for the most recent recent reset ( 1 = POR (power on reset), 2 = internal reset, 3 = watchdog
* timer, 4 = external reset 5 = other) * timer, 4 = external reset 5 = other)
*/ */
IMUResetReason BNO08x::get_reset_reason() BNO08xResetReason BNO08x::get_reset_reason()
{ {
uint32_t reset_reason = 0; uint32_t reset_reason = 0;
@ -631,7 +631,7 @@ IMUResetReason BNO08x::get_reset_reason()
ESP_LOGE(TAG, "Failed to receive product ID report."); ESP_LOGE(TAG, "Failed to receive product ID report.");
} }
return static_cast<IMUResetReason>(reset_reason); return static_cast<BNO08xResetReason>(reset_reason);
} }
/** /**
@ -1116,13 +1116,13 @@ bool BNO08x::run_full_calibration_routine()
float magf_x = 0; float magf_x = 0;
float magf_y = 0; float magf_y = 0;
float magf_z = 0; float magf_z = 0;
IMUAccuracy magnetometer_accuracy = IMUAccuracy::LOW; BNO08xAccuracy magnetometer_accuracy = BNO08xAccuracy::LOW;
float quat_I = 0; float quat_I = 0;
float quat_J = 0; float quat_J = 0;
float quat_K = 0; float quat_K = 0;
float quat_real = 0; float quat_real = 0;
IMUAccuracy quat_accuracy = IMUAccuracy::LOW; BNO08xAccuracy quat_accuracy = BNO08xAccuracy::LOW;
uint16_t high_accuracy = 0; uint16_t high_accuracy = 0;
uint16_t save_calibration_attempt = 0; uint16_t save_calibration_attempt = 0;
@ -1157,7 +1157,7 @@ bool BNO08x::run_full_calibration_routine()
vTaskDelay(5 / portTICK_PERIOD_MS); vTaskDelay(5 / portTICK_PERIOD_MS);
if ((magnetometer_accuracy >= IMUAccuracy::MED) && (quat_accuracy == IMUAccuracy::HIGH)) if ((magnetometer_accuracy >= BNO08xAccuracy::MED) && (quat_accuracy == BNO08xAccuracy::HIGH))
high_accuracy++; high_accuracy++;
else else
high_accuracy = 0; high_accuracy = 0;
@ -2385,25 +2385,25 @@ void BNO08x::reset_all_data()
raw_accel_X = 0U; raw_accel_X = 0U;
raw_accel_Y = 0U; raw_accel_Y = 0U;
raw_accel_Z = 0U; raw_accel_Z = 0U;
accel_accuracy = static_cast<uint16_t>(IMUAccuracy::UNDEFINED); accel_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
raw_lin_accel_X = 0U; raw_lin_accel_X = 0U;
raw_lin_accel_Y = 0U; raw_lin_accel_Y = 0U;
raw_lin_accel_Z = 0U; raw_lin_accel_Z = 0U;
accel_lin_accuracy = static_cast<uint16_t>(IMUAccuracy::UNDEFINED); accel_lin_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
raw_gyro_X = 0U; raw_gyro_X = 0U;
raw_gyro_Y = 0U; raw_gyro_Y = 0U;
raw_gyro_Z = 0U; raw_gyro_Z = 0U;
gyro_accuracy = static_cast<uint16_t>(IMUAccuracy::UNDEFINED); gyro_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
// reset quaternion to nan // reset quaternion to nan
raw_quat_I = 0U; raw_quat_I = 0U;
raw_quat_J = 0U; raw_quat_J = 0U;
raw_quat_K = 0U; raw_quat_K = 0U;
raw_quat_real = 0U; raw_quat_real = 0U;
raw_quat_radian_accuracy = static_cast<uint16_t>(IMUAccuracy::UNDEFINED); raw_quat_radian_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
quat_accuracy = static_cast<uint16_t>(IMUAccuracy::UNDEFINED); quat_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
raw_velocity_gyro_X = 0U; raw_velocity_gyro_X = 0U;
raw_velocity_gyro_Y = 0U; raw_velocity_gyro_Y = 0U;
@ -2412,7 +2412,7 @@ void BNO08x::reset_all_data()
gravity_X = 0U; gravity_X = 0U;
gravity_Y = 0U; gravity_Y = 0U;
gravity_Z = 0U; gravity_Z = 0U;
gravity_accuracy = static_cast<uint16_t>(IMUAccuracy::UNDEFINED); gravity_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
raw_uncalib_gyro_X = 0U; raw_uncalib_gyro_X = 0U;
raw_uncalib_gyro_Y = 0U; raw_uncalib_gyro_Y = 0U;
@ -2420,12 +2420,12 @@ void BNO08x::reset_all_data()
raw_bias_X = 0U; raw_bias_X = 0U;
raw_bias_Y = 0U; raw_bias_Y = 0U;
raw_bias_Z = 0U; raw_bias_Z = 0U;
uncalib_gyro_accuracy = static_cast<uint16_t>(IMUAccuracy::UNDEFINED); uncalib_gyro_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
raw_magf_X = 0U; raw_magf_X = 0U;
raw_magf_Y = 0U; raw_magf_Y = 0U;
raw_magf_Z = 0U; raw_magf_Z = 0U;
magf_accuracy = static_cast<uint16_t>(IMUAccuracy::UNDEFINED); magf_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
tap_detector = 0U; tap_detector = 0U;
step_count = 0U; step_count = 0U;
@ -2455,12 +2455,12 @@ void BNO08x::reset_all_data()
* *
* @return void, nothing to return * @return void, nothing to return
*/ */
void BNO08x::get_magf(float& x, float& y, float& z, IMUAccuracy& accuracy) void BNO08x::get_magf(float& x, float& y, float& z, BNO08xAccuracy& accuracy)
{ {
x = q_to_float(raw_magf_X, MAGNETOMETER_Q1); x = q_to_float(raw_magf_X, MAGNETOMETER_Q1);
y = q_to_float(raw_magf_Y, MAGNETOMETER_Q1); y = q_to_float(raw_magf_Y, MAGNETOMETER_Q1);
z = q_to_float(raw_magf_Z, MAGNETOMETER_Q1); z = q_to_float(raw_magf_Z, MAGNETOMETER_Q1);
accuracy = static_cast<IMUAccuracy>(magf_accuracy); accuracy = static_cast<BNO08xAccuracy>(magf_accuracy);
} }
/** /**
@ -2501,9 +2501,9 @@ float BNO08x::get_magf_Z()
* *
* @return The accuracy of reported magnetic field vector. * @return The accuracy of reported magnetic field vector.
*/ */
IMUAccuracy BNO08x::get_magf_accuracy() BNO08xAccuracy BNO08x::get_magf_accuracy()
{ {
return static_cast<IMUAccuracy>(magf_accuracy); return static_cast<BNO08xAccuracy>(magf_accuracy);
} }
/** /**
@ -2516,12 +2516,12 @@ IMUAccuracy BNO08x::get_magf_accuracy()
* *
* @return void, nothing to return * @return void, nothing to return
*/ */
void BNO08x::get_gravity(float& x, float& y, float& z, IMUAccuracy& accuracy) void BNO08x::get_gravity(float& x, float& y, float& z, BNO08xAccuracy& accuracy)
{ {
x = q_to_float(gravity_X, GRAVITY_Q1); x = q_to_float(gravity_X, GRAVITY_Q1);
y = q_to_float(gravity_Y, GRAVITY_Q1); y = q_to_float(gravity_Y, GRAVITY_Q1);
z = q_to_float(gravity_Z, GRAVITY_Q1); z = q_to_float(gravity_Z, GRAVITY_Q1);
accuracy = static_cast<IMUAccuracy>(gravity_accuracy); accuracy = static_cast<BNO08xAccuracy>(gravity_accuracy);
} }
/** /**
@ -2559,9 +2559,9 @@ float BNO08x::get_gravity_Z()
* *
* @return Accuracy of reported gravity. * @return Accuracy of reported gravity.
*/ */
IMUAccuracy BNO08x::get_gravity_accuracy() BNO08xAccuracy BNO08x::get_gravity_accuracy()
{ {
return static_cast<IMUAccuracy>(gravity_accuracy); return static_cast<BNO08xAccuracy>(gravity_accuracy);
} }
/** /**
@ -2689,14 +2689,14 @@ float BNO08x::get_yaw_deg()
* *
* @return void, nothing to return * @return void, nothing to return
*/ */
void BNO08x::get_quat(float& i, float& j, float& k, float& real, float& rad_accuracy, IMUAccuracy& accuracy) void BNO08x::get_quat(float& i, float& j, float& k, float& real, float& rad_accuracy, BNO08xAccuracy& accuracy)
{ {
i = q_to_float(raw_quat_I, ROTATION_VECTOR_Q1); i = q_to_float(raw_quat_I, ROTATION_VECTOR_Q1);
j = q_to_float(raw_quat_J, ROTATION_VECTOR_Q1); j = q_to_float(raw_quat_J, ROTATION_VECTOR_Q1);
k = q_to_float(raw_quat_K, ROTATION_VECTOR_Q1); k = q_to_float(raw_quat_K, ROTATION_VECTOR_Q1);
real = q_to_float(raw_quat_real, ROTATION_VECTOR_Q1); real = q_to_float(raw_quat_real, ROTATION_VECTOR_Q1);
rad_accuracy = q_to_float(raw_quat_radian_accuracy, ROTATION_VECTOR_Q1); rad_accuracy = q_to_float(raw_quat_radian_accuracy, ROTATION_VECTOR_Q1);
accuracy = static_cast<IMUAccuracy>(quat_accuracy); accuracy = static_cast<BNO08xAccuracy>(quat_accuracy);
} }
/** /**
@ -2759,9 +2759,9 @@ float BNO08x::get_quat_radian_accuracy()
* *
* @return The accuracy of reported quaternion. * @return The accuracy of reported quaternion.
*/ */
IMUAccuracy BNO08x::get_quat_accuracy() BNO08xAccuracy BNO08x::get_quat_accuracy()
{ {
return static_cast<IMUAccuracy>(quat_accuracy); return static_cast<BNO08xAccuracy>(quat_accuracy);
} }
/** /**
@ -2774,12 +2774,12 @@ IMUAccuracy BNO08x::get_quat_accuracy()
* *
* @return void, nothing to return * @return void, nothing to return
*/ */
void BNO08x::get_accel(float& x, float& y, float& z, IMUAccuracy& accuracy) void BNO08x::get_accel(float& x, float& y, float& z, BNO08xAccuracy& accuracy)
{ {
x = q_to_float(raw_accel_X, ACCELEROMETER_Q1); x = q_to_float(raw_accel_X, ACCELEROMETER_Q1);
y = q_to_float(raw_accel_Y, ACCELEROMETER_Q1); y = q_to_float(raw_accel_Y, ACCELEROMETER_Q1);
z = q_to_float(raw_accel_Z, ACCELEROMETER_Q1); z = q_to_float(raw_accel_Z, ACCELEROMETER_Q1);
accuracy = static_cast<IMUAccuracy>(accel_accuracy); accuracy = static_cast<BNO08xAccuracy>(accel_accuracy);
} }
/** /**
@ -2817,9 +2817,9 @@ float BNO08x::get_accel_Z()
* *
* @return Accuracy of linear acceleration. * @return Accuracy of linear acceleration.
*/ */
IMUAccuracy BNO08x::get_accel_accuracy() BNO08xAccuracy BNO08x::get_accel_accuracy()
{ {
return static_cast<IMUAccuracy>(accel_accuracy); return static_cast<BNO08xAccuracy>(accel_accuracy);
} }
/** /**
@ -2832,12 +2832,12 @@ IMUAccuracy BNO08x::get_accel_accuracy()
* *
* @return void, nothing to return * @return void, nothing to return
*/ */
void BNO08x::get_linear_accel(float& x, float& y, float& z, IMUAccuracy& accuracy) void BNO08x::get_linear_accel(float& x, float& y, float& z, BNO08xAccuracy& accuracy)
{ {
x = q_to_float(raw_lin_accel_X, LINEAR_ACCELEROMETER_Q1); x = q_to_float(raw_lin_accel_X, LINEAR_ACCELEROMETER_Q1);
y = q_to_float(raw_lin_accel_Y, LINEAR_ACCELEROMETER_Q1); y = q_to_float(raw_lin_accel_Y, LINEAR_ACCELEROMETER_Q1);
z = q_to_float(raw_lin_accel_Z, LINEAR_ACCELEROMETER_Q1); z = q_to_float(raw_lin_accel_Z, LINEAR_ACCELEROMETER_Q1);
accuracy = static_cast<IMUAccuracy>(accel_lin_accuracy); accuracy = static_cast<BNO08xAccuracy>(accel_lin_accuracy);
} }
/** /**
@ -2875,9 +2875,9 @@ float BNO08x::get_linear_accel_Z()
* *
* @return Accuracy of linear acceleration. * @return Accuracy of linear acceleration.
*/ */
IMUAccuracy BNO08x::get_linear_accel_accuracy() BNO08xAccuracy BNO08x::get_linear_accel_accuracy()
{ {
return static_cast<IMUAccuracy>(accel_lin_accuracy); return static_cast<BNO08xAccuracy>(accel_lin_accuracy);
} }
/** /**
@ -2980,12 +2980,12 @@ int16_t BNO08x::get_raw_magf_Z()
* *
* @return void, nothing to return * @return void, nothing to return
*/ */
void BNO08x::get_gyro_calibrated_velocity(float& x, float& y, float& z, IMUAccuracy& accuracy) void BNO08x::get_gyro_calibrated_velocity(float& x, float& y, float& z, BNO08xAccuracy& accuracy)
{ {
x = q_to_float(raw_gyro_X, GYRO_Q1); x = q_to_float(raw_gyro_X, GYRO_Q1);
y = q_to_float(raw_gyro_Y, GYRO_Q1); y = q_to_float(raw_gyro_Y, GYRO_Q1);
z = q_to_float(raw_gyro_Z, GYRO_Q1); z = q_to_float(raw_gyro_Z, GYRO_Q1);
accuracy = static_cast<IMUAccuracy>(gyro_accuracy); accuracy = static_cast<BNO08xAccuracy>(gyro_accuracy);
} }
/** /**
@ -3023,9 +3023,9 @@ float BNO08x::get_gyro_calibrated_velocity_Z()
* *
* @return Accuracy of calibrated gyro. * @return Accuracy of calibrated gyro.
*/ */
IMUAccuracy BNO08x::get_gyro_accuracy() BNO08xAccuracy BNO08x::get_gyro_accuracy()
{ {
return static_cast<IMUAccuracy>(gyro_accuracy); return static_cast<BNO08xAccuracy>(gyro_accuracy);
} }
/** /**
@ -3042,7 +3042,7 @@ IMUAccuracy BNO08x::get_gyro_accuracy()
* *
* @return void, nothing to return * @return void, nothing to return
*/ */
void BNO08x::get_uncalibrated_gyro(float& x, float& y, float& z, float& b_x, float& b_y, float& b_z, IMUAccuracy& accuracy) void BNO08x::get_uncalibrated_gyro(float& x, float& y, float& z, float& b_x, float& b_y, float& b_z, BNO08xAccuracy& accuracy)
{ {
x = q_to_float(raw_uncalib_gyro_X, GYRO_Q1); x = q_to_float(raw_uncalib_gyro_X, GYRO_Q1);
y = q_to_float(raw_uncalib_gyro_Y, GYRO_Q1); y = q_to_float(raw_uncalib_gyro_Y, GYRO_Q1);
@ -3050,7 +3050,7 @@ void BNO08x::get_uncalibrated_gyro(float& x, float& y, float& z, float& b_x, flo
b_x = q_to_float(raw_bias_X, GYRO_Q1); b_x = q_to_float(raw_bias_X, GYRO_Q1);
b_y = q_to_float(raw_bias_Y, GYRO_Q1); b_y = q_to_float(raw_bias_Y, GYRO_Q1);
b_z = q_to_float(raw_bias_Z, GYRO_Q1); b_z = q_to_float(raw_bias_Z, GYRO_Q1);
accuracy = static_cast<IMUAccuracy>(uncalib_gyro_accuracy); accuracy = static_cast<BNO08xAccuracy>(uncalib_gyro_accuracy);
} }
/** /**
@ -3118,9 +3118,9 @@ float BNO08x::get_uncalibrated_gyro_bias_Z()
* *
* @return Accuracy of uncalibrated gyro. * @return Accuracy of uncalibrated gyro.
*/ */
IMUAccuracy BNO08x::get_uncalibrated_gyro_accuracy() BNO08xAccuracy BNO08x::get_uncalibrated_gyro_accuracy()
{ {
return static_cast<IMUAccuracy>(uncalib_gyro_accuracy); return static_cast<BNO08xAccuracy>(uncalib_gyro_accuracy);
} }
/** /**

View File

@ -86,7 +86,7 @@ TEST_CASE("Finish Init", "[InitComprehensive]")
TEST_ASSERT_EQUAL(true, imu->hard_reset()); TEST_ASSERT_EQUAL(true, imu->hard_reset());
// check if reason is valid // check if reason is valid
TEST_ASSERT_NOT_EQUAL(IMUResetReason::UNDEFINED, imu->get_reset_reason()); TEST_ASSERT_NOT_EQUAL(BNO08xResetReason::UNDEFINED, imu->get_reset_reason());
BNO08xTestHelper::print_test_msg(TEST_TAG, "Destroying test IMU."); BNO08xTestHelper::print_test_msg(TEST_TAG, "Destroying test IMU.");
BNO08xTestHelper::destroy_test_imu(); BNO08xTestHelper::destroy_test_imu();