Improve outdoor traction control and raise top speed

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>
This commit is contained in:
2026-08-12 16:31:06 +09:00
parent 4fbe036427
commit 9f2ead2138
5 changed files with 1170 additions and 484 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
CXX = g++
CXXFLAGS = -O3 -std=c++17 -Wall -Wextra
LIBS = -lSDL2 -lpthread
CXXFLAGS = -O3 -std=c++17 -Wall -Wextra -I/usr/local/include
LIBS = -lSDL2 -lpthread -llivox_lidar_sdk_shared
TARGET = xbox_motor_control_cpp
SRC = xbox_motor_control.cpp
@@ -8,7 +8,7 @@ SRC = xbox_motor_control.cpp
all: $(TARGET)
$(TARGET): $(SRC)
$(CXX) $(CXXFLAGS) $(SRC) $(LIBS) -o $(TARGET)
$(CXX) $(CXXFLAGS) $(SRC) -o $(TARGET) $(LIBS)
clean:
rm -f $(TARGET)
+21
View File
@@ -0,0 +1,21 @@
{
"Mid360s": {
"lidar_net_info" : {
"cmd_data_port" : 56100,
"push_msg_port" : 56200,
"point_data_port": 56300,
"imu_data_port" : 56400,
"log_data_port" : 56500
},
"host_net_info" : [
{
"host_ip" : "192.168.1.5",
"cmd_data_port" : 56101,
"push_msg_port" : 56201,
"point_data_port": 56301,
"imu_data_port" : 56401,
"log_data_port" : 56501
}
]
}
}
+11 -5
View File
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
# 1-Click Launch Script for C++ 4WD Motor Control
# 1-Click Launch Script for C++ 4WD Motor Control with Mid-360S LiDAR Avoidance
PORT="${1:-/dev/ttyUSB0}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR" || exit 1
echo "=================================================================="
echo " 🚀 ZLAC8015D 4WD C++ 초저지연 모터 제어 원클릭 런치 시스템"
echo " 🚀 ZLAC8015D 4WD + Livox Mid-360S 라이다 원클릭 런치 시스템"
echo "=================================================================="
# 1. USB Latency 1ms 단축
@@ -23,8 +23,14 @@ if [ ! -f "./xbox_motor_control_cpp" ]; then
fi
echo "=================================================================="
echo " [시작] C++ 100Hz 초저지연 4WD 조이스틱 제어 시작 ($PORT)"
echo " [시작] C++ 100Hz 초저지연 4WD 조이스틱 + 라이다 장애물 회피 시작 ($PORT)"
echo " - 라이다 기능 토글: Xbox 컨트롤러 X 버튼"
echo " - 정지/종료: B 버튼 또는 Ctrl+C"
echo "=================================================================="
# 3. C++ 4WD 프로그램 실행
./xbox_motor_control_cpp --port "$PORT"
# 3. C++ 4WD 프로그램 실행 (추가 인자 전달 가능)
if [ $# -gt 1 ]; then
./xbox_motor_control_cpp --port "$PORT" "${@:2}"
else
./xbox_motor_control_cpp --port "$PORT"
fi
+1135 -476
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.