This commit is contained in:
fcl
2026-04-11 17:08:56 +08:00
parent a4b8d0db84
commit e17504c024
3 changed files with 12 additions and 12 deletions

View File

@@ -144,10 +144,10 @@ void ChassisInit()
.motor_type = GM6020,
};
chassis_motor_steering_config.can_init_config.tx_id = 1;
chassis_motor_steering_config.can_init_config.tx_id = 2;
motor_steering_rf = DJIMotorInit(&chassis_motor_steering_config);
chassis_motor_steering_config.can_init_config.tx_id = 2;
chassis_motor_steering_config.can_init_config.tx_id = 1;
motor_steering_lb = DJIMotorInit(&chassis_motor_steering_config);
PID_Init_Config_s chassis_follow_pid_conf = {
@@ -299,8 +299,8 @@ static void MinmizeRotation(float *angle, const float *last_angle, float *speed)
// 计算角度偏移
// offset_lf = atan2f(chassis_vy - w, chassis_vx - w) * RAD_2_DEGREE; // lf: y- , x-
offset_lb = atan2f(chassis_vy - w, chassis_vx - w) * RAD_2_DEGREE; // rf: y- , x+
offset_rf = atan2f(chassis_vy + w, chassis_vx + w) * RAD_2_DEGREE; // lb: y+ , x-注意
offset_lb = atan2f(chassis_vy + w, chassis_vx - w) * RAD_2_DEGREE; // rf: y- , x+
offset_rf = atan2f(chassis_vy - w, chassis_vx + w) * RAD_2_DEGREE; // lb: y+ , x-注意
// offset_rb = atan2f(chassis_vy + w, chassis_vx + w) * RAD_2_DEGREE; // rb: y+ , x+
// at_lf = STEERING_CHASSIS_ALIGN_ANGLE_LF + offset_lf; // 此处似乎不需要加上真实角度,因为我们需要的是绝对角度而不是相对角度