更新参数

This commit is contained in:
cyy_mac
2026-06-20 21:51:17 +08:00
parent 61e1be28c0
commit 9e0b50a4ea

View File

@@ -214,12 +214,10 @@ class HTTPHandler(BaseHTTPRequestHandler):
vx = float(body.get("vx", 0))
wz = float(body.get("wz", 0))
shared["cmd_speed"] = vx
# Bicycle model Vz→steer (matches firmware Vz_to_Akm_Angle)
# Axle_spacing=0.158, Wheel_spacing=0.162
# Bicycle model wz→steer using simulation's Ackermann geometry
if abs(vx) > 0.01 and abs(wz) > 1e-6:
R_turn = vx / wz
steer = math.atan(0.158 / (R_turn + 0.05 * 0.162))
shared["cmd_steer"] = steer if wz >= 0 else -steer
shared["cmd_steer"] = math.atan(L / R_turn)
else:
shared["cmd_steer"] = 0.0
self.send_response(200)