This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/sensors/imu/GyroscopeData.h
kazu 4f511d907e some fixes [multithreading,..]
needed interface changes [new options]
logger for android
wifi-ap-optimization
new test-cases
2016-09-28 12:19:14 +02:00

35 lines
628 B
C++

#ifndef GYROSCOPEDATA_H
#define GYROSCOPEDATA_H
#include <cmath>
#include <sstream>
/**
* data received from a gyroscope sensor
* IN RADIANS!
*/
struct GyroscopeData {
float x;
float y;
float z;
GyroscopeData() : x(0), y(0), z(0) {;}
/** ctor from RADIANS */
GyroscopeData(const float x, const float y, const float z) : x(x), y(y), z(z) {;}
float magnitude() const {
return std::sqrt( x*x + y*y + z*z );
}
std::string asString() const {
std::stringstream ss;
ss << "(" << x << "," << y << "," << z << ")";
return ss.str();
}
};
#endif // GYROSCOPEDATA_H