SignalK-Orientation 1.0.0
Orientation output in Signal K format for ESP32
Loading...
Searching...
No Matches
orientation_sensor.h
Go to the documentation of this file.
1
8#ifndef orientation_sensor_H_
9#define orientation_sensor_H_
10
11#ifndef BOARD_USES_HW_GPIO_NUMBERS
12#define BOARD_USES_HW_GPIO_NUMBERS
13#endif
14
15#include "sensor_fusion_class.h" // for OrientationSensorFusion-ESP library
16#include "signalk_orientation.h"
17
37 public:
38 OrientationSensor(uint8_t pin_i2c_sda, uint8_t pin_i2c_scl,
39 uint8_t accel_mag_i2c_addr, uint8_t gyro_i2c_addr);
40 SensorFusion* sensor_interface_;
41 void ReadAndProcessSensors(void);
42 int GetFusionRateHz(void);
43 private:
44};
45
46
56//sensESP v2 replaced NumericSensor with various sub-types class OrientationValues : public NumericSensor {
58 public:
80 OrientationValues(OrientationSensor* orientation_sensor,
82//sensESP v3 removes start()
83 //void start() override final; ///< starts periodic outputs of Attitude
86 float ReportValue(void);
87
88 private:
89 //SensESPv3 requires inheriting from Configurable and explicitly calling ConfigItem()
90 //virtual void get_configuration(JsonObject& doc) override;
91 //virtual bool set_configuration(const JsonObject& config) override;
92 //virtual String get_config_schema() override;
97 int throttlePrint_;
98
99}; // end class OrientationValues2
100
101
102#endif // ORIENTATION_SENSOR_H_
OrientationSensor represents a 9-Degrees-of-Freedom sensor (magnetometer, accelerometer,...
int GetFusionRateHz(void)
Return how fast we read the physical sensor and run the fusion algorithm.
SensorFusion * sensor_interface_
sensor's Fusion Library interface
void ReadAndProcessSensors(void)
reads sensor hardware and runs fusion algorithm
OrientationValues reads and outputs orientation parameters.
@ kMagCalFitInUse
fit of currently-used calibration. <3.5 is good.
@ kRateOfTurn
rate of change of compass heading
@ kMagFieldMagnitudeTrial
geomagnetic magnitude based on current readings
@ kCompassHeading
compass heading, also called yaw
@ kYaw
rotation about the vertical axis
@ kAttitude
attitude combines heading, pitch, and roll
@ kMagCalAlgorithmSolver
cal algorithm order used. [0,4,7,10] 10 is best
@ kAccelerationX
acceleration in the stern-to-bow axis
@ kRateOfRoll
rate of change of roll
@ kMagCalFitTrial
fit of candidate calibration. <3.5 is good.
@ kAccelerationZ
acceleration in the down-to-up axis
@ kRateOfPitch
rate of change of pitch
@ kMagNoiseCovariance
deviation of current reading from calibrated geomag sphere
@ kPitch
rotation about the transverse axis
@ kMagFieldMagnitude
geomagnetic magnitude of current calibration
@ kAccelerationY
acceleration in the starboard-to-port axis
@ kRoll
rotation about the longitudinal axis
@ kTemperature
temperature as reported by sensor IC
@ kMagInclination
geomagnetic inclination based on current readings
OrientationValType value_type_
Particular type of orientation parameter supplied.
float ReportValue(void)
fetches current orientation parameter
OrientationSensor * orientation_sensor_
Pointer to the orientation sensor.
uint report_interval_ms_
Interval between data outputs via Signal K.
int8_t save_mag_cal_
Flag for saving current magnetic calibration.
Vessel orientation data structures definition file.