sensorfw: filters/rotationfilter/rotationfilter.h Source File

sensorfw

rotationfilter.h
Go to the documentation of this file.
1
26#ifndef ROTATIONFILTER_H
27#define ROTATIONFILTER_H
28
29#include <QObject>
30
31#include "orientationdata.h"
32#include "filter.h"
33
40 class RotationFilter : public QObject, public FilterBase
41{
42 Q_OBJECT;
43public:
48 static FilterBase* factoryMethod()
49 {
50 return new RotationFilter();
51 }
52
53private:
54
58 RotationFilter();
59
65 double vectorLength(const TimedXyzData& data);
66
67 Sink<RotationFilter, TimedXyzData> accelerometerDataSink_;
68 Sink<RotationFilter, CompassData> compassDataSink_;
69 Source<TimedXyzData> source_;
70
71 void interpret(unsigned, const TimedXyzData*);
72 void updateZvalue(unsigned, const CompassData*);
73
74 inline int dotProduct(TimedXyzData a, TimedXyzData b) const {
75 return (a.x_ * b.x_) + (a.y_ * b.y_) + (a.z_ * b.z_);
76 }
77
78 TimedXyzData rotation_;
79};
80
81#endif // ROTATIONFILTER_H
CompassData
Datatype for compass measurements.
Definition: orientationdata.h:112
RotationFilter
Filter for calculating device axis rotations.
Definition: rotationfilter.h:41
RotationFilter::factoryMethod
static FilterBase * factoryMethod()
Factory method.
Definition: rotationfilter.h:48
TimedXyzData
Class for vector type measurement data (timestamp, x, y, z).
Definition: genericdata.h:53
TimedXyzData::x_
int x_
X value.
Definition: genericdata.h:70
TimedXyzData::y_
int y_
Y value.
Definition: genericdata.h:71
TimedXyzData::z_
int z_
Z value.
Definition: genericdata.h:72
orientationdata.h
Datatypes for different filters.