From 0b53396f90f00c4f7e3d9b3867cf921e0da77c51 Mon Sep 17 00:00:00 2001 From: ansignome <106889927+ansignome@users.noreply.github.com> Date: Sat, 18 May 2024 10:41:45 -0700 Subject: [PATCH 1/7] Add PREEMPTED to temp hca fault --- selfdrive/car/volkswagen/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/volkswagen/carstate.py b/selfdrive/car/volkswagen/carstate.py index b169970fed3b9d..ec6403496f7051 100644 --- a/selfdrive/car/volkswagen/carstate.py +++ b/selfdrive/car/volkswagen/carstate.py @@ -259,7 +259,7 @@ def update_hca_state(self, hca_status): # DISABLED means the EPS hasn't been configured to support Lane Assist self.eps_init_complete = self.eps_init_complete or (hca_status in ("DISABLED", "READY", "ACTIVE") or self.frame > 600) perm_fault = hca_status == "DISABLED" or (self.eps_init_complete and hca_status in ("INITIALIZING", "FAULT")) - temp_fault = hca_status == "REJECTED" or not self.eps_init_complete + temp_fault = hca_status in ("REJECTED", "PREEMPTED") or not self.eps_init_complete return temp_fault, perm_fault @staticmethod From 3a43f096225207c7c3cba534d6576109b6a4aa2c Mon Sep 17 00:00:00 2001 From: ansignome <106889927+ansignome@users.noreply.github.com> Date: Sat, 18 May 2024 10:49:35 -0700 Subject: [PATCH 2/7] Increase Wheelbase --- selfdrive/car/volkswagen/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/volkswagen/values.py b/selfdrive/car/volkswagen/values.py index d75ac9066317e7..5d5090c1aed9e9 100644 --- a/selfdrive/car/volkswagen/values.py +++ b/selfdrive/car/volkswagen/values.py @@ -272,7 +272,7 @@ class CAR(Platforms): VWCarDocs("Volkswagen Tiguan 2018-24"), VWCarDocs("Volkswagen Tiguan eHybrid 2021-23"), ], - VolkswagenCarSpecs(mass=1715, wheelbase=2.74), + VolkswagenCarSpecs(mass=1715, wheelbase=2.9), ) VOLKSWAGEN_TOURAN_MK2 = VolkswagenMQBPlatformConfig( # Chassis 1T [VWCarDocs("Volkswagen Touran 2016-23")], From 2563d7d87de2867389cf8f8a37869fd9194fed17 Mon Sep 17 00:00:00 2001 From: ansignome <106889927+ansignome@users.noreply.github.com> Date: Sat, 18 May 2024 10:57:50 -0700 Subject: [PATCH 3/7] Add min_steer_speed to VW values --- selfdrive/car/volkswagen/values.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/car/volkswagen/values.py b/selfdrive/car/volkswagen/values.py index 5d5090c1aed9e9..893255906b9abe 100644 --- a/selfdrive/car/volkswagen/values.py +++ b/selfdrive/car/volkswagen/values.py @@ -34,6 +34,8 @@ class CarControllerParams: STEER_TIME_ALERT = STEER_TIME_MAX - 10 # If mitigation fails, time to soft disengage before EPS timer expires STEER_TIME_STUCK_TORQUE = 1.9 # EPS limits same torque to 6 seconds, reset timer 3x within that period + DEFAULT_MIN_STEER_SPEED = 3.5 # m/s, newer EPS racks fault below this speed, don't show a low speed alert + ACCEL_MAX = 2.0 # 2.0 m/s max acceleration ACCEL_MIN = -3.5 # 3.5 m/s max deceleration @@ -134,6 +136,7 @@ def init(self): class VolkswagenCarSpecs(CarSpecs): centerToFrontRatio: float = 0.45 steerRatio: float = 15.6 + minSteerSpeed: float = CarControllerParams.DEFAULT_MIN_STEER_SPEED class Footnote(Enum): @@ -170,6 +173,9 @@ def init_make(self, CP: car.CarParams): if CP.carFingerprint in (CAR.VOLKSWAGEN_CRAFTER_MK2, CAR.VOLKSWAGEN_TRANSPORTER_T61): self.car_parts = CarParts([Device.threex_angled_mount, CarHarness.j533]) + if abs(CP.minSteerSpeed - CarControllerParams.DEFAULT_MIN_STEER_SPEED) < 1e-3: + self.min_steer_speed = 0 + # Check the 7th and 8th characters of the VIN before adding a new CAR. If the # chassis code is already listed below, don't add a new CAR, just add to the From e575fb4bce6502bb34c4e6e9d8aef3ce0634213d Mon Sep 17 00:00:00 2001 From: ansignome <106889927+ansignome@users.noreply.github.com> Date: Sat, 18 May 2024 11:01:28 -0700 Subject: [PATCH 4/7] Remove assert failure from docs_definitions.py --- selfdrive/car/docs_definitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/docs_definitions.py b/selfdrive/car/docs_definitions.py index bb1ca6bd4269bf..bf4c7f4b47adb5 100644 --- a/selfdrive/car/docs_definitions.py +++ b/selfdrive/car/docs_definitions.py @@ -266,7 +266,7 @@ def init(self, CP: car.CarParams, all_footnotes: dict[Enum, int]): # min steer & enable speed columns # TODO: set all the min steer speeds in carParams and remove this if self.min_steer_speed is not None: - assert CP.minSteerSpeed == 0, f"{CP.carFingerprint}: Minimum steer speed set in both CarDocs and CarParams" + assert CP.minSteerSpeed < 4, f"{CP.carFingerprint}: Minimum steer speed set in both CarDocs and CarParams" else: self.min_steer_speed = CP.minSteerSpeed From bb05b28a07b035e3742a76c449e6cae10402c0d2 Mon Sep 17 00:00:00 2001 From: ansignome <106889927+ansignome@users.noreply.github.com> Date: Sat, 18 May 2024 14:07:02 -0700 Subject: [PATCH 5/7] Add DEFAULT_MIN_STEER_SPEED to interface.py --- selfdrive/car/volkswagen/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/volkswagen/interface.py b/selfdrive/car/volkswagen/interface.py index 69e1bece0c61df..fbd0e3dba39851 100644 --- a/selfdrive/car/volkswagen/interface.py +++ b/selfdrive/car/volkswagen/interface.py @@ -2,7 +2,7 @@ from panda import Panda from openpilot.selfdrive.car import get_safety_config from openpilot.selfdrive.car.interfaces import CarInterfaceBase -from openpilot.selfdrive.car.volkswagen.values import CAR, CANBUS, NetworkLocation, TransmissionType, GearShifter, VolkswagenFlags +from openpilot.selfdrive.car.volkswagen.values import CAR, CANBUS, CarControllerParams, NetworkLocation, TransmissionType, GearShifter, VolkswagenFlags ButtonType = car.CarState.ButtonEvent.Type EventName = car.CarEvent.EventName @@ -103,7 +103,7 @@ def _update(self, c): enable_buttons=(ButtonType.setCruise, ButtonType.resumeCruise)) # Low speed steer alert hysteresis logic - if self.CP.minSteerSpeed > 0. and ret.vEgo < (self.CP.minSteerSpeed + 1.): + if (self.CP.minSteerSpeed - 1e-3) > CarControllerParams.DEFAULT_MIN_STEER_SPEED and ret.vEgo < (self.CP.minSteerSpeed + 1.): self.low_speed_alert = True elif ret.vEgo > (self.CP.minSteerSpeed + 2.): self.low_speed_alert = False From 39fecad15c120a90c7199b7486de2c60dac4bfae Mon Sep 17 00:00:00 2001 From: Markus Ansmann Date: Wed, 29 May 2024 12:59:53 -0700 Subject: [PATCH 6/7] Update opendbc to link to colortrekninja/opendbc:op-23-tiguan --- .gitmodules | 2 +- opendbc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 73f832b1d6ce9a..cecc1d5c5e4569 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ url = ../../commaai/panda.git [submodule "opendbc"] path = opendbc - url = ../../commaai/opendbc.git + url = ../../colortrekninja/opendbc.git [submodule "cereal"] path = cereal url = ../../commaai/cereal.git diff --git a/opendbc b/opendbc index 83884c2b2022e4..8d6f1cd99ba001 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit 83884c2b2022e4a16ae535d1ed72aca4711324b7 +Subproject commit 8d6f1cd99ba001ccbb1a72edc19e9ab4c163a6c6 From 9b54eb2e8da378cff60b936384e6d6d1836603bc Mon Sep 17 00:00:00 2001 From: colortrekninja <106889927+colortrekninja@users.noreply.github.com> Date: Wed, 29 May 2024 13:06:56 -0700 Subject: [PATCH 7/7] Reduce DEFAULT_MIN_STEER_SPEED to 3.0m/s --- selfdrive/car/volkswagen/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/volkswagen/values.py b/selfdrive/car/volkswagen/values.py index 893255906b9abe..06ec177072a1c5 100644 --- a/selfdrive/car/volkswagen/values.py +++ b/selfdrive/car/volkswagen/values.py @@ -34,7 +34,7 @@ class CarControllerParams: STEER_TIME_ALERT = STEER_TIME_MAX - 10 # If mitigation fails, time to soft disengage before EPS timer expires STEER_TIME_STUCK_TORQUE = 1.9 # EPS limits same torque to 6 seconds, reset timer 3x within that period - DEFAULT_MIN_STEER_SPEED = 3.5 # m/s, newer EPS racks fault below this speed, don't show a low speed alert + DEFAULT_MIN_STEER_SPEED = 3.0 # m/s, newer EPS racks fault below this speed, don't show a low speed alert ACCEL_MAX = 2.0 # 2.0 m/s max acceleration ACCEL_MIN = -3.5 # 3.5 m/s max deceleration