1.0
This commit is contained in:
@@ -261,9 +261,10 @@ void Motor_Update_RPM(float dt_s)
|
||||
s_last_count[MOTOR_RR] = curr_count_rr;
|
||||
|
||||
/* 左侧输入镜像修正:让“车体前进”统一表现为正脉冲 / 正 RPM。 */
|
||||
delta[MOTOR_FL] = (int16_t)(-delta[MOTOR_FL]);
|
||||
delta[MOTOR_RL] = (int16_t)(-delta[MOTOR_RL]);
|
||||
|
||||
// delta[MOTOR_FL] = (int16_t)(-delta[MOTOR_FL]);
|
||||
// delta[MOTOR_RL] = (int16_t)(-delta[MOTOR_RL]);
|
||||
delta[MOTOR_FR] = (int16_t)(-delta[MOTOR_FR]);
|
||||
delta[MOTOR_RR] = (int16_t)(-delta[MOTOR_RR]);
|
||||
/* 用 32 位内部累加,避免偶发高速度时 16 位回绕。 */
|
||||
s_odom_acc_ticks[MOTOR_FL] += delta[MOTOR_FL];
|
||||
s_odom_acc_ticks[MOTOR_RL] += delta[MOTOR_RL];
|
||||
|
||||
Reference in New Issue
Block a user