ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
BNO055 Class Reference

A class for managing the Adafruit BNO055 sensor. More...

#include <BNO055.h>

Collaboration diagram for BNO055:

Public Member Functions

 BNO055 ()
 Constructs a BNO055 instance.
 
void Update ()
 Updates the sensor data and applies filtering.
 
Vector3D GetLocalMagneticField ()
 Retrieves the local magnetic field vector.
 
Vector3D GetLocalForce ()
 Retrieves the computed local force vector.
 
Vector3D GetLocalAccelerationFiltered ()
 Retrieves the filtered local acceleration vector.
 
Vector3D GetLocalAngularVelocityFiltered ()
 Retrieves the filtered local angular velocity vector.
 
Vector3D GetLocalAcceleration ()
 Retrieves the raw local acceleration vector.
 
Vector3D GetLocalAngularVelocity ()
 Retrieves the raw local angular velocity vector.
 
Quaternion GetAbsoluteOrientation ()
 Retrieves the absolute orientation as a quaternion.
 

Private Member Functions

Vector3D ReadMagneticField ()
 Reads the magnetic field vector from the sensor.
 
Vector3D ReadLocalAcceleration ()
 Reads the local acceleration vector from the sensor.
 
Vector3D ReadLocalAngularVelocity ()
 Reads the local angular velocity vector from the sensor.
 
Vector3D ReadLocalGravityVector ()
 Reads the local gravity vector from the sensor.
 

Private Attributes

sensors_event_t angVelocityData
 
sensors_event_t magnetometerData
 
sensors_event_t accelerometerData
 
sensors_event_t gravityData
 Sensor event data.
 
Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28)
 BNO055 sensor instance.
 
Vector3D localForce
 Computed local force.
 
Vector3D localAcceleration
 Raw local acceleration data.
 
Vector3D localMagneticField
 Raw local magnetic field data.
 
Vector3D localAngularVelocity
 Raw local angular velocity data.
 
Vector3D localGravityVector
 Raw local gravity vector data.
 
Vector3D previousLocalAngularVelocity
 Previous angular velocity for filtering.
 
Quaternion absoluteOrientation
 Computed absolute orientation.
 
long previousMicros
 Timestamp of the previous sensor update.
 
VectorRunningAverageFilter< 10 > localAngulKF = VectorRunningAverageFilter<10>(0.1f)
 Filter for angular velocity.
 
VectorRunningAverageFilter< 10 > localAccelKF = VectorRunningAverageFilter<10>(0.1f)
 Filter for acceleration.
 
VectorRunningAverageFilter< 10 > localGraviKF = VectorRunningAverageFilter<10>(0.1f)
 Filter for gravity vector.
 

Detailed Description

A class for managing the Adafruit BNO055 sensor.

The BNO055 class provides methods for retrieving processed sensor data, including acceleration, angular velocity, magnetic field, gravity vector, and absolute orientation. It uses filters to smooth the data for improved reliability.

Definition at line 30 of file BNO055.h.

Constructor & Destructor Documentation

◆ BNO055()

BNO055 ( )

Constructs a BNO055 instance.

Definition at line 3 of file BNO055.cpp.

References bno, and previousMicros.

Member Function Documentation

◆ GetAbsoluteOrientation()

Quaternion GetAbsoluteOrientation ( )

Retrieves the absolute orientation as a quaternion.

Returns
A Quaternion representing the absolute orientation.

Definition at line 84 of file BNO055.cpp.

References absoluteOrientation.

◆ GetLocalAcceleration()

Vector3D GetLocalAcceleration ( )

Retrieves the raw local acceleration vector.

Returns
A Vector3D representing the raw local acceleration.

Definition at line 76 of file BNO055.cpp.

References localAcceleration.

◆ GetLocalAccelerationFiltered()

Vector3D GetLocalAccelerationFiltered ( )

Retrieves the filtered local acceleration vector.

Returns
A Vector3D representing the filtered local acceleration.

Definition at line 68 of file BNO055.cpp.

References VectorRunningAverageFilter< memory >::Filter(), localAcceleration, and localAccelKF.

◆ GetLocalAngularVelocity()

Vector3D GetLocalAngularVelocity ( )

Retrieves the raw local angular velocity vector.

Returns
A Vector3D representing the raw local angular velocity.

Definition at line 80 of file BNO055.cpp.

References localAngularVelocity.

◆ GetLocalAngularVelocityFiltered()

Vector3D GetLocalAngularVelocityFiltered ( )

Retrieves the filtered local angular velocity vector.

Returns
A Vector3D representing the filtered local angular velocity.

Definition at line 72 of file BNO055.cpp.

