Skip to content

Commit

Permalink
Rdm128 cruise delta to kegman.json (commaai#253)
Browse files Browse the repository at this point in the history
* Update kegman_conf.py

* Update drive_helpers.py
  • Loading branch information
rdm128 authored and kegman committed Dec 24, 2019
1 parent 0fbd042 commit bc90eac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 6 additions & 3 deletions selfdrive/controls/lib/drive_helpers.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from cereal import car
from common.numpy_fast import clip, interp
from selfdrive.config import Conversions as CV
from selfdrive.kegman_conf import kegman_conf

# kph
kegman = kegman_conf()
V_CRUISE_MAX = 144
V_CRUISE_MIN = 8
V_CRUISE_DELTA = 8
V_CRUISE_ENABLE_MIN = 40

V_CRUISE_DELTA = int(kegman.conf['CruiseDelta'])
V_CRUISE_ENABLE_MIN = int(kegman.conf['CruiseEnableMin'])
clip(V_CRUISE_DELTA, 2, 16)
clip(V_CRUISE_ENABLE_MIN, 1, 80)

class MPC_COST_LAT:
PATH = 1.0
Expand Down
10 changes: 9 additions & 1 deletion selfdrive/kegman_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ def read_config(self):
self.config.update({"ALCtimer":"2.0"})
self.element_updated = True

if "CruiseDelta" not in self.config:
self.config.update({"CruiseDelta":"8"})
self.element_updated = True

if "CruiseEnableMin" not in self.config:
self.config.update({"CruiseEnableMin":"40"})
self.element_updated = True

if self.element_updated:
print("updated")
self.write_config(self.config)
Expand All @@ -132,7 +140,7 @@ def read_config(self):
"1barHwy":"0.4", "2barHwy":"0.3", "3barHwy":"0.1", \
"steerRatio":"-1", "steerRateCost":"-1", "slowOnCurves":"0", "Kf":"-1", \
"sR_boost":"0", "sR_BP0":"0", "sR_BP1":"0", "sR_time":"1", \
"ALCnudgeLess":"0", "ALCminSpeed":"20.1168", "ALCtimer":"2.0"}
"ALCnudgeLess":"0", "ALCminSpeed":"20.1168", "ALCtimer":"2.0", "CrusieDelta":"8", "CruiseEnableMin":"40"}


self.write_config(self.config)
Expand Down

0 comments on commit bc90eac

Please sign in to comment.