SignalK-Orientation 1.0.0
Orientation output in Signal K format for ESP32
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
OrientationSensor Class Reference

OrientationSensor represents a 9-Degrees-of-Freedom sensor (magnetometer, accelerometer, and gyroscope). More...

#include <orientation_sensor.h>

Public Member Functions

 OrientationSensor (uint8_t pin_i2c_sda, uint8_t pin_i2c_scl, uint8_t accel_mag_i2c_addr, uint8_t gyro_i2c_addr)
 Constructor sets up the I2C communications to the sensor and initializes the sensor fusion library.
 
void ReadAndProcessSensors (void)
 reads sensor hardware and runs fusion algorithm
 
int GetFusionRateHz (void)
 Return how fast we read the physical sensor and run the fusion algorithm.
 

Public Attributes

SensorFusion * sensor_interface_
 sensor's Fusion Library interface
 

Detailed Description

OrientationSensor represents a 9-Degrees-of-Freedom sensor (magnetometer, accelerometer, and gyroscope).

This class provides the interface to the SensorFusion library which performs the I2C communication with the sensor and runs the sensor fusion algorithm.

A compatible sensor is the NXP FXOS8700 + FXAS21002 combination sensor. This combination sensor is found on products such as the Adafruit #3463 breakout board. The OrientationSensorFusion-ESP library is configured to use this NXP sensor by default, though other sensors can be used by adjusting the library's build.h and board.h files. Calling the public SensorFusion:: methods can be done after you instantiate OrientationSensor, for example by: orientation_sensor->sensor_interface_->GetOrientationQuaternion(); The OrientationSensorFusion-ESP library has details:

See also
https://github.com/BjarneBitscrambler/OrientationSensorFusion-ESP.git

Definition at line 36 of file orientation_sensor.h.

Constructor & Destructor Documentation

◆ OrientationSensor()

OrientationSensor::OrientationSensor ( uint8_t  pin_i2c_sda,
uint8_t  pin_i2c_scl,
uint8_t  accel_mag_i2c_addr,
uint8_t  gyro_i2c_addr 
)

Constructor sets up the I2C communications to the sensor and initializes the sensor fusion library.

Parameters
pin_i2c_sdaPin of SDA line to sensor. Use -1 for Arduino default.
pin_i2c_sclPin of SCL line to sensor. Use -1 for Arduino default.
accel_mag_i2c_addrI2C address of accelerometer/magnetometer IC.
gyro_i2c_addrI2C address of gyroscope IC.
config_pathRESTful path by which sensor can be configured.

Definition at line 27 of file orientation_sensor.cpp.

Member Function Documentation

◆ GetFusionRateHz()

int OrientationSensor::GetFusionRateHz ( void  )

Return how fast we read the physical sensor and run the fusion algorithm.

Definition at line 72 of file orientation_sensor.cpp.

◆ ReadAndProcessSensors()

void OrientationSensor::ReadAndProcessSensors ( void  )

reads sensor hardware and runs fusion algorithm

Read the Sensors and calculate orientation parameters.

Definition at line 80 of file orientation_sensor.cpp.

Member Data Documentation

◆ sensor_interface_

SensorFusion* OrientationSensor::sensor_interface_

sensor's Fusion Library interface

Definition at line 40 of file orientation_sensor.h.


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