References VectorRunningAverageFilter< memory >::Filter(), localAngularVelocity, and localAngulKF.

◆ GetLocalForce()

Vector3D GetLocalForce ( )

Retrieves the computed local force vector.

Returns
A Vector3D representing the local force.

Definition at line 64 of file BNO055.cpp.

References localForce.

◆ GetLocalMagneticField()

Vector3D GetLocalMagneticField ( )

Retrieves the local magnetic field vector.

Returns
A Vector3D representing the magnetic field.

Definition at line 60 of file BNO055.cpp.

References localMagneticField.

Referenced by Update().

◆ ReadLocalAcceleration()

Vector3D ReadLocalAcceleration ( )
private

Reads the local acceleration vector from the sensor.

Returns
A Vector3D representing the local acceleration.

Definition at line 26 of file BNO055.cpp.

References accelerometerData, and bno.

◆ ReadLocalAngularVelocity()

Vector3D ReadLocalAngularVelocity ( )
private

Reads the local angular velocity vector from the sensor.

Returns
A Vector3D representing the local angular velocity.

Definition at line 31 of file BNO055.cpp.

References angVelocityData, and bno.

◆ ReadLocalGravityVector()

Vector3D ReadLocalGravityVector ( )
private

Reads the local gravity vector from the sensor.

Returns
A Vector3D representing the local gravity vector.

Definition at line 36 of file BNO055.cpp.

References bno, and gravityData.

◆ ReadMagneticField()

Vector3D ReadMagneticField ( )
private

Reads the magnetic field vector from the sensor.

Returns
A Vector3D representing the magnetic field.

Definition at line 21 of file BNO055.cpp.

References bno, and magnetometerData.

◆ Update()

Member Data Documentation

◆ absoluteOrientation

Quaternion absoluteOrientation
private

Computed absolute orientation.

Definition at line 40 of file BNO055.h.

Referenced by GetAbsoluteOrientation(), and Update().

◆ accelerometerData

sensors_event_t accelerometerData
private

Definition at line 32 of file BNO055.h.

Referenced by ReadLocalAcceleration().

◆ angVelocityData

sensors_event_t angVelocityData
private

Definition at line 32 of file BNO055.h.

Referenced by ReadLocalAngularVelocity().

◆ bno

Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28)
private

◆ gravityData

sensors_event_t gravityData
private

Sensor event data.

Definition at line 32 of file BNO055.h.

Referenced by ReadLocalGravityVector().

◆ localAcceleration

Vector3D localAcceleration
private

Raw local acceleration data.

Definition at line 35 of file BNO055.h.

Referenced by GetLocalAcceleration(), GetLocalAccelerationFiltered(), and Update().

◆ localAccelKF

VectorRunningAverageFilter<10> localAccelKF = VectorRunningAverageFilter<10>(0.1f)
private

Filter for acceleration.

Definition at line 44 of file BNO055.h.

Referenced by GetLocalAccelerationFiltered().

◆ localAngularVelocity

Vector3D localAngularVelocity
private

Raw local angular velocity data.

Definition at line 37 of file BNO055.h.

Referenced by GetLocalAngularVelocity(), GetLocalAngularVelocityFiltered(), and Update().

◆ localAngulKF

VectorRunningAverageFilter<10> localAngulKF = VectorRunningAverageFilter<10>(0.1f)
private

Filter for angular velocity.

Definition at line 43 of file BNO055.h.

Referenced by GetLocalAngularVelocityFiltered().

◆ localForce

Vector3D localForce
private

Computed local force.

Definition at line 34 of file BNO055.h.

Referenced by GetLocalForce(), and Update().

◆ localGraviKF

VectorRunningAverageFilter<10> localGraviKF = VectorRunningAverageFilter<10>(0.1f)
private

Filter for gravity vector.

Definition at line 45 of file BNO055.h.

Referenced by Update().

◆ localGravityVector

Vector3D localGravityVector
private

Raw local gravity vector data.

Definition at line 38 of file BNO055.h.

Referenced by Update().

◆ localMagneticField

Vector3D localMagneticField
private

Raw local magnetic field data.

Definition at line 36 of file BNO055.h.

Referenced by GetLocalMagneticField().

◆ magnetometerData

sensors_event_t magnetometerData
private

Definition at line 32 of file BNO055.h.

Referenced by ReadMagneticField().

◆ previousLocalAngularVelocity

Vector3D previousLocalAngularVelocity
private

Previous angular velocity for filtering.

Definition at line 39 of file BNO055.h.

◆ previousMicros

long previousMicros
private

Timestamp of the previous sensor update.

Definition at line 41 of file BNO055.h.

Referenced by BNO055(), and Update().


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