Loading...
Searching...
No Matches
BNO08xTestHelper.hpp
Go to the documentation of this file.
#pragma once
#include "stdio.h"
#include "BNO08x.hpp"
class BNO08xTestHelper
{
private:
inline static BNO08x* test_imu = nullptr;
inline static bno08x_config_t imu_cfg;
static const constexpr char* TAG = "BNO08xTestHelper";
public:
typedef struct imu_report_data_t
{
uint32_t time_stamp;
float quat_I;
float quat_J;
float quat_K;
float quat_real;
float quat_radian_accuracy;
BNO08xAccuracy quat_accuracy;
float integrated_gyro_vel_x;
float integrated_gyro_vel_y;
float integrated_gyro_vel_z;
float accel_x;
float accel_y;
float accel_z;
BNO08xAccuracy accel_accuracy;
float lin_accel_x;
float lin_accel_y;
float lin_accel_z;
BNO08xAccuracy lin_accel_accuracy;
float grav_x;
float grav_y;
float grav_z;
BNO08xAccuracy grav_accuracy;
float calib_gyro_vel_x;
float calib_gyro_vel_y;
float calib_gyro_vel_z;
float uncalib_gyro_vel_x;
float uncalib_gyro_vel_y;
float uncalib_gyro_vel_z;
float uncalib_gyro_drift_x;
float uncalib_gyro_drift_y;
float uncalib_gyro_drift_z;
float magf_x;
float magf_y;
float magf_z;
BNO08xAccuracy magf_accuracy;
uint16_t raw_mems_gyro_x;
uint16_t raw_mems_gyro_y;
uint16_t raw_mems_gyro_z;
uint16_t step_count;
BNO08xStability stability_classifier;
BNO08xActivity activity_classifier;
} imu_report_data_t;
static void print_test_start_banner(const char* TEST_TAG)
{
printf("------------------------ BEGIN TEST: %s ------------------------\n\r", TEST_TAG);
}
static void print_test_end_banner(const char* TEST_TAG)
{
printf("------------------------ END TEST: %s ------------------------\n\r", TEST_TAG);
}
static void print_test_msg(const char* TEST_TAG, const char* msg)
{
printf("%s: %s: %s\n\r", TAG, TEST_TAG, msg);
}
static void set_test_imu_cfg(bno08x_config_t cfg)
{
imu_cfg = cfg;
}
static void create_test_imu()
{
if (test_imu != nullptr)
destroy_test_imu();
test_imu = new BNO08x();
}
static void destroy_test_imu()
{
if (test_imu != nullptr)
{
delete test_imu;
test_imu = nullptr;
}
}
static BNO08x* get_test_imu()
{
return test_imu;
}
static esp_err_t call_init_config_args()
{
if (test_imu == nullptr)
return ESP_FAIL;
return test_imu->init_config_args();
}
static esp_err_t call_init_gpio()
{
if (test_imu == nullptr)
return ESP_FAIL;
return test_imu->init_gpio();
}
static esp_err_t call_init_hint_isr()
{
if (test_imu == nullptr)
return ESP_FAIL;
return test_imu->init_hint_isr();
}
static esp_err_t call_init_spi()
{
if (test_imu == nullptr)
return ESP_FAIL;
return test_imu->init_spi();
}
static esp_err_t call_launch_tasks()
{
if (test_imu == nullptr)
return ESP_FAIL;
return test_imu->launch_tasks();
}
static bool rotation_vector_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
// prev report should always contain the default test values as per test structure
if (report_data->quat_I != default_report_data->quat_I)
new_data = true;
if (report_data->quat_J != default_report_data->quat_J)
new_data = true;
if (report_data->quat_K != default_report_data->quat_K)
new_data = true;
if (report_data->quat_real != default_report_data->quat_real)
new_data = true;
if (report_data->quat_accuracy != default_report_data->quat_accuracy)
new_data = true;
if (report_data->quat_radian_accuracy != default_report_data->quat_radian_accuracy)
new_data = true;
return new_data;
}
static bool gyro_integrated_rotation_vector_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->quat_I != default_report_data->quat_I)
new_data = true;
if (report_data->quat_J != default_report_data->quat_J)
new_data = true;
if (report_data->quat_K != default_report_data->quat_K)
new_data = true;
if (report_data->quat_real != default_report_data->quat_real)
new_data = true;
if (report_data->integrated_gyro_vel_x != default_report_data->integrated_gyro_vel_x)
new_data = true;
if (report_data->integrated_gyro_vel_y != default_report_data->integrated_gyro_vel_y)
new_data = true;
if (report_data->integrated_gyro_vel_z != default_report_data->integrated_gyro_vel_z)
new_data = true;
return new_data;
}
static bool uncalibrated_gyro_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->uncalib_gyro_vel_x != default_report_data->uncalib_gyro_vel_x)
new_data = true;
if (report_data->uncalib_gyro_vel_y != default_report_data->uncalib_gyro_vel_y)
new_data = true;
if (report_data->uncalib_gyro_vel_z != default_report_data->uncalib_gyro_vel_z)
new_data = true;
if (report_data->uncalib_gyro_drift_x != default_report_data->uncalib_gyro_drift_x)
new_data = true;
if (report_data->uncalib_gyro_drift_y != default_report_data->uncalib_gyro_drift_y)
new_data = true;
if (report_data->uncalib_gyro_drift_z != default_report_data->uncalib_gyro_drift_z)
new_data = true;
return new_data;
}
static bool calibrated_gyro_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->calib_gyro_vel_x != default_report_data->calib_gyro_vel_x)
new_data = true;
if (report_data->calib_gyro_vel_y != default_report_data->calib_gyro_vel_y)
new_data = true;
if (report_data->calib_gyro_vel_z != default_report_data->calib_gyro_vel_z)
new_data = true;
return new_data;
}
static bool accelerometer_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->accel_x != default_report_data->accel_x)
new_data = true;
if (report_data->accel_y != default_report_data->accel_y)
new_data = true;
if (report_data->accel_z != default_report_data->accel_z)
new_data = true;
if (report_data->accel_accuracy != default_report_data->accel_accuracy)
new_data = true;
return new_data;
}
static bool linear_accelerometer_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->lin_accel_x != default_report_data->lin_accel_x)
new_data = true;
if (report_data->lin_accel_y != default_report_data->lin_accel_y)
new_data = true;
if (report_data->lin_accel_z != default_report_data->lin_accel_z)
new_data = true;
if (report_data->lin_accel_accuracy != default_report_data->lin_accel_accuracy)
new_data = true;
return new_data;
}
static bool gravity_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->grav_x != default_report_data->grav_x)
new_data = true;
if (report_data->grav_y != default_report_data->grav_y)
new_data = true;
if (report_data->grav_z != default_report_data->grav_z)
new_data = true;
if (report_data->grav_accuracy != default_report_data->grav_accuracy)
new_data = true;
return new_data;
}
static bool magnetometer_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->magf_x != default_report_data->magf_x)
new_data = true;
if (report_data->magf_y != default_report_data->magf_y)
new_data = true;
if (report_data->magf_z != default_report_data->magf_z)
new_data = true;
if (report_data->magf_accuracy != default_report_data->magf_accuracy)
new_data = true;
return new_data;
}
static bool step_counter_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->step_count != default_report_data->step_count)
new_data = true;
return new_data;
}
static bool stability_classifier_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->stability_classifier != default_report_data->stability_classifier)
new_data = true;
return new_data;
}
static bool activity_classifier_data_is_new(imu_report_data_t* report_data, imu_report_data_t* default_report_data)
{
bool new_data = false;
if (report_data->activity_classifier != default_report_data->activity_classifier)
new_data = true;
return new_data;
}
static void update_report_data(imu_report_data_t* report_data)
{
test_imu->get_quat(report_data->quat_I, report_data->quat_J, report_data->quat_K, report_data->quat_real,
report_data->quat_radian_accuracy, report_data->quat_accuracy);
test_imu->get_integrated_gyro_velocity(
report_data->integrated_gyro_vel_x, report_data->integrated_gyro_vel_y, report_data->integrated_gyro_vel_z);
test_imu->get_accel(report_data->accel_x, report_data->accel_y, report_data->accel_z, report_data->accel_accuracy);
test_imu->get_linear_accel(report_data->lin_accel_x, report_data->lin_accel_y, report_data->lin_accel_z, report_data->lin_accel_accuracy);
test_imu->get_gravity(report_data->grav_x, report_data->grav_y, report_data->grav_z, report_data->grav_accuracy);
test_imu->get_calibrated_gyro_velocity(report_data->calib_gyro_vel_x, report_data->calib_gyro_vel_y, report_data->calib_gyro_vel_z);
test_imu->get_uncalibrated_gyro_velocity(report_data->uncalib_gyro_vel_x, report_data->uncalib_gyro_vel_y,
report_data->uncalib_gyro_vel_z, report_data->uncalib_gyro_drift_x, report_data->uncalib_gyro_drift_y,
report_data->uncalib_gyro_drift_z);
test_imu->get_magf(report_data->magf_x, report_data->magf_y, report_data->magf_z, report_data->magf_accuracy);
test_imu->get_raw_mems_gyro(report_data->raw_mems_gyro_x, report_data->raw_mems_gyro_y, report_data->raw_mems_gyro_z);
report_data->step_count = test_imu->get_step_count();
report_data->stability_classifier = test_imu->get_stability_classifier();
report_data->activity_classifier = test_imu->get_activity_classifier();
}
static void reset_all_imu_data_to_test_defaults()
{
static const constexpr uint16_t TEST_VAL_UINT16 = 65535U;
static const constexpr uint16_t TEST_VAL_UINT8 = 255;
test_imu->time_stamp = 0UL;
test_imu->raw_accel_X = TEST_VAL_UINT16;
test_imu->raw_accel_Y = TEST_VAL_UINT16;
test_imu->raw_accel_Z = TEST_VAL_UINT16;
test_imu->accel_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
test_imu->raw_lin_accel_X = TEST_VAL_UINT16;
test_imu->raw_lin_accel_Y = TEST_VAL_UINT16;
test_imu->raw_lin_accel_Z = TEST_VAL_UINT16;
test_imu->accel_lin_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
test_imu->raw_calib_gyro_X = TEST_VAL_UINT16;
test_imu->raw_calib_gyro_Y = TEST_VAL_UINT16;
test_imu->raw_calib_gyro_Z = TEST_VAL_UINT16;
// reset quaternion to nan
test_imu->raw_quat_I = TEST_VAL_UINT16;
test_imu->raw_quat_J = TEST_VAL_UINT16;
test_imu->raw_quat_K = TEST_VAL_UINT16;
test_imu->raw_quat_real = TEST_VAL_UINT16;
test_imu->raw_quat_radian_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
test_imu->quat_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
test_imu->integrated_gyro_velocity_X = TEST_VAL_UINT16;
test_imu->integrated_gyro_velocity_Y = TEST_VAL_UINT16;
test_imu->integrated_gyro_velocity_Z = TEST_VAL_UINT16;
test_imu->gravity_X = TEST_VAL_UINT16;
test_imu->gravity_Y = TEST_VAL_UINT16;
test_imu->gravity_Z = TEST_VAL_UINT16;
test_imu->gravity_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
test_imu->raw_uncalib_gyro_X = TEST_VAL_UINT16;
test_imu->raw_uncalib_gyro_Y = TEST_VAL_UINT16;
test_imu->raw_uncalib_gyro_Z = TEST_VAL_UINT16;
test_imu->raw_bias_X = TEST_VAL_UINT16;
test_imu->raw_bias_Y = TEST_VAL_UINT16;
test_imu->raw_bias_Z = TEST_VAL_UINT16;
test_imu->raw_magf_X = TEST_VAL_UINT16;
test_imu->raw_magf_Y = TEST_VAL_UINT16;
test_imu->raw_magf_Z = TEST_VAL_UINT16;
test_imu->magf_accuracy = static_cast<uint16_t>(BNO08xAccuracy::UNDEFINED);
test_imu->tap_detector = TEST_VAL_UINT8;
test_imu->step_count = TEST_VAL_UINT16;
test_imu->stability_classifier = static_cast<uint16_t>(BNO08xStability::UNDEFINED);
test_imu->activity_classifier = static_cast<uint16_t>(BNO08xActivity::UNDEFINED);
test_imu->mems_raw_accel_X = TEST_VAL_UINT16;
test_imu->mems_raw_accel_Y = TEST_VAL_UINT16;
test_imu->mems_raw_accel_Z = TEST_VAL_UINT16;
test_imu->mems_raw_gyro_X = TEST_VAL_UINT16;
test_imu->mems_raw_gyro_Y = TEST_VAL_UINT16;
test_imu->mems_raw_gyro_Z = TEST_VAL_UINT16;
test_imu->mems_raw_magf_X = TEST_VAL_UINT16;
test_imu->mems_raw_magf_Y = TEST_VAL_UINT16;
test_imu->mems_raw_magf_Z = TEST_VAL_UINT16;
}
static const char* BNO08xAccuracy_to_str(BNO08xAccuracy accuracy)
{
switch (accuracy)
{
case BNO08xAccuracy::LOW:
return "LOW";
case BNO08xAccuracy::MED:
return "MED";
case BNO08xAccuracy::HIGH:
return "HIGH";
case BNO08xAccuracy::UNDEFINED:
return "UNDEFINED";
default:
return "INVALID";
}
};
static const char* BNO08xStability_to_str(BNO08xStability stability)
{
switch (stability)
{
case BNO08xStability::UNKNOWN:
return "UNKNOWN";
case BNO08xStability::ON_TABLE:
return "ON TABLE";
case BNO08xStability::STATIONARY:
return "STATIONARY";
case BNO08xStability::UNDEFINED:
return "UNDEFINED";
default:
return "INVALID";
}
}
static const char* BNO08xActivity_to_str(BNO08xActivity activity)
{
switch (activity)
{
case BNO08xActivity::UNKNOWN:
return "UNKNOWN";
case BNO08xActivity::IN_VEHICLE:
return "IN VEHICLE";
case BNO08xActivity::ON_BICYCLE:
return "ON BICYCLE";
case BNO08xActivity::ON_FOOT:
return "ON FOOT";
case BNO08xActivity::STILL:
return "STILL";
case BNO08xActivity::TILTING:
return "TILTING";
case BNO08xActivity::WALKING:
return "WALKING";
case BNO08xActivity::RUNNING:
return "RUNNING";
case BNO08xActivity::ON_STAIRS:
return "ON STAIRS";
case BNO08xActivity::UNDEFINED:
return "UNDEFINED";
default:
return "INVALID";
}
}
};
BNO08x.hpp
BNO08xStability
BNO08xStability
BNO08xStability states returned from get_stability_classifier()
Definition BNO08x_global_types.hpp:65
BNO08xStability::UNDEFINED
@ UNDEFINED
BNO08xStability::STATIONARY
@ STATIONARY
BNO08xStability::UNKNOWN
@ UNKNOWN
BNO08xStability::ON_TABLE
@ ON_TABLE
BNO08xActivity
BNO08xActivity
BNO08xActivity states returned from get_activity_classifier()
Definition BNO08x_global_types.hpp:50
BNO08xActivity::UNDEFINED
@ UNDEFINED
BNO08xActivity::RUNNING
@ RUNNING
BNO08xActivity::WALKING
@ WALKING
BNO08xActivity::UNKNOWN
@ UNKNOWN
BNO08xActivity::TILTING
@ TILTING
BNO08xActivity::ON_FOOT
@ ON_FOOT
BNO08xActivity::STILL
@ STILL
BNO08xActivity::ON_BICYCLE
@ ON_BICYCLE
BNO08xActivity::IN_VEHICLE
@ IN_VEHICLE
BNO08xActivity::ON_STAIRS
@ ON_STAIRS
BNO08xAccuracy
BNO08xAccuracy
Sensor accuracy returned during sensor calibration.
Definition BNO08x_global_types.hpp:13
BNO08xAccuracy::UNDEFINED
@ UNDEFINED
BNO08xAccuracy::MED
@ MED
BNO08xAccuracy::LOW
@ LOW
BNO08xAccuracy::HIGH
@ HIGH
report_data
BNO08xTestHelper::imu_report_data_t report_data
Definition CallbackTests.cpp:21
new_data
bool new_data
Definition CallbackTests.cpp:25
BNO08x
BNO08x IMU driver class.
Definition BNO08x.hpp:34
BNO08x::integrated_gyro_velocity_Y
uint16_t integrated_gyro_velocity_Y
Definition BNO08x.hpp:399
BNO08x::raw_quat_radian_accuracy
uint16_t raw_quat_radian_accuracy
Definition BNO08x.hpp:397
BNO08x::get_gravity
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
BNO08x::launch_tasks
esp_err_t launch_tasks()
Launches spi_task and data_proc_task on constructor call.
Definition BNO08x.cpp:4003
BNO08x::raw_bias_Z
uint16_t raw_bias_Z
Uncalibrated gyro reading (See SH-2 Ref. Manual 6.5.14)
Definition BNO08x.hpp:404
BNO08x::tap_detector
uint8_t tap_detector
Tap detector reading (See SH-2 Ref. Manual 6.5.27)
Definition BNO08x.hpp:407
BNO08x::stability_classifier
uint8_t stability_classifier
BNO08xStability status reading (See SH-2 Ref. Manual 6.5.31)
Definition BNO08x.hpp:409
BNO08x::get_stability_classifier
BNO08xStability get_stability_classifier()
Get the current stability classifier (Seee Ref. Manual 6.5.31)
Definition BNO08x.cpp:3508
BNO08x::accel_accuracy
uint16_t accel_accuracy
Raw acceleration readings (See SH-2 Ref. Manual 6.5.8)
Definition BNO08x.hpp:393
BNO08x::accel_lin_accuracy
uint16_t accel_lin_accuracy
Raw linear acceleration (See SH-2 Ref. Manual 6.5.10)
Definition BNO08x.hpp:395
BNO08x::quat_accuracy
uint16_t quat_accuracy
Raw quaternion reading (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:398
BNO08x::get_accel
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
BNO08x::mems_raw_gyro_X
uint16_t mems_raw_gyro_X
Definition BNO08x.hpp:415
BNO08x::get_activity_classifier
BNO08xActivity get_activity_classifier()
Get the current activity classifier (Seee Ref. Manual 6.5.36)
Definition BNO08x.cpp:3527
BNO08x::get_linear_accel
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
BNO08x::init_config_args
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
BNO08x::init_spi
esp_err_t init_spi()
Initializes SPI.
Definition BNO08x.cpp:372
BNO08x::mems_raw_accel_Z
uint16_t mems_raw_accel_Z
Raw accelerometer readings from MEMS sensor (See SH2 Ref. Manual 6.5.8)
Definition BNO08x.hpp:414
BNO08x::raw_quat_J
uint16_t raw_quat_J
Definition BNO08x.hpp:397
BNO08x::integrated_gyro_velocity_X
uint16_t integrated_gyro_velocity_X
Definition BNO08x.hpp:399
BNO08x::raw_calib_gyro_Y
uint16_t raw_calib_gyro_Y
Definition BNO08x.hpp:396
BNO08x::raw_quat_I
uint16_t raw_quat_I
Definition BNO08x.hpp:397
BNO08x::activity_classifier
uint8_t activity_classifier
BNO08xActivity status reading (See SH-2 Ref. Manual 6.5.36)
Definition BNO08x.hpp:410
BNO08x::raw_accel_X
uint16_t raw_accel_X
Definition BNO08x.hpp:392
BNO08x::raw_quat_K
uint16_t raw_quat_K
Definition BNO08x.hpp:397
BNO08x::raw_quat_real
uint16_t raw_quat_real
Definition BNO08x.hpp:397
BNO08x::get_uncalibrated_gyro_velocity
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
BNO08x::raw_calib_gyro_X
uint16_t raw_calib_gyro_X
Definition BNO08x.hpp:396
BNO08x::raw_bias_X
uint16_t raw_bias_X
Definition BNO08x.hpp:403
BNO08x::get_integrated_gyro_velocity
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
BNO08x::mems_raw_magf_Z
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
BNO08x::mems_raw_accel_X
uint16_t mems_raw_accel_X
Definition BNO08x.hpp:413
BNO08x::init_hint_isr
esp_err_t init_hint_isr()
Initializes host interrupt ISR.
Definition BNO08x.cpp:321
BNO08x::raw_magf_X
uint16_t raw_magf_X
Definition BNO08x.hpp:405
BNO08x::get_calibrated_gyro_velocity
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
BNO08x::mems_raw_magf_Y
uint16_t mems_raw_magf_Y
Definition BNO08x.hpp:417
BNO08x::raw_magf_Z
uint16_t raw_magf_Z
Definition BNO08x.hpp:405
BNO08x::raw_accel_Y
uint16_t raw_accel_Y
Definition BNO08x.hpp:392
BNO08x::mems_raw_magf_X
uint16_t mems_raw_magf_X
Definition BNO08x.hpp:417
BNO08x::mems_raw_gyro_Y
uint16_t mems_raw_gyro_Y
Definition BNO08x.hpp:415
BNO08x::raw_lin_accel_Z
uint16_t raw_lin_accel_Z
Definition BNO08x.hpp:394
BNO08x::time_stamp
uint32_t time_stamp
Report timestamp (see datasheet 1.3.5.3)
Definition BNO08x.hpp:391
BNO08x::get_raw_mems_gyro
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
BNO08x::mems_raw_gyro_Z
uint16_t mems_raw_gyro_Z
Raw gyro readings from MEMS sensor (See SH-2 Ref. Manual 6.5.12)
Definition BNO08x.hpp:416
BNO08x::raw_bias_Y
uint16_t raw_bias_Y
Definition BNO08x.hpp:403
BNO08x::magf_accuracy
uint16_t magf_accuracy
Calibrated magnetic field reading in uTesla (See SH-2 Ref. Manual 6.5.16)
Definition BNO08x.hpp:406
BNO08x::raw_uncalib_gyro_Y
uint16_t raw_uncalib_gyro_Y
Definition BNO08x.hpp:403
BNO08x::raw_magf_Y
uint16_t raw_magf_Y
Definition BNO08x.hpp:405
BNO08x::integrated_gyro_velocity_Z
uint16_t integrated_gyro_velocity_Z
Raw gyro angular velocity reading from integrated gyro rotation vector (See SH-2 Ref....
Definition BNO08x.hpp:400
BNO08x::step_count
uint16_t step_count
Step counter reading (See SH-2 Ref. Manual 6.5.29)
Definition BNO08x.hpp:408
BNO08x::mems_raw_accel_Y
uint16_t mems_raw_accel_Y
Definition BNO08x.hpp:413
BNO08x::get_step_count
uint16_t get_step_count()
Get the counted amount of steps.
Definition BNO08x.cpp:3498
BNO08x::gravity_accuracy
uint16_t gravity_accuracy
Gravity reading in m/s^2 (See SH-2 Ref. Manual 6.5.11)
Definition BNO08x.hpp:402
BNO08x::init_gpio
esp_err_t init_gpio()
Initializes required gpio.
Definition BNO08x.cpp:293
BNO08x::raw_lin_accel_X
uint16_t raw_lin_accel_X
Definition BNO08x.hpp:394
BNO08x::get_magf
void get_magf(float &x, float &y, float &z, BNO08xAccuracy &accuracy)
Get the full magnetic field vector.
Definition BNO08x.cpp:2745
BNO08x::gravity_Y
uint16_t gravity_Y
Definition BNO08x.hpp:401
BNO08x::raw_accel_Z
uint16_t raw_accel_Z
Definition BNO08x.hpp:392
BNO08x::gravity_X
uint16_t gravity_X
Definition BNO08x.hpp:401
BNO08x::raw_calib_gyro_Z
uint16_t raw_calib_gyro_Z
Raw gyro reading (See SH-2 Ref. Manual 6.5.13)
Definition BNO08x.hpp:396
BNO08x::get_quat
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
BNO08x::gravity_Z
uint16_t gravity_Z
Definition BNO08x.hpp:401
BNO08x::raw_uncalib_gyro_Z
uint16_t raw_uncalib_gyro_Z
Definition BNO08x.hpp:403
BNO08x::raw_uncalib_gyro_X
uint16_t raw_uncalib_gyro_X
Definition BNO08x.hpp:403
BNO08x::raw_lin_accel_Y
uint16_t raw_lin_accel_Y
Definition BNO08x.hpp:394
BNO08xTestHelper
BNO08x unit test helper class.
Definition BNO08xTestHelper.hpp:16
BNO08xTestHelper::imu_cfg
static bno08x_config_t imu_cfg
Definition BNO08xTestHelper.hpp:19
BNO08xTestHelper::print_test_start_banner
static void print_test_start_banner(const char *TEST_TAG)
Prints test begin banner.
Definition BNO08xTestHelper.hpp:88
BNO08xTestHelper::calibrated_gyro_data_is_new
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
BNO08xTestHelper::imu_report_data_t
struct BNO08xTestHelper::imu_report_data_t imu_report_data_t
IMU configuration settings passed into constructor.
BNO08xTestHelper::magnetometer_data_is_new
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
BNO08xTestHelper::print_test_end_banner
static void print_test_end_banner(const char *TEST_TAG)
Prints end begin banner.
Definition BNO08xTestHelper.hpp:100
BNO08xTestHelper::test_imu
static BNO08x * test_imu
Definition BNO08xTestHelper.hpp:18
BNO08xTestHelper::gravity_data_is_new
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
BNO08xTestHelper::get_test_imu
static BNO08x * get_test_imu()
Deletes test IMU calling deconstructor and releases heap allocated memory.
Definition BNO08xTestHelper.hpp:162
BNO08xTestHelper::call_init_gpio
static esp_err_t call_init_gpio()
Used to call private BNO08x::init_gpio() member for tests.
Definition BNO08xTestHelper.hpp:185
BNO08xTestHelper::create_test_imu
static void create_test_imu()
Calls BNO08x constructor and creates new test IMU on heap.
Definition BNO08xTestHelper.hpp:135
BNO08xTestHelper::call_init_config_args
static esp_err_t call_init_config_args()
Used to call private BNO08x::init_config_args() member for tests.
Definition BNO08xTestHelper.hpp:172
BNO08xTestHelper::call_init_spi
static esp_err_t call_init_spi()
Used to call private BNO08x::init_spi() member for tests.
Definition BNO08xTestHelper.hpp:211
BNO08xTestHelper::print_test_msg
static void print_test_msg(const char *TEST_TAG, const char *msg)
Prints a message during a test.
Definition BNO08xTestHelper.hpp:113
BNO08xTestHelper::call_init_hint_isr
static esp_err_t call_init_hint_isr()
Used to call private BNO08x::init_hint_isr() member for tests.
Definition BNO08xTestHelper.hpp:198
BNO08xTestHelper::BNO08xAccuracy_to_str
static const char * BNO08xAccuracy_to_str(BNO08xAccuracy accuracy)
Converts BNO08xAccuracy enum class object to string.
Definition BNO08xTestHelper.hpp:628
BNO08xTestHelper::stability_classifier_data_is_new
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
BNO08xTestHelper::set_test_imu_cfg
static void set_test_imu_cfg(bno08x_config_t cfg)
Set test imu configuration used with create_test_imu()
Definition BNO08xTestHelper.hpp:125
BNO08xTestHelper::TAG
static const constexpr char * TAG
Definition BNO08xTestHelper.hpp:21
BNO08xTestHelper::step_counter_data_is_new
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
BNO08xTestHelper::gyro_integrated_rotation_vector_data_is_new
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
BNO08xTestHelper::update_report_data
static void update_report_data(imu_report_data_t *report_data)
Updates report data with calls relevant test_imu methods.
Definition BNO08xTestHelper.hpp:528
BNO08xTestHelper::BNO08xActivity_to_str
static const char * BNO08xActivity_to_str(BNO08xActivity activity)
Converts BNO08xActivity enum class object to string.
Definition BNO08xTestHelper.hpp:676
BNO08xTestHelper::linear_accelerometer_data_is_new
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
BNO08xTestHelper::uncalibrated_gyro_data_is_new
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
BNO08xTestHelper::reset_all_imu_data_to_test_defaults
static void reset_all_imu_data_to_test_defaults()
Resets internal test imu data with test defaults.
Definition BNO08xTestHelper.hpp:554
BNO08xTestHelper::accelerometer_data_is_new
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
BNO08xTestHelper::call_launch_tasks
static esp_err_t call_launch_tasks()
Used to call private BNO08x::launch_tasks() member for tests.
Definition BNO08xTestHelper.hpp:224
BNO08xTestHelper::destroy_test_imu
static void destroy_test_imu()
Deletes test IMU calling deconstructor and releases heap allocated memory.
Definition BNO08xTestHelper.hpp:148
BNO08xTestHelper::BNO08xStability_to_str
static const char * BNO08xStability_to_str(BNO08xStability stability)
Converts BNO08xStability enum class object to string.
Definition BNO08xTestHelper.hpp:652
BNO08xTestHelper::rotation_vector_data_is_new
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
BNO08xTestHelper::activity_classifier_data_is_new
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
BNO08xTestHelper::imu_report_data_t
IMU configuration settings passed into constructor.
Definition BNO08xTestHelper.hpp:26
BNO08xTestHelper::imu_report_data_t::activity_classifier
BNO08xActivity activity_classifier
Definition BNO08xTestHelper.hpp:77
BNO08xTestHelper::imu_report_data_t::integrated_gyro_vel_x
float integrated_gyro_vel_x
Definition BNO08xTestHelper.hpp:36
BNO08xTestHelper::imu_report_data_t::magf_accuracy
BNO08xAccuracy magf_accuracy
Definition BNO08xTestHelper.hpp:69
BNO08xTestHelper::imu_report_data_t::magf_x
float magf_x
Definition BNO08xTestHelper.hpp:66
BNO08xTestHelper::imu_report_data_t::grav_y
float grav_y
Definition BNO08xTestHelper.hpp:51
BNO08xTestHelper::imu_report_data_t::integrated_gyro_vel_z
float integrated_gyro_vel_z
Definition BNO08xTestHelper.hpp:38
BNO08xTestHelper::imu_report_data_t::quat_J
float quat_J
Definition BNO08xTestHelper.hpp:30
BNO08xTestHelper::imu_report_data_t::uncalib_gyro_drift_z
float uncalib_gyro_drift_z
Definition BNO08xTestHelper.hpp:64
BNO08xTestHelper::imu_report_data_t::uncalib_gyro_vel_x
float uncalib_gyro_vel_x
Definition BNO08xTestHelper.hpp:59
BNO08xTestHelper::imu_report_data_t::uncalib_gyro_drift_y
float uncalib_gyro_drift_y
Definition BNO08xTestHelper.hpp:63
BNO08xTestHelper::imu_report_data_t::lin_accel_x
float lin_accel_x
Definition BNO08xTestHelper.hpp:45
BNO08xTestHelper::imu_report_data_t::quat_K
float quat_K
Definition BNO08xTestHelper.hpp:31
BNO08xTestHelper::imu_report_data_t::lin_accel_accuracy
BNO08xAccuracy lin_accel_accuracy
Definition BNO08xTestHelper.hpp:48
BNO08xTestHelper::imu_report_data_t::magf_z
float magf_z
Definition BNO08xTestHelper.hpp:68
BNO08xTestHelper::imu_report_data_t::lin_accel_y
float lin_accel_y
Definition BNO08xTestHelper.hpp:46
BNO08xTestHelper::imu_report_data_t::lin_accel_z
float lin_accel_z
Definition BNO08xTestHelper.hpp:47
BNO08xTestHelper::imu_report_data_t::accel_x
float accel_x
Definition BNO08xTestHelper.hpp:40
BNO08xTestHelper::imu_report_data_t::grav_accuracy
BNO08xAccuracy grav_accuracy
Definition BNO08xTestHelper.hpp:53
BNO08xTestHelper::imu_report_data_t::calib_gyro_vel_z
float calib_gyro_vel_z
Definition BNO08xTestHelper.hpp:57
BNO08xTestHelper::imu_report_data_t::accel_y
float accel_y
Definition BNO08xTestHelper.hpp:41
BNO08xTestHelper::imu_report_data_t::raw_mems_gyro_y
uint16_t raw_mems_gyro_y
Definition BNO08xTestHelper.hpp:72
BNO08xTestHelper::imu_report_data_t::quat_real
float quat_real
Definition BNO08xTestHelper.hpp:32
BNO08xTestHelper::imu_report_data_t::stability_classifier
BNO08xStability stability_classifier
Definition BNO08xTestHelper.hpp:76
BNO08xTestHelper::imu_report_data_t::magf_y
float magf_y
Definition BNO08xTestHelper.hpp:67
BNO08xTestHelper::imu_report_data_t::calib_gyro_vel_x
float calib_gyro_vel_x
Definition BNO08xTestHelper.hpp:55
BNO08xTestHelper::imu_report_data_t::quat_I
float quat_I
Definition BNO08xTestHelper.hpp:29
BNO08xTestHelper::imu_report_data_t::raw_mems_gyro_x
uint16_t raw_mems_gyro_x
Definition BNO08xTestHelper.hpp:71
BNO08xTestHelper::imu_report_data_t::raw_mems_gyro_z
uint16_t raw_mems_gyro_z
Definition BNO08xTestHelper.hpp:73
BNO08xTestHelper::imu_report_data_t::quat_accuracy
BNO08xAccuracy quat_accuracy
Definition BNO08xTestHelper.hpp:34
BNO08xTestHelper::imu_report_data_t::uncalib_gyro_vel_z
float uncalib_gyro_vel_z
Definition BNO08xTestHelper.hpp:61
BNO08xTestHelper::imu_report_data_t::accel_accuracy
BNO08xAccuracy accel_accuracy
Definition BNO08xTestHelper.hpp:43
BNO08xTestHelper::imu_report_data_t::uncalib_gyro_drift_x
float uncalib_gyro_drift_x
Definition BNO08xTestHelper.hpp:62
BNO08xTestHelper::imu_report_data_t::grav_x
float grav_x
Definition BNO08xTestHelper.hpp:50
BNO08xTestHelper::imu_report_data_t::uncalib_gyro_vel_y
float uncalib_gyro_vel_y
Definition BNO08xTestHelper.hpp:60
BNO08xTestHelper::imu_report_data_t::quat_radian_accuracy
float quat_radian_accuracy
Definition BNO08xTestHelper.hpp:33
BNO08xTestHelper::imu_report_data_t::time_stamp
uint32_t time_stamp
Definition BNO08xTestHelper.hpp:27
BNO08xTestHelper::imu_report_data_t::step_count
uint16_t step_count
Definition BNO08xTestHelper.hpp:75
BNO08xTestHelper::imu_report_data_t::accel_z
float accel_z
Definition BNO08xTestHelper.hpp:42
BNO08xTestHelper::imu_report_data_t::grav_z
float grav_z
Definition BNO08xTestHelper.hpp:52
BNO08xTestHelper::imu_report_data_t::integrated_gyro_vel_y
float integrated_gyro_vel_y
Definition BNO08xTestHelper.hpp:37
BNO08xTestHelper::imu_report_data_t::calib_gyro_vel_y
float calib_gyro_vel_y
Definition BNO08xTestHelper.hpp:56
bno08x_config_t
IMU configuration settings passed into constructor.
Definition BNO08x_global_types.hpp:74