Brings in the airborne-landing fix from main. The previously
committed ARM binary was built against the pre-fix source, so it's
dropped again here rather than carried forward stale — same
build-on-target convention as before: run_4wd.sh will compile a
fresh aarch64 binary on next launch on the Jetson. Build and commit
that binary back to this branch afterward.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Previously, once a wheel's airborne flag cleared, its target reverted
to the normal drive command but the actual RPM still had to ramp up
through the gentle standstill-launch accel_rate/jerk profile. Since
the chassis is already moving at that point (unlike a stop-start),
the wheel spent several hundred ms unable to match ground speed,
dragging/grinding against the surface and occasionally landing on a
momentarily negative curve-turn target, making it spin backward.
Track the airborne->grounded transition per wheel and, on the tick it
clears, snap cmd directly to target and reset the jerk accel state
instead of ramping, so the wheel rejoins the other three immediately.
Verified working on hardware.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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 drops the stale committed x86-64 binary (built before this fix,
so its behavior no longer matched source). Build fresh on an x86
machine via `make`; run_4wd.sh already rebuilds automatically when
the binary is missing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>
The committed xbox_motor_control_cpp binary is x86-64 and won't run
on Jetson's aarch64. run_4wd.sh only rebuilds when the binary is
missing, so removing it here lets the first run on the Jetson
compile a native ARM binary via `make`. Commit that binary back to
this branch after building on-device to keep an ARM build tracked
here, same as main tracks the x86 one.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reads 0x20A5/0x20A6 error codes alongside existing feedback poll to
diagnose overcurrent/overload alarms, and adds rated/max current
query and max current write helpers.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds jerk-limited S-curve motion profiles, robust median-based
odometry to reject wheel-lift encoder spikes, per-wheel current-based
airborne/stall detection with pair-wise comparison to avoid false
positives during normal curve turns, curved-turn blending for spin
turns, and optional CSV telemetry logging. Fixes a bug where any
right-stick input while driving forward would override left-stick
curve steering. Raises max speed from 0.3 to 0.4 m/s.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>