mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 01:53:40 +08:00
Ramp Honda Fit steering torque after EPS pauses
This commit is contained in:
@@ -146,6 +146,10 @@ class CarController(CarControllerBase):
|
||||
self.params.STEER_DELTA_UP * DT_CTRL)
|
||||
_projection_previous = self.last_torque if _projection is not None else 0.
|
||||
self.last_torque = limited_torque
|
||||
if self.CP.carFingerprint == CAR.HONDA_FIT and CS.out.canValid and not CS.out.canTimeout:
|
||||
observed, expires = CS.eps_inactive_window
|
||||
if 0 < observed <= now_nanos < expires:
|
||||
self.last_torque = 0.0
|
||||
|
||||
# *** apply brake hysteresis ***
|
||||
pre_limit_brake, self.braking, self.brake_steady = actuator_hysteresis(brake, self.braking, self.brake_steady)
|
||||
@@ -284,7 +288,7 @@ class CarController(CarControllerBase):
|
||||
new_actuators.accel = self.accel
|
||||
new_actuators.gas = self.gas
|
||||
new_actuators.brake = self.brake
|
||||
new_actuators.torque = self.last_torque
|
||||
new_actuators.torque = limited_torque
|
||||
new_actuators.torqueOutputCan = apply_torque
|
||||
|
||||
self.frame += 1
|
||||
|
||||
@@ -39,6 +39,8 @@ class CarState(CarStateBase):
|
||||
|
||||
self.steer_status_values = defaultdict(lambda: "UNKNOWN", can_define.dv["STEER_STATUS"]["STEER_STATUS"])
|
||||
|
||||
self.eps_inactive_window = (0, 0)
|
||||
|
||||
self.brake_switch_prev = False
|
||||
self.brake_switch_active = False
|
||||
self.low_speed_alert = False
|
||||
@@ -104,6 +106,9 @@ class CarState(CarStateBase):
|
||||
ret.seatbeltUnlatched = bool(cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LAMP"] or not cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LATCHED"])
|
||||
|
||||
steer_status = self.steer_status_values[cp.vl["STEER_STATUS"]["STEER_STATUS"]]
|
||||
if self.CP.carFingerprint == CAR.HONDA_FIT:
|
||||
self.eps_inactive_window = (parser_expiry(cp, "STEER_STATUS", "STEER_CONTROL_ACTIVE")
|
||||
if not cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] else (0, 0))
|
||||
ret.steerFaultPermanent = steer_status not in ("NORMAL", "NO_TORQUE_ALERT_1", "NO_TORQUE_ALERT_2", "LOW_SPEED_LOCKOUT", "TMP_FAULT")
|
||||
if self.CP.flags & HondaFlags.BOSCH_ALT_RADAR:
|
||||
# TODO: See if this logic works for all other Honda
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "3e4859b63d8b1a6300a7caa99d5329925152c9098f4157f4e93ea4e1d00ca019", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "67a2f12c7f0d4997461cde13e0908a0cc565bdeace0729bada60f3e89d088a99", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user