fix: remove attitude_t, unify with INS_t
- Delete attitude_t struct from ins_task.h - INS_Init() returns INS_t* directly instead of casting from INS.Gyro offset - Change Gimbal_Upload_Data_s.gimbal_imu_data to INS_t* pointer - Update gimbal.c and robot_cmd.c accordingly
This commit is contained in:
@@ -77,12 +77,12 @@ static void InitQuaternion(float *init_q4)
|
||||
init_q4[i + 1] = axis_rot[i] * sinf(angle / 2.0f); // 轴角公式,第三轴为0(没有z轴分量)
|
||||
}
|
||||
|
||||
attitude_t *INS_Init(void)
|
||||
INS_t *INS_Init(void)
|
||||
{
|
||||
if (!INS.init)
|
||||
INS.init = 1;
|
||||
else
|
||||
return (attitude_t *)&INS.Gyro;
|
||||
return &INS;
|
||||
|
||||
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_4);
|
||||
|
||||
@@ -112,7 +112,7 @@ attitude_t *INS_Init(void)
|
||||
// noise of accel is relatively big and of high freq,thus lpf is used
|
||||
INS.AccelLPF = 0.0085;
|
||||
DWT_GetDeltaT(&INS_DWT_Count);
|
||||
return (attitude_t *)&INS.Gyro; // @todo: 这里偷懒了,不要这样做! 修改INT_t结构体可能会导致异常,待修复.
|
||||
return &INS;
|
||||
}
|
||||
|
||||
/* 注意以1kHz的频率运行此任务 */
|
||||
|
||||
Reference in New Issue
Block a user