更新参数
This commit is contained in:
6
main.py
6
main.py
@@ -214,12 +214,10 @@ class HTTPHandler(BaseHTTPRequestHandler):
|
|||||||
vx = float(body.get("vx", 0))
|
vx = float(body.get("vx", 0))
|
||||||
wz = float(body.get("wz", 0))
|
wz = float(body.get("wz", 0))
|
||||||
shared["cmd_speed"] = vx
|
shared["cmd_speed"] = vx
|
||||||
# Bicycle model Vz→steer (matches firmware Vz_to_Akm_Angle)
|
# Bicycle model wz→steer using simulation's Ackermann geometry
|
||||||
# Axle_spacing=0.158, Wheel_spacing=0.162
|
|
||||||
if abs(vx) > 0.01 and abs(wz) > 1e-6:
|
if abs(vx) > 0.01 and abs(wz) > 1e-6:
|
||||||
R_turn = vx / wz
|
R_turn = vx / wz
|
||||||
steer = math.atan(0.158 / (R_turn + 0.05 * 0.162))
|
shared["cmd_steer"] = math.atan(L / R_turn)
|
||||||
shared["cmd_steer"] = steer if wz >= 0 else -steer
|
|
||||||
else:
|
else:
|
||||||
shared["cmd_steer"] = 0.0
|
shared["cmd_steer"] = 0.0
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
|
|||||||
Reference in New Issue
Block a user