mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-23 06:52:07 +08:00
add param to override carParams.dashcamOnly (#24857)
* add param to override carParams.dashcamOnly * little cleaner
This commit is contained in:
@@ -94,6 +94,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"CompletedTrainingVersion", PERSISTENT},
|
||||
{"ControlsReady", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
||||
{"CurrentRoute", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
||||
{"DashcamOverride", PERSISTENT},
|
||||
{"DisableLogging", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
||||
{"DisablePowerDown", PERSISTENT},
|
||||
{"DisableRadar_Allow", PERSISTENT},
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
from cereal import car
|
||||
from panda import Panda
|
||||
from common.conversions import Conversions as CV
|
||||
@@ -38,9 +37,7 @@ class CarInterface(CarInterfaceBase):
|
||||
# These cars have been put into dashcam only due to both a lack of users and test coverage.
|
||||
# These cars likely still work fine. Once a user confirms each car works and a test route is
|
||||
# added to selfdrive/car/tests/routes.py, we can remove it from this list.
|
||||
ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, CAR.ELANTRA_GT_I30}
|
||||
if candidate in HDA2_CAR:
|
||||
ret.dashcamOnly = not os.path.exists('/data/enable-ev6')
|
||||
ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, CAR.ELANTRA_GT_I30} or candidate in HDA2_CAR
|
||||
|
||||
ret.steerActuatorDelay = 0.1 # Default delay
|
||||
ret.steerLimitTimer = 0.4
|
||||
|
||||
@@ -104,6 +104,9 @@ class Controls:
|
||||
if not self.disengage_on_accelerator:
|
||||
self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.DISABLE_DISENGAGE_ON_GAS
|
||||
|
||||
if self.CP.dashcamOnly and params.get_bool("DashcamOverride"):
|
||||
self.CP.dashcamOnly = False
|
||||
|
||||
# read params
|
||||
self.is_metric = params.get_bool("IsMetric")
|
||||
self.is_ldw_enabled = params.get_bool("IsLdwEnabled")
|
||||
|
||||
Reference in New Issue
Block a user