陀螺仪欧拉角的计算

This commit is contained in:
bmy
2023-12-22 22:39:59 +08:00
parent 2dffcf04f0
commit 20666b0c75
5 changed files with 212 additions and 36 deletions

View File

@@ -3,13 +3,44 @@
#include "stdio.h"
#include "ch32v30x.h"
typedef struct {
float gyro_x;
float gyro_y;
float gyro_z;
float acc_x;
float acc_y;
float acc_z;
} icm_param_t;
extern float imu_acc_x;
extern float imu_acc_y;
extern float imu_acc_z;
extern float imu_gyro_x;
extern float imu_gyro_y;
extern float imu_gyro_z;
typedef struct {
float q0;
float q1;
float q2;
float q3;
} quater_param_t;
extern void by_imu_data_get(void);
typedef struct {
float pitch; //俯仰角
float roll; //偏航角
float yaw; //翻滚角
} euler_param_t;
typedef struct {
float Xdata;
float Ydata;
float Zdata;
} gyro_param_t;
extern icm_param_t icm_data;
extern euler_param_t eulerAngle;
void gyroOffset_init(void);
float fast_sqrt(float x);
void ICM_AHRSupdate(float gx, float gy, float gz, float ax, float ay, float az);
void ICM_getValues();
void ICM_getEulerianAngles(void);
#endif