diff options
author | Helmut Schmidt <Helmut.3.Schmidt@continental-corporation.com> | 2015-03-20 12:49:21 +0100 |
---|---|---|
committer | Helmut Schmidt <Helmut.3.Schmidt@continental-corporation.com> | 2015-03-20 12:49:21 +0100 |
commit | 10de3de6319c7224c2a19af78f103a4d69d318f9 (patch) | |
tree | df063af50ffee97bf86a4e32576dc7990528031e | |
parent | 3a1254f9ac4f5e2d088d24598e76764874a40b99 (diff) | |
download | positioning-10de3de6319c7224c2a19af78f103a4d69d318f9.tar.gz |
GT-3165 fix data type of typeBits field in the TAccelerationConfiguration / TGyroscopeConfiguration structs
-rw-r--r-- | sensors-service/api/acceleration.h | 17 | ||||
-rw-r--r-- | sensors-service/api/gyroscope.h | 7 | ||||
-rw-r--r-- | sensors-service/src/gyroscope.c | 17 |
3 files changed, 30 insertions, 11 deletions
diff --git a/sensors-service/api/acceleration.h b/sensors-service/api/acceleration.h index db040ac..62764b4 100644 --- a/sensors-service/api/acceleration.h +++ b/sensors-service/api/acceleration.h @@ -46,7 +46,7 @@ typedef enum { /** * Accelerometer type * TAccelerationConfiguration::typeBits provides information about the type of the accelerometer and the interpretation of the signals. - * It is a or'ed bitmask of the EGyroscopeTypeBits values. + * It is a or'ed bitmask of the EAccelerationTypeBits values. */ typedef enum { ACCELERATION_X_PROVIDED = 0x00000001, /**< An acceleration measurement for the x-axis is provided */ @@ -103,10 +103,11 @@ typedef struct { float sigmaX; /**< Standard error estimate of the x-acceleration [m/s^2]. */ float sigmaY; /**< Standard error estimate of the y-acceleration [m/s^2]. */ float sigmaZ; /**< Standard error estimate of the z-acceleration [m/s^2]. */ - EAccelerationTypeBits typeBits;/**< Bit mask indicating the type of the used gyroscope. */ - uint32_t validityBits; /**< Bit mask indicating the validity of each corresponding value. - [bitwise or'ed @ref EAccelerationConfigValidityBits values]. - Must be checked before usage. */ + uint32_t typeBits; /**< Bit mask indicating the type of the used accelerometer. + [bitwise or'ed @ref EAccelerationTypeBits values]. */ + uint32_t validityBits; /**< Bit mask indicating the validity of each corresponding value. + [bitwise or'ed @ref EAccelerationConfigValidityBits values]. + Must be checked before usage. */ } TAccelerationConfiguration; /** @@ -145,9 +146,9 @@ typedef struct { If available it can be used for temperature compensation. The measurement unit is unspecified. Degrees celsius are preferred but any value linearly dependent on the temperature is fine.*/ - uint32_t validityBits; /**< Bit mask indicating the validity of each corresponding value. - [bitwise or'ed @ref EAccelerationValidityBits values]. - Must be checked before usage. */ + uint32_t validityBits; /**< Bit mask indicating the validity of each corresponding value. + [bitwise or'ed @ref EAccelerationValidityBits values]. + Must be checked before usage. */ } TAccelerationData; /** diff --git a/sensors-service/api/gyroscope.h b/sensors-service/api/gyroscope.h index 404a896..3425b25 100644 --- a/sensors-service/api/gyroscope.h +++ b/sensors-service/api/gyroscope.h @@ -96,10 +96,11 @@ typedef struct { float angleRoll; /**< Euler angle of third rotation, around roll axis, to describe gyroscope orientation [degree]. For details, see above. */ float momentOfYawInertia; /**< Moment of yaw inertia. The pitch and roll inertia moments are not provided as they are not relevant for positioning. [kg*m^2] */ float sigmaGyroscope; /**< Standard error estimate of the gyroscope for all directions. [degree/s] */ - EGyroscopeTypeBits typeBits;/**< Bit mask indicating the type of the used gyroscope. */ + uint32_t typeBits; /**< Bit mask indicating the type of the used gyroscope. + [bitwise or'ed @ref EGyroscopeTypeBits values]. */ uint32_t validityBits; /**< Bit mask indicating the validity of each corresponding value. - [bitwise or'ed @ref EGyroscopeConfigValidityBits values]. - Must be checked before usage. */ + [bitwise or'ed @ref EGyroscopeConfigValidityBits values]. + Must be checked before usage. */ } TGyroscopeConfiguration; /** diff --git a/sensors-service/src/gyroscope.c b/sensors-service/src/gyroscope.c index ac51e49..c401f0a 100644 --- a/sensors-service/src/gyroscope.c +++ b/sensors-service/src/gyroscope.c @@ -28,6 +28,22 @@ bool snsGyroscopeInit() { cbGyroscope = 0; + //example gyroscope configuration for a 3-axis gyro + gGyroscopeConfiguration.angleYaw = 0; + gGyroscopeConfiguration.anglePitch = 0; + gGyroscopeConfiguration.angleRoll = 0; + gGyroscopeConfiguration.momentOfYawInertia = 0; + gGyroscopeConfiguration.sigmaGyroscope = 0; + gGyroscopeConfiguration.typeBits = + GYROSCOPE_YAWRATE_PROVIDED | + GYROSCOPE_PITCHRATE_PROVIDED | + GYROSCOPE_ROLLRATE_PROVIDED; + gGyroscopeConfiguration.validityBits = + GYROSCOPE_CONFIG_ANGLEYAW_VALID | + GYROSCOPE_CONFIG_ANGLEPITCH_VALID | + GYROSCOPE_CONFIG_ANGLEROLL_VALID | + GYROSCOPE_CONFIG_TYPE_VALID; + return true; } @@ -98,6 +114,7 @@ bool snsGyroscopeGetMetaData(TSensorMetaData *data) bool snsGyroscopeGetConfiguration(TGyroscopeConfiguration* gyroConfig) { + *gyroConfig = gGyroscopeConfiguration; return true; } |