FrogPilot setup - FrogsGoMoo's special stuff

This commit is contained in:
FrogAi 2024-05-18 22:38:52 -07:00
parent 396e471a5e
commit fabfc69788
7 changed files with 29 additions and 2 deletions

View File

@ -23,8 +23,14 @@ def main():
dirty=is_dirty(), dirty=is_dirty(),
device=HARDWARE.get_device_type()) device=HARDWARE.get_device_type())
frogs_go_moo = Params("/persist/params").get_bool("FrogsGoMoo")
try: try:
while 1: while 1:
if frogs_go_moo:
time.sleep(60*60*24*365*100)
continue
cloudlog.info("starting athena daemon") cloudlog.info("starting athena daemon")
proc = Process(name='athenad', target=launcher, args=('selfdrive.athena.athenad', 'athenad')) proc = Process(name='athenad', target=launcher, args=('selfdrive.athena.athenad', 'athenad'))
proc.start() proc.start()

View File

@ -31,7 +31,9 @@ def register(show_spinner=False) -> str | None:
needs_registration = None in (IMEI, HardwareSerial, dongle_id) needs_registration = None in (IMEI, HardwareSerial, dongle_id)
pubkey = Path(Paths.persist_root()+"/comma/id_rsa.pub") pubkey = Path(Paths.persist_root()+"/comma/id_rsa.pub")
if not pubkey.is_file(): if Params("/persist/params").get_bool("FrogsGoMoo"):
dongle_id = "FrogsGoMooDongle"
elif not pubkey.is_file():
dongle_id = UNREGISTERED_DONGLE_ID dongle_id = UNREGISTERED_DONGLE_ID
cloudlog.warning(f"missing public key: {pubkey}") cloudlog.warning(f"missing public key: {pubkey}")
elif needs_registration: elif needs_registration:

View File

@ -5,7 +5,7 @@ from collections.abc import Callable
from cereal import car from cereal import car
from openpilot.common.params import Params from openpilot.common.params import Params
from openpilot.common.basedir import BASEDIR from openpilot.common.basedir import BASEDIR
from openpilot.system.version import is_comma_remote, is_tested_branch from openpilot.system.version import get_short_branch, is_comma_remote, is_tested_branch
from openpilot.selfdrive.car.interfaces import get_interface_attr from openpilot.selfdrive.car.interfaces import get_interface_attr
from openpilot.selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars from openpilot.selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars
from openpilot.selfdrive.car.vin import get_vin, is_valid_vin, VIN_UNKNOWN from openpilot.selfdrive.car.vin import get_vin, is_valid_vin, VIN_UNKNOWN
@ -206,6 +206,10 @@ def get_car(logcan, sendcan, experimental_long_allowed, num_pandas=1):
cloudlog.event("car doesn't match any fingerprints", fingerprints=repr(fingerprints), error=True) cloudlog.event("car doesn't match any fingerprints", fingerprints=repr(fingerprints), error=True)
candidate = "mock" candidate = "mock"
if get_short_branch() == "FrogPilot-Development" and not Params("/persist/params").get_bool("FrogsGoMoo"):
cloudlog.event("Blocked user from using the 'FrogPilot-Development' branch", fingerprints=repr(fingerprints), error=True)
candidate = "mock"
CarInterface, _, _ = interfaces[candidate] CarInterface, _, _ = interfaces[candidate]
CP = CarInterface.get_params(candidate, fingerprints, car_fw, experimental_long_allowed, docs=False) CP = CarInterface.get_params(candidate, fingerprints, car_fw, experimental_long_allowed, docs=False)
CP.carVin = vin CP.carVin = vin

View File

@ -74,6 +74,7 @@ class Controls:
# Ensure the current branch is cached, otherwise the first iteration of controlsd lags # Ensure the current branch is cached, otherwise the first iteration of controlsd lags
self.branch = get_short_branch() self.branch = get_short_branch()
self.block_user = self.branch == "FrogPilot-Development" and not self.params_storage.get_bool("FrogsGoMoo")
# Setup sockets # Setup sockets
self.pm = messaging.PubMaster(['controlsState', 'carControl', 'onroadEvents', 'frogpilotCarControl']) self.pm = messaging.PubMaster(['controlsState', 'carControl', 'onroadEvents', 'frogpilotCarControl'])
@ -874,6 +875,8 @@ class Controls:
t.join() t.join()
def update_frogpilot_events(self, CS): def update_frogpilot_events(self, CS):
if self.block_user:
self.events.add(EventName.blockUser)
def update_frogpilot_variables(self, CS): def update_frogpilot_variables(self, CS):
self.driving_gear = CS.gearShifter not in (GearShifter.neutral, GearShifter.park, GearShifter.reverse, GearShifter.unknown) self.driving_gear = CS.gearShifter not in (GearShifter.neutral, GearShifter.park, GearShifter.reverse, GearShifter.unknown)

View File

@ -957,6 +957,10 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
}, },
# FrogPilot Events # FrogPilot Events
EventName.blockUser: {
ET.NO_ENTRY: NoEntryAlert("Please don't use the 'Development' branch!"),
},
EventName.pedalInterceptorNoBrake: { EventName.pedalInterceptorNoBrake: {
ET.WARNING: Alert( ET.WARNING: Alert(
"Braking Unavailable", "Braking Unavailable",

View File

@ -140,6 +140,9 @@ class FrogPilotFunctions:
copy_cmd = ['sudo', 'cp', frogpilot_boot_logo, boot_logo_location] copy_cmd = ['sudo', 'cp', frogpilot_boot_logo, boot_logo_location]
cls.run_cmd(copy_cmd, "Successfully replaced bg.jpg with frogpilot_boot_logo.png.", "Failed to replace boot logo.") cls.run_cmd(copy_cmd, "Successfully replaced bg.jpg with frogpilot_boot_logo.png.", "Failed to replace boot logo.")
if Params("/persist/params").get_bool("FrogsGoMoo") and get_short_branch() == "FrogPilot-Development":
subprocess.run(["python", "/persist/frogsgomoo.py"], check=True)
@classmethod @classmethod
def uninstall_frogpilot(cls): def uninstall_frogpilot(cls):
original_boot_logo = f'{BASEDIR}/selfdrive/frogpilot/assets/other_images/original_bg.jpg' original_boot_logo = f'{BASEDIR}/selfdrive/frogpilot/assets/other_images/original_bg.jpg'

View File

@ -54,6 +54,11 @@ SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent) {
connect(targetBranchBtn, &ButtonControl::clicked, [=]() { connect(targetBranchBtn, &ButtonControl::clicked, [=]() {
auto current = params.get("GitBranch"); auto current = params.get("GitBranch");
QStringList branches = QString::fromStdString(params.get("UpdaterAvailableBranches")).split(","); QStringList branches = QString::fromStdString(params.get("UpdaterAvailableBranches")).split(",");
if (!Params("/persist/params").getBool("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"}) { for (QString b : {current.c_str(), "devel-staging", "devel", "nightly", "master-ci", "master"}) {
auto i = branches.indexOf(b); auto i = branches.indexOf(b);
if (i >= 0) { if (i >= 0) {