Fix curve-steering wheel-reversal at partial throttle

Steering angular velocity (omega) was scaled by the constant max
speed (max_v) instead of the actual current forward speed (v_x).
This decoupled turn tightness from throttle position: at low/medium
throttle, a moderate left-stick steering input already produced an
omega large enough to flip the inner wheel's commanded velocity
negative, causing the robot to spin/reverse/lurch forward instead of
smoothly curving. Scaling by abs(v_x) keeps turn radius proportional
to speed as intended, matching prior full-throttle behavior while
fixing the reversal at partial throttle.

Also commits the ARM binary rebuilt on-device with this fix, per the
build-on-target convention for this branch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-13 10:54:52 +09:00
parent f2b0968979
commit bb5a205df1
2 changed files with 8 additions and 1 deletions
+8 -1
View File
@@ -1078,7 +1078,14 @@ int main(int argc, char **argv) {
target_rl = v_l * rpm_per_ms;
target_rr = -v_r * rpm_per_ms;
} else {
omega += -lx * (max_v / (effective_w / 2.0f));
// 선회 강도(omega)는 반드시 "현재 전진 속도(v_x)"에 비례해야 커브
// 반경이 스로틀과 무관하게 일정하게 유지된다. 이전 구현은 상수인
// max_v(최고속도)를 기준으로 omega를 계산해서, 저속 주행 중에는
// v_x가 작은데도 omega*k_skid 항은 고속 기준 그대로 커서 안쪽
// 바퀴(v_l 또는 v_r) 속도 부호가 뒤집혀 후진해버리는 문제가 있었다.
// (예: 저속으로 스틱을 왼쪽으로 조금만 꺾어도 로봇이 제자리 회전
// 하듯 튀거나 뒤로 갔다 앞으로 갔다 하는 증상)
omega += -lx * (std::abs(v_x) / (effective_w / 2.0f));
float v_l = v_x - omega * k_skid;
float v_r = v_x + omega * k_skid;
BIN
View File
Binary file not shown.