Skip to content

Commit

Permalink
Update interface.py
Browse files Browse the repository at this point in the history
Co-Authored-By: Willem Melching <willem.melching@gmail.com>
  • Loading branch information
Casey Francis and pd0wm committed Jun 4, 2022
1 parent 3deb406 commit 1df4cf6
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions selfdrive/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 2560, 8000], [0, 2560, 3840]]
if eps_modified:
if Params().get_bool('Torque'):
max_torque = 2.0
friction = 0.05
max_torque = 1.7
friction = 0.087112

ret.lateralTuning.init('torque')
ret.lateralTuning.torque.useSteeringAngle = True
ret.lateralTuning.torque.kp = 2.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kp = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kf = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.5 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.1 / MAX_LAT_ACCEL
ret.lateralTuning.torque.friction = friction
else:
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.3], [0.1]]
Expand All @@ -118,13 +118,13 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
if eps_modified:
if Params().get_bool('Torque'):
max_torque = 2.0
friction = 0.05
friction = 0.04 #prickle said this is pretty good

ret.lateralTuning.init('torque')
ret.lateralTuning.torque.useSteeringAngle = True
ret.lateralTuning.torque.kp = 2.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kp = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kf = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.5 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.1 / MAX_LAT_ACCEL
ret.lateralTuning.torque.friction = friction
else:
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.36], [0.108]] #minus 10% from 0.4, 0.12
Expand All @@ -141,14 +141,14 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
ret.steerRatio = 16.33 # 11.82 is spec end-to-end
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end
if Params().get_bool('Torque'):
max_torque = 2.0
friction = 0.05
max_torque = 1.7
friction = 0.087112

ret.lateralTuning.init('torque')
ret.lateralTuning.torque.useSteeringAngle = True
ret.lateralTuning.torque.kp = 2.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kp = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kf = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.5 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.1 / MAX_LAT_ACCEL
ret.lateralTuning.torque.friction = friction
else:
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]]
Expand Down Expand Up @@ -188,14 +188,14 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 2560, 10000], [0, 2560, 3840]]
# Use LQR tune if param is set
if Params().get_bool('Torque'):
max_torque = 2.0
friction = 0.05
max_torque = 1.7
friction = 0.087112

ret.lateralTuning.init('torque')
ret.lateralTuning.torque.useSteeringAngle = True
ret.lateralTuning.torque.kp = 2.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kp = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kf = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.5 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.1 / MAX_LAT_ACCEL
ret.lateralTuning.torque.friction = friction
else:
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.21], [0.07]]
Expand Down Expand Up @@ -266,14 +266,14 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
ret.steerRatio = 16.0 #11.95 is spec
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]]
if Params().get_bool('Torque'):
max_torque = 2.0
friction = 0.05
max_torque = 1.7
friction = 0.087112

ret.lateralTuning.init('torque')
ret.lateralTuning.torque.useSteeringAngle = True
ret.lateralTuning.torque.kp = 2.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kp = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.kf = 1.0 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.5 / MAX_LAT_ACCEL
ret.lateralTuning.torque.ki = 0.1 / MAX_LAT_ACCEL
ret.lateralTuning.torque.friction = friction
else:
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.06]]
Expand Down

0 comments on commit 1df4cf6

Please sign in to comment.