2#include <NDEVR/OrientationSensor.h>
3#include <NDEVR/QueueBuffer.h>
4#include <NDEVR/Quaternion.h>
83 bool m_reset_gyro =
true;
84 bool m_store_readings =
false;
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:540
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Used to calculate madgick orientation given sensor streams for gyro and optionally magnetometer(s) an...
Definition MadgwickOrientationSensor.h:34
bool supportsRodded() const override
Definition MadgwickOrientationSensor.h:47
Buffer< Time > v_gyro_timestamp
Definition MadgwickOrientationSensor.h:64
Angle< fltp08 > angularVelocity() const
void processAcceleration(Ray< 3, fltp08 > accel_data, const Time &ts)
void setRequestGyroCallback(const std::function< void()> &callback)
Definition MadgwickOrientationSensor.h:48
sint02 getPacketGyroState() const
void processMadgwick(Time time)
bool requestGyroCalibration() override
void setPacketGyroState(sint02 state)
void setGyroState(GyroState state)
Buffer< Ray< 3, fltp08 > > v_accel_data_sync
Definition MadgwickOrientationSensor.h:63
MadgwickOrientationSensor(const Model &model, ProgressInfo *log, QObject *parent=nullptr)
QueueBuffer< OrientationReading, uint04, ObjectAllocator< true, uint04 > > m_historic_orientation
Definition MadgwickOrientationSensor.h:82
void updateFromQuaternion(Time time)
bool supportsFixed() const override
Definition MadgwickOrientationSensor.h:46
static void updateMadgwick(Vector< 3, fltp08 > g, Vector< 3, fltp08 > a, Vector< 3, fltp08 > m, Quaternion< fltp08 > &q, TimeSpan time_span, fltp08 beta)
Matrix< fltp08 > orientationAt(const Time &time) const
std::mutex m_theta_mtx
Definition MadgwickOrientationSensor.h:69
Vector< 3, Angle< fltp08 > > angleFromQuaternion(const Quaternion< fltp08 > &quaternion) const
void processQuaternion(const Quaternion< fltp08 > &quaternion, const Time &ts)
Buffer< Ray< 3, fltp08 > > v_gyro_data
Definition MadgwickOrientationSensor.h:65
TimeSpan m_total_ts
Definition MadgwickOrientationSensor.h:75
bool readyToSetupFrame() const
void processGyro(Ray< 3, fltp08 > gyro_data, const Time &ts)
bool collectRecentRecords(const Time &cutoff_time, Buffer< IMU::Point, uint04, ObjectAllocator< false > > &imu_points, const Time &offset_time)
void initialComputeMadgwick(Vector< 3, fltp08 > a, Vector< 3, fltp08 > m, Quaternion< fltp08 > &q, Time time)
std::function< void()> m_request_gyro_callback
Definition MadgwickOrientationSensor.h:62
void setStoreReadings(bool store_readings)
Definition Matrix.hpp:176
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
Definition MemoryManager.h:261
Used to report the orientation of a Hardware object within 3D space.
Definition OrientationSensor.h:86
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
https://www.3dgep.com/understanding-quaternions/
Definition Quaternion.hpp:23
Stores objects in a first-in, first out queue based Buffer with push and pop functions.
Definition QueueBuffer.hpp:10
Definition Vertex.hpp:317
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
int16_t sint02
-Defines an alias representing a 2 byte, signed integer. -Can represent exact integer values -32767 t...
Definition BaseValues.hpp:57
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
GyroState
Used by OrientationSensor to display the current state of any available gyro.
Definition OrientationSensor.h:43
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
A single reading, typically used by a MadgwickOrientationSensor consisiting of input from all IMU sen...
Definition MadgwickOrientationSensor.h:15
Vector< 3, fltp08 > accel
Definition MadgwickOrientationSensor.h:24
Vector< 3, fltp08 > magnet
Definition MadgwickOrientationSensor.h:25
OrientationReading()
Definition MadgwickOrientationSensor.h:16
HARDWARE_API OrientationReading(Quaternion< fltp08 > quaternion, Vector< 3, fltp08 > gyro, Vector< 3, fltp08 > accel, Vector< 3, fltp08 > magnet, const Time &time)
Time time
Definition MadgwickOrientationSensor.h:26
Vector< 3, fltp08 > gyro
Definition MadgwickOrientationSensor.h:23
Quaternion< fltp08 > quaternion
Definition MadgwickOrientationSensor.h:22