dragonpilot mod for 0.8.5-4

This commit is contained in:
Rick Lan
2021-07-02 12:49:43 +08:00
parent 145b222f0d
commit 522fb06db7
224 changed files with 9120 additions and 7777 deletions
+8 -1
View File
@@ -5,6 +5,7 @@ import sys
import time
import textwrap
from pathlib import Path
import re
# NOTE: Do NOT import anything here that needs be built (e.g. params)
from common.basedir import BASEDIR
@@ -74,10 +75,16 @@ def build(spinner, dirty=False):
add_file_handler(cloudlog)
cloudlog.error("scons build failed\n" + error_s)
try:
result = subprocess.check_output(["ifconfig", "wlan0"], encoding='utf8')
ip = re.findall(r"inet addr:((\d+\.){3}\d+)", result)[0][0]
except:
ip = 'N/A'
# Show TextWindow
spinner.close()
error_s = "\n \n".join(["\n".join(textwrap.wrap(e, 65)) for e in errors])
with TextWindow("openpilot failed to build\n \n" + error_s) as t:
with TextWindow(("openpilot failed to build (IP: %s)\n \n" % ip) + error_s) as t:
t.wait_for_exit()
exit(1)
else:
+48 -4
View File
@@ -12,7 +12,7 @@ from common.basedir import BASEDIR
from common.params import Params, ParamKeyType
from common.text_window import TextWindow
from selfdrive.boardd.set_time import set_time
from selfdrive.hardware import HARDWARE, PC, TICI
from selfdrive.hardware import HARDWARE, PC, TICI, EON
from selfdrive.manager.helpers import unblock_stdout
from selfdrive.manager.process import ensure_running
from selfdrive.manager.process_config import managed_processes
@@ -21,6 +21,8 @@ from selfdrive.swaglog import cloudlog, add_file_handler
from selfdrive.version import dirty, get_git_commit, version, origin, branch, commit, \
terms_version, training_version, comma_remote, \
get_git_branch, get_git_remote
from common.dp_conf import init_params_vals
def manager_init():
@@ -48,6 +50,10 @@ def manager_init():
if params.get(k) is None:
params.put(k, v)
# dp init params
init_params_vals(params)
dp_reg = params.get_bool('dp_reg')
# is this dashcam?
if os.getenv("PASSIVE") is not None:
params.put_bool("Passive", bool(int(os.getenv("PASSIVE"))))
@@ -65,6 +71,13 @@ def manager_init():
except PermissionError:
print("WARNING: failed to make /dev/shm")
# dp - make sure libmessaging_shared.so is working
if EON:
os.chmod(BASEDIR, 0o755)
os.chmod("/dev/shm", 0o777)
os.chmod(os.path.join(BASEDIR, "cereal"), 0o755)
os.chmod(os.path.join(BASEDIR, "cereal", "libmessaging_shared.so"), 0o755)
# set version params
params.put("Version", version)
params.put("TermsVersion", terms_version)
@@ -111,12 +124,43 @@ def manager_thread():
cloudlog.info("manager start")
cloudlog.info({"environ": os.environ})
# save boot log
subprocess.call("./bootlog", cwd=os.path.join(BASEDIR, "selfdrive/loggerd"))
params = Params()
dp_reg = params.get_bool('dp_reg')
dp_appd = params.get_bool('dp_appd')
dp_updated = params.get_bool('dp_updated')
dp_logger = params.get_bool('dp_logger')
dp_athenad = params.get_bool('dp_athenad')
dp_uploader = params.get_bool('dp_uploader')
dp_dashcamd = params.get_bool('dp_dashcamd')
dp_panda_no_gps = params.get_bool('dp_panda_no_gps')
if params.get_bool('dp_atl'):
dp_reg = False
if not dp_reg:
dp_logger = False
dp_athenad = False
dp_uploader = False
# save boot log
if dp_logger:
subprocess.call("./bootlog", cwd=os.path.join(BASEDIR, "selfdrive/loggerd"))
ignore = []
if not dp_appd:
ignore += ['appd']
if dp_panda_no_gps:
ignore += ['ubloxd']
if not dp_dashcamd:
ignore += ['dashcamd']
if not dp_updated:
ignore += ['updated']
if not dp_logger:
ignore += ['logcatd', 'loggerd', 'proclogd', 'logmessaged', 'tombstoned']
if not dp_athenad:
ignore += ['manage_athenad']
if not dp_uploader or not dp_reg:
ignore += ['uploader']
if not dp_athenad and not dp_uploader:
ignore += ['deleter']
if params.get("DongleId", encoding='utf8') == UNREGISTERED_DONGLE_ID:
ignore += ["manage_athenad", "uploader"]
if os.getenv("NOBOARD") is not None:
+15 -12
View File
@@ -1,29 +1,31 @@
import os
from selfdrive.manager.process import PythonProcess, NativeProcess, DaemonProcess
from selfdrive.hardware import EON, TICI, PC
from selfdrive.hardware import EON, TICI, PC, JETSON
from common.params import Params
JETSON = JETSON or Params().get_bool('dp_jetson')
WEBCAM = os.getenv("USE_WEBCAM") is not None
procs = [
DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"),
DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid", enabled=not JETSON),
# due to qualcomm kernel bugs SIGKILLing camerad sometimes causes page table corruption
NativeProcess("camerad", "selfdrive/camerad", ["./camerad"], unkillable=True, driverview=True),
NativeProcess("clocksd", "selfdrive/clocksd", ["./clocksd"]),
NativeProcess("dmonitoringmodeld", "selfdrive/modeld", ["./dmonitoringmodeld"], enabled=(not PC or WEBCAM), driverview=True),
NativeProcess("logcatd", "selfdrive/logcatd", ["./logcatd"]),
NativeProcess("loggerd", "selfdrive/loggerd", ["./loggerd"]),
NativeProcess("dmonitoringmodeld", "selfdrive/modeld", ["./dmonitoringmodeld"], enabled=not JETSON and (not PC or WEBCAM), driverview=True),
NativeProcess("logcatd", "selfdrive/logcatd", ["./logcatd"], enabled=not JETSON),
NativeProcess("loggerd", "selfdrive/loggerd", ["./loggerd"], enabled=not JETSON),
NativeProcess("modeld", "selfdrive/modeld", ["./modeld"]),
NativeProcess("proclogd", "selfdrive/proclogd", ["./proclogd"]),
NativeProcess("proclogd", "selfdrive/proclogd", ["./proclogd"], enabled=not JETSON),
NativeProcess("sensord", "selfdrive/sensord", ["./sensord"], enabled=not PC, persistent=EON, sigkill=EON),
NativeProcess("ubloxd", "selfdrive/locationd", ["./ubloxd"], enabled=(not PC or WEBCAM)),
NativeProcess("ubloxd", "selfdrive/locationd", ["./ubloxd"], enabled=not PC or WEBCAM),
NativeProcess("ui", "selfdrive/ui", ["./ui"], persistent=True, watchdog_max_dt=(10 if TICI else None)),
NativeProcess("locationd", "selfdrive/locationd", ["./locationd"]),
PythonProcess("calibrationd", "selfdrive.locationd.calibrationd"),
PythonProcess("controlsd", "selfdrive.controls.controlsd"),
PythonProcess("deleter", "selfdrive.loggerd.deleter", persistent=True),
PythonProcess("dmonitoringd", "selfdrive.monitoring.dmonitoringd", enabled=(not PC or WEBCAM), driverview=True),
PythonProcess("logmessaged", "selfdrive.logmessaged", persistent=True),
PythonProcess("dmonitoringd", "selfdrive.monitoring.dmonitoringd", enabled=not JETSON and (not PC or WEBCAM), driverview=True),
PythonProcess("logmessaged", "selfdrive.logmessaged", enabled=not JETSON, persistent=True),
PythonProcess("pandad", "selfdrive.pandad", persistent=True),
PythonProcess("paramsd", "selfdrive.locationd.paramsd"),
PythonProcess("plannerd", "selfdrive.controls.plannerd"),
@@ -31,9 +33,10 @@ procs = [
PythonProcess("rtshield", "selfdrive.rtshield", enabled=EON),
PythonProcess("thermald", "selfdrive.thermald.thermald", persistent=True),
PythonProcess("timezoned", "selfdrive.timezoned", enabled=TICI, persistent=True),
PythonProcess("tombstoned", "selfdrive.tombstoned", enabled=not PC, persistent=True),
PythonProcess("updated", "selfdrive.updated", enabled=not PC, persistent=True),
PythonProcess("uploader", "selfdrive.loggerd.uploader", persistent=True),
PythonProcess("tombstoned", "selfdrive.tombstoned", enabled=not PC and not JETSON, persistent=True),
PythonProcess("updated", "selfdrive.updated", enabled=not PC and not JETSON, persistent=True),
PythonProcess("uploader", "selfdrive.loggerd.uploader", enabled=not JETSON, persistent=True),
PythonProcess("systemd", "selfdrive.dragonpilot.systemd", persistent=True),
]
managed_processes = {p.name: p for p in procs}