68 lines
1.8 KiB
C
68 lines
1.8 KiB
C
#ifndef AHRS_MIDDLEWARE_H
|
|
#define AHRS_MIDDLEWARE_H
|
|
|
|
#include "struct_typedef.h"
|
|
|
|
/**
|
|
****************************(C) COPYRIGHT 2016 DJI****************************
|
|
* @file AHRS_MiddleWare.c/h
|
|
* @brief 姿态解算中间层,为姿态解算提供相关函数
|
|
* @note
|
|
* @history
|
|
* Version Date Author Modification
|
|
* V1.0.0 Dec-26-2018 RM 1. 完成
|
|
*
|
|
@verbatim
|
|
==============================================================================
|
|
|
|
==============================================================================
|
|
@endverbatim
|
|
****************************(C) COPYRIGHT 2016 DJI****************************
|
|
*/
|
|
|
|
//重新对应的数据类型
|
|
// typedef signed char int8_t;
|
|
// typedef signed short int int16_t;
|
|
// typedef signed int int32_t;
|
|
// typedef signed long long int64_t;
|
|
|
|
// /* exact-width unsigned integer types */
|
|
// typedef unsigned char uint8_t;
|
|
// typedef unsigned short int uint16_t;
|
|
// typedef unsigned int uint32_t;
|
|
// typedef unsigned long long uint64_t;
|
|
// typedef unsigned char bool_t;
|
|
// typedef float fp32;
|
|
// typedef double fp64;
|
|
|
|
//定义 NULL
|
|
#ifndef NULL
|
|
#define NULL 0
|
|
#endif
|
|
|
|
//定义PI 值
|
|
#ifndef PI
|
|
#define PI 3.14159265358979f
|
|
#endif
|
|
|
|
//定义 角度(度)转换到 弧度的比例
|
|
#ifndef ANGLE_TO_RAD
|
|
#define ANGLE_TO_RAD 0.01745329251994329576923690768489f
|
|
#endif
|
|
|
|
//定义 弧度 转换到 角度的比例
|
|
#ifndef RAD_TO_ANGLE
|
|
#define RAD_TO_ANGLE 57.295779513082320876798154814105f
|
|
#endif
|
|
|
|
extern void AHRS_get_height(fp32 *high);
|
|
extern void AHRS_get_latitude(fp32 *latitude);
|
|
extern fp32 AHRS_invSqrt(fp32 num);
|
|
extern fp32 AHRS_sinf(fp32 angle);
|
|
extern fp32 AHRS_cosf(fp32 angle);
|
|
extern fp32 AHRS_tanf(fp32 angle);
|
|
extern fp32 AHRS_asinf(fp32 sin);
|
|
extern fp32 AHRS_acosf(fp32 cos);
|
|
extern fp32 AHRS_atan2f(fp32 y, fp32 x);
|
|
#endif
|