feat: add IMU mount orientation correction via macro-controlled axis remapping

Support NORMAL, YAW_180, ROLL_180, PITCH_180 presets selected at compile
time by IMU_MOUNT_ORIENTATION macro. Replaces direct BMI088-to-INS
assignment with IMU_Mount_Correct() for sign flip and axis swap.
This commit is contained in:
2026-05-31 19:45:56 +08:00
parent 9b8e204ff7
commit ea4e45b940
2 changed files with 57 additions and 7 deletions
+18
View File
@@ -25,6 +25,16 @@
#define INS_TASK_PERIOD 1
/* IMU安装方向配置 */
typedef enum {
IMU_MOUNT_NORMAL = 0, // IMU与机体坐标系一致
IMU_MOUNT_YAW_180, // IMU绕Z轴旋转180°
IMU_MOUNT_ROLL_180, // IMU绕X轴旋转180°(上下颠倒)
IMU_MOUNT_PITCH_180, // IMU绕Y轴旋转180°(前后颠倒)
} IMU_Mount_Orientation_e;
#define IMU_MOUNT_ORIENTATION IMU_MOUNT_NORMAL
typedef struct
{
float q[4]; // 四元数估计值
@@ -67,6 +77,14 @@ typedef struct
float Roll;
} IMU_Param_t;
/**
* @brief 根据IMU安装方向宏,对原始数据进行轴映射和符号修正
*
* @param raw 原始IMU数据(3轴)
* @param out 修正后数据(3轴)
*/
void IMU_Mount_Correct(const float raw[3], float out[3]);
/**
* @brief 初始化惯导解算系统
*