30 #ifndef INCLUDE_IMUNANO33_IMUNANO33_HPP_
31 #define INCLUDE_IMUNANO33_IMUNANO33_HPP_
36 #ifdef IMUNANO33_EMBED
44 #ifdef IMUNANO33_EMBED
132 : m_initialQ{initialQ}, m_filter{gyroFavoring, initialQ} {}
170 const num_t pressure) {
171 m_climate.
update(temperature, humidity, pressure);
190 const num_t deltaT) {
191 m_filter.
update(accel, gyro, deltaT);
241 const num_t temperature,
const num_t humidity,
242 const num_t pressure) {
File containing the imunano33::Climate class.
File containing the imunano33::Filter class.
File containing the imunano33::Quaternion class.
A minimized version of vectors for embedded devices without access to the STL (such as on an Arduino,...
Contains imunano33::TempUnit and imunano33::PressureUnit enums, in addition to number type.
double num_t
Alias to number type depending on embed.
Definition: unit.hpp:34
Handles climate data from Nano 33 (or other) sensors.
Definition: climate.hpp:25
bool dataExists() const
Determines if climate data exists.
Definition: climate.hpp:67
num_t getPressure() const
Gets pressure.
Definition: climate.hpp:115
num_t getTemp() const
Gets temperature.
Definition: climate.hpp:78
void update(const num_t temp, const num_t humid, const num_t pressure)
Updates climate data.
Definition: climate.hpp:166
num_t getHumidity() const
Gets relative humidity.
Definition: climate.hpp:157
void reset()
Resets climate data.
Definition: climate.hpp:178
A complementary filter for a 6 axis IMU using quaternions.
Definition: filter.hpp:44
void updateAccel(const Vector3D &accel)
Updates filter with accelerometer data.
Definition: filter.hpp:158
num_t getGyroFavoring() const
Gets gyroscope favoring.
Definition: filter.hpp:249
void reset()
Resets quaternion to [1, 0, 0, 0], or facing towards position x direction.
Definition: filter.hpp:235
void update(const Vector3D &accel, const Vector3D &gyro, const num_t time)
Updates filter with both gyro and accel data.
Definition: filter.hpp:222
void setGyroFavoring(const num_t favoring)
Sets gyro favoring.
Definition: filter.hpp:269
void updateGyro(const Vector3D &gyro, const num_t time)
Updates filter with gyro data.
Definition: filter.hpp:136
void setRotQ(const Quaternion &q)
Sets rotation quaternion for the filter.
Definition: filter.hpp:259
Quaternion getRotQ() const
Gets rotation quaternion of the complementary filter.
Definition: filter.hpp:242
A data processor for IMU and climate data from an Arduino Nano 33 BLE Sense.
Definition: imunano33.hpp:87
IMUNano33 & operator=(IMUNano33 &&)=default
Move assignment.
void zeroIMU()
Sets current IMU orientation to be facing the positive X-axis..
Definition: imunano33.hpp:262
bool climateDataExists() const
Determines if climate data exists.
Definition: imunano33.hpp:360
void updateIMUGyro(const Vector3D &gyro, const num_t deltaT)
Updates IMU gyroscope data.
Definition: imunano33.hpp:215
void updateIMUAccel(const Vector3D &accel)
Updates IMU acceleration data.
Definition: imunano33.hpp:201
num_t getTemperature() const
Gets temperature.
Definition: imunano33.hpp:322
num_t getHumidity() const
Gets relative humidity.
Definition: imunano33.hpp:350
void resetClimate()
Resets climate data.
Definition: imunano33.hpp:269
void updateClimate(const num_t temperature, const num_t humidity, const num_t pressure)
Updates climate data.
Definition: imunano33.hpp:169
IMUNano33(IMUNano33 &&)=default
Move constructor.
IMUNano33(const num_t gyroFavoring)
Constructor.
Definition: imunano33.hpp:112
Quaternion getRotQ() const
Gets rotation quaternion of the complementary filter.
Definition: imunano33.hpp:303
void update(const Vector3D &accel, const Vector3D &gyro, const num_t deltaT, const num_t temperature, const num_t humidity, const num_t pressure)
Updates both IMU and climate data.
Definition: imunano33.hpp:240
~IMUNano33()=default
Destructor.
void resetIMU()
Resets IMU orientation to the initialQ argument provided in the constructor.
Definition: imunano33.hpp:254
num_t getGyroFavoring() const
Gets gyroscope favoring.
Definition: imunano33.hpp:310
IMUNano33(const IMUNano33 &other)=default
Copy constructor.
void setGyroFavoring(const num_t favoring)
Sets gyro favoring.
Definition: imunano33.hpp:294
IMUNano33 & operator=(const IMUNano33 &other)=default
Assignment operator.
IMUNano33()=default
Default constructor.
IMUNano33(const num_t gyroFavoring, const Quaternion &initialQ)
Constructor.
Definition: imunano33.hpp:131
void updateIMU(const Vector3D &accel, const Vector3D &gyro, const num_t deltaT)
Updates IMU data.
Definition: imunano33.hpp:189
num_t getPressure() const
Gets pressure.
Definition: imunano33.hpp:336
void setRotQ(const Quaternion &q)
Sets rotation quaternion for the filter.
Definition: imunano33.hpp:281
A simple quaternion class for rotations.
Definition: quaternion.hpp:40
A simple 3D vector representation.
Definition: simplevectors.hpp:844
A minimal 3D vector representation.
Definition: sv_embed.hpp:168