Add IMU integration (Phases 1-5a) and RC/kinematics reliability fixes
IMU integration (WitMotion HWT905-RS232, doc/06-imu-integration-plan.md): - Phase 1: raw accel/gyro/angle observation, power-on-relative yaw offset - Phase 2: x,y odometry + wheel-vs-IMU omega residual, using a self-fused heading (wheel encoder omega + raw gyro_z average) instead of the IMU's own onboard fused yaw, which field logs showed disagreeing with its own raw gyro sign ~30% of the time during turns - Phase 3: straight-line heading-hold PI trim, active only when steering is centered and no lidar dodge is in progress, capped and field-tuned - Phase 4: whole-body slip detection (commanded vs IMU-measured omega ratio) that temporarily scales down v_x/omega, independent of the per-wheel current-based diagnostics - Phase 5a: k_skid/effective_w replaced with values fitted from real wheel-vs-IMU logs (0.406->0.51, 0.684->0.87) instead of the geometric formula, which field data showed under-driving every turn RC receiver: switched from ttyUSB* guessing to udev-stable device names (ttyMOTOR/ttyRC/ttyIMU), wired through run_4wd.sh and set_low_latency.sh. Motor driver: read motor/driver temperature registers (0x20A4/0x20B0) for proactive overheat visibility in the HUD/CSV. Control fixes: - Airborne-wheel zeroing no longer applies during spin turns, where reaction-torque-driven diagonal load transfer was misclassified as wheels leaving the ground and cutting spin torque in half - jerkLimitedStep's instant-acceleration path now only fires for same-direction speed increases; sign reversals (RC noise/deadzone jitter near a stop, or a genuine direction change) go through the jerk-limited path instead of snapping across zero Auto CSV logging (logs/, gitignored) extended with encoder ticks, IMU, odometry, heading-hold, slip, and temperature columns for field analysis. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -8,7 +8,10 @@ if [ ! -e "$PORT" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEV_NAME=$(basename "$PORT")
|
||||
# /dev/ttyMOTOR 같은 udev 고정 심볼릭 링크로 넘어올 수 있으므로, sysfs 조회에
|
||||
# 필요한 실제 장치명(ttyUSB0 등)으로 반드시 풀어준다 — 안 그러면
|
||||
# /sys/bus/usb-serial/devices/ttyMOTOR 경로가 존재하지 않아 항상 폴백으로 샌다.
|
||||
DEV_NAME=$(basename "$(readlink -f "$PORT")")
|
||||
LATENCY_PATH="/sys/bus/usb-serial/devices/$DEV_NAME/latency_timer"
|
||||
|
||||
if [ -f "$LATENCY_PATH" ]; then
|
||||
|
||||
Reference in New Issue
Block a user