esp32_BNO08x 1.31
C++ BNO08x IMU driver component for esp-idf.
Loading...
Searching...
No Matches
BNO08xRptRVGeomag Class Reference

Class to represent geomagnetic rotation vector reports. (See Ref. Manual 6.5.20) More...

#include <BNO08xRptRVGeomag.hpp>

Inheritance diagram for BNO08xRptRVGeomag:
Collaboration diagram for BNO08xRptRVGeomag:

Public Member Functions

 BNO08xRptRVGeomag (uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t *sync_ctx)
 
bool tare (bool x=true, bool y=true, bool z=true)
 Tares geomagnetic rotation vector.
 
bool tare_persist ()
 Saves most recent tare operation to BNO08x internal flash, such that it persists on reset.
 
void tare_clear ()
 Clears most recent tare operation.
 
- Public Member Functions inherited from BNO08xRptRVGeneric
bool enable (uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg) override
 Enables a rotation vector report such that the BNO08x begins it.
 
bno08x_quat_t get_quat ()
 Grabs most recent rotation vector data in form of unit quaternion, rad accuracy units in radians (if available, else constant 0.0f).
 
bno08x_euler_angle_t get_euler (bool in_degrees=true)
 Grabs most recent rotation vector data in form of an euler angle, units are in degrees or rads.
 
- Public Member Functions inherited from BNO08xRpt
bool disable (sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg)
 Disables a sensor report by setting its period to 0us such that the BNO08x stops sending it.
 
bool register_cb (std::function< void(void)> cb_fxn)
 Registers a callback to execute when new data from a specific report is received.
 
bool has_new_data ()
 Checks if a new report has been received since the last time this function was called.
 
bool flush ()
 Flush all buffered reports for this sensor/report module.
 
bool get_sample_counts (bno08x_sample_counts_t &sample_counts)
 Gets sample counts for this sensor (see SH-2 ref manual 6.4.3.1)
 
bool clear_sample_counts ()
 Clears BNO08x internal sample counts for this sensor. (see SH-2 ref manual 6.4.3.1)
 
bool get_meta_data (bno08x_meta_data_t &meta_data)
 Retrieves meta data for this sensor/report by reading respective record in FRS (flash record system).
 

Private Member Functions

void update_data (sh2_SensorValue_t *sensor_val) override
 Updates geomagnetic rotation vector data from decoded sensor event.
 

Static Private Attributes

static const constexpr char * TAG = "BNO08xRptRVGeomag"
 

Additional Inherited Members

- Protected Member Functions inherited from BNO08xRptRVGeneric
 BNO08xRptRVGeneric (uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t *sync_ctx)
 
bool tare (bool x, bool y, bool z, sh2_TareBasis_t basis)
 Tares vector basis according to axis flags.
 
- Protected Member Functions inherited from BNO08xRpt
bool rpt_enable (uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg)
 Enables a sensor report such that the BNO08x begins sending it.
 
 BNO08xRpt (uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t *sync_ctx)
 BNO08xRpt report constructor.
 
void unlock_sh2_HAL ()
 Unlocks sh2 HAL lib to allow other tasks to call its APIs.
 
void lock_sh2_HAL ()
 Locks sh2 HAL lib to only allow the calling task to call its APIs.
 
void unlock_user_data ()
 Unlocks user data to allow other tasks to read/modify it.
 
void lock_user_data ()
 Locks locks user data to only allow the calling task to read/modify it.
 
void signal_data_available ()
 Signals to BNO08x::data_available() that a new report has arrived.
 
- Protected Attributes inherited from BNO08xRptRVGeneric
bno08x_quat_t data
 
- Protected Attributes inherited from BNO08xRpt
uint8_t ID
 Report ID, ex. SH2_ACCELERATION.
 
EventBits_t rpt_bit
 Respective enable and data bit for report in evt_grp_rpt_en and evt_grp_rpt_data.
 
uint32_t period_us
 The period/interval of the report in microseconds.
 
BNO08xPrivateTypes::bno08x_sync_ctx_tsync_ctx
 
- Static Protected Attributes inherited from BNO08xRptRVGeneric
static const constexpr char * TAG = "BNO08xRptRVGeneric"
 
- Static Protected Attributes inherited from BNO08xRpt
static const constexpr float RAD_2_DEG
 Constant for radian to degree conversions, sed in quaternion to euler function conversions.
 
static const constexpr char * TAG = "BNO08xRpt"
 

Detailed Description

Class to represent geomagnetic rotation vector reports. (See Ref. Manual 6.5.20)

Constructor & Destructor Documentation

◆ BNO08xRptRVGeomag()

BNO08xRptRVGeomag::BNO08xRptRVGeomag ( uint8_t ID,
EventBits_t rpt_bit,
BNO08xPrivateTypes::bno08x_sync_ctx_t * sync_ctx )
inline

Member Function Documentation

◆ tare()

bool BNO08xRptRVGeomag::tare ( bool x = true,
bool y = true,
bool z = true )

Tares geomagnetic rotation vector.

Parameters
xIf true tare x axis (optional, default true).
yIf true tare y axis (optional, default true).
zIf true tare z axis (optional, default true).
Returns
True if tare operation succeeded.
Here is the call graph for this function:

◆ tare_clear()

void BNO08xRptRVGeomag::tare_clear ( )

Clears most recent tare operation.

Returns
void, nothing to return
Here is the call graph for this function:

◆ tare_persist()

bool BNO08xRptRVGeomag::tare_persist ( )

Saves most recent tare operation to BNO08x internal flash, such that it persists on reset.

Returns
True if tare operation succeeded.
Here is the call graph for this function:

◆ update_data()

void BNO08xRptRVGeomag::update_data ( sh2_SensorValue_t * sensor_val)
overrideprivatevirtual

Updates geomagnetic rotation vector data from decoded sensor event.

Parameters
sensor_valThe sh2_SensorValue_t struct used in sh2_decodeSensorEvent() call.
Returns
void, nothing to return

Implements BNO08xRpt.

Here is the call graph for this function:

Member Data Documentation

◆ TAG

const constexpr char* BNO08xRptRVGeomag::TAG = "BNO08xRptRVGeomag"
staticconstexprprivate

The documentation for this class was generated from the following files: