$search
00001 #ifndef COMM_UTIL_LL_H 00002 #define COMM_UTIL_LL_H 00003 00004 #include <stdint.h> 00005 #include <math.h> 00006 00007 #define GRAVITY_SI 9.810665 // in SI m/s^2 00008 //#define GRAVITY_COMM GRAVITY_SI * 1000.0 // in Comm mm/s^2 00009 00010 inline float degreesToRadians(float angle); 00011 inline float radiansToDegrees(float angle); 00012 00013 inline float LLToSIClimb(int16_t climb); 00014 00015 // ****************** accel *********************** 00016 00017 inline float LLToSIAccX(int16_t acc); 00018 inline float LLToSIAccY(int16_t acc); 00019 inline float LLToSIAccZ(int16_t acc); 00020 00021 /* 00022 inline int32_t LLtoCommAccX(int16_t acc, float g); 00023 inline int32_t LLtoCommAccY(int16_t acc, float g); 00024 inline int32_t LLtoCommAccZ(int16_t acc, float g); 00025 */ 00026 // ****************** angle rate *********************** 00027 00028 inline float LLToSIAngleRateYaw (int16_t angle_rate); 00029 inline float LLToSIAngleRateRoll (int16_t angle_rate); 00030 inline float LLToSIAngleRatePitch(int16_t angle_rate); 00031 //inline int32_t LLtoCommAngleRateYaw(int16_t angle_rate); 00032 00033 // ****************** angle *********************** 00034 00035 inline float LLToSIAngleRoll(int16_t angle); 00036 inline float LLToSIAnglePitch(int16_t angle); 00037 inline float LLToSIAngleYaw(uint16_t angle); 00038 00039 /* 00040 inline uint16_t LLtoCommAngleRoll (int16_t angle); 00041 inline uint16_t LLtoCommAnglePitch(int16_t angle); 00042 inline uint16_t LLtoCommAngleYaw (uint16_t angle); 00043 */ 00044 // **** for direct motor control 00045 00046 inline short SIToLLCmdRoll (float angle_cmd); 00047 inline short SIToLLCmdPitch (float angle_cmd); 00048 inline short SIToLLCmdYawRate(float yaw_rate_cmd); 00049 inline short SIToLLCmdThrust (float thrust_cmd); 00050 /* 00051 inline short commToLLCmdRoll (int16_t cmd_roll); 00052 inline short commToLLCmdPitch (int16_t cmd_pitch); 00053 inline short commToLLCmdYawRate (int32_t cmd_yaw_rate); 00054 inline short commToLLCmdThrust (int16_t cmd_thrust); 00055 */ 00056 #endif // COMM_UTIL_H