# esp32_BNO08x: BNO08x.hpp Source File

Loading...
Searching...
No Matches
BNO08x.hpp
Go to the documentation of this file.
#pragma once
// esp-idf includes
#include <driver/gpio.h>
#include <driver/spi_common.h>
#include <driver/spi_master.h>
#include <esp_log.h>
#include <esp_rom_gpio.h>
#include <esp_timer.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <freertos/event_groups.h>
#include <freertos/queue.h>
#include <rom/ets_sys.h>
// standard library includes
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <cstring>
#include <functional>
#include <vector>
enum channels_t
{
CHANNEL_COMMAND,
CHANNEL_EXECUTABLE,
CHANNEL_CONTROL,
CHANNEL_REPORTS,
CHANNEL_WAKE_REPORTS,
CHANNEL_GYRO
};
enum class IMUAccuracy
{
LOW = 1,
MED,
HIGH
};
typedef struct bno08x_config_t
{
spi_host_device_t spi_peripheral;
gpio_num_t io_mosi;
gpio_num_t io_miso;
gpio_num_t io_sclk;
gpio_num_t io_cs;
gpio_num_t io_int;
gpio_num_t io_rst;
gpio_num_t io_wake;
uint32_t sclk_speed;
bno08x_config_t()
: spi_peripheral((spi_host_device_t)CONFIG_ESP32_BNO08x_SPI_HOST)
, io_mosi((gpio_num_t)CONFIG_ESP32_BNO08X_GPIO_DI) // default:
, io_miso((gpio_num_t)CONFIG_ESP32_BNO08X_GPIO_SDA) // default:
, io_sclk((gpio_num_t)CONFIG_ESP32_BNO08X_GPIO_SCL) // default:
, io_cs((gpio_num_t)CONFIG_ESP32_BNO08X_GPIO_CS) // default:
, io_int((gpio_num_t)CONFIG_ESP32_BNO08X_GPIO_HINT) // default:
, io_rst((gpio_num_t)CONFIG_ESP32_BNO08X_GPIO_RST) // default:
, io_wake((gpio_num_t)CONFIG_ESP32_BNO08X_GPIO_WAKE) // default: -1 (unused)
, sclk_speed((uint32_t)CONFIG_ESP32_BNO08X_SCL_SPEED_HZ) // default: 2MH
{
}
bno08x_config_t(spi_host_device_t spi_peripheral, gpio_num_t io_mosi, gpio_num_t io_miso, gpio_num_t io_sclk, gpio_num_t io_cs,
gpio_num_t io_int, gpio_num_t io_rst, gpio_num_t io_wake, uint32_t sclk_speed)
: spi_peripheral(spi_peripheral)
, io_mosi(io_mosi)
, io_miso(io_miso)
, io_sclk(io_sclk)
, io_cs(io_cs)
, io_int(io_int)
, io_rst(io_rst)
, io_wake(io_wake)
, sclk_speed(sclk_speed)
{
}
} bno08x_config_t;
class BNO08x
{
public:
BNO08x(bno08x_config_t imu_config = default_imu_config);
bool initialize();
bool hard_reset();
bool soft_reset();
uint8_t get_reset_reason();
bool mode_sleep();
bool mode_on();
float q_to_float(int16_t fixed_point_value, uint8_t q_point);
bool run_full_calibration_routine();
void calibrate_all();
void calibrate_accelerometer();
void calibrate_gyro();
void calibrate_magnetometer();
void calibrate_planar_accelerometer();
void request_calibration_status();
bool calibration_complete();
void end_calibration();
void save_calibration();
void enable_rotation_vector(uint32_t time_between_reports);
void enable_game_rotation_vector(uint32_t time_between_reports);
void enable_ARVR_stabilized_rotation_vector(uint32_t time_between_reports);
void enable_ARVR_stabilized_game_rotation_vector(uint32_t time_between_reports);
void enable_gyro_integrated_rotation_vector(uint32_t time_between_reports);
void enable_accelerometer(uint32_t time_between_reports);
void enable_linear_accelerometer(uint32_t time_between_reports);
void enable_gravity(uint32_t time_between_reports);
void enable_gyro(uint32_t time_between_reports);
void enable_uncalibrated_gyro(uint32_t time_between_reports);
void enable_magnetometer(uint32_t time_between_reports);
void enable_tap_detector(uint32_t time_between_reports);
void enable_step_counter(uint32_t time_between_reports);
void enable_stability_classifier(uint32_t time_between_reports);
void enable_activity_classifier(uint32_t time_between_reports, uint32_t activities_to_enable, uint8_t (&activity_confidence_vals)[9]);
void enable_raw_accelerometer(uint32_t time_between_reports);
void enable_raw_gyro(uint32_t time_between_reports);
void enable_raw_magnetometer(uint32_t time_between_reports);
void disable_rotation_vector();
void disable_game_rotation_vector();
void disable_ARVR_stabilized_rotation_vector();
void disable_ARVR_stabilized_game_rotation_vector();
void disable_gyro_integrated_rotation_vector();
void disable_accelerometer();
void disable_linear_accelerometer();
void disable_gravity();
void disable_gyro();
void disable_uncalibrated_gyro();
void disable_magnetometer();
void disable_tap_detector();
void disable_step_counter();
void disable_stability_classifier();
void disable_activity_classifier();
void disable_raw_accelerometer();
void disable_raw_gyro();
void disable_raw_magnetometer();
void tare_now(uint8_t axis_sel = TARE_AXIS_ALL, uint8_t rotation_vector_basis = TARE_ROTATION_VECTOR);
void save_tare();
void clear_tare();
bool data_available();
void register_cb(std::function<void()> cb_fxn);
uint32_t get_time_stamp();
void get_magf(float& x, float& y, float& z, uint8_t& accuracy);
float get_magf_X();
float get_magf_Y();
float get_magf_Z();
uint8_t get_magf_accuracy();
void get_gravity(float& x, float& y, float& z, uint8_t& accuracy);
float get_gravity_X();
float get_gravity_Y();
float get_gravity_Z();
uint8_t get_gravity_accuracy();
float get_roll();
float get_pitch();
float get_yaw();
float get_roll_deg();
float get_pitch_deg();
float get_yaw_deg();
void get_quat(float& i, float& j, float& k, float& real, float& rad_accuracy, uint8_t& accuracy);
float get_quat_I();
float get_quat_J();
float get_quat_K();
float get_quat_real();
float get_quat_radian_accuracy();
uint8_t get_quat_accuracy();
void get_accel(float& x, float& y, float& z, uint8_t& accuracy);
float get_accel_X();
float get_accel_Y();
float get_accel_Z();
uint8_t get_accel_accuracy();
void get_linear_accel(float& x, float& y, float& z, uint8_t& accuracy);
float get_linear_accel_X();
float get_linear_accel_Y();
float get_linear_accel_Z();
uint8_t get_linear_accel_accuracy();
int16_t get_raw_accel_X();
int16_t get_raw_accel_Y();
int16_t get_raw_accel_Z();
int16_t get_raw_gyro_X();
int16_t get_raw_gyro_Y();
int16_t get_raw_gyro_Z();
int16_t get_raw_magf_X();
int16_t get_raw_magf_Y();
int16_t get_raw_magf_Z();
void get_gyro_calibrated_velocity(float& x, float& y, float& z, uint8_t& accuracy);
float get_gyro_calibrated_velocity_X();
float get_gyro_calibrated_velocity_Y();
float get_gyro_calibrated_velocity_Z();
uint8_t get_gyro_accuracy();
void get_uncalibrated_gyro(float& x, float& y, float& z, float& bx, float& by, float& bz, uint8_t& accuracy);
float get_uncalibrated_gyro_X();
float get_uncalibrated_gyro_Y();
float get_uncalibrated_gyro_Z();
float get_uncalibrated_gyro_bias_X();
float get_uncalibrated_gyro_bias_Y();
float get_uncalibrated_gyro_bias_Z();
uint8_t get_uncalibrated_gyro_accuracy();
void get_gyro_velocity(float& x, float& y, float& z);
float get_gyro_velocity_X();
float get_gyro_velocity_Y();
float get_gyro_velocity_Z();
uint8_t get_tap_detector();
uint16_t get_step_count();
int8_t get_stability_classifier();
uint8_t get_activity_classifier();
// Metadata functions
int16_t get_Q1(uint16_t record_ID);
int16_t get_Q2(uint16_t record_ID);
int16_t get_Q3(uint16_t record_ID);
float get_resolution(uint16_t record_ID);
float get_range(uint16_t record_ID);
uint32_t FRS_read_word(uint16_t record_ID, uint8_t word_number);
bool FRS_read_request(uint16_t record_ID, uint16_t read_offset, uint16_t block_size);
bool FRS_read_data(uint16_t record_ID, uint8_t start_location, uint8_t words_to_read);
// Record IDs from figure 29, page 29 reference manual
// These are used to read the metadata for each sensor type
static const constexpr uint16_t FRS_RECORD_ID_ACCELEROMETER =
0xE302;
static const constexpr uint16_t FRS_RECORD_ID_GYROSCOPE_CALIBRATED =
0xE306;
static const constexpr uint16_t FRS_RECORD_ID_MAGNETIC_FIELD_CALIBRATED =
0xE309;
static const constexpr uint16_t FRS_RECORD_ID_ROTATION_VECTOR =
0xE30B;
static const constexpr uint8_t TARE_AXIS_ALL = 0x07;
static const constexpr uint8_t TARE_AXIS_Z = 0x04;
// Which rotation vector to tare, BNO08x saves them seperately
static const constexpr uint8_t TARE_ROTATION_VECTOR = 0;
static const constexpr uint8_t TARE_GAME_ROTATION_VECTOR = 1;
static const constexpr uint8_t TARE_GEOMAGNETIC_ROTATION_VECTOR = 2;
static const constexpr uint8_t TARE_GYRO_INTEGRATED_ROTATION_VECTOR = 3;
static const constexpr uint8_t TARE_ARVR_STABILIZED_ROTATION_VECTOR = 4;
static const constexpr uint8_t TARE_ARVR_STABILIZED_GAME_ROTATION_VECTOR = 5;
static const constexpr int16_t ROTATION_VECTOR_Q1 = 14;
static const constexpr int16_t ROTATION_VECTOR_ACCURACY_Q1 = 12;
static const constexpr int16_t ACCELEROMETER_Q1 = 8;
static const constexpr int16_t LINEAR_ACCELEROMETER_Q1 = 8;
static const constexpr int16_t GYRO_Q1 = 9;
static const constexpr int16_t MAGNETOMETER_Q1 = 4;
static const constexpr int16_t ANGULAR_VELOCITY_Q1 = 10;
static const constexpr int16_t GRAVITY_Q1 = 8;
private:
typedef struct bno08x_rx_packet_t
{
uint8_t header[4];
uint8_t body[300];
uint16_t length;
} bno08x_rx_packet_t;
typedef struct bno08x_tx_packet_t
{
uint8_t body[50];
uint16_t length;
} bno08x_tx_packet_t;
bool wait_for_rx_done();
bool wait_for_tx_done();
bool wait_for_data();
bool receive_packet();
void send_packet(bno08x_tx_packet_t* packet);
void enable_report(uint8_t report_ID, uint32_t time_between_reports, const EventBits_t report_evt_grp_bit);
void disable_report(uint8_t report_ID, const EventBits_t report_evt_grp_bit);
void queue_packet(uint8_t channel_number, uint8_t data_length, uint8_t* commands);
void queue_command(uint8_t command, uint8_t* commands);
void queue_feature_command(uint8_t report_ID, uint32_t time_between_reports);
void queue_feature_command(uint8_t report_ID, uint32_t time_between_reports, uint32_t specific_config);
void queue_calibrate_command(uint8_t _to_calibrate);
void queue_tare_command(uint8_t command, uint8_t axis = TARE_AXIS_ALL, uint8_t rotation_vector_basis = TARE_ROTATION_VECTOR);
void queue_request_product_id_command();
uint16_t parse_packet(bno08x_rx_packet_t* packet);
uint16_t parse_product_id_report(bno08x_rx_packet_t* packet);
uint16_t parse_frs_read_response_report(bno08x_rx_packet_t* packet);
uint16_t parse_input_report(bno08x_rx_packet_t* packet);
uint16_t parse_command_report(bno08x_rx_packet_t* packet);
// for debug
void print_header(bno08x_rx_packet_t* packet);
void print_packet(bno08x_rx_packet_t* packet);
static bno08x_config_t default_imu_config;
EventGroupHandle_t
evt_grp_spi;
EventGroupHandle_t evt_grp_report_en;
QueueHandle_t queue_rx_data;
QueueHandle_t queue_tx_data;
QueueHandle_t queue_frs_read_data;
QueueHandle_t queue_reset_reason;
std::vector<std::function<void()>> cb_list; // Vector for storing any call-back functions added with register_cb()
uint32_t meta_data[9];
bno08x_config_t imu_config{};
spi_bus_config_t bus_config{};
spi_device_interface_config_t imu_spi_config{};
spi_device_handle_t spi_hdl{};
spi_transaction_t spi_transaction{};
// These are the raw sensor values (without Q applied) pulled from the user requested Input Report
uint32_t time_stamp;
uint16_t raw_accel_X, raw_accel_Y, raw_accel_Z,
accel_accuracy;
uint16_t raw_lin_accel_X, raw_lin_accel_Y, raw_lin_accel_Z,
accel_lin_accuracy;
uint16_t raw_gyro_X, raw_gyro_Y, raw_gyro_Z, gyro_accuracy;
uint16_t raw_quat_I, raw_quat_J, raw_quat_K, raw_quat_real, raw_quat_radian_accuracy,
quat_accuracy;
uint16_t raw_velocity_gyro_X, raw_velocity_gyro_Y,
raw_velocity_gyro_Z;
uint16_t gravity_X, gravity_Y, gravity_Z,
gravity_accuracy;
uint16_t raw_uncalib_gyro_X, raw_uncalib_gyro_Y, raw_uncalib_gyro_Z, raw_bias_X, raw_bias_Y, raw_bias_Z,
uncalib_gyro_accuracy;
uint16_t raw_magf_X, raw_magf_Y, raw_magf_Z,
magf_accuracy;
uint8_t tap_detector;
uint16_t step_count;
uint8_t stability_classifier;
uint8_t activity_classifier;
uint8_t* activity_confidences;
uint8_t calibration_status;
uint16_t mems_raw_accel_X, mems_raw_accel_Y,
mems_raw_accel_Z;
uint16_t mems_raw_gyro_X, mems_raw_gyro_Y,
mems_raw_gyro_Z;
uint16_t mems_raw_magf_X, mems_raw_magf_Y,
mems_raw_magf_Z;
// spi task
TaskHandle_t spi_task_hdl;
static void spi_task_trampoline(void* arg);
void spi_task();
// data processing task
TaskHandle_t data_proc_task_hdl;
static void data_proc_task_trampoline(void* arg);
void data_proc_task();
static void IRAM_ATTR hint_handler(void* arg);
static bool
isr_service_installed;
static const constexpr uint16_t RX_DATA_LENGTH = 300;
static const constexpr uint16_t MAX_METADATA_LENGTH = 9;
static const constexpr uint64_t HOST_INT_TIMEOUT_MS =
300ULL;
// evt_grp_spi bits
static const constexpr EventBits_t EVT_GRP_SPI_RX_DONE_BIT =
(1 << 0);
static const constexpr EventBits_t EVT_GRP_SPI_RX_VALID_PACKET =
(1 << 1);
static const constexpr EventBits_t EVT_GRP_SPI_RX_INVALID_PACKET =
(1 << 2);
static const constexpr EventBits_t EVT_GRP_SPI_TX_DONE = (1 << 3);
// evt_grp_report_en bits
static const constexpr EventBits_t EVT_GRP_RPT_ROTATION_VECTOR_BIT = (1 << 0);
static const constexpr EventBits_t EVT_GRP_RPT_GAME_ROTATION_VECTOR_BIT = (1 << 1);
static const constexpr EventBits_t EVT_GRP_RPT_ARVR_S_ROTATION_VECTOR_BIT =
(1 << 2);
static const constexpr EventBits_t EVT_GRP_RPT_ARVR_S_GAME_ROTATION_VECTOR_BIT =
(1 << 3);
static const constexpr EventBits_t EVT_GRP_RPT_GYRO_ROTATION_VECTOR_BIT =
(1 << 4);
static const constexpr EventBits_t EVT_GRP_RPT_ACCELEROMETER_BIT = (1 << 5);
static const constexpr EventBits_t EVT_GRP_RPT_LINEAR_ACCELEROMETER_BIT = (1 << 6);
static const constexpr EventBits_t EVT_GRP_RPT_GRAVITY_BIT = (1 << 7);
static const constexpr EventBits_t EVT_GRP_RPT_GYRO_BIT = (1 << 8);
static const constexpr EventBits_t EVT_GRP_RPT_GYRO_UNCALIBRATED_BIT = (1 << 9);
static const constexpr EventBits_t EVT_GRP_RPT_MAGNETOMETER_BIT = (1 << 10);
static const constexpr EventBits_t EVT_GRP_RPT_TAP_DETECTOR_BIT = (1 << 11);
static const constexpr EventBits_t EVT_GRP_RPT_STEP_COUNTER_BIT = (1 << 12);
static const constexpr EventBits_t EVT_GRP_RPT_STABILITY_CLASSIFIER_BIT = (1 << 13);
static const constexpr EventBits_t EVT_GRP_RPT_ACTIVITY_CLASSIFIER_BIT = (1 << 14);
static const constexpr EventBits_t EVT_GRP_RPT_RAW_ACCELEROMETER_BIT = (1 << 15);
static const constexpr EventBits_t EVT_GRP_RPT_RAW_GYRO_BIT = (1 << 16);
static const constexpr EventBits_t EVT_GRP_RPT_RAW_MAGNETOMETER_BIT = (1 << 17);
static const constexpr EventBits_t EVT_GRP_RPT_ALL_BITS =
EVT_GRP_RPT_ROTATION_VECTOR_BIT | EVT_GRP_RPT_GAME_ROTATION_VECTOR_BIT | EVT_GRP_RPT_ARVR_S_ROTATION_VECTOR_BIT |
EVT_GRP_RPT_ARVR_S_GAME_ROTATION_VECTOR_BIT | EVT_GRP_RPT_GYRO_ROTATION_VECTOR_BIT | EVT_GRP_RPT_ACCELEROMETER_BIT |
EVT_GRP_RPT_LINEAR_ACCELEROMETER_BIT | EVT_GRP_RPT_GRAVITY_BIT | EVT_GRP_RPT_GYRO_BIT | EVT_GRP_RPT_GYRO_UNCALIBRATED_BIT |
EVT_GRP_RPT_MAGNETOMETER_BIT | EVT_GRP_RPT_TAP_DETECTOR_BIT | EVT_GRP_RPT_STEP_COUNTER_BIT | EVT_GRP_RPT_STABILITY_CLASSIFIER_BIT |
EVT_GRP_RPT_ACTIVITY_CLASSIFIER_BIT | EVT_GRP_RPT_RAW_ACCELEROMETER_BIT | EVT_GRP_RPT_RAW_GYRO_BIT | EVT_GRP_RPT_RAW_MAGNETOMETER_BIT;
// Higher level calibration commands, used by queue_calibrate_command
static const constexpr uint8_t CALIBRATE_ACCEL = 0;
static const constexpr uint8_t CALIBRATE_GYRO = 1;
static const constexpr uint8_t CALIBRATE_MAG = 2;
static const constexpr uint8_t CALIBRATE_PLANAR_ACCEL = 3;
static const constexpr uint8_t CALIBRATE_ACCEL_GYRO_MAG =
4;
static const constexpr uint8_t CALIBRATE_STOP = 5;
// Command IDs (see Ref. Manual 6.4)
static const constexpr uint8_t COMMAND_ERRORS = 1;
static const constexpr uint8_t COMMAND_COUNTER = 2;
static const constexpr uint8_t COMMAND_TARE = 3;
static const constexpr uint8_t COMMAND_INITIALIZE = 4;
static const constexpr uint8_t COMMAND_DCD = 6;
static const constexpr uint8_t COMMAND_ME_CALIBRATE = 7;
static const constexpr uint8_t COMMAND_DCD_PERIOD_SAVE = 9;
static const constexpr uint8_t COMMAND_OSCILLATOR = 10;
static const constexpr uint8_t COMMAND_CLEAR_DCD = 11;
// SHTP channel 2 control report IDs, used in communication with sensor (See Ref. Manual 6.2)
static const constexpr uint8_t SHTP_REPORT_COMMAND_RESPONSE = 0xF1;
static const constexpr uint8_t SHTP_REPORT_COMMAND_REQUEST = 0xF2;
static const constexpr uint8_t SHTP_REPORT_FRS_READ_RESPONSE = 0xF3;
static const constexpr uint8_t SHTP_REPORT_FRS_READ_REQUEST = 0xF4;
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_RESPONSE = 0xF8;
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_REQUEST = 0xF9;
static const constexpr uint8_t SHTP_REPORT_BASE_TIMESTAMP = 0xFB;
static const constexpr uint8_t SHTP_REPORT_SET_FEATURE_COMMAND = 0xFD;
// Sensor report IDs, used when enabling and reading BNO08x reports
static const constexpr uint8_t SENSOR_REPORT_ID_ACCELEROMETER = 0x01;
static const constexpr uint8_t SENSOR_REPORT_ID_GYROSCOPE = 0x02;
static const constexpr uint8_t SENSOR_REPORT_ID_MAGNETIC_FIELD = 0x03;
static const constexpr uint8_t SENSOR_REPORT_ID_LINEAR_ACCELERATION = 0x04;
static const constexpr uint8_t SENSOR_REPORT_ID_ROTATION_VECTOR = 0x05;
static const constexpr uint8_t SENSOR_REPORT_ID_GRAVITY = 0x06;
static const constexpr uint8_t SENSOR_REPORT_ID_UNCALIBRATED_GYRO = 0x07;
static const constexpr uint8_t SENSOR_REPORT_ID_GAME_ROTATION_VECTOR = 0x08;
static const constexpr uint8_t SENSOR_REPORT_ID_GEOMAGNETIC_ROTATION_VECTOR = 0x09;
static const constexpr uint8_t SENSOR_REPORT_ID_GYRO_INTEGRATED_ROTATION_VECTOR = 0x2A;
static const constexpr uint8_t SENSOR_REPORT_ID_TAP_DETECTOR = 0x10;
static const constexpr uint8_t SENSOR_REPORT_ID_STEP_COUNTER = 0x11;
static const constexpr uint8_t SENSOR_REPORT_ID_STABILITY_CLASSIFIER = 0x13;
static const constexpr uint8_t SENSOR_REPORT_ID_RAW_ACCELEROMETER = 0x14;
static const constexpr uint8_t SENSOR_REPORT_ID_RAW_GYROSCOPE = 0x15;
static const constexpr uint8_t SENSOR_REPORT_ID_RAW_MAGNETOMETER = 0x16;
static const constexpr uint8_t SENSOR_REPORT_ID_PERSONAL_ACTIVITY_CLASSIFIER = 0x1E;
static const constexpr uint8_t SENSOR_REPORT_ID_ARVR_STABILIZED_ROTATION_VECTOR = 0x28;
static const constexpr uint8_t SENSOR_REPORT_ID_ARVR_STABILIZED_GAME_ROTATION_VECTOR = 0x29;
// Tare commands used by queue_tare_command
static const constexpr uint8_t TARE_NOW = 0;
static const constexpr uint8_t TARE_PERSIST = 1;
static const constexpr uint8_t TARE_SET_REORIENTATION = 2;
static const constexpr char* TAG = "BNO08x";
};
bno08x_config_t
struct bno08x_config_t bno08x_config_t
IMU configuration settings passed into constructor.
channels_t
channels_t
SHTP protocol channels.
Definition BNO08x.hpp:25
CHANNEL_COMMAND
@ CHANNEL_COMMAND
Definition BNO08x.hpp:26
CHANNEL_REPORTS
@ CHANNEL_REPORTS
Definition BNO08x.hpp:29
CHANNEL_CONTROL
@ CHANNEL_CONTROL
Definition BNO08x.hpp:28
CHANNEL_EXECUTABLE
@ CHANNEL_EXECUTABLE
Definition BNO08x.hpp:27
CHANNEL_WAKE_REPORTS
@ CHANNEL_WAKE_REPORTS
Definition BNO08x.hpp:30
CHANNEL_GYRO
@ CHANNEL_GYRO
Definition BNO08x.hpp:31
IMUAccuracy
IMUAccuracy
Sensor accuracy returned during sensor calibration.
Definition BNO08x.hpp:36
IMUAccuracy::MED
@ MED
IMUAccuracy::LOW
@ LOW
IMUAccuracy::HIGH
@ HIGH
BNO08x
Definition BNO08x.hpp:89
BNO08x::disable_report
void disable_report(uint8_t report_ID, const EventBits_t report_evt_grp_bit)
Disables a sensor report for a given ID by setting its time interval to 0.
Definition BNO08x.cpp:482
BNO08x::SHTP_REPORT_PRODUCT_ID_RESPONSE
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_RESPONSE
See SH2 Ref. Manual 6.3.2.
Definition BNO08x.hpp:454
BNO08x::enable_gravity
void enable_gravity(uint32_t time_between_reports)
Sends command to enable gravity reading reports (See Ref. Manual 6.5.11)
Definition BNO08x.cpp:1275
BNO08x::raw_quat_radian_accuracy
uint16_t raw_quat_radian_accuracy
Definition BNO08x.hpp:347
BNO08x::SENSOR_REPORT_ID_RAW_GYROSCOPE
static const constexpr uint8_t SENSOR_REPORT_ID_RAW_GYROSCOPE
See SH2 Ref. Manual 6.5.12.
Definition BNO08x.hpp:474
BNO08x::raw_gyro_Z
uint16_t raw_gyro_Z
Definition BNO08x.hpp:346
BNO08x::ACCELEROMETER_Q1
static const constexpr int16_t ACCELEROMETER_Q1
Acceleration Q point (See SH-2 Ref. Manual 6.5.9)
Definition BNO08x.hpp:271
BNO08x::print_packet
void print_packet(bno08x_rx_packet_t *packet)
Prints the passed SHTP packet to serial console with ESP_LOG statement.
Definition BNO08x.cpp:2446
BNO08x::SENSOR_REPORT_ID_MAGNETIC_FIELD
static const constexpr uint8_t SENSOR_REPORT_ID_MAGNETIC_FIELD
See SH2 Ref. Manual 6.5.16.
Definition BNO08x.hpp:462
BNO08x::register_cb
void register_cb(std::function< void()> cb_fxn)
Registers a callback to execute when new data from a report is received.
Definition BNO08x.cpp:864
BNO08x::uncalib_gyro_accuracy
uint16_t uncalib_gyro_accuracy
Uncalibrated gyro reading (See SH-2 Ref. Manual 6.5.14)
Definition BNO08x.hpp:354
BNO08x::raw_bias_Z
uint16_t raw_bias_Z
Definition BNO08x.hpp:353
BNO08x::FRS_RECORD_ID_MAGNETIC_FIELD_CALIBRATED
static const constexpr uint16_t FRS_RECORD_ID_MAGNETIC_FIELD_CALIBRATED
Calibrated magnetometer record ID, to be passed in metadata functions like get_Q1()
Definition BNO08x.hpp:253
BNO08x::COMMAND_TARE
static const constexpr uint8_t COMMAND_TARE
Command and response to tare command (See Sh2 Ref. Manual 6.4.4)
Definition BNO08x.hpp:441
BNO08x::get_accel_Z
float get_accel_Z()
Get z axis acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:2000
BNO08x::get_uncalibrated_gyro_Z
float get_uncalibrated_gyro_Z()
Get uncalibrated gyro Z axis angular velocity measurement.
Definition BNO08x.cpp:2271
BNO08x::data_proc_task_trampoline
static void data_proc_task_trampoline(void *arg)
Static function used to launch data processing task.
Definition BNO08x.cpp:2819
BNO08x::ROTATION_VECTOR_Q1
static const constexpr int16_t ROTATION_VECTOR_Q1
Rotation vector Q point (See SH-2 Ref. Manual 6.5.18)
Definition BNO08x.hpp:269
BNO08x::spi_task_trampoline
static void spi_task_trampoline(void *arg)
Static function used to launch spi task.
Definition BNO08x.cpp:2769
BNO08x::get_stability_classifier
int8_t get_stability_classifier()
Get the current stability classifier (Seee Ref. Manual 6.5.31)
Definition BNO08x.cpp:2389
BNO08x::EVT_GRP_RPT_GAME_ROTATION_VECTOR_BIT
static const constexpr EventBits_t EVT_GRP_RPT_GAME_ROTATION_VECTOR_BIT
When set, game rotation vector reports are active.
Definition BNO08x.hpp:401
BNO08x::get_range
float get_range(uint16_t record_ID)
Gets range from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2557
BNO08x::get_linear_accel_Y
float get_linear_accel_Y()
Get y axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
Definition BNO08x.cpp:2048
BNO08x::get_magf_X
float get_magf_X()
Get X component of magnetic field vector.
Definition BNO08x.cpp:1661
BNO08x::TARE_PERSIST
static const constexpr uint8_t TARE_PERSIST
See SH2 Ref. Manual 6.4.4.2.
Definition BNO08x.hpp:482
BNO08x::tap_detector
uint8_t tap_detector
Tap detector reading (See SH-2 Ref. Manual 6.5.27)
Definition BNO08x.hpp:357
BNO08x::get_reset_reason
uint8_t get_reset_reason()
Requests product ID, prints the returned info over serial, and returns the reason for the most resent...
Definition BNO08x.cpp:322
BNO08x::get_quat_I
float get_quat_I()
Get I component of reported quaternion.
Definition BNO08x.cpp:1897
BNO08x::enable_raw_magnetometer
void enable_raw_magnetometer(uint32_t time_between_reports)
Sends command to enable raw magnetometer reports (See Ref. Manual 6.5.15)
Definition BNO08x.cpp:1388
BNO08x::get_Q3
int16_t get_Q3(uint16_t record_ID)
Gets Q3 point from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2527
BNO08x::get_gyro_calibrated_velocity_Z
float get_gyro_calibrated_velocity_Z()
Get calibrated gyro z axis angular velocity measurement.
Definition BNO08x.cpp:2206
BNO08x::disable_tap_detector
void disable_tap_detector()
Sends command to disable tap detector reports by setting report interval to 0.
Definition BNO08x.cpp:1508
BNO08x::disable_raw_accelerometer
void disable_raw_accelerometer()
Sends command to disable raw accelerometer reports by setting report interval to 0.
Definition BNO08x.cpp:1548
BNO08x::mode_sleep
bool mode_sleep()
Puts BNO08x sensor into sleep/low power mode using executable channel.
Definition BNO08x.cpp:372
BNO08x::EVT_GRP_RPT_ACCELEROMETER_BIT
static const constexpr EventBits_t EVT_GRP_RPT_ACCELEROMETER_BIT
When set, accelerometer reports are active.
Definition BNO08x.hpp:408
BNO08x::get_uncalibrated_gyro_Y
float get_uncalibrated_gyro_Y()
Get uncalibrated gyro Y axis angular velocity measurement.
Definition BNO08x.cpp:2261
BNO08x::raw_gyro_X
uint16_t raw_gyro_X
Definition BNO08x.hpp:346
BNO08x::EVT_GRP_RPT_ROTATION_VECTOR_BIT
static const constexpr EventBits_t EVT_GRP_RPT_ROTATION_VECTOR_BIT
When set, rotation vector reports are active.
Definition BNO08x.hpp:400
BNO08x::RX_DATA_LENGTH
static const constexpr uint16_t RX_DATA_LENGTH
length buffer containing data received over spi
Definition BNO08x.hpp:384
BNO08x::stability_classifier
uint8_t stability_classifier
Stability status reading (See SH-2 Ref. Manual 6.5.31)
Definition BNO08x.hpp:359
BNO08x::get_pitch
float get_pitch()
Get the reported rotation about y axis.
Definition BNO08x.cpp:1789
BNO08x::get_uncalibrated_gyro
void get_uncalibrated_gyro(float &x, float &y, float &z, float &bx, float &by, float &bz, uint8_t &accuracy)
Get full rotational velocity without drift compensation (units in Rad/s). An estimate of drift is giv...
Definition BNO08x.cpp:2235
BNO08x::calibrate_planar_accelerometer
void calibrate_planar_accelerometer()
Sends command to calibrate planar accelerometer.
Definition BNO08x.cpp:632
BNO08x::SHTP_REPORT_SET_FEATURE_COMMAND
static const constexpr uint8_t SHTP_REPORT_SET_FEATURE_COMMAND
See SH2 Ref. Manual 6.5.4.
Definition BNO08x.hpp:457
BNO08x::get_resolution
float get_resolution(uint16_t record_ID)
Gets resolution from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2540
BNO08x::get_raw_accel_X
int16_t get_raw_accel_X()
Get raw accelerometer x axis reading from physical accelerometer MEMs sensor (See Ref....
Definition BNO08x.cpp:2078
BNO08x::SHTP_REPORT_COMMAND_RESPONSE
static const constexpr uint8_t SHTP_REPORT_COMMAND_RESPONSE
See SH2 Ref. Manual 6.3.9.
Definition BNO08x.hpp:450
BNO08x::disable_rotation_vector
void disable_rotation_vector()
Sends command to disable rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:1398
BNO08x::TARE_AXIS_ALL
static const constexpr uint8_t TARE_AXIS_ALL
Tare all axes (used with tare now command)
Definition BNO08x.hpp:258
BNO08x::SENSOR_REPORT_ID_GYROSCOPE
static const constexpr uint8_t SENSOR_REPORT_ID_GYROSCOPE
See SH2 Ref. Manual 6.5.13.
Definition BNO08x.hpp:461
BNO08x::TARE_GEOMAGNETIC_ROTATION_VECTOR
static const constexpr uint8_t TARE_GEOMAGNETIC_ROTATION_VECTOR
tare geomagnetic rotation vector
Definition BNO08x.hpp:264
BNO08x::get_quat_accuracy
uint8_t get_quat_accuracy()
Get accuracy of reported quaternion.
Definition BNO08x.cpp:1952
BNO08x::enable_accelerometer
void enable_accelerometer(uint32_t time_between_reports)
Sends command to enable accelerometer reports (See Ref. Manual 6.5.9)
Definition BNO08x.cpp:1253
BNO08x::TARE_NOW
static const constexpr uint8_t TARE_NOW
See SH2 Ref. Manual 6.4.4.1.
Definition BNO08x.hpp:481
BNO08x::FRS_read_word
uint32_t FRS_read_word(uint16_t record_ID, uint8_t word_number)
Reads meta data word from BNO08x FRS (flash record system) given the record ID and word number....
Definition BNO08x.cpp:2578
BNO08x::q_to_float
float q_to_float(int16_t fixed_point_value, uint8_t q_point)
Converts a register value to a float using its associated Q point. (See https://en....
Definition BNO08x.cpp:1621
BNO08x::wait_for_rx_done
bool wait_for_rx_done()
Waits for data to be received over SPI, or HOST_INT_TIMEOUT_MS to elapse.
Definition BNO08x.cpp:144
BNO08x::get_uncalibrated_gyro_X
float get_uncalibrated_gyro_X()
Get uncalibrated gyro x axis angular velocity measurement.
Definition BNO08x.cpp:2251
BNO08x::hard_reset
bool hard_reset()
Hard resets BNO08x sensor.
Definition BNO08x.cpp:250
BNO08x::parse_product_id_report
uint16_t parse_product_id_report(bno08x_rx_packet_t *packet)
Parses product id report and prints device info.
Definition BNO08x.cpp:928
BNO08x::SENSOR_REPORT_ID_STEP_COUNTER
static const constexpr uint8_t SENSOR_REPORT_ID_STEP_COUNTER
See SH2 Ref. Manual 6.5.29.
Definition BNO08x.hpp:471
BNO08x::MAX_METADATA_LENGTH
static const constexpr uint16_t MAX_METADATA_LENGTH
max length of metadata used in frs read operations
Definition BNO08x.hpp:385
BNO08x::send_packet
void send_packet(bno08x_tx_packet_t *packet)
Sends a queued SHTP packet via SPI.
Definition BNO08x.cpp:529
BNO08x::get_raw_magf_Y
int16_t get_raw_magf_Y()
Get raw magnetometer y axis reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:2148
BNO08x::TAG
static const constexpr char * TAG
Class tag used for serial print statements.
Definition BNO08x.hpp:485
BNO08x::get_raw_gyro_Z
int16_t get_raw_gyro_Z()
Get raw gyroscope z axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:2128
BNO08x::spi_task
void spi_task()
Task responsible for SPI transactions. Executed when HINT in is asserted by BNO08x.
Definition BNO08x.cpp:2780
BNO08x::enable_raw_accelerometer
void enable_raw_accelerometer(uint32_t time_between_reports)
Sends command to enable raw accelerometer reports (See Ref. Manual 6.5.8)
Definition BNO08x.cpp:1366
BNO08x::COMMAND_OSCILLATOR
static const constexpr uint8_t COMMAND_OSCILLATOR
Retrieve oscillator type command (See SH2 Ref. Manual 6.4)
Definition BNO08x.hpp:446
BNO08x::COMMAND_INITIALIZE
static const constexpr uint8_t COMMAND_INITIALIZE
Reinitialize sensor hub components See (SH2 Ref. Manual 6.4.5)
Definition BNO08x.hpp:442
BNO08x::get_uncalibrated_gyro_accuracy
uint8_t get_uncalibrated_gyro_accuracy()
Get uncalibrated gyro accuracy.
Definition BNO08x.cpp:2311
BNO08x::EVT_GRP_SPI_RX_DONE_BIT
static const constexpr EventBits_t EVT_GRP_SPI_RX_DONE_BIT
When this bit is set it indicates a receive procedure has completed.
Definition BNO08x.hpp:391
BNO08x::accel_accuracy
uint16_t accel_accuracy
Raw acceleration readings (See SH-2 Ref. Manual 6.5.8)
Definition BNO08x.hpp:343
BNO08x::get_linear_accel_accuracy
uint8_t get_linear_accel_accuracy()
Get accuracy of linear acceleration.
Definition BNO08x.cpp:2068
BNO08x::SENSOR_REPORT_ID_ACCELEROMETER
static const constexpr uint8_t SENSOR_REPORT_ID_ACCELEROMETER
See SH2 Ref. Manual 6.5.9.
Definition BNO08x.hpp:460
BNO08x::print_header
void print_header(bno08x_rx_packet_t *packet)
Prints the header of the passed SHTP packet to serial console with ESP_LOG statement.
Definition BNO08x.cpp:2419
BNO08x::get_magf
void get_magf(float &x, float &y, float &z, uint8_t &accuracy)
Get the full magnetic field vector.
Definition BNO08x.cpp:1648
BNO08x::FRS_RECORD_ID_GYROSCOPE_CALIBRATED
static const constexpr uint16_t FRS_RECORD_ID_GYROSCOPE_CALIBRATED
Calirated gyroscope record ID, to be passed in metadata functions like get_Q1()
Definition BNO08x.hpp:251
BNO08x::accel_lin_accuracy
uint16_t accel_lin_accuracy
Raw linear acceleration (See SH-2 Ref. Manual 6.5.10)
Definition BNO08x.hpp:345
BNO08x::quat_accuracy
uint16_t quat_accuracy
Raw quaternion reading (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:348
BNO08x::data_available
bool data_available()
Checks if BNO08x has asserted interrupt and sent data.
Definition BNO08x.cpp:847
BNO08x::SENSOR_REPORT_ID_ROTATION_VECTOR
static const constexpr uint8_t SENSOR_REPORT_ID_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.18.
Definition BNO08x.hpp:464
BNO08x::COMMAND_ERRORS
static const constexpr uint8_t COMMAND_ERRORS
Definition BNO08x.hpp:439
BNO08x::get_gravity
void get_gravity(float &x, float &y, float &z, uint8_t &accuracy)
Get full reported gravity vector, units in m/s^2.
Definition BNO08x.cpp:1709
BNO08x::bno08x_tx_packet_t
struct BNO08x::bno08x_tx_packet_t bno08x_tx_packet_t
Holds data that is sent over spi.
BNO08x::EVT_GRP_RPT_GYRO_BIT
static const constexpr EventBits_t EVT_GRP_RPT_GYRO_BIT
When set, gyro reports are active.
Definition BNO08x.hpp:411
BNO08x::enable_magnetometer
void enable_magnetometer(uint32_t time_between_reports)
Sends command to enable magnetometer reports (See Ref. Manual 6.5.16)
Definition BNO08x.cpp:1308
BNO08x::mems_raw_gyro_X
uint16_t mems_raw_gyro_X
Definition BNO08x.hpp:365
BNO08x::EVT_GRP_RPT_RAW_ACCELEROMETER_BIT
static const constexpr EventBits_t EVT_GRP_RPT_RAW_ACCELEROMETER_BIT
When set, raw accelerometer reports are active.
Definition BNO08x.hpp:418
BNO08x::get_accel_accuracy
uint8_t get_accel_accuracy()
Get accuracy of linear acceleration.
Definition BNO08x.cpp:2010
BNO08x::FRS_read_data
bool FRS_read_data(uint16_t record_ID, uint8_t start_location, uint8_t words_to_read)
Read meta data from BNO08x FRS (flash record system) given the record ID. Contains Q points and other...
Definition BNO08x.cpp:2630
BNO08x::bno08x_rx_packet_t
struct BNO08x::bno08x_rx_packet_t bno08x_rx_packet_t
Holds data that is received over spi.
BNO08x::BNO08x
BNO08x(bno08x_config_t imu_config=default_imu_config)
BNO08x imu constructor.
Definition BNO08x.cpp:15
BNO08x::enable_report
void enable_report(uint8_t report_ID, uint32_t time_between_reports, const EventBits_t report_evt_grp_bit)
Enables a sensor report for a given ID.
Definition BNO08x.cpp:455
BNO08x::imu_spi_config
spi_device_interface_config_t imu_spi_config
SPI slave device settings.
Definition BNO08x.hpp:336
BNO08x::disable_step_counter
void disable_step_counter()
Sends command to disable step counter reports by setting report interval to 0.
Definition BNO08x.cpp:1518
BNO08x::get_Q1
int16_t get_Q1(uint16_t record_ID)
Gets Q1 point from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2497
BNO08x::tare_now
void tare_now(uint8_t axis_sel=TARE_AXIS_ALL, uint8_t rotation_vector_basis=TARE_ROTATION_VECTOR)
Sends command to tare an axis (See Ref. Manual 6.4.4.1)
Definition BNO08x.cpp:1581
BNO08x::get_tap_detector
uint8_t get_tap_detector()
Get if tap has occured.
Definition BNO08x.cpp:2367
BNO08x::get_magf_accuracy
uint8_t get_magf_accuracy()
Get accuracy of reported magnetic field vector.
Definition BNO08x.cpp:1694
BNO08x::isr_service_installed
static bool isr_service_installed
true of the isr service has been installed, only has to be done once regardless of how many devices a...
Definition BNO08x.hpp:3
BNO08x::queue_tare_command
void queue_tare_command(uint8_t command, uint8_t axis=TARE_AXIS_ALL, uint8_t rotation_vector_basis=TARE_ROTATION_VECTOR)
Queues a packet containing a command related to zeroing sensor's axes. (See Ref. Manual 6....
Definition BNO08x.cpp:2732
BNO08x::get_gyro_calibrated_velocity
void get_gyro_calibrated_velocity(float &x, float &y, float &z, uint8_t &accuracy)
Get full rotational velocity with drift compensation (units in Rad/s).
Definition BNO08x.cpp:2173
BNO08x::queue_tx_data
QueueHandle_t queue_tx_data
Packet queue used to send data to be sent over SPI from sending functions to spi_task.
Definition BNO08x.hpp:326
BNO08x::wait_for_data
bool wait_for_data()
Waits for a valid or invalid packet to be received or HOST_INT_TIMEOUT_MS to elapse.
Definition BNO08x.cpp:177
BNO08x::raw_velocity_gyro_Y
uint16_t raw_velocity_gyro_Y
Definition BNO08x.hpp:349
BNO08x::COMMAND_CLEAR_DCD
static const constexpr uint8_t COMMAND_CLEAR_DCD
Clear DCD & Reset command (See SH2 Ref. Manual 6.4)
Definition BNO08x.hpp:447
BNO08x::parse_command_report
uint16_t parse_command_report(bno08x_rx_packet_t *packet)
Parses received command report sent by BNO08x (See Ref. Manual 6.3.9)
Definition BNO08x.cpp:1168
BNO08x::get_activity_classifier
uint8_t get_activity_classifier()
Get the current activity classifier (Seee Ref. Manual 6.5.36)
Definition BNO08x.cpp:2408
BNO08x::disable_activity_classifier
void disable_activity_classifier()
Sends command to disable activity classifier reports by setting report interval to 0.
Definition BNO08x.cpp:1538
BNO08x::get_uncalibrated_gyro_bias_Z
float get_uncalibrated_gyro_bias_Z()
Get uncalibrated gyro Z axis drift estimate.
Definition BNO08x.cpp:2301
BNO08x::get_quat
void get_quat(float &i, float &j, float &k, float &real, float &rad_accuracy, uint8_t &accuracy)
Get the full quaternion reading.
Definition BNO08x.cpp:1882
BNO08x::parse_frs_read_response_report
uint16_t parse_frs_read_response_report(bno08x_rx_packet_t *packet)
Sends packet to be parsed to meta data function call (frs_read_word()) through queue.
Definition BNO08x.cpp:962
BNO08x::EVT_GRP_RPT_GYRO_ROTATION_VECTOR_BIT
static const constexpr EventBits_t EVT_GRP_RPT_GYRO_ROTATION_VECTOR_BIT
When set, gyro integrator rotation vector reports are active.
Definition BNO08x.hpp:406
BNO08x::SHTP_REPORT_PRODUCT_ID_REQUEST
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_REQUEST
See SH2 Ref. Manual 6.3.1.
Definition BNO08x.hpp:455
BNO08x::get_gravity_Z
float get_gravity_Z()
Get the reported z axis gravity.
Definition BNO08x.cpp:1742
BNO08x::enable_ARVR_stabilized_game_rotation_vector
void enable_ARVR_stabilized_game_rotation_vector(uint32_t time_between_reports)
Sends command to enable ARVR stabilized game rotation vector reports (See Ref. Manual 6....
Definition BNO08x.cpp:1231
BNO08x::CALIBRATE_STOP
static const constexpr uint8_t CALIBRATE_STOP
Stop calibration command used by queue_calibrate_command.
Definition BNO08x.hpp:436
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:364
BNO08x::TARE_SET_REORIENTATION
static const constexpr uint8_t TARE_SET_REORIENTATION
See SH2 Ref. Manual 6.4.4.3.
Definition BNO08x.hpp:483
BNO08x::enable_step_counter
void enable_step_counter(uint32_t time_between_reports)
Sends command to enable step counter reports (See Ref. Manual 6.5.29)
Definition BNO08x.cpp:1330
BNO08x::get_quat_real
float get_quat_real()
Get real component of reported quaternion.
Definition BNO08x.cpp:1930
BNO08x::queue_command
void queue_command(uint8_t command, uint8_t *commands)
Queues a packet containing a command.
Definition BNO08x.cpp:554
BNO08x::disable_gravity
void disable_gravity()
Sends command to disable gravity reports by setting report interval to 0.
Definition BNO08x.cpp:1468
BNO08x::EVT_GRP_SPI_RX_VALID_PACKET
static const constexpr EventBits_t EVT_GRP_SPI_RX_VALID_PACKET
When this bit is set, it indicates a valid packet has been received and processed.
Definition BNO08x.hpp:393
BNO08x::spi_task_hdl
TaskHandle_t spi_task_hdl
spi_task() handle
Definition BNO08x.hpp:371
BNO08x::raw_quat_J
uint16_t raw_quat_J
Definition BNO08x.hpp:347
BNO08x::get_quat_radian_accuracy
float get_quat_radian_accuracy()
Get radian accuracy of reported quaternion.
Definition BNO08x.cpp:1941
BNO08x::raw_gyro_Y
uint16_t raw_gyro_Y
Definition BNO08x.hpp:346
BNO08x::default_imu_config
static bno08x_config_t default_imu_config
default imu config settings
Definition BNO08x.hpp:319
BNO08x::queue_packet
void queue_packet(uint8_t channel_number, uint8_t data_length, uint8_t *commands)
Queues an SHTP packet to be sent via SPI.
Definition BNO08x.cpp:500
BNO08x::evt_grp_report_en
EventGroupHandle_t evt_grp_report_en
Event group for indicating which reports are currently enabled.
Definition BNO08x.hpp:323
BNO08x::EVT_GRP_SPI_RX_INVALID_PACKET
static const constexpr EventBits_t EVT_GRP_SPI_RX_INVALID_PACKET
When this bit is set, it indicates an invalid packet has been received.
Definition BNO08x.hpp:395
BNO08x::get_yaw
float get_yaw()
Get the reported rotation about z axis.
Definition BNO08x.cpp:1818
BNO08x::EVT_GRP_RPT_TAP_DETECTOR_BIT
static const constexpr EventBits_t EVT_GRP_RPT_TAP_DETECTOR_BIT
When set, tap detector reports are active.
Definition BNO08x.hpp:414
BNO08x::disable_magnetometer
void disable_magnetometer()
Sends command to disable magnetometer reports by setting report interval to 0.
Definition BNO08x.cpp:1498
BNO08x::SENSOR_REPORT_ID_GRAVITY
static const constexpr uint8_t SENSOR_REPORT_ID_GRAVITY
See SH2 Ref. Manual 6.5.11.
Definition BNO08x.hpp:465
BNO08x::parse_packet
uint16_t parse_packet(bno08x_rx_packet_t *packet)
Parses a packet received from bno08x, updating any data according to received reports.
Definition BNO08x.cpp:875
BNO08x::TARE_ARVR_STABILIZED_GAME_ROTATION_VECTOR
static const constexpr uint8_t TARE_ARVR_STABILIZED_GAME_ROTATION_VECTOR
Tare ARVR stabilized game rotation vector.
Definition BNO08x.hpp:267
BNO08x::raw_quat_I
uint16_t raw_quat_I
Definition BNO08x.hpp:347
BNO08x::cb_list
std::vector< std::function< void()> > cb_list
Definition BNO08x.hpp:330
BNO08x::EVT_GRP_RPT_RAW_GYRO_BIT
static const constexpr EventBits_t EVT_GRP_RPT_RAW_GYRO_BIT
When set, raw gyro reports are active.
Definition BNO08x.hpp:419
BNO08x::get_roll_deg
float get_roll_deg()
Get the reported rotation about x axis.
Definition BNO08x.cpp:1845
BNO08x::get_raw_accel_Z
int16_t get_raw_accel_Z()
Get raw accelerometer z axis reading from physical accelerometer MEMs sensor (See Ref....
Definition BNO08x.cpp:2098
BNO08x::calibration_complete
bool calibration_complete()
Returns true if calibration has completed.
Definition BNO08x.cpp:709
BNO08x::SENSOR_REPORT_ID_PERSONAL_ACTIVITY_CLASSIFIER
static const constexpr uint8_t SENSOR_REPORT_ID_PERSONAL_ACTIVITY_CLASSIFIER
See SH2 Ref. Manual 6.5.36.
Definition BNO08x.hpp:476
BNO08x::enable_gyro_integrated_rotation_vector
void enable_gyro_integrated_rotation_vector(uint32_t time_between_reports)
Sends command to enable gyro integrated rotation vector reports (See Ref. Manual 6....
Definition BNO08x.cpp:1242
BNO08x::get_uncalibrated_gyro_bias_Y
float get_uncalibrated_gyro_bias_Y()
Get uncalibrated gyro Y axis drift estimate.
Definition BNO08x.cpp:2291
BNO08x::SHTP_REPORT_FRS_READ_REQUEST
static const constexpr uint8_t SHTP_REPORT_FRS_READ_REQUEST
See SH2 Ref. Manual 6.3.6.
Definition BNO08x.hpp:453
BNO08x::activity_classifier
uint8_t activity_classifier
Activity status reading (See SH-2 Ref. Manual 6.5.36)
Definition BNO08x.hpp:360
BNO08x::disable_raw_gyro
void disable_raw_gyro()
Sends command to disable raw gyro reports by setting report interval to 0.
Definition BNO08x.cpp:1558
BNO08x::raw_accel_X
uint16_t raw_accel_X
Definition BNO08x.hpp:342
BNO08x::get_linear_accel_X
float get_linear_accel_X()
Get x axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
Definition BNO08x.cpp:2038
BNO08x::disable_game_rotation_vector
void disable_game_rotation_vector()
Sends command to disable game rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:1408
BNO08x::raw_quat_K
uint16_t raw_quat_K
Definition BNO08x.hpp:347
BNO08x::EVT_GRP_RPT_ARVR_S_GAME_ROTATION_VECTOR_BIT
static const constexpr EventBits_t EVT_GRP_RPT_ARVR_S_GAME_ROTATION_VECTOR_BIT
When set, ARVR stabilized game rotation vector reports are active.
Definition BNO08x.hpp:404
BNO08x::COMMAND_DCD_PERIOD_SAVE
static const constexpr uint8_t COMMAND_DCD_PERIOD_SAVE
Configure DCD periodic saving (See SH2 Ref. Manual 6.4)
Definition BNO08x.hpp:445
BNO08x::meta_data
uint32_t meta_data[9]
First 9 bytes of meta data returned from FRS read operation (we don't really need the rest) (See Ref....
Definition BNO08x.hpp:332
BNO08x::wait_for_tx_done
bool wait_for_tx_done()
Waits for a queued packet to be sent or HOST_INT_TIMEOUT_MS to elapse.
Definition BNO08x.cpp:223
BNO08x::queue_rx_data
QueueHandle_t queue_rx_data
Packet queue used to send data received from bno08x from spi_task to data_proc_task.
Definition BNO08x.hpp:325
BNO08x::EVT_GRP_RPT_STABILITY_CLASSIFIER_BIT
static const constexpr EventBits_t EVT_GRP_RPT_STABILITY_CLASSIFIER_BIT
When set, stability classifier reports are active.
Definition BNO08x.hpp:416
BNO08x::enable_uncalibrated_gyro
void enable_uncalibrated_gyro(uint32_t time_between_reports)
Sends command to enable uncalibrated gyro reports (See Ref. Manual 6.5.14)
Definition BNO08x.cpp:1297
BNO08x::hint_handler
static void IRAM_ATTR hint_handler(void *arg)
HINT interrupt service routine, handles falling edge of BNO08x HINT pin.
Definition BNO08x.cpp:2859
BNO08x::SENSOR_REPORT_ID_RAW_ACCELEROMETER
static const constexpr uint8_t SENSOR_REPORT_ID_RAW_ACCELEROMETER
See SH2 Ref. Manual 6.5.8.
Definition BNO08x.hpp:473
BNO08x::SENSOR_REPORT_ID_TAP_DETECTOR
static const constexpr uint8_t SENSOR_REPORT_ID_TAP_DETECTOR
See SH2 Ref. Manual 6.5.27.
Definition BNO08x.hpp:470
BNO08x::get_gyro_accuracy
uint8_t get_gyro_accuracy()
Get calibrated gyro accuracy.
Definition BNO08x.cpp:2216
BNO08x::disable_gyro
void disable_gyro()
Sends command to disable gyro reports by setting report interval to 0.
Definition BNO08x.cpp:1478
BNO08x::get_magf_Y
float get_magf_Y()
Get Y component of magnetic field vector.
Definition BNO08x.cpp:1672
BNO08x::COMMAND_ME_CALIBRATE
static const constexpr uint8_t COMMAND_ME_CALIBRATE
Command and response to configure ME calibration (See SH2 Ref. Manual 6.4.7)
Definition BNO08x.hpp:444
BNO08x::queue_reset_reason
QueueHandle_t queue_reset_reason
Queue used to send reset reason from product id report to reset_reason() function.
Definition BNO08x.hpp:328
BNO08x::raw_quat_real
uint16_t raw_quat_real
Definition BNO08x.hpp:347
BNO08x::get_gravity_X
float get_gravity_X()
Get the reported x axis gravity.
Definition BNO08x.cpp:1722
BNO08x::EVT_GRP_RPT_ALL_BITS
static const constexpr EventBits_t EVT_GRP_RPT_ALL_BITS
Definition BNO08x.hpp:422
BNO08x::get_roll
float get_roll()
Get the reported rotation about x axis.
Definition BNO08x.cpp:1762
BNO08x::raw_bias_X
uint16_t raw_bias_X
Definition BNO08x.hpp:353
BNO08x::get_gravity_Y
float get_gravity_Y()
Get the reported y axis gravity.
Definition BNO08x.cpp:1732
BNO08x::enable_ARVR_stabilized_rotation_vector
void enable_ARVR_stabilized_rotation_vector(uint32_t time_between_reports)
Sends command to enable ARVR stabilized rotation vector reports (See Ref. Manual 6....
Definition BNO08x.cpp:1220
BNO08x::SENSOR_REPORT_ID_ARVR_STABILIZED_ROTATION_VECTOR
static const constexpr uint8_t SENSOR_REPORT_ID_ARVR_STABILIZED_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.42.
Definition BNO08x.hpp:477
BNO08x::enable_raw_gyro
void enable_raw_gyro(uint32_t time_between_reports)
Sends command to enable raw gyro reports (See Ref. Manual 6.5.12)
Definition BNO08x.cpp:1377
BNO08x::parse_input_report
uint16_t parse_input_report(bno08x_rx_packet_t *packet)
Parses received input report sent by BNO08x.
Definition BNO08x.cpp:987
BNO08x::TARE_ROTATION_VECTOR
static const constexpr uint8_t TARE_ROTATION_VECTOR
Tare rotation vector.
Definition BNO08x.hpp:262
BNO08x::EVT_GRP_RPT_MAGNETOMETER_BIT
static const constexpr EventBits_t EVT_GRP_RPT_MAGNETOMETER_BIT
When set, magnetometer reports are active.
Definition BNO08x.hpp:413
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:368
BNO08x::ROTATION_VECTOR_ACCURACY_Q1
static const constexpr int16_t ROTATION_VECTOR_ACCURACY_Q1
Rotation vector accuracy estimate Q point (See SH-2 Ref. Manual 6.5.18)
Definition BNO08x.hpp:270
BNO08x::get_accel
void get_accel(float &x, float &y, float &z, uint8_t &accuracy)
Get full acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:1967
BNO08x::mems_raw_accel_X
uint16_t mems_raw_accel_X
Definition BNO08x.hpp:363
BNO08x::COMMAND_COUNTER
static const constexpr uint8_t COMMAND_COUNTER
Definition BNO08x.hpp:440
BNO08x::get_Q2
int16_t get_Q2(uint16_t record_ID)
Gets Q2 point from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2512
BNO08x::CALIBRATE_PLANAR_ACCEL
static const constexpr uint8_t CALIBRATE_PLANAR_ACCEL
Calibrate planar acceleration command used by queue_calibrate_command.
Definition BNO08x.hpp:433
BNO08x::get_raw_accel_Y
int16_t get_raw_accel_Y()
Get raw accelerometer y axis reading from physical accelerometer MEMs sensor (See Ref....
Definition BNO08x.cpp:2088
BNO08x::EVT_GRP_RPT_ACTIVITY_CLASSIFIER_BIT
static const constexpr EventBits_t EVT_GRP_RPT_ACTIVITY_CLASSIFIER_BIT
When set, activity classifier reports are active.
Definition BNO08x.hpp:417
BNO08x::soft_reset
bool soft_reset()
Soft resets BNO08x sensor using executable channel.
Definition BNO08x.cpp:294
BNO08x::bus_config
spi_bus_config_t bus_config
SPI bus GPIO configuration settings.
Definition BNO08x.hpp:335
BNO08x::gyro_accuracy
uint16_t gyro_accuracy
Raw gyro reading (See SH-2 Ref. Manual 6.5.13)
Definition BNO08x.hpp:346
BNO08x::get_raw_magf_Z
int16_t get_raw_magf_Z()
Get raw magnetometer z axis reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:2158
BNO08x::queue_frs_read_data
QueueHandle_t queue_frs_read_data
Queue used to send packet body from data_proc_task to frs read functions.
Definition BNO08x.hpp:327
BNO08x::calibrate_gyro
void calibrate_gyro()
Sends command to calibrate gyro.
Definition BNO08x.cpp:608
BNO08x::SENSOR_REPORT_ID_RAW_MAGNETOMETER
static const constexpr uint8_t SENSOR_REPORT_ID_RAW_MAGNETOMETER
See SH2 Ref. Manual 6.5.15.
Definition BNO08x.hpp:475
BNO08x::TARE_GYRO_INTEGRATED_ROTATION_VECTOR
static const constexpr uint8_t TARE_GYRO_INTEGRATED_ROTATION_VECTOR
Tare gyro integrated rotation vector.
Definition BNO08x.hpp:265
BNO08x::FRS_RECORD_ID_ROTATION_VECTOR
static const constexpr uint16_t FRS_RECORD_ID_ROTATION_VECTOR
Rotation vector record ID, to be passed in metadata functions like get_Q1()
Definition BNO08x.hpp:255
BNO08x::get_quat_K
float get_quat_K()
Get K component of reported quaternion.
Definition BNO08x.cpp:1919
BNO08x::get_quat_J
float get_quat_J()
Get J component of reported quaternion.
Definition BNO08x.cpp:1908
BNO08x::MAGNETOMETER_Q1
static const constexpr int16_t MAGNETOMETER_Q1
Magnetometer Q point (See SH-2 Ref. Manual 6.5.16)
Definition BNO08x.hpp:274
BNO08x::save_calibration
void save_calibration()
Sends command to save internal calibration data (See Ref. Manual 6.4.7).
Definition BNO08x.cpp:734
BNO08x::evt_grp_spi
EventGroupHandle_t evt_grp_spi
Event group for indicating when bno08x hint pin has triggered and when new data has been processed....
Definition BNO08x.hpp:322
BNO08x::EVT_GRP_SPI_TX_DONE
static const constexpr EventBits_t EVT_GRP_SPI_TX_DONE
When this bit is set, it indicates a queued packet has been sent.
Definition BNO08x.hpp:397
BNO08x::GYRO_Q1
static const constexpr int16_t GYRO_Q1
Gyro Q point (See SH-2 Ref. Manual 6.5.13)
Definition BNO08x.hpp:273
BNO08x::disable_ARVR_stabilized_rotation_vector
void disable_ARVR_stabilized_rotation_vector()
Sends command to disable ARVR stabilized rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:1418
BNO08x::raw_velocity_gyro_X
uint16_t raw_velocity_gyro_X
Definition BNO08x.hpp:349
BNO08x::raw_magf_X
uint16_t raw_magf_X
Definition BNO08x.hpp:355
BNO08x::EVT_GRP_RPT_ARVR_S_ROTATION_VECTOR_BIT
static const constexpr EventBits_t EVT_GRP_RPT_ARVR_S_ROTATION_VECTOR_BIT
When set, ARVR stabilized rotation vector reports are active.
Definition BNO08x.hpp:402
BNO08x::disable_gyro_integrated_rotation_vector
void disable_gyro_integrated_rotation_vector()
Sends command to disable gyro integrated rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:1438
BNO08x::mems_raw_magf_Y
uint16_t mems_raw_magf_Y
Definition BNO08x.hpp:367
BNO08x::disable_uncalibrated_gyro
void disable_uncalibrated_gyro()
Sends command to disable uncalibrated gyro reports by setting report interval to 0.
Definition BNO08x.cpp:1488
BNO08x::ANGULAR_VELOCITY_Q1
static const constexpr int16_t ANGULAR_VELOCITY_Q1
Angular velocity Q point (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:275
BNO08x::SHTP_REPORT_COMMAND_REQUEST
static const constexpr uint8_t SHTP_REPORT_COMMAND_REQUEST
See SH2 Ref. Manual 6.3.8.
Definition BNO08x.hpp:451
BNO08x::enable_stability_classifier
void enable_stability_classifier(uint32_t time_between_reports)
Sends command to enable activity stability classifier reports (See Ref. Manual 6.5....
Definition BNO08x.cpp:1341
BNO08x::disable_ARVR_stabilized_game_rotation_vector
void disable_ARVR_stabilized_game_rotation_vector()
Sends command to disable ARVR stabilized game rotation vector reports by setting report interval to 0...
Definition BNO08x.cpp:1428
BNO08x::EVT_GRP_RPT_STEP_COUNTER_BIT
static const constexpr EventBits_t EVT_GRP_RPT_STEP_COUNTER_BIT
When set, step counter reports are active.
Definition BNO08x.hpp:415
BNO08x::disable_stability_classifier
void disable_stability_classifier()
Sends command to disable stability reports by setting report interval to 0.
Definition BNO08x.cpp:1528
BNO08x::data_proc_task
void data_proc_task()
Task responsible parsing packets. Executed when SPI task sends a packet to be parsed,...
Definition BNO08x.cpp:2830
BNO08x::raw_magf_Z
uint16_t raw_magf_Z
Definition BNO08x.hpp:355
BNO08x::raw_velocity_gyro_Z
uint16_t raw_velocity_gyro_Z
Raw gyro angular velocity reading (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:350
BNO08x::enable_rotation_vector
void enable_rotation_vector(uint32_t time_between_reports)
Sends command to enable rotation vector reports (See Ref. Manual 6.5.18)
Definition BNO08x.cpp:1209
BNO08x::get_magf_Z
float get_magf_Z()
Get Z component of magnetic field vector.
Definition BNO08x.cpp:1683
BNO08x::enable_tap_detector
void enable_tap_detector(uint32_t time_between_reports)
Sends command to enable tap detector reports (See Ref. Manual 6.5.27)
Definition BNO08x.cpp:1319
BNO08x::raw_accel_Y
uint16_t raw_accel_Y
Definition BNO08x.hpp:342
BNO08x::mems_raw_magf_X
uint16_t mems_raw_magf_X
Definition BNO08x.hpp:367
BNO08x::SENSOR_REPORT_ID_STABILITY_CLASSIFIER
static const constexpr uint8_t SENSOR_REPORT_ID_STABILITY_CLASSIFIER
See SH2 Ref. Manual 6.5.31.
Definition BNO08x.hpp:472
BNO08x::queue_request_product_id_command
void queue_request_product_id_command()
Queues a packet containing the request product ID command.
Definition BNO08x.cpp:570
BNO08x::mems_raw_gyro_Y
uint16_t mems_raw_gyro_Y
Definition BNO08x.hpp:365
BNO08x::get_gyro_calibrated_velocity_X
float get_gyro_calibrated_velocity_X()
Get calibrated gyro x axis angular velocity measurement.
Definition BNO08x.cpp:2186
BNO08x::EVT_GRP_RPT_GRAVITY_BIT
static const constexpr EventBits_t EVT_GRP_RPT_GRAVITY_BIT
When set, gravity reports are active.
Definition BNO08x.hpp:410
BNO08x::TARE_GAME_ROTATION_VECTOR
static const constexpr uint8_t TARE_GAME_ROTATION_VECTOR
Tare game rotation vector.
Definition BNO08x.hpp:263
BNO08x::SENSOR_REPORT_ID_GEOMAGNETIC_ROTATION_VECTOR
static const constexpr uint8_t SENSOR_REPORT_ID_GEOMAGNETIC_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.20.
Definition BNO08x.hpp:468
BNO08x::raw_lin_accel_Z
uint16_t raw_lin_accel_Z
Definition BNO08x.hpp:344
BNO08x::time_stamp
uint32_t time_stamp
Report timestamp (see datasheet 1.3.5.3)
Definition BNO08x.hpp:341
BNO08x::get_accel_X
float get_accel_X()
Get x axis acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:1980
BNO08x::enable_game_rotation_vector
void enable_game_rotation_vector(uint32_t time_between_reports)
Sends command to enable game rotation vector reports (See Ref. Manual 6.5.19)
Definition BNO08x.cpp:1198
BNO08x::TARE_ARVR_STABILIZED_ROTATION_VECTOR
static const constexpr uint8_t TARE_ARVR_STABILIZED_ROTATION_VECTOR
Tare ARVR stabilized rotation vector.
Definition BNO08x.hpp:266
BNO08x::CALIBRATE_MAG
static const constexpr uint8_t CALIBRATE_MAG
Calibrate magnetometer command used by queue_calibrate_command.
Definition BNO08x.hpp:432
BNO08x::spi_transaction
spi_transaction_t spi_transaction
SPI transaction handle.
Definition BNO08x.hpp:338
BNO08x::mode_on
bool mode_on()
Turns on/ brings BNO08x sensor out of sleep mode using executable channel.
Definition BNO08x.cpp:348
BNO08x::calibrate_magnetometer
void calibrate_magnetometer()
Sends command to calibrate magnetometer.
Definition BNO08x.cpp:620
BNO08x::EVT_GRP_RPT_RAW_MAGNETOMETER_BIT
static const constexpr EventBits_t EVT_GRP_RPT_RAW_MAGNETOMETER_BIT
When set, raw magnetometer reports are active.
Definition BNO08x.hpp:420
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:366
BNO08x::raw_bias_Y
uint16_t raw_bias_Y
Definition BNO08x.hpp:353
BNO08x::magf_accuracy
uint16_t magf_accuracy
Calibrated magnetic field reading in uTesla (See SH-2 Ref. Manual 6.5.16)
Definition BNO08x.hpp:356
BNO08x::end_calibration
void end_calibration()
Sends command to end calibration procedure.
Definition BNO08x.cpp:722
BNO08x::SENSOR_REPORT_ID_UNCALIBRATED_GYRO
static const constexpr uint8_t SENSOR_REPORT_ID_UNCALIBRATED_GYRO
See SH2 Ref. Manual 6.5.14.
Definition BNO08x.hpp:466
BNO08x::spi_hdl
spi_device_handle_t spi_hdl
SPI device handle.
Definition BNO08x.hpp:337
BNO08x::raw_uncalib_gyro_Y
uint16_t raw_uncalib_gyro_Y
Definition BNO08x.hpp:353
BNO08x::get_gravity_accuracy
uint8_t get_gravity_accuracy()
Get the reported gravity accuracy.
Definition BNO08x.cpp:1752
BNO08x::SENSOR_REPORT_ID_GYRO_INTEGRATED_ROTATION_VECTOR
static const constexpr uint8_t SENSOR_REPORT_ID_GYRO_INTEGRATED_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.44.
Definition BNO08x.hpp:469
BNO08x::get_gyro_velocity_Y
float get_gyro_velocity_Y()
Get y axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6....
Definition BNO08x.cpp:2347
BNO08x::raw_magf_Y
uint16_t raw_magf_Y
Definition BNO08x.hpp:355
BNO08x::get_gyro_velocity_X
float get_gyro_velocity_X()
Get x axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6....
Definition BNO08x.cpp:2337
BNO08x::CALIBRATE_ACCEL
static const constexpr uint8_t CALIBRATE_ACCEL
Calibrate accelerometer command used by queue_calibrate_command.
Definition BNO08x.hpp:430
BNO08x::SENSOR_REPORT_ID_LINEAR_ACCELERATION
static const constexpr uint8_t SENSOR_REPORT_ID_LINEAR_ACCELERATION
See SH2 Ref. Manual 6.5.10.
Definition BNO08x.hpp:463
BNO08x::queue_calibrate_command
void queue_calibrate_command(uint8_t _to_calibrate)
Queues a packet containing a command to calibrate the specified sensor.
Definition BNO08x.cpp:645
BNO08x::LINEAR_ACCELEROMETER_Q1
static const constexpr int16_t LINEAR_ACCELEROMETER_Q1
Linear acceleration Q point (See SH-2 Ref. Manual 6.5.10)
Definition BNO08x.hpp:272
BNO08x::calibration_status
uint8_t calibration_status
Calibration status of device (See SH-2 Ref. Manual 6.4.7.1 & 6.4.7.2)
Definition BNO08x.hpp:362
BNO08x::get_uncalibrated_gyro_bias_X
float get_uncalibrated_gyro_bias_X()
Get uncalibrated gyro x axis drift estimate.
Definition BNO08x.cpp:2281
BNO08x::get_gyro_calibrated_velocity_Y
float get_gyro_calibrated_velocity_Y()
Get calibrated gyro y axis angular velocity measurement.
Definition BNO08x.cpp:2196
BNO08x::get_linear_accel
void get_linear_accel(float &x, float &y, float &z, uint8_t &accuracy)
Get full linear acceleration (acceleration of the device minus gravity, units in m/s^2).
Definition BNO08x.cpp:2025
BNO08x::disable_accelerometer
void disable_accelerometer()
Sends command to disable accelerometer reports by setting report interval to 0.
Definition BNO08x.cpp:1448
BNO08x::enable_gyro
void enable_gyro(uint32_t time_between_reports)
Sends command to enable gyro reports (See Ref. Manual 6.5.13)
Definition BNO08x.cpp:1286
BNO08x::enable_activity_classifier
void enable_activity_classifier(uint32_t time_between_reports, uint32_t activities_to_enable, uint8_t(&activity_confidence_vals)[9])
Sends command to enable activity classifier reports (See Ref. Manual 6.5.36)
Definition BNO08x.cpp:1354
BNO08x::FRS_RECORD_ID_ACCELEROMETER
static const constexpr uint16_t FRS_RECORD_ID_ACCELEROMETER
Accelerometer record ID, to be passed in metadata functions like get_Q1()
Definition BNO08x.hpp:249
BNO08x::step_count
uint16_t step_count
Step counter reading (See SH-2 Ref. Manual 6.5.29)
Definition BNO08x.hpp:358
BNO08x::mems_raw_accel_Y
uint16_t mems_raw_accel_Y
Definition BNO08x.hpp:363
BNO08x::get_time_stamp
uint32_t get_time_stamp()
Return timestamp of most recent report.
Definition BNO08x.cpp:1633
BNO08x::EVT_GRP_RPT_LINEAR_ACCELEROMETER_BIT
static const constexpr EventBits_t EVT_GRP_RPT_LINEAR_ACCELEROMETER_BIT
When set, linear accelerometer reports are active.
Definition BNO08x.hpp:409
BNO08x::SENSOR_REPORT_ID_GAME_ROTATION_VECTOR
static const constexpr uint8_t SENSOR_REPORT_ID_GAME_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.19.
Definition BNO08x.hpp:467
BNO08x::get_step_count
uint16_t get_step_count()
Get the counted amount of steps.
Definition BNO08x.cpp:2379
BNO08x::disable_raw_magnetometer
void disable_raw_magnetometer()
Sends command to disable raw magnetometer reports by setting report interval to 0.
Definition BNO08x.cpp:1568
BNO08x::get_raw_magf_X
int16_t get_raw_magf_X()
Get raw magnetometer x axis reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:2138
BNO08x::FRS_read_request
bool FRS_read_request(uint16_t record_ID, uint16_t read_offset, uint16_t block_size)
Requests meta data from BNO08x FRS (flash record system) given the record ID. Contains Q points and o...
Definition BNO08x.cpp:2600
BNO08x::gravity_accuracy
uint16_t gravity_accuracy
Gravity reading in m/s^2 (See SH-2 Ref. Manual 6.5.11)
Definition BNO08x.hpp:352
BNO08x::GRAVITY_Q1
static const constexpr int16_t GRAVITY_Q1
Gravity Q point (See SH-2 Ref. Manual 6.5.11)
Definition BNO08x.hpp:276
BNO08x::enable_linear_accelerometer
void enable_linear_accelerometer(uint32_t time_between_reports)
Sends command to enable linear accelerometer reports (See Ref. Manual 6.5.10)
Definition BNO08x.cpp:1264
BNO08x::raw_lin_accel_X
uint16_t raw_lin_accel_X
Definition BNO08x.hpp:344
BNO08x::get_gyro_velocity_Z
float get_gyro_velocity_Z()
Get z axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6....
Definition BNO08x.cpp:2357
BNO08x::SHTP_REPORT_BASE_TIMESTAMP
static const constexpr uint8_t SHTP_REPORT_BASE_TIMESTAMP
See SH2 Ref. Manual 7.2.1.
Definition BNO08x.hpp:456
BNO08x::receive_packet
bool receive_packet()
Receives a SHTP packet via SPI and sends it to data_proc_task()
Definition BNO08x.cpp:396
BNO08x::run_full_calibration_routine
bool run_full_calibration_routine()
Runs full calibration routine.
Definition BNO08x.cpp:753
BNO08x::HOST_INT_TIMEOUT_MS
static const constexpr uint64_t HOST_INT_TIMEOUT_MS
Max wait between HINT being asserted by BNO08x before transaction is considered failed (in milisecond...
Definition BNO08x.hpp:387
BNO08x::initialize
bool initialize()
Initializes BNO08x sensor.
Definition BNO08x.cpp:114
BNO08x::CALIBRATE_GYRO
static const constexpr uint8_t CALIBRATE_GYRO
Calibrate gyro command used by queue_calibrate_command.
Definition BNO08x.hpp:431
BNO08x::SENSOR_REPORT_ID_ARVR_STABILIZED_GAME_ROTATION_VECTOR
static const constexpr uint8_t SENSOR_REPORT_ID_ARVR_STABILIZED_GAME_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.43.
Definition BNO08x.hpp:478
BNO08x::SHTP_REPORT_FRS_READ_RESPONSE
static const constexpr uint8_t SHTP_REPORT_FRS_READ_RESPONSE
See SH2 Ref. Manual 6.3.7.
Definition BNO08x.hpp:452
BNO08x::TARE_AXIS_Z
static const constexpr uint8_t TARE_AXIS_Z
Tar yaw axis only (used with tare now command)
Definition BNO08x.hpp:259
BNO08x::imu_config
bno08x_config_t imu_config
IMU configuration settings.
Definition BNO08x.hpp:334
BNO08x::calibrate_accelerometer
void calibrate_accelerometer()
Sends command to calibrate accelerometer.
Definition BNO08x.cpp:596
BNO08x::COMMAND_DCD
static const constexpr uint8_t COMMAND_DCD
Save DCD command (See SH2 Ref. Manual 6.4.7)
Definition BNO08x.hpp:443
BNO08x::get_raw_gyro_X
int16_t get_raw_gyro_X()
Get raw gyroscope x axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:2108
BNO08x::gravity_Y
uint16_t gravity_Y
Definition BNO08x.hpp:351
BNO08x::raw_accel_Z
uint16_t raw_accel_Z
Definition BNO08x.hpp:342
BNO08x::queue_feature_command
void queue_feature_command(uint8_t report_ID, uint32_t time_between_reports)
Queues a packet containing a command with a request for sensor reports, reported periodically....
Definition BNO08x.cpp:2756
BNO08x::gravity_X
uint16_t gravity_X
Definition BNO08x.hpp:351
BNO08x::get_pitch_deg
float get_pitch_deg()
Get the reported rotation about y axis.
Definition BNO08x.cpp:1855
BNO08x::CALIBRATE_ACCEL_GYRO_MAG
static const constexpr uint8_t CALIBRATE_ACCEL_GYRO_MAG
Calibrate accelerometer, gyro, & magnetometer command used by queue_calibrate_command.
Definition BNO08x.hpp:434
BNO08x::get_yaw_deg
float get_yaw_deg()
Get the reported rotation about z axis.
Definition BNO08x.cpp:1865
BNO08x::EVT_GRP_RPT_GYRO_UNCALIBRATED_BIT
static const constexpr EventBits_t EVT_GRP_RPT_GYRO_UNCALIBRATED_BIT
When set, uncalibrated gyro reports are active.
Definition BNO08x.hpp:412
BNO08x::activity_confidences
uint8_t * activity_confidences
Confidence of read activities (See SH-2 Ref. Manual 6.5.36)
Definition BNO08x.hpp:361
BNO08x::data_proc_task_hdl
TaskHandle_t data_proc_task_hdl
data_proc_task() task handle
Definition BNO08x.hpp:376
BNO08x::gravity_Z
uint16_t gravity_Z
Definition BNO08x.hpp:351
BNO08x::raw_uncalib_gyro_Z
uint16_t raw_uncalib_gyro_Z
Definition BNO08x.hpp:353
BNO08x::save_tare
void save_tare()
Sends command to save tare into non-volatile memory of BNO08x (See Ref. Manual 6.4....
Definition BNO08x.cpp:1593
BNO08x::disable_linear_accelerometer
void disable_linear_accelerometer()
Sends command to disable linear accelerometer reports by setting report interval to 0.
Definition BNO08x.cpp:1458
BNO08x::calibrate_all
void calibrate_all()
Sends command to calibrate accelerometer, gyro, and magnetometer.
Definition BNO08x.cpp:584
BNO08x::raw_uncalib_gyro_X
uint16_t raw_uncalib_gyro_X
Definition BNO08x.hpp:353
BNO08x::get_accel_Y
float get_accel_Y()
Get y axis acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:1990
BNO08x::get_linear_accel_Z
float get_linear_accel_Z()
Get z axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
Definition BNO08x.cpp:2058
BNO08x::clear_tare
void clear_tare()
Sends command to clear persistent tare settings in non-volatile memory of BNO08x (See Ref....
Definition BNO08x.cpp:1605
BNO08x::get_gyro_velocity
void get_gyro_velocity(float &x, float &y, float &z)
Full rotational velocity from gyro-integrated rotation vector (See Ref. Manual 6.5....
Definition BNO08x.cpp:2325
BNO08x::raw_lin_accel_Y
uint16_t raw_lin_accel_Y
Definition BNO08x.hpp:344
BNO08x::get_raw_gyro_Y
int16_t get_raw_gyro_Y()
Get raw gyroscope y axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:2118
BNO08x::request_calibration_status
void request_calibration_status()
Requests ME calibration status from BNO08x (see Ref. Manual 6.4.7.2)
Definition BNO08x.cpp:692
BNO08x::bno08x_rx_packet_t
Holds data that is received over spi.
Definition BNO08x.hpp:281
BNO08x::bno08x_rx_packet_t::length
uint16_t length
Body of SHTP packet.
Definition BNO08x.hpp:284
BNO08x::bno08x_rx_packet_t::header
uint8_t header[4]
Header of SHTP packet.
Definition BNO08x.hpp:282
BNO08x::bno08x_rx_packet_t::body
uint8_t body[300]
Definition BNO08x.hpp:283
BNO08x::bno08x_tx_packet_t
Holds data that is sent over spi.
Definition BNO08x.hpp:289
BNO08x::bno08x_tx_packet_t::body
uint8_t body[50]
Body of SHTP the packet (header + body)
Definition BNO08x.hpp:290
BNO08x::bno08x_tx_packet_t::length
uint16_t length
Packet length in bytes.
Definition BNO08x.hpp:291
bno08x_config_t
IMU configuration settings passed into constructor.
Definition BNO08x.hpp:44
bno08x_config_t::spi_peripheral
spi_host_device_t spi_peripheral
SPI peripheral to be used.
Definition BNO08x.hpp:45
bno08x_config_t::sclk_speed
uint32_t sclk_speed
Desired SPI SCLK speed in Hz (max 3MHz)
Definition BNO08x.hpp:53
bno08x_config_t::io_int
gpio_num_t io_int
Chip select pin (connects to BNO08x CS pin)
Definition BNO08x.hpp:50
bno08x_config_t::io_rst
gpio_num_t io_rst
Host interrupt pin (connects to BNO08x INT pin)
Definition BNO08x.hpp:51
bno08x_config_t::io_sclk
gpio_num_t io_sclk
SCLK pin (connects to BNO08x SCL pin)
Definition BNO08x.hpp:48
bno08x_config_t::io_mosi
gpio_num_t io_mosi
MOSI GPIO pin (connects to BNO08x DI pin)
Definition BNO08x.hpp:46
bno08x_config_t::io_wake
gpio_num_t io_wake
Reset pin (connects to BNO08x RST pin)
Definition BNO08x.hpp:52
bno08x_config_t::io_miso
gpio_num_t io_miso
MISO GPIO pin (connects to BNO08x SDA pin)
Definition BNO08x.hpp:47
bno08x_config_t::io_cs
gpio_num_t io_cs
Definition BNO08x.hpp:49
bno08x_config_t::bno08x_config_t
bno08x_config_t()
Default IMU configuration settings constructor. To modify default GPIO pins, run "idf....
Definition BNO08x.hpp:58
bno08x_config_t::bno08x_config_t
bno08x_config_t(spi_host_device_t spi_peripheral, gpio_num_t io_mosi, gpio_num_t io_miso, gpio_num_t io_sclk, gpio_num_t io_cs, gpio_num_t io_int, gpio_num_t io_rst, gpio_num_t io_wake, uint32_t sclk_speed)
Overloaded IMU configuration settings constructor for custom pin settings.
Definition BNO08x.hpp:73