 XDK API  3.6.0 Documentation
Rotation

Rotation Sensor based on BMI160 and BMM150. More... Collaboration diagram for Rotation:

## Files

file  BCDS_Rotation.h

## Data Structures

struct  Rotation_EulerData_S

struct  Rotation_QuaternionData_S

## Typedefs

typedef float Rotation_DataType_T

typedef struct Rotation_EulerData_S Rotation_EulerData_T

typedef struct
Rotation_EulerData_S
Rotation_EulerDataPtr_T

typedef void * Rotation_HandlePtr_T

typedef enum Rotation_InitStatus_E Rotation_InitStatus_T

typedef struct
Rotation_QuaternionData_S
Rotation_QuaternionData_T

typedef struct
Rotation_QuaternionData_S
Rotation_QuaternionDataPtr_T

## Enumerations

enum  Rotation_InitStatus_E

## Functions

Retcode_T Rotation_deInit (void)
API to Deinitialise the rotation module. More...

Retcode_T Rotation_init (Rotation_HandlePtr_T handle)
Initializes the rotation sensor. More...

Retcode_T Rotation_readQuaternionValue (Rotation_QuaternionDataPtr_T quaternionValue)
Reads rotation quaternion value from the rotation sensor. More...

## Detailed Description

In geometry, the Rotation of an object (such as a line, plane or rigid body) is part of the description of how it is placed in the space it is in.
Rotation sensor is applied to detect direction status of the device in two or three dimensions.
Certain methods to describe Rotations of a rigid body in three dimensions have been developed.
They are as follows :

EULER ANGLES :

To describe an Rotation in 3-dimensional Euclidean space, three parameters are required.
They can be given in several ways, Euler angles being one of them, which describes the Rotation of a frame of reference (typically, a coordinate system or basis) relative to another.
They are represented by heading (rotation around the Z-axis), pitch (rotation around the X-axis) and roll (rotation around the Y-axis).
Euler Angles can be represented in degrees or in radians.

QUATERNION :

Unit quaternion provides a convenient mathematical notation for representing Rotations and rotations of objects in three dimensions.
A quaternion represents two things. It has an x, y and z component, which represents the axis about which a rotation will occur.
It also has a w component, which represents the amount of rotation which will occur about this axis.

Quaternion is represented by vector q(q,q,q,q) where in, q = cos(θ/2) , q = u * sin(θ/2) , q = v * sin(θ/2) , q = w * sin(θ/2) ( [u,v,w] is the unit vector parallel to rotation axis )

Rotation Calibration method :
Rotation calibration should be done by leaving the device in flat position a few seconds (for gyroscope calibration) and then making the '8' figure motion (for magnetometer calibration) as in https://www.youtube.com/watch?v=sP3d00Hr14o.
'8' figure motion may be done more than once (maybe 5 times) for a proper calibration.

Limitations of Rotation :
This sensor cannot be used while using virtual sensor fingerPrint.

## Data Structure Documentation

 struct Rotation_EulerData_S

Data structure for Rotation sensor euler data

### Data Fields

Rotation_DataType_T heading

Rotation_DataType_T pitch

Rotation_DataType_T roll

#### Field Documentation

 Rotation_DataType_T heading

heading data - rotation around z axis

 Rotation_DataType_T pitch

pitch data - rotation around x axis

 Rotation_DataType_T roll

roll data - rotation around y axis

 struct Rotation_QuaternionData_S

Data structure for Rotation sensor quaternion data

### Data Fields

Rotation_DataType_T w

Rotation_DataType_T x

Rotation_DataType_T y

Rotation_DataType_T z

#### Field Documentation

q data of vector q

q data of vector q

q data of vector q

q data of vector q

## Typedef Documentation

 typedef float Rotation_DataType_T

Data type used for reading Rotation data

 typedef struct Rotation_EulerData_S Rotation_EulerData_T
 typedef struct Rotation_EulerData_S * Rotation_EulerDataPtr_T
 typedef void* Rotation_HandlePtr_T

Defines the handle for Rotation sensor

 typedef enum Rotation_InitStatus_E Rotation_InitStatus_T
 typedef struct Rotation_QuaternionData_S Rotation_QuaternionData_T
 typedef struct Rotation_QuaternionData_S * Rotation_QuaternionDataPtr_T

## Enumeration Type Documentation

Enum values to represent Rotation sensor initialisation status

Enumerator
ROTATION_SENSOR_UNINITIALISED

Specifies rotation sensor is uninitialised

ROTATION_SENSOR_INITIALISED

Specifies rotation sensor is initialised

## Function Documentation

 Retcode_T Rotation_deInit ( void )
Return values
 RETCODE_OK Rotation sensor De-initialization success RETCODE_FAILURE Rotation sensor De-initialization failure
Warning
This API needs to be called when we require to stop the rotation data reading.
Note
The return value consist of (First 1 MSByte represents Package ID, Next Byte represents Severity and Last 2 LSBytes represents error code).
Pass the return value of this function to #BCDS_getUserErrorCode() API to know the user type return code present in #BCDS_SensorErrorType.h.
 Retcode_T Rotation_init ( Rotation_HandlePtr_T handle )
Parameters
 [in] Orientation_HandlePtr_T the handle to the rotation object that should be initialized
Return values
 RETCODE_OK Rotation sensor initialization success. RETCODE_NULL_POINTER In case of invalid sensor handle.
Note
Refer #XdkSensorHandle.h for selecting the proper handle.
The return value consist of (First 1 MSByte represents Package ID, Next Byte represents Severity and Last 2 LSBytes represents error code).
Pass the return value of this function to #BCDS_getUserErrorCode() API to know the user type return code present in #BCDS_SensorErrorType.h.
 Retcode_T Rotation_readQuaternionValue ( Rotation_QuaternionDataPtr_T quaternionValue )
Parameters
 [out] Rotation_QuaternionDataPtr_T quaternionValue, output parameter in which the quaternion value will be written to, from within the function
Return values
 RETCODE_OK Reading rotation quaternion value success. RETCODE_UNINITIALIZED If called without initializing the sensor. RETCODE_NULL_POINTER In case quaternionValue is a NULL pointer.
Note
The return value consist of (First 1 MSByte represents Package ID, Next Byte represents Severity and Last 2 LSBytes represents error code).
Pass the return value of this function to #BCDS_getUserErrorCode() API to know the user type return code present in #BCDS_SensorErrorType.h.

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:52 by doxygen 1.8.8