Skip to content

Commit 197de0f

Browse files
committed
fix kegman when missing key doesn't exist
1 parent 7237d28 commit 197de0f

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

selfdrive/kegman_conf.py

+3-26
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,9 @@ def read_config():
2020
except:
2121
cloudlog.exception("reading kegman.json error")
2222
config = default_config
23-
if "battPercOff" not in config:
24-
config.update({"battPercOff": 25})
25-
if "carVoltageMinEonShutdown" not in config:
26-
config.update({"carVoltageMinEonShutdown": 11200})
27-
if "brakeStoppingTarget" not in config:
28-
config.update({"brakeStoppingTarget": 0.25})
29-
if "angle_steers_offset" not in config:
30-
config.update({"angle_steers_offset": 0})
31-
if "brake_distance_extra" not in config: # extra braking distance in m
32-
config.update({"brake_distance_extra": 1})
33-
if "lastALCAMode" not in config:
34-
config.update({"lastALCAMode": 1})
35-
if "brakefactor" not in config: # brake at 20% higher speeds than what I like
36-
config.update({"brakefactor": 1.2})
37-
if "lastGasMode" not in config:
38-
config.update({"lastGasMode": 0})
39-
if "lastSloMode" not in config:
40-
config.update({"lastSloMode": 1})
41-
if "leadDistance" not in config: # leadDistance only works for Accord and Insight, have not tested other honda vehicles
42-
config.update({"leadDistance": 5.0})
43-
if "useCarCaching" not in config:
44-
config.update({"useCarCaching": True}) # disable if you want to grab your car's fingerprint on every boot
45-
if "autoUpdate" not in config:
46-
config.update({"autoUpdate": True}) # this lets updated.py check and pull updates every hour and reboot
47-
if "wheelTouchSeconds" not in config:
48-
config.update({"wheelTouchSeconds": 1800})
23+
for i in default_config:
24+
if i not in config:
25+
config.update({i: default_config[i]})
4926

5027
# force update
5128
if config["carVoltageMinEonShutdown"] == "11800":

0 commit comments

Comments
 (0)