?? imu.h
字號:
/****************************************************************************** File Name: include/IMU.h Description: IMU data structure definition and its transformation******************************************************************************//****************************************************************************** Author: alfred.liushu@gmail.com Upadate: 2008/09/16 File founded Copyright 2008-2009 Robot Lab., Dept.of Automation, Tsinghua University******************************************************************************/#ifndef __IMU_H__#define __IMU_H__#include <math.h>#include "../include/Setting.h"/****************************** Data structures ***************************************************//*Raw data structure*/typedef struct{ DATATYPE acceleration; /*Accelerations in meters per square second*/ DATATYPE angularVelocity; /*Angular velocities in degrees per second, clockwise*/}IMURAW;/*Formatted data structure*/typedef struct{ DATATYPE acceleration; /*Accelerations in meters per square second*/ DATATYPE angularVelocity; /*Angular velocities in radians per second, anticlockwise*/}IMU;/****************************** Synchronition parameters ***************************************************/const TIME IMUPeriod = 10; /*IMU period time, measured in milliseconds*//****************************** Transformation constants ***************************************************/const DATATYPE AccelerationGain = DATATYPE(1); /*1*/const DATATYPE AngularGain = -Pi/180; /*Transform deg/s-clockwise to rad/s-anticlockwise*//****************************** Transformation function definitions ***************************************************/inline void IMURAW2IMU(const IMURAW& raw, IMU& imu); /*Transform raw data from IMU*/inline void IMU2IMURAW(const IMU& imu, IMURAW& raw); /*Transform IMU data to raw format*//****************************** Transformation function implementations ***************************************************/void IMURAW2IMU(const IMURAW& raw, IMU& imu){ imu.acceleration = raw.acceleration * AccelerationGain; imu.angularVelocity = raw.angularVelocity * AngularGain;}void IMU2IMURAW(const IMU& imu, IMURAW& raw){ raw.acceleration = imu.acceleration / AccelerationGain; raw.angularVelocity = imu.angularVelocity / AngularGain;}#endif /*__IMU_H__*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -