9-axis sensor fusion with Kalman filter

Add support for 9-axis gravity and linear-acceleration sensors
virtual orientation sensor using 9-axis fusion

Change-Id: I6717539373fce781c10e97b6fa59f68a831a592f
This commit is contained in:
Mathias Agopian 2011-05-17 22:54:42 -07:00
parent bc00846436
commit b62013f6aa
2 changed files with 13 additions and 1 deletions

View File

@ -21,8 +21,9 @@
#include <sys/types.h>
#include <utils/Errors.h>
#include <utils/String8.h>
#include <utils/Flattenable.h>
#include <utils/String8.h>
#include <utils/Timers.h>
#include <hardware/sensors.h>
@ -64,6 +65,8 @@ public:
float getResolution() const;
float getPowerUsage() const;
int32_t getMinDelay() const;
nsecs_t getMinDelayNs() const;
int32_t getVersion() const;
// Flattenable interface
virtual size_t getFlattenedSize() const;
@ -83,6 +86,7 @@ private:
float mResolution;
float mPower;
int32_t mMinDelay;
int32_t mVersion;
};
// ----------------------------------------------------------------------------

View File

@ -89,6 +89,14 @@ int32_t Sensor::getMinDelay() const {
return mMinDelay;
}
nsecs_t Sensor::getMinDelayNs() const {
return getMinDelay() * 1000;
}
int32_t Sensor::getVersion() const {
return mVersion;
}
size_t Sensor::getFlattenedSize() const
{
return sizeof(int32_t) + ((mName.length() + 3) & ~3) +