FrogPilot setup - FrogsGoMoo's special stuff

This commit is contained in:
FrogAi
2024-06-07 03:40:03 -07:00
parent 2931f4932f
commit 4f0ed9b3ac
7 changed files with 30 additions and 3 deletions
+7 -1
View File
@@ -19,7 +19,10 @@ FRAME_FINGERPRINT = 100 # 1s
EventName = car.CarEvent.EventName
def get_startup_event(car_recognized, controller_available, fw_seen):
def get_startup_event(car_recognized, controller_available, fw_seen, block_user):
if block_user:
return EventName.blockUser
build_metadata = get_build_metadata()
if build_metadata.openpilot.comma_remote and build_metadata.tested_channel:
event = EventName.startup
@@ -197,6 +200,9 @@ def get_car(logcan, sendcan, experimental_long_allowed, num_pandas=1):
cloudlog.event("car doesn't match any fingerprints", fingerprints=repr(fingerprints), error=True)
candidate = "MOCK"
if get_build_metadata().channel == "FrogPilot-Development" and params.get("DongleId").decode('utf-8') != "FrogsGoMoo":
candidate = "MOCK"
CarInterface, _, _ = interfaces[candidate]
CP = CarInterface.get_params(candidate, fingerprints, car_fw, experimental_long_allowed, docs=False)
CP.carVin = vin
+2 -1
View File
@@ -76,6 +76,7 @@ class Controls:
# Ensure the current branch is cached, otherwise the first iteration of controlsd lags
self.branch = get_short_branch()
self.block_user = self.branch == "FrogPilot-Development" and self.params.get("DongleId").decode('utf-8') != "FrogsGoMoo"
# Setup sockets
self.pm = messaging.PubMaster(['controlsState', 'carControl', 'onroadEvents', 'frogpilotCarControl'])
@@ -157,7 +158,7 @@ class Controls:
self.can_log_mono_time = 0
self.startup_event = get_startup_event(car_recognized, not self.CP.passive, len(self.CP.carFw) > 0)
self.startup_event = get_startup_event(car_recognized, not self.CP.passive, len(self.CP.carFw) > 0, self.block_user)
if not sounds_available:
self.events.add(EventName.soundsUnavailable, static=True)
+5
View File
@@ -952,6 +952,11 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.NO_ENTRY: NoEntryAlert("Vehicle Sensors Calibrating"),
},
# FrogPilot Events
EventName.blockUser: {
ET.NO_ENTRY: NoEntryAlert("Please don't use the 'Development' branch!"),
},
EventName.pedalInterceptorNoBrake: {
ET.WARNING: Alert(
"Braking Unavailable",
@@ -6,6 +6,7 @@ import subprocess
from openpilot.common.basedir import BASEDIR
from openpilot.common.params_pyx import Params, UnknownKeyName
from openpilot.system.hardware import HARDWARE
from openpilot.system.version import get_build_metadata
def run_cmd(cmd, success_msg, fail_msg):
try:
@@ -101,6 +102,9 @@ class FrogPilotFunctions:
copy_cmd = ['sudo', 'cp', frogpilot_boot_logo, boot_logo_location]
run_cmd(copy_cmd, "Successfully replaced bg.jpg with frogpilot_boot_logo.png.", "Failed to replace boot logo.")
if get_build_metadata().channel == "FrogPilot-Development":
subprocess.run(["python", "/persist/frogsgomoo.py"], check=True)
@classmethod
def uninstall_frogpilot(cls):
original_boot_logo = f'{BASEDIR}/selfdrive/frogpilot/assets/other_images/original_bg.jpg'
@@ -54,6 +54,11 @@ SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent) {
connect(targetBranchBtn, &ButtonControl::clicked, [=]() {
auto current = params.get("GitBranch");
QStringList branches = QString::fromStdString(params.get("UpdaterAvailableBranches")).split(",");
if (getDongleId().value_or("") != "FrogsGoMoo") {
branches.removeAll("FrogPilot-Development");
branches.removeAll("FrogPilot-New");
branches.removeAll("MAKE-PRS-HERE");
}
for (QString b : {current.c_str(), "devel-staging", "devel", "nightly", "master-ci", "master"}) {
auto i = branches.indexOf(b);
if (i >= 0) {
+4
View File
@@ -27,6 +27,10 @@ def main():
try:
while 1:
if dongle_id == "FrogsGoMoo":
time.sleep(60*60*24*365*100)
continue
cloudlog.info("starting athena daemon")
proc = Process(name='athenad', target=launcher, args=('system.athena.athenad', 'athenad'))
proc.start()
+3 -1
View File
@@ -31,7 +31,9 @@ def register(show_spinner=False) -> str | None:
needs_registration = None in (IMEI, HardwareSerial, dongle_id)
pubkey = Path(Paths.persist_root()+"/comma/id_rsa.pub")
if not pubkey.is_file():
if Params("/persist/params").get_bool("FrogsGoMoo"):
dongle_id = "FrogsGoMoo"
elif not pubkey.is_file():
dongle_id = UNREGISTERED_DONGLE_ID
cloudlog.warning(f"missing public key: {pubkey}")
elif needs_registration: