21 static const constexpr char*
TAG =
"BNO08xTestHelper";
90 printf(
"------------------------ BEGIN TEST: %s ------------------------\n\r", TEST_TAG);
102 printf(
"------------------------ END TEST: %s ------------------------\n\r", TEST_TAG);
115 printf(
"%s: %s: %s\n\r",
TAG, TEST_TAG, msg);
556 static const constexpr uint16_t TEST_VAL_UINT16 = 65535U;
557 static const constexpr uint16_t TEST_VAL_UINT8 = 255;
BNO08xStability
BNO08xStability states returned from get_stability_classifier()
Definition BNO08x_global_types.hpp:65
BNO08xActivity
BNO08xActivity states returned from get_activity_classifier()
Definition BNO08x_global_types.hpp:50
BNO08xAccuracy
Sensor accuracy returned during sensor calibration.
Definition BNO08x_global_types.hpp:13
BNO08xTestHelper::imu_report_data_t report_data
Definition CallbackTests.cpp:21
bool new_data
Definition CallbackTests.cpp:25
BNO08x IMU driver class.
Definition BNO08x.hpp:34
uint16_t integrated_gyro_velocity_Y
Definition BNO08x.hpp:399
uint16_t raw_quat_radian_accuracy
Definition BNO08x.hpp:397
void get_gravity(float &x, float &y, float &z, BNO08xAccuracy &accuracy)
Get full reported gravity vector, units in m/s^2.
Definition BNO08x.cpp:2806
esp_err_t launch_tasks()
Launches spi_task and data_proc_task on constructor call.
Definition BNO08x.cpp:4003
uint16_t raw_bias_Z
Uncalibrated gyro reading (See SH-2 Ref. Manual 6.5.14)
Definition BNO08x.hpp:404
uint8_t tap_detector
Tap detector reading (See SH-2 Ref. Manual 6.5.27)
Definition BNO08x.hpp:407
uint8_t stability_classifier
BNO08xStability status reading (See SH-2 Ref. Manual 6.5.31)
Definition BNO08x.hpp:409
BNO08xStability get_stability_classifier()
Get the current stability classifier (Seee Ref. Manual 6.5.31)
Definition BNO08x.cpp:3508
uint16_t accel_accuracy
Raw acceleration readings (See SH-2 Ref. Manual 6.5.8)
Definition BNO08x.hpp:393
uint16_t accel_lin_accuracy
Raw linear acceleration (See SH-2 Ref. Manual 6.5.10)
Definition BNO08x.hpp:395
uint16_t quat_accuracy
Raw quaternion reading (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:398
void get_accel(float &x, float &y, float &z, BNO08xAccuracy &accuracy)
Get full acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:3064
uint16_t mems_raw_gyro_X
Definition BNO08x.hpp:415
BNO08xActivity get_activity_classifier()
Get the current activity classifier (Seee Ref. Manual 6.5.36)
Definition BNO08x.cpp:3527
void get_linear_accel(float &x, float &y, float &z, BNO08xAccuracy &accuracy)
Get full linear acceleration (acceleration of the device minus gravity, units in m/s^2).
Definition BNO08x.cpp:3122
esp_err_t init_config_args()
Initializes required esp-idf SPI data structures with values from user passed bno08x_config_t struct.
Definition BNO08x.cpp:124
esp_err_t init_spi()
Initializes SPI.
Definition BNO08x.cpp:372
uint16_t mems_raw_accel_Z
Raw accelerometer readings from MEMS sensor (See SH2 Ref. Manual 6.5.8)
Definition BNO08x.hpp:414
uint16_t raw_quat_J
Definition BNO08x.hpp:397
uint16_t integrated_gyro_velocity_X
Definition BNO08x.hpp:399
uint16_t raw_calib_gyro_Y
Definition BNO08x.hpp:396
uint16_t raw_quat_I
Definition BNO08x.hpp:397
uint8_t activity_classifier
BNO08xActivity status reading (See SH-2 Ref. Manual 6.5.36)
Definition BNO08x.hpp:410
uint16_t raw_accel_X
Definition BNO08x.hpp:392
uint16_t raw_quat_K
Definition BNO08x.hpp:397
uint16_t raw_quat_real
Definition BNO08x.hpp:397
void get_uncalibrated_gyro_velocity(float &x, float &y, float &z, float &bx, float &by, float &bz)
Get full rotational velocity without drift compensation (units in Rad/s). An estimate of drift is giv...
Definition BNO08x.cpp:3367
uint16_t raw_calib_gyro_X
Definition BNO08x.hpp:396
uint16_t raw_bias_X
Definition BNO08x.hpp:403
void get_integrated_gyro_velocity(float &x, float &y, float &z)
Full rotational velocity from gyro-integrated rotation vector (See Ref. Manual 6.5....
Definition BNO08x.cpp:3446
uint16_t mems_raw_magf_Z
Raw magnetometer (compass) readings from MEMS sensor (See SH-2 Ref. Manual 6.5.15)
Definition BNO08x.hpp:418
uint16_t mems_raw_accel_X
Definition BNO08x.hpp:413
esp_err_t init_hint_isr()
Initializes host interrupt ISR.
Definition BNO08x.cpp:321
uint16_t raw_magf_X
Definition BNO08x.hpp:405
void get_calibrated_gyro_velocity(float &x, float &y, float &z)
Get full rotational velocity with drift compensation (units in Rad/s).
Definition BNO08x.cpp:3317
uint16_t mems_raw_magf_Y
Definition BNO08x.hpp:417
uint16_t raw_magf_Z
Definition BNO08x.hpp:405
uint16_t raw_accel_Y
Definition BNO08x.hpp:392
uint16_t mems_raw_magf_X
Definition BNO08x.hpp:417
uint16_t mems_raw_gyro_Y
Definition BNO08x.hpp:415
uint16_t raw_lin_accel_Z
Definition BNO08x.hpp:394
uint32_t time_stamp
Report timestamp (see datasheet 1.3.5.3)
Definition BNO08x.hpp:391
void get_raw_mems_gyro(uint16_t &x, uint16_t &y, uint16_t &z)
Get raw gyroscope full reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:3225
uint16_t mems_raw_gyro_Z
Raw gyro readings from MEMS sensor (See SH-2 Ref. Manual 6.5.12)
Definition BNO08x.hpp:416
uint16_t raw_bias_Y
Definition BNO08x.hpp:403
uint16_t magf_accuracy
Calibrated magnetic field reading in uTesla (See SH-2 Ref. Manual 6.5.16)
Definition BNO08x.hpp:406
uint16_t raw_uncalib_gyro_Y
Definition BNO08x.hpp:403
uint16_t raw_magf_Y
Definition BNO08x.hpp:405
uint16_t integrated_gyro_velocity_Z
Raw gyro angular velocity reading from integrated gyro rotation vector (See SH-2 Ref....
Definition BNO08x.hpp:400
uint16_t step_count
Step counter reading (See SH-2 Ref. Manual 6.5.29)
Definition BNO08x.hpp:408
uint16_t mems_raw_accel_Y
Definition BNO08x.hpp:413
uint16_t get_step_count()
Get the counted amount of steps.
Definition BNO08x.cpp:3498
uint16_t gravity_accuracy
Gravity reading in m/s^2 (See SH-2 Ref. Manual 6.5.11)
Definition BNO08x.hpp:402
esp_err_t init_gpio()
Initializes required gpio.
Definition BNO08x.cpp:293
uint16_t raw_lin_accel_X
Definition BNO08x.hpp:394
void get_magf(float &x, float &y, float &z, BNO08xAccuracy &accuracy)
Get the full magnetic field vector.
Definition BNO08x.cpp:2745
uint16_t gravity_Y
Definition BNO08x.hpp:401
uint16_t raw_accel_Z
Definition BNO08x.hpp:392
uint16_t gravity_X
Definition BNO08x.hpp:401
uint16_t raw_calib_gyro_Z
Raw gyro reading (See SH-2 Ref. Manual 6.5.13)
Definition BNO08x.hpp:396
void get_quat(float &i, float &j, float &k, float &real, float &rad_accuracy, BNO08xAccuracy &accuracy)
Get the full quaternion reading.
Definition BNO08x.cpp:2979
uint16_t gravity_Z
Definition BNO08x.hpp:401
uint16_t raw_uncalib_gyro_Z
Definition BNO08x.hpp:403
uint16_t raw_uncalib_gyro_X
Definition BNO08x.hpp:403
uint16_t raw_lin_accel_Y
Definition BNO08x.hpp:394
BNO08x unit test helper class.
Definition BNO08xTestHelper.hpp:16
static bno08x_config_t imu_cfg
Definition BNO08xTestHelper.hpp:19
static void print_test_start_banner(const char *TEST_TAG)
Prints test begin banner.
Definition BNO08xTestHelper.hpp:88
static bool calibrated_gyro_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:343
struct BNO08xTestHelper::imu_report_data_t imu_report_data_t
IMU configuration settings passed into constructor.
static bool magnetometer_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:448
static void print_test_end_banner(const char *TEST_TAG)
Prints end begin banner.
Definition BNO08xTestHelper.hpp:100
static BNO08x * test_imu
Definition BNO08xTestHelper.hpp:18
static bool gravity_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:421
static BNO08x * get_test_imu()
Deletes test IMU calling deconstructor and releases heap allocated memory.
Definition BNO08xTestHelper.hpp:162
static esp_err_t call_init_gpio()
Used to call private BNO08x::init_gpio() member for tests.
Definition BNO08xTestHelper.hpp:185
static void create_test_imu()
Calls BNO08x constructor and creates new test IMU on heap.
Definition BNO08xTestHelper.hpp:135
static esp_err_t call_init_config_args()
Used to call private BNO08x::init_config_args() member for tests.
Definition BNO08xTestHelper.hpp:172
static esp_err_t call_init_spi()
Used to call private BNO08x::init_spi() member for tests.
Definition BNO08xTestHelper.hpp:211
static void print_test_msg(const char *TEST_TAG, const char *msg)
Prints a message during a test.
Definition BNO08xTestHelper.hpp:113
static esp_err_t call_init_hint_isr()
Used to call private BNO08x::init_hint_isr() member for tests.
Definition BNO08xTestHelper.hpp:198
static const char * BNO08xAccuracy_to_str(BNO08xAccuracy accuracy)
Converts BNO08xAccuracy enum class object to string.
Definition BNO08xTestHelper.hpp:628
static bool stability_classifier_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:493
static void set_test_imu_cfg(bno08x_config_t cfg)
Set test imu configuration used with create_test_imu()
Definition BNO08xTestHelper.hpp:125
static const constexpr char * TAG
Definition BNO08xTestHelper.hpp:21
static bool step_counter_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:475
static bool gyro_integrated_rotation_vector_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:274
static void update_report_data(imu_report_data_t *report_data)
Updates report data with calls relevant test_imu methods.
Definition BNO08xTestHelper.hpp:528
static const char * BNO08xActivity_to_str(BNO08xActivity activity)
Converts BNO08xActivity enum class object to string.
Definition BNO08xTestHelper.hpp:676
static bool linear_accelerometer_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:394
static bool uncalibrated_gyro_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:310
static void reset_all_imu_data_to_test_defaults()
Resets internal test imu data with test defaults.
Definition BNO08xTestHelper.hpp:554
static bool accelerometer_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:367
static esp_err_t call_launch_tasks()
Used to call private BNO08x::launch_tasks() member for tests.
Definition BNO08xTestHelper.hpp:224
static void destroy_test_imu()
Deletes test IMU calling deconstructor and releases heap allocated memory.
Definition BNO08xTestHelper.hpp:148
static const char * BNO08xStability_to_str(BNO08xStability stability)
Converts BNO08xStability enum class object to string.
Definition BNO08xTestHelper.hpp:652
static bool rotation_vector_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:240
static bool activity_classifier_data_is_new(imu_report_data_t *report_data, imu_report_data_t *default_report_data)
Checks if report_data matches the default states stored within prev_report_data data for respective r...
Definition BNO08xTestHelper.hpp:511
IMU configuration settings passed into constructor.
Definition BNO08xTestHelper.hpp:26
BNO08xActivity activity_classifier
Definition BNO08xTestHelper.hpp:77
float integrated_gyro_vel_x
Definition BNO08xTestHelper.hpp:36
BNO08xAccuracy magf_accuracy
Definition BNO08xTestHelper.hpp:69
float magf_x
Definition BNO08xTestHelper.hpp:66
float grav_y
Definition BNO08xTestHelper.hpp:51
float integrated_gyro_vel_z
Definition BNO08xTestHelper.hpp:38
float quat_J
Definition BNO08xTestHelper.hpp:30
float uncalib_gyro_drift_z
Definition BNO08xTestHelper.hpp:64
float uncalib_gyro_vel_x
Definition BNO08xTestHelper.hpp:59
float uncalib_gyro_drift_y
Definition BNO08xTestHelper.hpp:63
float lin_accel_x
Definition BNO08xTestHelper.hpp:45
float quat_K
Definition BNO08xTestHelper.hpp:31
BNO08xAccuracy lin_accel_accuracy
Definition BNO08xTestHelper.hpp:48
float magf_z
Definition BNO08xTestHelper.hpp:68
float lin_accel_y
Definition BNO08xTestHelper.hpp:46
float lin_accel_z
Definition BNO08xTestHelper.hpp:47
float accel_x
Definition BNO08xTestHelper.hpp:40
BNO08xAccuracy grav_accuracy
Definition BNO08xTestHelper.hpp:53
float calib_gyro_vel_z
Definition BNO08xTestHelper.hpp:57
float accel_y
Definition BNO08xTestHelper.hpp:41
uint16_t raw_mems_gyro_y
Definition BNO08xTestHelper.hpp:72
float quat_real
Definition BNO08xTestHelper.hpp:32
BNO08xStability stability_classifier
Definition BNO08xTestHelper.hpp:76
float magf_y
Definition BNO08xTestHelper.hpp:67
float calib_gyro_vel_x
Definition BNO08xTestHelper.hpp:55
float quat_I
Definition BNO08xTestHelper.hpp:29
uint16_t raw_mems_gyro_x
Definition BNO08xTestHelper.hpp:71
uint16_t raw_mems_gyro_z
Definition BNO08xTestHelper.hpp:73
BNO08xAccuracy quat_accuracy
Definition BNO08xTestHelper.hpp:34
float uncalib_gyro_vel_z
Definition BNO08xTestHelper.hpp:61
BNO08xAccuracy accel_accuracy
Definition BNO08xTestHelper.hpp:43
float uncalib_gyro_drift_x
Definition BNO08xTestHelper.hpp:62
float grav_x
Definition BNO08xTestHelper.hpp:50
float uncalib_gyro_vel_y
Definition BNO08xTestHelper.hpp:60
float quat_radian_accuracy
Definition BNO08xTestHelper.hpp:33
uint32_t time_stamp
Definition BNO08xTestHelper.hpp:27
uint16_t step_count
Definition BNO08xTestHelper.hpp:75
float accel_z
Definition BNO08xTestHelper.hpp:42
float grav_z
Definition BNO08xTestHelper.hpp:52
float integrated_gyro_vel_y
Definition BNO08xTestHelper.hpp:37
float calib_gyro_vel_y
Definition BNO08xTestHelper.hpp:56
IMU configuration settings passed into constructor.
Definition BNO08x_global_types.hpp:74