Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Op 23 tiguan #113

Open
wants to merge 7 commits into
base: vw-community-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion opendbc
Submodule opendbc updated 1 files
+1 −1 vw_mqb_2010.dbc
2 changes: 1 addition & 1 deletion selfdrive/car/docs_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/volkswagen/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/car/volkswagen/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion selfdrive/car/volkswagen/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.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

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -272,7 +278,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")],
Expand Down