XDK API  3.6.0
Documentation
Files | Data Structures | Typedefs | Enumerations | Functions
Orientation

Orientation Sensor based on BMI160 and BMM150. More...

+ Collaboration diagram for Orientation:

Files

file  BCDS_Orientation.h
 

Data Structures

struct  Orientation_EulerData_S
 
struct  Orientation_QuaternionData_S
 

Typedefs

typedef float Orientation_DataType_T
 
typedef struct
Orientation_EulerData_S 
Orientation_EulerData_T
 
typedef struct
Orientation_EulerData_S
Orientation_EulerDataPtr_T
 
typedef void * Orientation_HandlePtr_T
 
typedef enum
Orientation_InitStatus_E 
Orientation_InitStatus_T
 
typedef struct
Orientation_QuaternionData_S 
Orientation_QuaternionData_T
 
typedef struct
Orientation_QuaternionData_S
Orientation_QuaternionDataPtr_T
 

Enumerations

enum  Orientation_InitStatus_E
 

Functions

 BCDS_DEPRECATED (Retcode_T Orientation_readQuaternionValue(Orientation_QuaternionDataPtr_T quaternionValue))
 Reads orientation quaternion value from the orientation sensor. More...
 
Retcode_T Orientation_deInit (void)
 API to Deinitialise the orientation module. More...
 
Retcode_T Orientation_init (Orientation_HandlePtr_T handle)
 Initializes the Orientation sensor.This API should return RETCODE_OK in order to communicate with sensor.This function needs to be called before calling any other function of the Orientation sensor api. More...
 
Retcode_T Orientation_readEulerDegreeVal (Orientation_EulerDataPtr_T eulerValueInDegree)
 Reads orientation euler value in degrees from the orientation sensor. The degree values vary from 0 to 360. More...
 
Retcode_T Orientation_readEulerRadianVal (Orientation_EulerDataPtr_T eulerValueInRadian)
 Reads orientation euler value in radians from the orientation sensor. The radian values vary from 0 to 6.28 (2*pi) More...
 

Detailed Description

In geometry, the orientation 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.
Orientation sensor is applied to detect direction status of the device in two or three dimensions.
Certain methods to describe orientations of a rigid body in three dimensions have been developed.
They are as follows :

EULER ANGLES :

To describe an orientation 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 orientation 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 orientations 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[0],q[1],q[2],q[3]) where in, q[0] = cos(θ/2) , q[1] = u * sin(θ/2) , q[2] = v * sin(θ/2) , q[3] = w * sin(θ/2) ( [u,v,w] is the unit vector parallel to rotation axis )

Orientation Calibration method :
Orientation 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 orientation :
This sensor cannot be used while using virtual sensor fingerPrint.


Data Structure Documentation

struct Orientation_EulerData_S

Data structure for Orientation sensor euler data

Data Fields

Orientation_DataType_T heading
 
Orientation_DataType_T pitch
 
Orientation_DataType_T roll
 
Orientation_DataType_T yaw
 

Field Documentation

heading data - rotation around z axis

pitch data - rotation around x axis

roll data - rotation around y axis

struct Orientation_QuaternionData_S

Data structure for Orientation sensor quaternion data

Data Fields

Orientation_DataType_T w
 
Orientation_DataType_T x
 
Orientation_DataType_T y
 
Orientation_DataType_T z
 

Field Documentation

q[0] data of vector q

q[1] data of vector q

q[2] data of vector q

q[3] data of vector q

Typedef Documentation

typedef float Orientation_DataType_T

Data type used for reading orientation data

typedef void* Orientation_HandlePtr_T

Defines the handle for Orientation sensor

Enumeration Type Documentation

Enum values to represent Orientation sensor initialisation status

Enumerator
ORIENTATION_SENSOR_UNINITIALISED 

Specifies orientation sensor is uninitialised

ORIENTATION_SENSOR_INITIALISED 

Specifies orientation sensor is initialised

Function Documentation

BCDS_DEPRECATED ( Retcode_T   Orientation_readQuaternionValueOrientation_QuaternionDataPtr_T quaternionValue)
Deprecated:
since version v3.0.1, replaced by Rotation_readQuaternionValue
Parameters
[out]Orientation_QuaternionDataPtr_TquaternionValue, output parameter in which the quaternion value will be written to, from within the function
Return values
RETCODE_SUCCESSReading orientation quaternion value success.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
RETCODE_INVALID_PARAMIn 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.
Retcode_T Orientation_deInit ( void  )
Return values
RETCODE_OKOrientation sensor De-initialization success
RETCODE_FAILUREOrientation sensor De-initialization failure
Warning
This API needs to be called when we require to stop the orientation 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 Orientation_init ( Orientation_HandlePtr_T  handle)
Parameters
[in]Orientation_HandlePtr_Tthe handle to the orientation object that should be initialized
Return values
RETCODE_OKOrientation sensor initialization success.
RETCODE_NULL_POINTERIn 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 Orientation_readEulerDegreeVal ( Orientation_EulerDataPtr_T  eulerValueInDegree)
Parameters
[out]Orientation_EulerDataPtr_TeulerValueInDegree, output parameter in which the euler value in degrees will be written to, from within the function
Return values
RETCODE_SUCCESSReading orientation euler value in degrees success.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
RETCODE_NULL_POINTERIn case eulerValueInDegre 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.
Retcode_T Orientation_readEulerRadianVal ( Orientation_EulerDataPtr_T  eulerValueInRadian)
Parameters
[out]Orientation_EulerDataPtr_TeulerValueInRadian, output parameter in which the euler value in radians will be written to, from within the function
Return values
RETCODE_SUCCESSReading orientation euler value in radians success.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
RETCODE_NULL_POINTERIn case eulerValueInRadian 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