esp32_BNO08x 1.2
C++ BNO08x IMU driver component for esp-idf.
Loading...
Searching...
No Matches
BNO08x.hpp
Go to the documentation of this file.
1
5#pragma once
6// standard library includes
7#include <inttypes.h>
8#include <math.h>
9#include <stdio.h>
10#include <cstring>
11#include <functional>
12#include <vector>
13
14// esp-idf includes
15#include <esp_log.h>
16#include <esp_rom_gpio.h>
17#include <esp_timer.h>
18#include <freertos/FreeRTOS.h>
19#include <freertos/task.h>
20#include <freertos/event_groups.h>
21#include <freertos/queue.h>
22#include <freertos/semphr.h>
23#include <rom/ets_sys.h>
24
25// in-house includes
27
33class BNO08x
34{
35 public:
37 ~BNO08x();
38 bool initialize();
39
40 bool hard_reset();
41 bool soft_reset();
43
44 bool mode_sleep();
45 bool mode_on();
46 float q_to_float(int16_t fixed_point_value, uint8_t q_point);
47
49 void calibrate_all();
51 void calibrate_gyro();
56 void end_calibration();
57 void save_calibration();
58
59 void enable_rotation_vector(uint32_t time_between_reports);
60 void enable_game_rotation_vector(uint32_t time_between_reports);
61 void enable_ARVR_stabilized_rotation_vector(uint32_t time_between_reports);
62 void enable_ARVR_stabilized_game_rotation_vector(uint32_t time_between_reports);
63 void enable_gyro_integrated_rotation_vector(uint32_t time_between_reports);
64 void enable_uncalibrated_gyro(uint32_t time_between_reports);
65 void enable_calibrated_gyro(uint32_t time_between_reports);
66 void enable_accelerometer(uint32_t time_between_reports);
67 void enable_linear_accelerometer(uint32_t time_between_reports);
68 void enable_gravity(uint32_t time_between_reports);
69 void enable_magnetometer(uint32_t time_between_reports);
70 void enable_tap_detector(uint32_t time_between_reports);
71 void enable_step_counter(uint32_t time_between_reports);
72 void enable_stability_classifier(uint32_t time_between_reports);
73 void enable_activity_classifier(uint32_t time_between_reports, BNO08xActivityEnable activities_to_enable, uint8_t (&activity_confidence_vals)[9]);
74 void enable_raw_mems_gyro(uint32_t time_between_reports);
75 void enable_raw_mems_accelerometer(uint32_t time_between_reports);
76 void enable_raw_mems_magnetometer(uint32_t time_between_reports);
77
85 void disable_gravity();
96
97 void tare_now(uint8_t axis_sel = TARE_AXIS_ALL, uint8_t rotation_vector_basis = TARE_ROTATION_VECTOR);
98 void save_tare();
99 void clear_tare();
100
101 bool data_available(bool ignore_no_reports_enabled = false);
102 void register_cb(std::function<void()> cb_fxn);
103
105
106 uint32_t get_time_stamp();
107
108 void get_magf(float& x, float& y, float& z, BNO08xAccuracy& accuracy);
109 float get_magf_X();
110 float get_magf_Y();
111 float get_magf_Z();
113
114 void get_gravity(float& x, float& y, float& z, BNO08xAccuracy& accuracy);
115 float get_gravity_X();
116 float get_gravity_Y();
117 float get_gravity_Z();
119
120 float get_roll();
121 float get_pitch();
122 float get_yaw();
123
124 float get_roll_deg();
125 float get_pitch_deg();
126 float get_yaw_deg();
127
128 void get_quat(float& i, float& j, float& k, float& real, float& rad_accuracy, BNO08xAccuracy& accuracy);
129 float get_quat_I();
130 float get_quat_J();
131 float get_quat_K();
132 float get_quat_real();
135
136 void get_accel(float& x, float& y, float& z, BNO08xAccuracy& accuracy);
137 float get_accel_X();
138 float get_accel_Y();
139 float get_accel_Z();
141
142 void get_linear_accel(float& x, float& y, float& z, BNO08xAccuracy& accuracy);
143 float get_linear_accel_X();
144 float get_linear_accel_Y();
145 float get_linear_accel_Z();
147
148 void get_raw_mems_accel(uint16_t& x, uint16_t& y, uint16_t& z);
149 uint16_t get_raw_mems_accel_X();
150 uint16_t get_raw_mems_accel_Y();
151 uint16_t get_raw_mems_accel_Z();
152
153 void get_raw_mems_gyro(uint16_t& x, uint16_t& y, uint16_t& z);
154 uint16_t get_raw_mems_gyro_X();
155 uint16_t get_raw_mems_gyro_Y();
156 uint16_t get_raw_mems_gyro_Z();
157
158 void get_raw_mems_magf(uint16_t& x, uint16_t& y, uint16_t& z);
159 uint16_t get_raw_mems_magf_X();
160 uint16_t get_raw_mems_magf_Y();
161 uint16_t get_raw_mems_magf_Z();
162
163 void get_calibrated_gyro_velocity(float& x, float& y, float& z);
167
168 void get_uncalibrated_gyro_velocity(float& x, float& y, float& z, float& bx, float& by, float& bz);
175
176 void get_integrated_gyro_velocity(float& x, float& y, float& z);
180
181 uint8_t get_tap_detector();
182 uint16_t get_step_count();
185
186 // Metadata functions
187 int16_t get_Q1(uint16_t record_ID);
188 int16_t get_Q2(uint16_t record_ID);
189 int16_t get_Q3(uint16_t record_ID);
190 float get_resolution(uint16_t record_ID);
191 float get_range(uint16_t record_ID);
192 uint32_t FRS_read_word(uint16_t record_ID, uint8_t word_number);
193 bool FRS_read_request(uint16_t record_ID, uint16_t read_offset, uint16_t block_size);
194 bool FRS_read_data(uint16_t record_ID, uint8_t start_location, uint8_t words_to_read);
195
196 // Record IDs from figure 29, page 29 reference manual
197 // These are used to read the metadata for each sensor type
198 static const constexpr uint16_t FRS_RECORD_ID_ACCELEROMETER =
199 0xE302U;
200 static const constexpr uint16_t FRS_RECORD_ID_GYROSCOPE_CALIBRATED =
201 0xE306U;
202 static const constexpr uint16_t FRS_RECORD_ID_MAGNETIC_FIELD_CALIBRATED =
203 0xE309U;
204 static const constexpr uint16_t FRS_RECORD_ID_ROTATION_VECTOR =
205 0xE30BU;
206
207 static const constexpr uint8_t TARE_AXIS_ALL = 0x07U;
208 static const constexpr uint8_t TARE_AXIS_Z = 0x04U;
209
210 // Which rotation vector to tare, BNO08x saves them seperately
211 static const constexpr uint8_t TARE_ROTATION_VECTOR = 0U;
212 static const constexpr uint8_t TARE_GAME_ROTATION_VECTOR = 1U;
213 static const constexpr uint8_t TARE_GEOMAGNETIC_ROTATION_VECTOR = 2U;
214 static const constexpr uint8_t TARE_GYRO_INTEGRATED_ROTATION_VECTOR = 3U;
215 static const constexpr uint8_t TARE_ARVR_STABILIZED_ROTATION_VECTOR = 4U;
216 static const constexpr uint8_t TARE_ARVR_STABILIZED_GAME_ROTATION_VECTOR = 5U;
217
218 static const constexpr int16_t ROTATION_VECTOR_Q1 = 14;
219 static const constexpr int16_t ROTATION_VECTOR_ACCURACY_Q1 = 12;
220 static const constexpr int16_t ACCELEROMETER_Q1 = 8;
221 static const constexpr int16_t LINEAR_ACCELEROMETER_Q1 = 8;
222 static const constexpr int16_t GYRO_Q1 = 9;
223 static const constexpr int16_t MAGNETOMETER_Q1 = 4;
224 static const constexpr int16_t ANGULAR_VELOCITY_Q1 = 10;
225 static const constexpr int16_t GRAVITY_Q1 = 8;
226
227 private:
238
240 typedef struct bno08x_rx_packet_t
241 {
242 uint8_t header[4];
243 uint8_t body[300];
244 uint16_t length;
246
248 typedef struct bno08x_tx_packet_t
249 {
250 uint8_t body[50];
251 uint16_t length;
253
259
261 typedef struct bno08x_init_status_t
262 {
267 uint8_t task_count;
269 bool spi_task;
270 bool spi_bus;
272
274 : gpio_outputs(false)
275 , gpio_inputs(false)
276 , isr_service(false)
277 , isr_handler(false)
278 , task_count(0)
279 , data_proc_task(false)
280 , spi_task(false)
281 , spi_bus(false)
282 , spi_device(false)
283 {
284 }
286
287 esp_err_t init_config_args();
288 esp_err_t init_gpio();
289 esp_err_t init_gpio_inputs();
290 esp_err_t init_gpio_outputs();
291 esp_err_t init_hint_isr();
292 esp_err_t init_spi();
293
294 esp_err_t deinit_gpio();
295 esp_err_t deinit_gpio_inputs();
296 esp_err_t deinit_gpio_outputs();
297 esp_err_t deinit_hint_isr();
298 esp_err_t deinit_spi();
299
300 bool wait_for_rx_done();
301 bool wait_for_tx_done();
302 bool wait_for_data();
303 esp_err_t receive_packet();
304 esp_err_t receive_packet_header(bno08x_rx_packet_t* packet);
305 esp_err_t receive_packet_body(bno08x_rx_packet_t* packet);
306 void send_packet(bno08x_tx_packet_t* packet);
307 void flush_rx_packets(uint8_t flush_count);
308 void enable_report(uint8_t report_ID, uint32_t time_between_reports, const EventBits_t report_evt_grp_bit, uint32_t special_config = 0);
309 void disable_report(uint8_t report_ID, const EventBits_t report_evt_grp_bit);
310 void queue_packet(uint8_t channel_number, uint8_t data_length, uint8_t* commands);
311 void queue_command(uint8_t command, uint8_t* commands);
312 void queue_feature_command(uint8_t report_ID, uint32_t time_between_reports, uint32_t specific_config = 0);
313 void queue_calibrate_command(uint8_t _to_calibrate);
314 void queue_tare_command(uint8_t command, uint8_t axis = TARE_AXIS_ALL, uint8_t rotation_vector_basis = TARE_ROTATION_VECTOR);
316
317 // functions to parse packets received from bno08x
318 uint16_t parse_packet(bno08x_rx_packet_t* packet, bool& notify_users);
322 uint16_t parse_input_report(bno08x_rx_packet_t* packet);
323 void parse_input_report_data(bno08x_rx_packet_t* packet, uint16_t* data, uint16_t data_length);
326
327 // functions to update data returned to user
328 void update_accelerometer_data(uint16_t* data, uint8_t status);
329 void update_lin_accelerometer_data(uint16_t* data, uint8_t status);
330 void update_calibrated_gyro_data(uint16_t* data, uint8_t status);
331 void update_uncalibrated_gyro_data(uint16_t* data, uint8_t status);
332 void update_magf_data(uint16_t* data, uint8_t status);
333 void update_gravity_data(uint16_t* data, uint8_t status);
334 void update_rotation_vector_data(uint16_t* data, uint8_t status);
335 void update_step_counter_data(uint16_t* data);
336 void update_raw_accelerometer_data(uint16_t* data);
337 void update_raw_gyro_data(uint16_t* data);
338 void update_raw_magf_data(uint16_t* data);
344
345 // for debug
346 void print_header(bno08x_rx_packet_t* packet);
347 void print_packet(bno08x_rx_packet_t* packet);
348 bool first_boot = true;
349
350 // spi task
351 TaskHandle_t spi_task_hdl;
352 static void spi_task_trampoline(void* arg);
353 void spi_task();
354
355 // data processing task
356 TaskHandle_t data_proc_task_hdl;
357 static void data_proc_task_trampoline(void* arg);
358 void data_proc_task();
359
360 // task control
361 SemaphoreHandle_t sem_kill_tasks;
362 esp_err_t launch_tasks();
363 esp_err_t kill_all_tasks();
364
365 void update_report_period_trackers(uint8_t report_ID, uint32_t new_period);
366 static uint8_t report_ID_to_report_period_tracker_idx(uint8_t report_ID);
367
368 EventGroupHandle_t
370 EventGroupHandle_t evt_grp_report_en;
371 EventGroupHandle_t evt_grp_task_flow;
372
373 QueueHandle_t queue_rx_data;
374 QueueHandle_t queue_tx_data;
375 QueueHandle_t queue_frs_read_data;
376 QueueHandle_t queue_reset_reason;
377
378 std::vector<std::function<void()>> cb_list; // Vector for storing any call-back functions added with register_cb()
379
380 uint32_t meta_data[9];
381
383 spi_bus_config_t bus_config{};
384 spi_device_interface_config_t imu_spi_config{};
385 spi_device_handle_t spi_hdl{};
386 spi_transaction_t spi_transaction{};
389
390 // These are the raw sensor values (without Q applied) pulled from the user requested Input Report
391 uint32_t time_stamp;
407 uint8_t tap_detector;
408 uint16_t step_count;
411 uint8_t* activity_confidences = nullptr;
419
420 static void IRAM_ATTR hint_handler(void* arg);
421
422 static const constexpr uint8_t TASK_CNT = 2U;
423
424 static const constexpr uint16_t RX_DATA_LENGTH = 300U;
425 static const constexpr uint16_t MAX_METADATA_LENGTH = 9U;
426
427 static const constexpr TickType_t HOST_INT_TIMEOUT_DEFAULT_MS =
428 3000UL /
429 portTICK_PERIOD_MS;
430
431 static const constexpr TickType_t HARD_RESET_DELAY_MS =
432 100UL /
433 portTICK_PERIOD_MS;
434
435 static const constexpr TickType_t CMD_EXECUTION_DELAY_MS =
436 10UL /
437 portTICK_PERIOD_MS;
438
439 static const constexpr uint32_t SCLK_MAX_SPEED = 3000000UL;
440
441 // evt_grp_spi bits
442 static const constexpr EventBits_t EVT_GRP_SPI_RX_DONE_BIT =
443 (1U << 0U);
444 static const constexpr EventBits_t EVT_GRP_SPI_RX_VALID_PACKET_BIT =
445 (1U << 1U);
446 static const constexpr EventBits_t EVT_GRP_SPI_RX_INVALID_PACKET_BIT =
447 (1U << 2U);
448 static const constexpr EventBits_t EVT_GRP_SPI_TX_DONE_BIT = (1 << 3);
449
450 // evt_grp_report_en bits
451 static const constexpr EventBits_t EVT_GRP_RPT_ROTATION_VECTOR_BIT = (1 << 0);
452 static const constexpr EventBits_t EVT_GRP_RPT_GAME_ROTATION_VECTOR_BIT = (1 << 1);
453 static const constexpr EventBits_t EVT_GRP_RPT_ARVR_S_ROTATION_VECTOR_BIT =
454 (1U << 2U);
455 static const constexpr EventBits_t EVT_GRP_RPT_ARVR_S_GAME_ROTATION_VECTOR_BIT =
456 (1U << 3U);
457 static const constexpr EventBits_t EVT_GRP_RPT_GYRO_ROTATION_VECTOR_BIT =
458 (1U << 4U);
459 static const constexpr EventBits_t EVT_GRP_RPT_ACCELEROMETER_BIT = (1U << 5U);
460 static const constexpr EventBits_t EVT_GRP_RPT_LINEAR_ACCELEROMETER_BIT = (1U << 6U);
461 static const constexpr EventBits_t EVT_GRP_RPT_GRAVITY_BIT = (1U << 7U);
462 static const constexpr EventBits_t EVT_GRP_RPT_GYRO_BIT = (1U << 8U);
463 static const constexpr EventBits_t EVT_GRP_RPT_GYRO_UNCALIBRATED_BIT = (1U << 9U);
464 static const constexpr EventBits_t EVT_GRP_RPT_MAGNETOMETER_BIT = (1U << 10U);
465 static const constexpr EventBits_t EVT_GRP_RPT_TAP_DETECTOR_BIT = (1U << 11U);
466 static const constexpr EventBits_t EVT_GRP_RPT_STEP_COUNTER_BIT = (1U << 12U);
467 static const constexpr EventBits_t EVT_GRP_RPT_STABILITY_CLASSIFIER_BIT = (1U << 13U);
468 static const constexpr EventBits_t EVT_GRP_RPT_ACTIVITY_CLASSIFIER_BIT = (1U << 14U);
469 static const constexpr EventBits_t EVT_GRP_RPT_RAW_ACCELEROMETER_BIT = (1U << 15U);
470 static const constexpr EventBits_t EVT_GRP_RPT_RAW_GYRO_BIT = (1U << 16U);
471 static const constexpr EventBits_t EVT_GRP_RPT_RAW_MAGNETOMETER_BIT = (1U << 17U);
472
473 // evt_grp_task_flow bits
474 static const constexpr EventBits_t EVT_GRP_TSK_FLW_RUNNING_BIT =
475 (1U << 0U);
476
477 static const constexpr EventBits_t EVT_GRP_RPT_ALL_BITS =
483
484 // Higher level calibration commands, used by queue_calibrate_command
485 static const constexpr uint8_t CALIBRATE_ACCEL = 0U;
486 static const constexpr uint8_t CALIBRATE_GYRO = 1U;
487 static const constexpr uint8_t CALIBRATE_MAG = 2U;
488 static const constexpr uint8_t CALIBRATE_PLANAR_ACCEL = 3U;
489 static const constexpr uint8_t CALIBRATE_ACCEL_GYRO_MAG =
490 4U;
491 static const constexpr uint8_t CALIBRATE_STOP = 5U;
492
493 // Command IDs (see Ref. Manual 6.4)
494 static const constexpr uint8_t COMMAND_ERRORS = 1U;
495 static const constexpr uint8_t COMMAND_COUNTER = 2U;
496 static const constexpr uint8_t COMMAND_TARE = 3U;
497 static const constexpr uint8_t COMMAND_INITIALIZE = 4U;
498 static const constexpr uint8_t COMMAND_DCD = 6U;
499 static const constexpr uint8_t COMMAND_ME_CALIBRATE = 7U;
500 static const constexpr uint8_t COMMAND_DCD_PERIOD_SAVE = 9U;
501 static const constexpr uint8_t COMMAND_OSCILLATOR = 10U;
502 static const constexpr uint8_t COMMAND_CLEAR_DCD = 11U;
503
504 // SHTP channel 2 control report IDs, used in communication with sensor (See Ref. Manual 6.2)
505 static const constexpr uint8_t SHTP_REPORT_COMMAND_RESPONSE = 0xF1U;
506 static const constexpr uint8_t SHTP_REPORT_COMMAND_REQUEST = 0xF2U;
507 static const constexpr uint8_t SHTP_REPORT_FRS_READ_RESPONSE = 0xF3U;
508 static const constexpr uint8_t SHTP_REPORT_FRS_READ_REQUEST = 0xF4U;
509 static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_RESPONSE = 0xF8U;
510 static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_REQUEST = 0xF9U;
511 static const constexpr uint8_t SHTP_REPORT_BASE_TIMESTAMP = 0xFBU;
512 static const constexpr uint8_t SHTP_REPORT_SET_FEATURE_COMMAND = 0xFDU;
513 static const constexpr uint8_t SHTP_REPORT_GET_FEATURE_RESPONSE = 0xFCU;
514
515 // Sensor report IDs, used when enabling and reading BNO08x reports
516 static const constexpr uint8_t SENSOR_REPORT_ID_ACCELEROMETER = 0x01U;
517 static const constexpr uint8_t SENSOR_REPORT_ID_GYROSCOPE = 0x02U;
518 static const constexpr uint8_t SENSOR_REPORT_ID_MAGNETIC_FIELD = 0x03U;
519 static const constexpr uint8_t SENSOR_REPORT_ID_LINEAR_ACCELERATION = 0x04U;
520 static const constexpr uint8_t SENSOR_REPORT_ID_ROTATION_VECTOR = 0x05U;
521 static const constexpr uint8_t SENSOR_REPORT_ID_GRAVITY = 0x06U;
522 static const constexpr uint8_t SENSOR_REPORT_ID_UNCALIBRATED_GYRO = 0x07U;
523 static const constexpr uint8_t SENSOR_REPORT_ID_GAME_ROTATION_VECTOR = 0x08U;
524 static const constexpr uint8_t SENSOR_REPORT_ID_GEOMAGNETIC_ROTATION_VECTOR = 0x09U;
525 static const constexpr uint8_t SENSOR_REPORT_ID_GYRO_INTEGRATED_ROTATION_VECTOR = 0x2AU;
526 static const constexpr uint8_t SENSOR_REPORT_ID_TAP_DETECTOR = 0x10U;
527 static const constexpr uint8_t SENSOR_REPORT_ID_STEP_COUNTER = 0x11U;
528 static const constexpr uint8_t SENSOR_REPORT_ID_STABILITY_CLASSIFIER = 0x13U;
529 static const constexpr uint8_t SENSOR_REPORT_ID_RAW_ACCELEROMETER = 0x14U;
530 static const constexpr uint8_t SENSOR_REPORT_ID_RAW_GYROSCOPE = 0x15U;
531 static const constexpr uint8_t SENSOR_REPORT_ID_RAW_MAGNETOMETER = 0x16U;
532 static const constexpr uint8_t SENSOR_REPORT_ID_PERSONAL_ACTIVITY_CLASSIFIER = 0x1EU;
533 static const constexpr uint8_t SENSOR_REPORT_ID_ARVR_STABILIZED_ROTATION_VECTOR = 0x28U;
534 static const constexpr uint8_t SENSOR_REPORT_ID_ARVR_STABILIZED_GAME_ROTATION_VECTOR = 0x29U;
535
536 // Tare commands used by queue_tare_command
537 static const constexpr uint8_t TARE_NOW = 0U;
538 static const constexpr uint8_t TARE_PERSIST = 1U;
539 static const constexpr uint8_t TARE_SET_REORIENTATION = 2U;
540
541 static const constexpr uint8_t REPORT_CNT = 19;
542
552
554 0;
556
559
560 static const constexpr char* TAG = "BNO08x";
561
562 friend class BNO08xTestHelper; // allow test helper to access private members for unit tests
563};
BNO08xStability
BNO08xStability states returned from get_stability_classifier()
Definition BNO08x_global_types.hpp:65
struct bno08x_config_t bno08x_config_t
IMU configuration settings passed into constructor.
BNO08xResetReason
Reason for previous IMU reset (returned by get_reset_reason())
Definition BNO08x_global_types.hpp:23
BNO08xActivity
BNO08xActivity states returned from get_activity_classifier()
Definition BNO08x_global_types.hpp:50
BNO08xActivityEnable
BNO08xActivity Classifier enable bits passed to enable_activity_classifier()
Definition BNO08x_global_types.hpp:35
BNO08xAccuracy
Sensor accuracy returned during sensor calibration.
Definition BNO08x_global_types.hpp:13
BNO08x IMU driver class.
Definition BNO08x.hpp:34
void parse_input_report_data(bno08x_rx_packet_t *packet, uint16_t *data, uint16_t data_length)
Parses data from received input report.
Definition BNO08x.cpp:1891
uint16_t integrated_gyro_velocity_Y
Definition BNO08x.hpp:399
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:1050
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_RESPONSE
See SH2 Ref. Manual 6.3.2.
Definition BNO08x.hpp:509
void enable_gravity(uint32_t time_between_reports)
Sends command to enable gravity reading reports (See Ref. Manual 6.5.11)
Definition BNO08x.cpp:2300
static const constexpr uint32_t SCLK_MAX_SPEED
Max SPI SCLK speed BNO08x is capable of.
Definition BNO08x.hpp:439
uint16_t raw_quat_radian_accuracy
Definition BNO08x.hpp:397
void enable_activity_classifier(uint32_t time_between_reports, BNO08xActivityEnable 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:2379
static const constexpr uint8_t SENSOR_REPORT_ID_RAW_GYROSCOPE
See SH2 Ref. Manual 6.5.12.
Definition BNO08x.hpp:530
void update_personal_activity_classifier_data(bno08x_rx_packet_t *packet)
Updates activity classifier data from parsed input report.
Definition BNO08x.cpp:2170
static const constexpr int16_t ACCELEROMETER_Q1
Acceleration Q point (See SH-2 Ref. Manual 6.5.9)
Definition BNO08x.hpp:220
void print_packet(bno08x_rx_packet_t *packet)
Prints the passed SHTP packet to serial console with ESP_LOG statement.
Definition BNO08x.cpp:3565
static const constexpr uint8_t SENSOR_REPORT_ID_MAGNETIC_FIELD
See SH2 Ref. Manual 6.5.16.
Definition BNO08x.hpp:518
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
void register_cb(std::function< void()> cb_fxn)
Registers a callback to execute when new data from a report is received.
Definition BNO08x.cpp:1493
esp_err_t launch_tasks()
Launches spi_task and data_proc_task on constructor call.
Definition BNO08x.cpp:4003
uint16_t raw_bias_Z
Uncalibrated gyro reading (See SH-2 Ref. Manual 6.5.14)
Definition BNO08x.hpp:404
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:202
static const constexpr uint8_t COMMAND_TARE
Command and response to tare command (See Sh2 Ref. Manual 6.4.4)
Definition BNO08x.hpp:496
float get_accel_Z()
Get z axis acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:3097
static void data_proc_task_trampoline(void *arg)
Static function used to launch data processing task.
Definition BNO08x.cpp:3940
static const constexpr int16_t ROTATION_VECTOR_Q1
Rotation vector Q point (See SH-2 Ref. Manual 6.5.18)
Definition BNO08x.hpp:218
static void spi_task_trampoline(void *arg)
Static function used to launch spi task.
Definition BNO08x.cpp:3874
void update_report_period_trackers(uint8_t report_ID, uint32_t new_period)
Updates period of respective report in report_period_trackers and recalculates host_int_timeout_ms ac...
Definition BNO08x.cpp:4101
static const constexpr EventBits_t EVT_GRP_RPT_GAME_ROTATION_VECTOR_BIT
When set, game rotation vector reports are active.
Definition BNO08x.hpp:452
float get_range(uint16_t record_ID)
Gets range from BNO08x FRS (flash record system).
Definition BNO08x.cpp:3676
float get_linear_accel_Y()
Get y axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
Definition BNO08x.cpp:3145
float get_magf_X()
Get X component of magnetic field vector.
Definition BNO08x.cpp:2758
static const constexpr uint8_t TARE_PERSIST
See SH2 Ref. Manual 6.4.4.2.
Definition BNO08x.hpp:538
uint8_t tap_detector
Tap detector reading (See SH-2 Ref. Manual 6.5.27)
Definition BNO08x.hpp:407
float get_quat_I()
Get I component of reported quaternion.
Definition BNO08x.cpp:2994
int16_t get_Q3(uint16_t record_ID)
Gets Q3 point from BNO08x FRS (flash record system).
Definition BNO08x.cpp:3646
float get_calibrated_gyro_velocity_Z()
Get calibrated gyro z axis angular velocity measurement.
Definition BNO08x.cpp:3349
static const constexpr EventBits_t EVT_GRP_SPI_RX_INVALID_PACKET_BIT
When this bit is set, it indicates an invalid packet has been received.
Definition BNO08x.hpp:446
void disable_tap_detector()
Sends command to disable tap detector reports by setting report interval to 0.
Definition BNO08x.cpp:2534
bool mode_sleep()
Puts BNO08x sensor into sleep/low power mode using executable channel.
Definition BNO08x.cpp:886
static const constexpr EventBits_t EVT_GRP_RPT_ACCELEROMETER_BIT
When set, accelerometer reports are active.
Definition BNO08x.hpp:459
static const constexpr EventBits_t EVT_GRP_RPT_ROTATION_VECTOR_BIT
When set, rotation vector reports are active.
Definition BNO08x.hpp:451
static const constexpr uint16_t RX_DATA_LENGTH
length buffer containing data received over spi
Definition BNO08x.hpp:424
uint8_t stability_classifier
BNO08xStability status reading (See SH-2 Ref. Manual 6.5.31)
Definition BNO08x.hpp:409
float get_pitch()
Get the reported rotation about y axis.
Definition BNO08x.cpp:2886
uint16_t parse_packet(bno08x_rx_packet_t *packet, bool &notify_users)
Parses a packet received from bno08x, updating any data according to received reports.
Definition BNO08x.cpp:1507
void calibrate_planar_accelerometer()
Sends command to calibrate planar accelerometer.
Definition BNO08x.cpp:1236
static const constexpr uint8_t SHTP_REPORT_SET_FEATURE_COMMAND
See SH2 Ref. Manual 6.5.4.
Definition BNO08x.hpp:512
float get_resolution(uint16_t record_ID)
Gets resolution from BNO08x FRS (flash record system).
Definition BNO08x.cpp:3659
static const constexpr uint8_t SHTP_REPORT_COMMAND_RESPONSE
See SH2 Ref. Manual 6.3.9.
Definition BNO08x.hpp:505
void disable_rotation_vector()
Sends command to disable rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:2424
static const constexpr uint8_t TARE_AXIS_ALL
Tare all axes (used with tare now command)
Definition BNO08x.hpp:207
esp_err_t deinit_gpio_inputs()
Deinitializes GPIO inputs, called from deconstructor.
Definition BNO08x.cpp:453
struct BNO08x::bno08x_init_status_t bno08x_init_status_t
Holds info about which functionality has been successfully initialized (used by deconstructor during ...
uint16_t parse_feature_get_response_report(bno08x_rx_packet_t *packet)
Parses get feature request report received from BNO08x.
Definition BNO08x.cpp:1683
static const constexpr uint8_t SENSOR_REPORT_ID_GYROSCOPE
See SH2 Ref. Manual 6.5.13.
Definition BNO08x.hpp:517
static const constexpr uint8_t TARE_GEOMAGNETIC_ROTATION_VECTOR
tare geomagnetic rotation vector
Definition BNO08x.hpp:213
esp_err_t deinit_spi()
Deinitializes SPI.
Definition BNO08x.cpp:562
BNO08xStability get_stability_classifier()
Get the current stability classifier (Seee Ref. Manual 6.5.31)
Definition BNO08x.cpp:3508
void enable_accelerometer(uint32_t time_between_reports)
Sends command to enable accelerometer reports (See Ref. Manual 6.5.9)
Definition BNO08x.cpp:2278
static uint8_t report_ID_to_report_period_tracker_idx(uint8_t report_ID)
Converts report id to respective index in report_period_trackers.
Definition BNO08x.cpp:4155
static const constexpr uint8_t TARE_NOW
See SH2 Ref. Manual 6.4.4.1.
Definition BNO08x.hpp:537
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:3697
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:2648
bool wait_for_rx_done()
Waits for data to be received over SPI, or host_int_timeout_ms to elapse.
Definition BNO08x.cpp:608
bool hard_reset()
Hard resets BNO08x sensor.
Definition BNO08x.cpp:737
uint16_t parse_product_id_report(bno08x_rx_packet_t *packet)
Parses product id report and prints device info.
Definition BNO08x.cpp:1616
static const constexpr uint8_t SENSOR_REPORT_ID_STEP_COUNTER
See SH2 Ref. Manual 6.5.29.
Definition BNO08x.hpp:527
static const constexpr uint16_t MAX_METADATA_LENGTH
max length of metadata used in frs read operations
Definition BNO08x.hpp:425
void send_packet(bno08x_tx_packet_t *packet)
Sends a queued SHTP packet via SPI.
Definition BNO08x.cpp:1127
static const constexpr char * TAG
Class tag used for serial print statements.
Definition BNO08x.hpp:560
float get_uncalibrated_gyro_velocity_Y()
Get uncalibrated gyro Y axis angular velocity measurement.
Definition BNO08x.cpp:3392
BNO08xAccuracy get_magf_accuracy()
Get accuracy of reported magnetic field vector.
Definition BNO08x.cpp:2791
float get_integrated_gyro_velocity_X()
Get x axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6....
Definition BNO08x.cpp:3458
void spi_task()
Task responsible for SPI transactions. Executed when HINT in is asserted by BNO08x.
Definition BNO08x.cpp:3885
static const constexpr uint8_t COMMAND_OSCILLATOR
Retrieve oscillator type command (See SH2 Ref. Manual 6.4)
Definition BNO08x.hpp:501
static const constexpr uint8_t COMMAND_INITIALIZE
Reinitialize sensor hub components See (SH2 Ref. Manual 6.4.5)
Definition BNO08x.hpp:497
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:442
uint16_t accel_accuracy
Raw acceleration readings (See SH-2 Ref. Manual 6.5.8)
Definition BNO08x.hpp:393
uint16_t get_raw_mems_magf_X()
Get raw magnetometer x axis reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:3283
static const constexpr uint8_t SENSOR_REPORT_ID_ACCELEROMETER
See SH2 Ref. Manual 6.5.9.
Definition BNO08x.hpp:516
void update_stability_classifier_data(bno08x_rx_packet_t *packet)
Updates stability classifier data from parsed input report.
Definition BNO08x.cpp:2158
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:3538
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:200
uint16_t accel_lin_accuracy
Raw linear acceleration (See SH-2 Ref. Manual 6.5.10)
Definition BNO08x.hpp:395
uint16_t quat_accuracy
Raw quaternion reading (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:398
static const constexpr uint8_t SENSOR_REPORT_ID_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.18.
Definition BNO08x.hpp:520
static const constexpr uint8_t COMMAND_ERRORS
Definition BNO08x.hpp:494
static const constexpr TickType_t CMD_EXECUTION_DELAY_MS
How long to delay after queueing command to allow it to execute (for ex. after sending command to ena...
Definition BNO08x.hpp:435
struct BNO08x::bno08x_tx_packet_t bno08x_tx_packet_t
Holds data that is sent over spi.
static const constexpr EventBits_t EVT_GRP_RPT_GYRO_BIT
When set, gyro reports are active.
Definition BNO08x.hpp:462
void update_magf_data(uint16_t *data, uint8_t status)
Updates magnetic field data from parsed input report.
Definition BNO08x.cpp:2040
void enable_magnetometer(uint32_t time_between_reports)
Sends command to enable magnetometer reports (See Ref. Manual 6.5.16)
Definition BNO08x.cpp:2333
void get_accel(float &x, float &y, float &z, BNO08xAccuracy &accuracy)
Get full acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:3064
uint16_t mems_raw_gyro_X
Definition BNO08x.hpp:415
static const constexpr EventBits_t EVT_GRP_RPT_RAW_ACCELEROMETER_BIT
When set, raw accelerometer reports are active.
Definition BNO08x.hpp:469
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:3749
struct BNO08x::bno08x_rx_packet_t bno08x_rx_packet_t
Holds data that is received over spi.
spi_device_interface_config_t imu_spi_config
SPI slave device settings.
Definition BNO08x.hpp:384
void disable_step_counter()
Sends command to disable step counter reports by setting report interval to 0.
Definition BNO08x.cpp:2544
int16_t get_Q1(uint16_t record_ID)
Gets Q1 point from BNO08x FRS (flash record system).
Definition BNO08x.cpp:3616
bno08x_init_status_t init_status
Initialization status of various functionality, used by deconstructor during cleanup,...
Definition BNO08x.hpp:388
void reset_all_data_to_defaults()
Resets all data returned by public getter APIs to initial values of 0 and low accuracy.
Definition BNO08x.cpp:2670
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:2608
uint8_t get_tap_detector()
Get if tap has occured.
Definition BNO08x.cpp:3488
void flush_rx_packets(uint8_t flush_count)
Definition BNO08x.cpp:1144
float get_calibrated_gyro_velocity_Y()
Get calibrated gyro y axis angular velocity measurement.
Definition BNO08x.cpp:3339
BNO08xActivity get_activity_classifier()
Get the current activity classifier (Seee Ref. Manual 6.5.36)
Definition BNO08x.cpp:3527
uint16_t get_raw_mems_gyro_Y()
Get raw gyroscope y axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:3247
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
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:3851
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:374
void disable_calibrated_gyro()
Sends command to disable calibrated gyro reports by setting report interval to 0.
Definition BNO08x.cpp:2504
esp_err_t deinit_gpio()
Deinitializes GPIO, called from deconstructor.
Definition BNO08x.cpp:427
bool wait_for_data()
Waits for a valid or invalid packet to be received or host_int_timeout_ms to elapse.
Definition BNO08x.cpp:648
static const constexpr uint8_t COMMAND_CLEAR_DCD
Clear DCD & Reset command (See SH2 Ref. Manual 6.4)
Definition BNO08x.hpp:502
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:1943
void disable_activity_classifier()
Sends command to disable activity classifier reports by setting report interval to 0.
Definition BNO08x.cpp:2564
float get_uncalibrated_gyro_bias_Z()
Get uncalibrated gyro Z axis drift estimate.
Definition BNO08x.cpp:3432
uint16_t parse_frs_read_response_report(bno08x_rx_packet_t *packet)
Sends packet to be parsed to meta data function call (FRS_read_data()) through queue.
Definition BNO08x.cpp:1663
static const constexpr EventBits_t EVT_GRP_RPT_GYRO_ROTATION_VECTOR_BIT
When set, gyro integrator rotation vector reports are active.
Definition BNO08x.hpp:457
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_REQUEST
See SH2 Ref. Manual 6.3.1.
Definition BNO08x.hpp:510
static const constexpr uint8_t TASK_CNT
Total amount of tasks utilized by BNO08x driver library.
Definition BNO08x.hpp:422
float get_gravity_Z()
Get the reported z axis gravity.
Definition BNO08x.cpp:2839
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:2256
static const constexpr uint8_t CALIBRATE_STOP
Stop calibration command used by queue_calibrate_command.
Definition BNO08x.hpp:491
esp_err_t init_config_args()
Initializes required esp-idf SPI data structures with values from user passed bno08x_config_t struct.
Definition BNO08x.cpp:124
esp_err_t init_spi()
Initializes SPI.
Definition BNO08x.cpp:372
uint16_t mems_raw_accel_Z
Raw accelerometer readings from MEMS sensor (See SH2 Ref. Manual 6.5.8)
Definition BNO08x.hpp:414
static const constexpr uint8_t TARE_SET_REORIENTATION
See SH2 Ref. Manual 6.4.4.3.
Definition BNO08x.hpp:539
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:2355
float get_quat_real()
Get real component of reported quaternion.
Definition BNO08x.cpp:3027
esp_err_t kill_all_tasks()
Deletes spi_task and data_proc_task safely on deconstructor call.
Definition BNO08x.cpp:4055
void queue_command(uint8_t command, uint8_t *commands)
Queues a packet containing a command.
Definition BNO08x.cpp:1158
void disable_raw_mems_gyro()
Sends command to disable raw gyro reports by setting report interval to 0.
Definition BNO08x.cpp:2585
void disable_gravity()
Sends command to disable gravity reports by setting report interval to 0.
Definition BNO08x.cpp:2494
static const constexpr EventBits_t EVT_GRP_TSK_FLW_RUNNING_BIT
When set, data_proc_task and spi_task are active, when 0 they are pending deletion or deleted.
Definition BNO08x.hpp:474
BNO08xAccuracy get_linear_accel_accuracy()
Get accuracy of linear acceleration.
Definition BNO08x.cpp:3165
TaskHandle_t spi_task_hdl
spi_task() handle
Definition BNO08x.hpp:351
uint16_t raw_quat_J
Definition BNO08x.hpp:397
float get_quat_radian_accuracy()
Get radian accuracy of reported quaternion.
Definition BNO08x.cpp:3038
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:1098
void disable_raw_mems_magnetometer()
Sends command to disable raw magnetometer reports by setting report interval to 0.
Definition BNO08x.cpp:2595
EventGroupHandle_t evt_grp_report_en
Event group for indicating which reports are currently enabled.
Definition BNO08x.hpp:370
float get_yaw()
Get the reported rotation about z axis.
Definition BNO08x.cpp:2915
uint16_t integrated_gyro_velocity_X
Definition BNO08x.hpp:399
static const constexpr EventBits_t EVT_GRP_RPT_TAP_DETECTOR_BIT
When set, tap detector reports are active.
Definition BNO08x.hpp:465
void disable_magnetometer()
Sends command to disable magnetometer reports by setting report interval to 0.
Definition BNO08x.cpp:2524
uint16_t raw_calib_gyro_Y
Definition BNO08x.hpp:396
static const constexpr uint8_t SENSOR_REPORT_ID_GRAVITY
See SH2 Ref. Manual 6.5.11.
Definition BNO08x.hpp:521
~BNO08x()
BNO08x imu deconstructor.
Definition BNO08x.cpp:34
static const constexpr uint8_t TARE_ARVR_STABILIZED_GAME_ROTATION_VECTOR
Tare ARVR stabilized game rotation vector.
Definition BNO08x.hpp:216
void enable_raw_mems_magnetometer(uint32_t time_between_reports)
Sends command to enable raw MEMs magnetometer reports (See Ref. Manual 6.5.15)
Definition BNO08x.cpp:2414
uint16_t raw_quat_I
Definition BNO08x.hpp:397
void enable_raw_mems_accelerometer(uint32_t time_between_reports)
Sends command to enable raw MEMs accelerometer reports (See Ref. Manual 6.5.8)
Definition BNO08x.cpp:2392
std::vector< std::function< void()> > cb_list
Definition BNO08x.hpp:378
static const constexpr EventBits_t EVT_GRP_RPT_RAW_GYRO_BIT
When set, raw gyro reports are active.
Definition BNO08x.hpp:470
void disable_raw_mems_accelerometer()
Sends command to disable raw accelerometer reports by setting report interval to 0.
Definition BNO08x.cpp:2575
void update_raw_magf_data(uint16_t *data)
Updates raw magnetic field data from parsed input report.
Definition BNO08x.cpp:2132
BNO08xAccuracy get_accel_accuracy()
Get accuracy of linear acceleration.
Definition BNO08x.cpp:3107
float get_roll_deg()
Get the reported rotation about x axis.
Definition BNO08x.cpp:2942
float get_uncalibrated_gyro_velocity_X()
Get uncalibrated gyro x axis angular velocity measurement.
Definition BNO08x.cpp:3382
bool calibration_complete()
Returns true if calibration has completed.
Definition BNO08x.cpp:1314
static const constexpr uint8_t SENSOR_REPORT_ID_PERSONAL_ACTIVITY_CLASSIFIER
See SH2 Ref. Manual 6.5.36.
Definition BNO08x.hpp:532
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:2267
void update_lin_accelerometer_data(uint16_t *data, uint8_t status)
Updates linear accelerometer data from parsed input report.
Definition BNO08x.cpp:1991
float get_uncalibrated_gyro_bias_Y()
Get uncalibrated gyro Y axis drift estimate.
Definition BNO08x.cpp:3422
static const constexpr uint8_t SHTP_REPORT_FRS_READ_REQUEST
See SH2 Ref. Manual 6.3.6.
Definition BNO08x.hpp:508
uint8_t activity_classifier
BNO08xActivity status reading (See SH-2 Ref. Manual 6.5.36)
Definition BNO08x.hpp:410
uint16_t raw_accel_X
Definition BNO08x.hpp:392
float get_linear_accel_X()
Get x axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
Definition BNO08x.cpp:3135
void disable_game_rotation_vector()
Sends command to disable game rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:2434
float get_calibrated_gyro_velocity_X()
Get calibrated gyro x axis angular velocity measurement.
Definition BNO08x.cpp:3329
uint16_t raw_quat_K
Definition BNO08x.hpp:397
BNO08xAccuracy get_gravity_accuracy()
Get the reported gravity accuracy.
Definition BNO08x.cpp:2849
uint16_t get_raw_mems_magf_Z()
Get raw magnetometer z axis reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:3303
void enable_report(uint8_t report_ID, uint32_t time_between_reports, const EventBits_t report_evt_grp_bit, uint32_t special_config=0)
Enables a sensor report for a given ID.
Definition BNO08x.cpp:1016
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:455
static const constexpr uint8_t COMMAND_DCD_PERIOD_SAVE
Configure DCD periodic saving (See SH2 Ref. Manual 6.4)
Definition BNO08x.hpp:500
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:380
uint16_t parse_gyro_integrated_rotation_vector_report(bno08x_rx_packet_t *packet)
Parses received gyro integrated rotation vector report sent by BNO08x.
Definition BNO08x.cpp:1930
BNO08xAccuracy get_quat_accuracy()
Get accuracy of reported quaternion.
Definition BNO08x.cpp:3049
bool wait_for_tx_done()
Waits for a queued packet to be sent or host_int_timeout_ms to elapse.
Definition BNO08x.cpp:704
QueueHandle_t queue_rx_data
Packet queue used to send data received from bno08x from spi_task to data_proc_task.
Definition BNO08x.hpp:373
static const constexpr EventBits_t EVT_GRP_RPT_STABILITY_CLASSIFIER_BIT
When set, stability classifier reports are active.
Definition BNO08x.hpp:467
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:2322
uint32_t largest_sample_period_us
Current largest sample period of any enabled report in microseconds (used to determine timeout for hi...
Definition BNO08x.hpp:553
static void IRAM_ATTR hint_handler(void *arg)
HINT interrupt service routine, handles falling edge of BNO08x HINT pin.
Definition BNO08x.cpp:4209
static const constexpr uint8_t SENSOR_REPORT_ID_RAW_ACCELEROMETER
See SH2 Ref. Manual 6.5.8.
Definition BNO08x.hpp:529
static const constexpr uint8_t SENSOR_REPORT_ID_TAP_DETECTOR
See SH2 Ref. Manual 6.5.27.
Definition BNO08x.hpp:526
float get_magf_Y()
Get Y component of magnetic field vector.
Definition BNO08x.cpp:2769
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:499
void update_raw_accelerometer_data(uint16_t *data)
Updates raw accelerometer data from parsed input report.
Definition BNO08x.cpp:2104
QueueHandle_t queue_reset_reason
Queue used to send reset reason from product id report to reset_reason() function.
Definition BNO08x.hpp:376
uint16_t get_raw_mems_accel_Z()
Get raw accelerometer z axis reading from physical accelerometer MEMs sensor (See Ref....
Definition BNO08x.cpp:3211
uint16_t raw_quat_real
Definition BNO08x.hpp:397
uint16_t get_raw_mems_accel_X()
Get raw accelerometer x axis reading from physical accelerometer MEMs sensor (See Ref....
Definition BNO08x.cpp:3191
void get_uncalibrated_gyro_velocity(float &x, float &y, float &z, float &bx, float &by, float &bz)
Get full rotational velocity without drift compensation (units in Rad/s). An estimate of drift is giv...
Definition BNO08x.cpp:3367
uint16_t raw_calib_gyro_X
Definition BNO08x.hpp:396
float get_gravity_X()
Get the reported x axis gravity.
Definition BNO08x.cpp:2819
uint16_t get_raw_mems_gyro_X()
Get raw gyroscope x axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:3237
static const constexpr EventBits_t EVT_GRP_RPT_ALL_BITS
Definition BNO08x.hpp:477
float get_roll()
Get the reported rotation about x axis.
Definition BNO08x.cpp:2859
uint16_t raw_bias_X
Definition BNO08x.hpp:403
float get_gravity_Y()
Get the reported y axis gravity.
Definition BNO08x.cpp:2829
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:2245
void enable_raw_mems_gyro(uint32_t time_between_reports)
Sends command to enable raw MEMs gyro reports (See Ref. Manual 6.5.12)
Definition BNO08x.cpp:2403
static const constexpr uint8_t SENSOR_REPORT_ID_ARVR_STABILIZED_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.42.
Definition BNO08x.hpp:533
uint16_t parse_input_report(bno08x_rx_packet_t *packet)
Parses received input report sent by BNO08x.
Definition BNO08x.cpp:1794
esp_err_t receive_packet()
Receives a SHTP packet via SPI and sends it to data_proc_task()
Definition BNO08x.cpp:906
void update_uncalibrated_gyro_data(uint16_t *data, uint8_t status)
Updates uncalibrated gyro data from parsed input report.
Definition BNO08x.cpp:2022
static const constexpr uint8_t TARE_ROTATION_VECTOR
Tare rotation vector.
Definition BNO08x.hpp:211
esp_err_t init_gpio_inputs()
Initializes required gpio inputs.
Definition BNO08x.cpp:220
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
static const constexpr EventBits_t EVT_GRP_RPT_MAGNETOMETER_BIT
When set, magnetometer reports are active.
Definition BNO08x.hpp:464
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
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:219
void get_raw_mems_magf(uint16_t &x, uint16_t &y, uint16_t &z)
Get raw magnetometer full reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:3271
uint16_t mems_raw_accel_X
Definition BNO08x.hpp:413
static const constexpr uint8_t COMMAND_COUNTER
Definition BNO08x.hpp:495
int16_t get_Q2(uint16_t record_ID)
Gets Q2 point from BNO08x FRS (flash record system).
Definition BNO08x.cpp:3631
static const constexpr uint8_t CALIBRATE_PLANAR_ACCEL
Calibrate planar acceleration command used by queue_calibrate_command.
Definition BNO08x.hpp:488
void update_calibrated_gyro_data(uint16_t *data, uint8_t status)
Updates linear gyro data from parsed input report.
Definition BNO08x.cpp:2007
static const constexpr EventBits_t EVT_GRP_SPI_RX_VALID_PACKET_BIT
When this bit is set, it indicates a valid packet has been received and processed.
Definition BNO08x.hpp:444
static const constexpr uint8_t REPORT_CNT
Total unique reports that can be returned by BNO08x.
Definition BNO08x.hpp:541
BNO08xResetReason get_reset_reason()
Requests product ID, prints the returned info over serial, and returns the reason for the most resent...
Definition BNO08x.cpp:826
static const constexpr EventBits_t EVT_GRP_RPT_ACTIVITY_CLASSIFIER_BIT
When set, activity classifier reports are active.
Definition BNO08x.hpp:468
bool soft_reset()
Soft resets BNO08x sensor using executable channel.
Definition BNO08x.cpp:802
spi_bus_config_t bus_config
SPI bus GPIO configuration settings.
Definition BNO08x.hpp:383
QueueHandle_t queue_frs_read_data
Queue used to send packet body from data_proc_task to frs read functions.
Definition BNO08x.hpp:375
void calibrate_gyro()
Sends command to calibrate gyro.
Definition BNO08x.cpp:1212
esp_err_t deinit_hint_isr()
Deinitializes host interrupt ISR, called from deconstructor.
Definition BNO08x.cpp:526
void enable_calibrated_gyro(uint32_t time_between_reports)
Sends command to enable calibrated gyro reports (See Ref. Manual 6.5.13)
Definition BNO08x.cpp:2311
static const constexpr uint8_t SENSOR_REPORT_ID_RAW_MAGNETOMETER
See SH2 Ref. Manual 6.5.15.
Definition BNO08x.hpp:531
static const constexpr uint8_t TARE_GYRO_INTEGRATED_ROTATION_VECTOR
Tare gyro integrated rotation vector.
Definition BNO08x.hpp:214
esp_err_t receive_packet_body(bno08x_rx_packet_t *packet)
Receives a SHTP packet body via SPI.
Definition BNO08x.cpp:987
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:204
float get_quat_K()
Get K component of reported quaternion.
Definition BNO08x.cpp:3016
float get_quat_J()
Get J component of reported quaternion.
Definition BNO08x.cpp:3005
static const constexpr int16_t MAGNETOMETER_Q1
Magnetometer Q point (See SH-2 Ref. Manual 6.5.16)
Definition BNO08x.hpp:223
static const constexpr TickType_t HARD_RESET_DELAY_MS
How long RST pin is held low during hard reset (min 10ns according to datasheet, but should be longer...
Definition BNO08x.hpp:431
void save_calibration()
Sends command to save internal calibration data (See Ref. Manual 6.4.7).
Definition BNO08x.cpp:1339
esp_err_t init_hint_isr()
Initializes host interrupt ISR.
Definition BNO08x.cpp:321
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:369
void update_rotation_vector_data(uint16_t *data, uint8_t status)
Updates roation vector data from parsed input report.
Definition BNO08x.cpp:2072
void update_step_counter_data(uint16_t *data)
Updates step counter data from parsed input report.
Definition BNO08x.cpp:2092
static const constexpr int16_t GYRO_Q1
Gyro Q point (See SH-2 Ref. Manual 6.5.13)
Definition BNO08x.hpp:222
void disable_ARVR_stabilized_rotation_vector()
Sends command to disable ARVR stabilized rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:2444
float get_integrated_gyro_velocity_Z()
Get z axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6....
Definition BNO08x.cpp:3478
uint16_t raw_magf_X
Definition BNO08x.hpp:405
void get_raw_mems_accel(uint16_t &x, uint16_t &y, uint16_t &z)
Get full raw acceleration from physical accelerometer MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:3179
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
SemaphoreHandle_t sem_kill_tasks
semaphore to count amount of killed tasks
Definition BNO08x.hpp:361
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:453
void disable_gyro_integrated_rotation_vector()
Sends command to disable gyro integrated rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:2464
uint16_t mems_raw_magf_Y
Definition BNO08x.hpp:417
void disable_uncalibrated_gyro()
Sends command to disable uncalibrated gyro reports by setting report interval to 0.
Definition BNO08x.cpp:2514
static const constexpr int16_t ANGULAR_VELOCITY_Q1
Angular velocity Q point (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:224
void update_integrated_gyro_rotation_vector_data(bno08x_rx_packet_t *packet)
Updates integrated gyro rotation vector data from SHTP channel 5 (CHANNEL_GYRO) special report data.
Definition BNO08x.cpp:2206
static const constexpr uint8_t SHTP_REPORT_COMMAND_REQUEST
See SH2 Ref. Manual 6.3.8.
Definition BNO08x.hpp:506
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:2366
TickType_t host_int_timeout_ms
Max wait between HINT being asserted by BNO08x before transaction is considered failed (in milisecond...
Definition BNO08x.hpp:557
esp_err_t deinit_gpio_outputs()
Deinitializes GPIO outputs, called from deconstructor.
Definition BNO08x.cpp:475
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:2454
static const constexpr EventBits_t EVT_GRP_RPT_STEP_COUNTER_BIT
When set, step counter reports are active.
Definition BNO08x.hpp:466
void disable_stability_classifier()
Sends command to disable stability reports by setting report interval to 0.
Definition BNO08x.cpp:2554
void data_proc_task()
Task responsible parsing packets. Executed when SPI task sends a packet to be parsed,...
Definition BNO08x.cpp:3951
uint16_t raw_magf_Z
Definition BNO08x.hpp:405
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:2234
float get_magf_Z()
Get Z component of magnetic field vector.
Definition BNO08x.cpp:2780
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:2344
bool data_available(bool ignore_no_reports_enabled=false)
Checks if BNO08x has asserted interrupt and sent data.
Definition BNO08x.cpp:1469
uint16_t raw_accel_Y
Definition BNO08x.hpp:392
uint16_t mems_raw_magf_X
Definition BNO08x.hpp:417
static const constexpr uint8_t SENSOR_REPORT_ID_STABILITY_CLASSIFIER
See SH2 Ref. Manual 6.5.31.
Definition BNO08x.hpp:528
void queue_request_product_id_command()
Queues a packet containing the request product ID command.
Definition BNO08x.cpp:1174
uint16_t mems_raw_gyro_Y
Definition BNO08x.hpp:415
float get_uncalibrated_gyro_velocity_Z()
Get uncalibrated gyro Z axis angular velocity measurement.
Definition BNO08x.cpp:3402
static const constexpr EventBits_t EVT_GRP_RPT_GRAVITY_BIT
When set, gravity reports are active.
Definition BNO08x.hpp:461
static const constexpr uint8_t TARE_GAME_ROTATION_VECTOR
Tare game rotation vector.
Definition BNO08x.hpp:212
static const constexpr uint8_t SENSOR_REPORT_ID_GEOMAGNETIC_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.20.
Definition BNO08x.hpp:524
uint16_t raw_lin_accel_Z
Definition BNO08x.hpp:394
uint32_t time_stamp
Report timestamp (see datasheet 1.3.5.3)
Definition BNO08x.hpp:391
float get_accel_X()
Get x axis acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:3077
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:2223
static const constexpr uint8_t TARE_ARVR_STABILIZED_ROTATION_VECTOR
Tare ARVR stabilized rotation vector.
Definition BNO08x.hpp:215
static const constexpr uint8_t CALIBRATE_MAG
Calibrate magnetometer command used by queue_calibrate_command.
Definition BNO08x.hpp:487
channels_t
SHTP protocol channels.
Definition BNO08x.hpp:230
@ CHANNEL_CONTROL
Definition BNO08x.hpp:233
@ CHANNEL_EXECUTABLE
Definition BNO08x.hpp:232
@ CHANNEL_REPORTS
Definition BNO08x.hpp:234
@ CHANNEL_COMMAND
Definition BNO08x.hpp:231
@ CHANNEL_GYRO
Definition BNO08x.hpp:236
@ CHANNEL_WAKE_REPORTS
Definition BNO08x.hpp:235
spi_transaction_t spi_transaction
SPI transaction handle.
Definition BNO08x.hpp:386
bool mode_on()
Turns on/ brings BNO08x sensor out of sleep mode using executable channel.
Definition BNO08x.cpp:866
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
void calibrate_magnetometer()
Sends command to calibrate magnetometer.
Definition BNO08x.cpp:1224
static const constexpr EventBits_t EVT_GRP_RPT_RAW_MAGNETOMETER_BIT
When set, raw magnetometer reports are active.
Definition BNO08x.hpp:471
uint16_t mems_raw_gyro_Z
Raw gyro readings from MEMS sensor (See SH-2 Ref. Manual 6.5.12)
Definition BNO08x.hpp:416
uint16_t raw_bias_Y
Definition BNO08x.hpp:403
EventGroupHandle_t evt_grp_task_flow
Event group for indicating when tasks should complete and self-delete (on deconstructor call)
Definition BNO08x.hpp:371
uint16_t magf_accuracy
Calibrated magnetic field reading in uTesla (See SH-2 Ref. Manual 6.5.16)
Definition BNO08x.hpp:406
void update_tap_detector_data(bno08x_rx_packet_t *packet)
Updates tap detector data from parsed input report.
Definition BNO08x.cpp:2146
void end_calibration()
Sends command to end calibration procedure.
Definition BNO08x.cpp:1327
esp_err_t receive_packet_header(bno08x_rx_packet_t *packet)
Receives a SHTP packet header via SPI.
Definition BNO08x.cpp:955
static const constexpr uint8_t SENSOR_REPORT_ID_UNCALIBRATED_GYRO
See SH2 Ref. Manual 6.5.14.
Definition BNO08x.hpp:522
spi_device_handle_t spi_hdl
SPI device handle.
Definition BNO08x.hpp:385
uint16_t raw_uncalib_gyro_Y
Definition BNO08x.hpp:403
static const constexpr uint8_t SENSOR_REPORT_ID_GYRO_INTEGRATED_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.44.
Definition BNO08x.hpp:525
uint16_t raw_magf_Y
Definition BNO08x.hpp:405
static const constexpr uint8_t CALIBRATE_ACCEL
Calibrate accelerometer command used by queue_calibrate_command.
Definition BNO08x.hpp:485
static const constexpr uint8_t SENSOR_REPORT_ID_LINEAR_ACCELERATION
See SH2 Ref. Manual 6.5.10.
Definition BNO08x.hpp:519
static const constexpr uint8_t SHTP_REPORT_GET_FEATURE_RESPONSE
See SH2 Ref. Manual 6.5.5.
Definition BNO08x.hpp:513
void queue_calibrate_command(uint8_t _to_calibrate)
Queues a packet containing a command to calibrate the specified sensor.
Definition BNO08x.cpp:1250
esp_err_t init_gpio_outputs()
Initializes required gpio outputs.
Definition BNO08x.cpp:255
static const constexpr int16_t LINEAR_ACCELEROMETER_Q1
Linear acceleration Q point (See SH-2 Ref. Manual 6.5.10)
Definition BNO08x.hpp:221
void update_raw_gyro_data(uint16_t *data)
Updates raw gyro data from parsed input report.
Definition BNO08x.cpp:2118
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(bno08x_config_t imu_config=bno08x_config_t())
BNO08x imu constructor.
Definition BNO08x.cpp:12
uint8_t calibration_status
Calibration status of device (See SH-2 Ref. Manual 6.4.7.1 & 6.4.7.2)
Definition BNO08x.hpp:412
float get_uncalibrated_gyro_bias_X()
Get uncalibrated gyro x axis drift estimate.
Definition BNO08x.cpp:3412
void disable_accelerometer()
Sends command to disable accelerometer reports by setting report interval to 0.
Definition BNO08x.cpp:2474
void update_gravity_data(uint16_t *data, uint8_t status)
Updates gravity data from parsed input report.
Definition BNO08x.cpp:2056
static const constexpr uint16_t FRS_RECORD_ID_ACCELEROMETER
Accelerometer record ID, to be passed in metadata functions like get_Q1()
Definition BNO08x.hpp:198
uint16_t step_count
Step counter reading (See SH-2 Ref. Manual 6.5.29)
Definition BNO08x.hpp:408
uint16_t mems_raw_accel_Y
Definition BNO08x.hpp:413
uint16_t get_raw_mems_magf_Y()
Get raw magnetometer y axis reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:3293
uint32_t get_time_stamp()
Return timestamp of most recent report.
Definition BNO08x.cpp:2660
static const constexpr EventBits_t EVT_GRP_RPT_LINEAR_ACCELEROMETER_BIT
When set, linear accelerometer reports are active.
Definition BNO08x.hpp:460
static const constexpr uint8_t SENSOR_REPORT_ID_GAME_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.19.
Definition BNO08x.hpp:523
uint16_t get_step_count()
Get the counted amount of steps.
Definition BNO08x.cpp:3498
static const constexpr EventBits_t EVT_GRP_SPI_TX_DONE_BIT
When this bit is set, it indicates a queued packet has been sent.
Definition BNO08x.hpp:448
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:3719
uint16_t gravity_accuracy
Gravity reading in m/s^2 (See SH-2 Ref. Manual 6.5.11)
Definition BNO08x.hpp:402
esp_err_t init_gpio()
Initializes required gpio.
Definition BNO08x.cpp:293
static const constexpr int16_t GRAVITY_Q1
Gravity Q point (See SH-2 Ref. Manual 6.5.11)
Definition BNO08x.hpp:225
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:2289
uint16_t raw_lin_accel_X
Definition BNO08x.hpp:394
uint8_t current_slowest_report_ID
ID of the currently enabled report with the largest sample period.
Definition BNO08x.hpp:555
bno08x_report_period_tracker_t report_period_trackers[REPORT_CNT]
Current sample period of each report in microseconds linked to report ID (0 if not enabled).
Definition BNO08x.hpp:543
static const constexpr uint8_t SHTP_REPORT_BASE_TIMESTAMP
See SH2 Ref. Manual 7.2.1.
Definition BNO08x.hpp:511
bool first_boot
true only for first execution of hard_reset(), used to suppress the printing of product ID report.
Definition BNO08x.hpp:348
static const constexpr TickType_t HOST_INT_TIMEOUT_DEFAULT_MS
Max wait between HINT being asserted by BNO08x before transaction is considered failed (in milisecond...
Definition BNO08x.hpp:427
uint16_t get_raw_mems_gyro_Z()
Get raw gyroscope z axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:3257
bool run_full_calibration_routine()
Runs full calibration routine.
Definition BNO08x.cpp:1358
void get_magf(float &x, float &y, float &z, BNO08xAccuracy &accuracy)
Get the full magnetic field vector.
Definition BNO08x.cpp:2745
struct BNO08x::bno08x_report_period_tracker_t bno08x_report_period_tracker_t
bool initialize()
Initializes BNO08x sensor.
Definition BNO08x.cpp:74
static const constexpr uint8_t CALIBRATE_GYRO
Calibrate gyro command used by queue_calibrate_command.
Definition BNO08x.hpp:486
static const constexpr uint8_t SENSOR_REPORT_ID_ARVR_STABILIZED_GAME_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.43.
Definition BNO08x.hpp:534
static const constexpr uint8_t SHTP_REPORT_FRS_READ_RESPONSE
See SH2 Ref. Manual 6.3.7.
Definition BNO08x.hpp:507
uint16_t get_raw_mems_accel_Y()
Get raw accelerometer y axis reading from physical accelerometer MEMs sensor (See Ref....
Definition BNO08x.cpp:3201
static const constexpr uint8_t TARE_AXIS_Z
Tar yaw axis only (used with tare now command)
Definition BNO08x.hpp:208
bno08x_config_t imu_config
IMU configuration settings.
Definition BNO08x.hpp:382
void calibrate_accelerometer()
Sends command to calibrate accelerometer.
Definition BNO08x.cpp:1200
static const constexpr uint8_t COMMAND_DCD
Save DCD command (See SH2 Ref. Manual 6.4.7)
Definition BNO08x.hpp:498
uint16_t gravity_Y
Definition BNO08x.hpp:401
uint16_t raw_accel_Z
Definition BNO08x.hpp:392
uint16_t gravity_X
Definition BNO08x.hpp:401
float get_pitch_deg()
Get the reported rotation about y axis.
Definition BNO08x.cpp:2952
static const constexpr uint8_t CALIBRATE_ACCEL_GYRO_MAG
Calibrate accelerometer, gyro, & magnetometer command used by queue_calibrate_command.
Definition BNO08x.hpp:489
uint16_t raw_calib_gyro_Z
Raw gyro reading (See SH-2 Ref. Manual 6.5.13)
Definition BNO08x.hpp:396
void get_quat(float &i, float &j, float &k, float &real, float &rad_accuracy, BNO08xAccuracy &accuracy)
Get the full quaternion reading.
Definition BNO08x.cpp:2979
void queue_feature_command(uint8_t report_ID, uint32_t time_between_reports, uint32_t specific_config=0)
Queues a packet containing a command with a request for sensor reports, reported periodically....
Definition BNO08x.cpp:3815
float get_yaw_deg()
Get the reported rotation about z axis.
Definition BNO08x.cpp:2962
static const constexpr EventBits_t EVT_GRP_RPT_GYRO_UNCALIBRATED_BIT
When set, uncalibrated gyro reports are active.
Definition BNO08x.hpp:463
uint8_t * activity_confidences
Confidence of read activities (See SH-2 Ref. Manual 6.5.36)
Definition BNO08x.hpp:411
void update_command_data(bno08x_rx_packet_t *packet)
Updates command data from parsed input report.
Definition BNO08x.cpp:2188
TaskHandle_t data_proc_task_hdl
data_proc_task() task handle
Definition BNO08x.hpp:356
uint16_t gravity_Z
Definition BNO08x.hpp:401
uint16_t raw_uncalib_gyro_Z
Definition BNO08x.hpp:403
void save_tare()
Sends command to save tare into non-volatile memory of BNO08x (See Ref. Manual 6.4....
Definition BNO08x.cpp:2620
void disable_linear_accelerometer()
Sends command to disable linear accelerometer reports by setting report interval to 0.
Definition BNO08x.cpp:2484
void calibrate_all()
Sends command to calibrate accelerometer, gyro, and magnetometer.
Definition BNO08x.cpp:1188
uint16_t raw_uncalib_gyro_X
Definition BNO08x.hpp:403
float get_accel_Y()
Get y axis acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:3087
float get_linear_accel_Z()
Get z axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
Definition BNO08x.cpp:3155
void clear_tare()
Sends command to clear persistent tare settings in non-volatile memory of BNO08x (See Ref....
Definition BNO08x.cpp:2632
void update_accelerometer_data(uint16_t *data, uint8_t status)
Updates accelerometer data from parsed input report.
Definition BNO08x.cpp:1975
uint16_t raw_lin_accel_Y
Definition BNO08x.hpp:394
float get_integrated_gyro_velocity_Y()
Get y axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6....
Definition BNO08x.cpp:3468
void request_calibration_status()
Requests ME calibration status from BNO08x (see Ref. Manual 6.4.7.2)
Definition BNO08x.cpp:1297
BNO08x unit test helper class.
Definition BNO08xTestHelper.hpp:16
Holds info about which functionality has been successfully initialized (used by deconstructor during ...
Definition BNO08x.hpp:262
bool data_proc_task
True if xTaskCreate has been called successfully for data_proc_task.
Definition BNO08x.hpp:268
bno08x_init_status_t()
Definition BNO08x.hpp:273
bool isr_service
True if global ISR service has been initialized.
Definition BNO08x.hpp:265
uint8_t task_count
How many successfully initialized tasks (max of TSK_CNT)
Definition BNO08x.hpp:267
bool gpio_inputs
True if GPIO inputs have been initialized.
Definition BNO08x.hpp:264
bool gpio_outputs
True if GPIO outputs have been initialized.
Definition BNO08x.hpp:263
bool spi_task
True if xTaskCreate has been called successfully for spi_task.
Definition BNO08x.hpp:269
bool spi_bus
True if spi_bus_initialize() has been called successfully.
Definition BNO08x.hpp:270
bool isr_handler
True if HINT ISR handler has been initialized.
Definition BNO08x.hpp:266
bool spi_device
True if spi_bus_add_device() has been called successfully.
Definition BNO08x.hpp:271
uint8_t report_ID
Definition BNO08x.hpp:256
uint32_t period
Definition BNO08x.hpp:257
Holds data that is received over spi.
Definition BNO08x.hpp:241
uint16_t length
Body of SHTP packet.
Definition BNO08x.hpp:244
uint8_t header[4]
Header of SHTP packet.
Definition BNO08x.hpp:242
uint8_t body[300]
Definition BNO08x.hpp:243
Holds data that is sent over spi.
Definition BNO08x.hpp:249
uint8_t body[50]
Body of SHTP the packet (header + body)
Definition BNO08x.hpp:250
uint16_t length
Packet length in bytes.
Definition BNO08x.hpp:251
IMU configuration settings passed into constructor.
Definition BNO08x_global_types.hpp:74