90 void QuaternionToEuler(
double i,
double j,
double k,
double w,
double &roll,
double &pitch,
double &yaw);
93 void EulerToQuaternion(
double roll,
double pitch,
double yaw,
double &i,
double &j,
double &k,
double &w);
95 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
96 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
97 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
101 bool SetOrientationData(
double roll,
double pitch,
double yaw,
double w = 0.0)
override;
112 virtual bool SetPowerMode(
const std::string &mode)
override;
223 bool callHandshake();
227 double last_q_i = 0.0;
228 double last_q_j = 0.0;
229 double last_q_k = 0.0;
230 double last_q_w = 1.0;
233 double last_raw_q_i = 0.0;
234 double last_raw_q_j = 0.0;
235 double last_raw_q_k = 0.0;
236 double last_raw_q_w = 1.0;
239 std::unique_ptr<IMUSensorFusion> m_SensorFusion;
244 double x {0.0}, y {0.0}, z {0.0};
247 RawSensorData m_RawAccel, m_RawGyro, m_RawMag;
250 std::chrono::steady_clock::time_point m_LastFusionTime;
251 bool m_FusionTimerInitialized {
false};
254 bool isFusionEnabled()
const;
257 void recreateFusionFilter();
The I2C class manages connection with I2C devices on Linux systems. I2C communication is commonly use...
The Serial class manages connection with serial devices including Bluetooth. Serial communication is ...
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
virtual bool SetOperationMode(const std::string &mode) override
SetOperationMode Set the operation mode of the IMU sensor.
INDI::PropertySwitch IMUFrameSP
virtual const char * getDefaultName() override
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
INDI::PropertySwitch AstroCoordsTypeSP
bool SetAccelerationData(double x, double y, double z) override
SetAccelerationData Set the linear acceleration data.
INDI::PropertyNumber MagneticDeclinationNP
INDI::PropertyNumber FusionParamsNP
Algorithm tuning parameters (β for Madgwick; Kp & Ki for Mahony)
virtual bool SetUpdateRate(double rate) override
SetUpdateRate Set the sensor polling frequency.
void RecalculateAstroCoordinates()
uint8_t getSupportedConnections() const
Get the currently configured supported connection modes.
Connection::Serial * serialConnection
INDI::PropertySwitch FusionTypeSP
Select fusion algorithm: Madgwick or Mahony.
bool SetGyroscopeData(double x, double y, double z) override
SetGyroscopeData Set the angular velocity data.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
void EulerToQuaternion(double roll, double pitch, double yaw, double &i, double &j, double &k, double &w)
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Connection::I2C * i2cConnection
virtual bool LoadCalibrationData() override
LoadCalibrationData Load previously saved calibration data.
virtual bool SaveCalibrationData() override
SaveCalibrationData Save the current calibration data.
virtual bool StartCalibration() override
StartCalibration Initiate the calibration sequence.
bool SetMagnetometerData(double x, double y, double z) override
SetMagnetometerData Set the magnetic field strength data.
void QuaternionToEuler(double i, double j, double k, double w, double &roll, double &pitch, double &yaw)
enum INDI::IMU::@450 IMUConnection
INDI::PropertyNumber GeographicCoordNP
virtual bool Handshake()
Performs a device-specific handshake after a connection is established. This method should be overrid...
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool SetDistanceUnits(bool metric) override
SetUnits Set the units for sensor data.
INDI::PropertyNumber TelescopeVectorNP
virtual bool SetPowerMode(const std::string &mode) override
SetPowerMode Set the power mode of the IMU sensor.
INDI::PropertyNumber AstroCoordinatesNP
void setSupportedConnections(const uint8_t &value)
INDI::PropertyNumber SyncAxisNP
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
INDI::PropertySwitch SensorFusionSP
Enable / Disable software sensor fusion.
INDI::PropertyNumber OrientationAdjustmentsNP
virtual bool ResetCalibration() override
ResetCalibration Reset calibration data.
virtual bool SetAngularUnits(bool degrees) override
SetAngularUnits Set the angular units for sensor data.
bool SetOrientationData(double roll, double pitch, double yaw, double w=0.0) override
SetOrientationData Set the orientation data (Roll, Pitch, Yaw, Quaternion W)
@ FUSION_PARAM_1
β for Madgwick; Kp for Mahony
@ FUSION_PARAM_2
unused for Madgwick; Ki for Mahony
Combines all INDI Connection Plugins. Each INDI connection plugin is responsible of managing communic...
Namespace to encapsulate INDI client, drivers, and mediator classes.