mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-26 03:12:08 +08:00
@@ -12,7 +12,7 @@ from . import hondacan
|
||||
from .values import AH
|
||||
|
||||
|
||||
def actuator_hystereses(brake, braking, brake_steady, v_ego, civic):
|
||||
def actuator_hystereses(brake, braking, brake_steady, v_ego, civic, odyssey):
|
||||
# hyst params... TODO: move these to VehicleParams
|
||||
brake_hyst_on = 0.02 # to activate brakes exceed this value
|
||||
brake_hyst_off = 0.005 # to deactivate brakes below this value
|
||||
@@ -32,7 +32,7 @@ def actuator_hystereses(brake, braking, brake_steady, v_ego, civic):
|
||||
brake_steady = brake + brake_hyst_gap
|
||||
brake = brake_steady
|
||||
|
||||
if not civic and brake > 0.0:
|
||||
if (not civic and not odyssey) and brake > 0.0:
|
||||
brake += 0.15
|
||||
|
||||
return brake, braking, brake_steady
|
||||
@@ -78,7 +78,7 @@ class CarController(object):
|
||||
return
|
||||
|
||||
# *** apply brake hysteresis ***
|
||||
brake, self.braking, self.brake_steady = actuator_hystereses(actuators.brake, self.braking, self.brake_steady, CS.v_ego, CS.civic)
|
||||
brake, self.braking, self.brake_steady = actuator_hystereses(actuators.brake, self.braking, self.brake_steady, CS.v_ego, CS.civic, CS.odyssey)
|
||||
|
||||
# *** no output if not enabled ***
|
||||
if not enabled and CS.pcm_acc_status:
|
||||
@@ -121,8 +121,8 @@ class CarController(object):
|
||||
tt = sec_since_boot()
|
||||
GAS_MAX = 1004
|
||||
BRAKE_MAX = 1024/4
|
||||
if CS.civic:
|
||||
is_fw_modified = os.getenv("DONGLE_ID") in ['b0f5a01cf604185c']
|
||||
if CS.civic or CS.odyssey:
|
||||
is_fw_modified = os.getenv("DONGLE_ID") in ['b0f5a01cf604185cxxx']
|
||||
STEER_MAX = 0x1FFF if is_fw_modified else 0x1000
|
||||
elif CS.crv:
|
||||
STEER_MAX = 0x300 # CR-V only uses 12-bits and requires a lower value
|
||||
|
||||
@@ -104,7 +104,7 @@ class CarInterface(object):
|
||||
# self.accord_msg = []
|
||||
raise NotImplementedError
|
||||
|
||||
if not self.CS.civic:
|
||||
if not self.CS.civic and not self.CS.odyssey:
|
||||
self.compute_gb = get_compute_gb_acura()
|
||||
else:
|
||||
self.compute_gb = compute_gb_honda
|
||||
@@ -215,7 +215,7 @@ class CarInterface(object):
|
||||
ret.wheelbase = 3.00
|
||||
ret.centerToFront = ret.wheelbase * 0.41
|
||||
ret.steerRatio = 15.3
|
||||
ret.steerKp, ret.steerKi = 0.8, 0.24
|
||||
ret.steerKp, ret.steerKi = 0.6, 0.18
|
||||
|
||||
ret.longitudinalKpBP = [0., 5., 35.]
|
||||
ret.longitudinalKpV = [1.2, 0.8, 0.5]
|
||||
|
||||
Reference in New Issue
Block a user