|
|
@ -161,6 +161,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
# Tire stiffness factor fictitiously lower if it includes the steering column torsion effect. |
|
|
|
# Tire stiffness factor fictitiously lower if it includes the steering column torsion effect. |
|
|
|
# For modeling details, see p.198-200 in "The Science of Vehicle Dynamics (2014), M. Guiggiani" |
|
|
|
# For modeling details, see p.198-200 in "The Science of Vehicle Dynamics (2014), M. Guiggiani" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0], [0]] |
|
|
|
ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] |
|
|
|
ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] |
|
|
|
ret.lateralTuning.pid.kf = 0.00006 # conservative feed-forward |
|
|
|
ret.lateralTuning.pid.kf = 0.00006 # conservative feed-forward |
|
|
|
|
|
|
|
|
|
|
@ -169,16 +170,40 @@ class CarInterface(CarInterfaceBase): |
|
|
|
if fw.ecu == "eps" and b"," in fw.fwVersion: |
|
|
|
if fw.ecu == "eps" and b"," in fw.fwVersion: |
|
|
|
eps_modified = True |
|
|
|
eps_modified = True |
|
|
|
|
|
|
|
|
|
|
|
if candidate in [CAR.CIVIC, CAR.CIVIC_BOSCH]: |
|
|
|
if candidate == CAR.CIVIC: |
|
|
|
stop_and_go = True |
|
|
|
stop_and_go = True |
|
|
|
ret.mass = CivicParams.MASS |
|
|
|
ret.mass = CivicParams.MASS |
|
|
|
ret.wheelbase = CivicParams.WHEELBASE |
|
|
|
ret.wheelbase = CivicParams.WHEELBASE |
|
|
|
ret.centerToFront = CivicParams.CENTER_TO_FRONT |
|
|
|
ret.centerToFront = CivicParams.CENTER_TO_FRONT |
|
|
|
ret.steerRatio = 15.38 # 10.93 is end-to-end spec |
|
|
|
ret.steerRatio = 15.38 # 10.93 is end-to-end spec |
|
|
|
|
|
|
|
if eps_modified: |
|
|
|
|
|
|
|
# stock request input values: 0x0000, 0x00DE, 0x014D, 0x01EF, 0x0290, 0x0377, 0x0454, 0x0610, 0x06EE |
|
|
|
|
|
|
|
# stock request output values: 0x0000, 0x0917, 0x0DC5, 0x1017, 0x119F, 0x140B, 0x1680, 0x1680, 0x1680 |
|
|
|
|
|
|
|
# modified request output values: 0x0000, 0x0917, 0x0DC5, 0x1017, 0x119F, 0x140B, 0x1680, 0x2880, 0x3180 |
|
|
|
|
|
|
|
# stock filter output values: 0x009F, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108 |
|
|
|
|
|
|
|
# modified filter output values: 0x009F, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0400, 0x0480 |
|
|
|
|
|
|
|
# note: max request allowed is 4096, but request is capped at 3840 in firmware, so modifications result in 2x max |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 2560, 8000], [0, 2560, 3840]] |
|
|
|
|
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.3], [0.1]] |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 2560], [0, 2560]] |
|
|
|
|
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[1.1], [0.33]] |
|
|
|
tire_stiffness_factor = 1. |
|
|
|
tire_stiffness_factor = 1. |
|
|
|
|
|
|
|
|
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.4], [0.12]] if eps_modified else [[0.8], [0.24]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.lateralTuning.pid.kf = 0.00006 |
|
|
|
ret.longitudinalTuning.kpV = [3.6, 2.4, 1.5] |
|
|
|
|
|
|
|
ret.longitudinalTuning.kiBP = [0., 35.] |
|
|
|
|
|
|
|
ret.longitudinalTuning.kiV = [0.54, 0.36] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif candidate == CAR.CIVIC_BOSCH: |
|
|
|
|
|
|
|
stop_and_go = True |
|
|
|
|
|
|
|
ret.mass = CivicParams.MASS |
|
|
|
|
|
|
|
ret.wheelbase = CivicParams.WHEELBASE |
|
|
|
|
|
|
|
ret.centerToFront = CivicParams.CENTER_TO_FRONT |
|
|
|
|
|
|
|
ret.steerRatio = 15.38 # 10.93 is end-to-end spec |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end |
|
|
|
|
|
|
|
tire_stiffness_factor = 1. |
|
|
|
|
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpV = [3.6, 2.4, 1.5] |
|
|
|
ret.longitudinalTuning.kpV = [3.6, 2.4, 1.5] |
|
|
|
ret.longitudinalTuning.kiBP = [0., 35.] |
|
|
|
ret.longitudinalTuning.kiBP = [0., 35.] |
|
|
@ -192,6 +217,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.83 |
|
|
|
ret.wheelbase = 2.83 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.39 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.39 |
|
|
|
ret.steerRatio = 16.33 # 11.82 is spec end-to-end |
|
|
|
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 |
|
|
|
tire_stiffness_factor = 0.8467 |
|
|
|
tire_stiffness_factor = 0.8467 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
@ -205,6 +231,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.67 |
|
|
|
ret.wheelbase = 2.67 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.37 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.37 |
|
|
|
ret.steerRatio = 18.61 # 15.3 is spec end-to-end |
|
|
|
ret.steerRatio = 18.61 # 15.3 is spec end-to-end |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] # TODO: determine if there is a dead zone at the top end |
|
|
|
tire_stiffness_factor = 0.72 |
|
|
|
tire_stiffness_factor = 0.72 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
@ -218,6 +245,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.62 |
|
|
|
ret.wheelbase = 2.62 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.steerRatio = 16.89 # as spec |
|
|
|
ret.steerRatio = 16.89 # as spec |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 1000], [0, 1000]] # TODO: determine if there is a dead zone at the top end |
|
|
|
tire_stiffness_factor = 0.444 |
|
|
|
tire_stiffness_factor = 0.444 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
@ -232,8 +260,16 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.66 |
|
|
|
ret.wheelbase = 2.66 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.steerRatio = 16.0 # 12.3 is spec end-to-end |
|
|
|
ret.steerRatio = 16.0 # 12.3 is spec end-to-end |
|
|
|
|
|
|
|
if eps_modified: |
|
|
|
|
|
|
|
# stock request input values: 0x0000, 0x00DB, 0x01BB, 0x0296, 0x0377, 0x0454, 0x0532, 0x0610, 0x067F |
|
|
|
|
|
|
|
# stock request output values: 0x0000, 0x0500, 0x0A15, 0x0E6D, 0x1100, 0x1200, 0x129A, 0x134D, 0x1400 |
|
|
|
|
|
|
|
# modified request output values: 0x0000, 0x0500, 0x0A15, 0x0E6D, 0x1100, 0x1200, 0x1ACD, 0x239A, 0x2800 |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 2560, 10000], [0, 2560, 3840]] |
|
|
|
|
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.3], [0.1]] |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] |
|
|
|
|
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.64], [0.192]] |
|
|
|
tire_stiffness_factor = 0.677 |
|
|
|
tire_stiffness_factor = 0.677 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] |
|
|
|
|
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpV = [1.2, 0.8, 0.5] |
|
|
|
ret.longitudinalTuning.kpV = [1.2, 0.8, 0.5] |
|
|
|
ret.longitudinalTuning.kiBP = [0., 35.] |
|
|
|
ret.longitudinalTuning.kiBP = [0., 35.] |
|
|
@ -246,6 +282,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.66 |
|
|
|
ret.wheelbase = 2.66 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.steerRatio = 16.0 # 12.3 is spec end-to-end |
|
|
|
ret.steerRatio = 16.0 # 12.3 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 |
|
|
|
tire_stiffness_factor = 0.677 |
|
|
|
tire_stiffness_factor = 0.677 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
@ -259,6 +296,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.53 |
|
|
|
ret.wheelbase = 2.53 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.39 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.39 |
|
|
|
ret.steerRatio = 13.06 |
|
|
|
ret.steerRatio = 13.06 |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end |
|
|
|
tire_stiffness_factor = 0.75 |
|
|
|
tire_stiffness_factor = 0.75 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.06]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.06]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
@ -272,6 +310,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.68 |
|
|
|
ret.wheelbase = 2.68 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.38 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.38 |
|
|
|
ret.steerRatio = 15.0 # as spec |
|
|
|
ret.steerRatio = 15.0 # as spec |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 1000], [0, 1000]] # TODO: determine if there is a dead zone at the top end |
|
|
|
tire_stiffness_factor = 0.444 |
|
|
|
tire_stiffness_factor = 0.444 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
@ -285,6 +324,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 3.00 |
|
|
|
ret.wheelbase = 3.00 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.steerRatio = 14.35 # as spec |
|
|
|
ret.steerRatio = 14.35 # as spec |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end |
|
|
|
tire_stiffness_factor = 0.82 |
|
|
|
tire_stiffness_factor = 0.82 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.45], [0.135]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.45], [0.135]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
@ -298,6 +338,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.90 |
|
|
|
ret.wheelbase = 2.90 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 # from CAR.ODYSSEY |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 # from CAR.ODYSSEY |
|
|
|
ret.steerRatio = 14.35 |
|
|
|
ret.steerRatio = 14.35 |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 32767], [0, 32767]] # TODO: determine if there is a dead zone at the top end |
|
|
|
tire_stiffness_factor = 0.82 |
|
|
|
tire_stiffness_factor = 0.82 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.45], [0.135]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.45], [0.135]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
@ -311,6 +352,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.82 |
|
|
|
ret.wheelbase = 2.82 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.428 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.428 |
|
|
|
ret.steerRatio = 17.25 # as spec |
|
|
|
ret.steerRatio = 17.25 # as spec |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end |
|
|
|
tire_stiffness_factor = 0.444 |
|
|
|
tire_stiffness_factor = 0.444 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
@ -324,6 +366,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 3.18 |
|
|
|
ret.wheelbase = 3.18 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.41 |
|
|
|
ret.steerRatio = 15.59 # as spec |
|
|
|
ret.steerRatio = 15.59 # as spec |
|
|
|
|
|
|
|
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end |
|
|
|
tire_stiffness_factor = 0.444 |
|
|
|
tire_stiffness_factor = 0.444 |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] |
|
|
|
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|
ret.longitudinalTuning.kpBP = [0., 5., 35.] |
|
|
|