|
SignalK-Orientation 1.0.0
Orientation output in Signal K format for ESP32
|
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 | |
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:
Definition at line 36 of file orientation_sensor.h.
| 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.
| pin_i2c_sda | Pin of SDA line to sensor. Use -1 for Arduino default. |
| pin_i2c_scl | Pin of SCL line to sensor. Use -1 for Arduino default. |
| accel_mag_i2c_addr | I2C address of accelerometer/magnetometer IC. |
| gyro_i2c_addr | I2C address of gyroscope IC. |
| config_path | RESTful path by which sensor can be configured. |
Definition at line 27 of file orientation_sensor.cpp.
| 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.
| 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.
| SensorFusion* OrientationSensor::sensor_interface_ |
sensor's Fusion Library interface
Definition at line 40 of file orientation_sensor.h.