mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-10 10:13:45 +08:00
FrogPilot features - Force device onroad/offroad
This commit is contained in:
@@ -209,6 +209,8 @@ def hardware_thread(end_event, hw_queue) -> None:
|
||||
# FrogPilot variables
|
||||
frogpilot_toggles = FrogPilotVariables.toggles
|
||||
|
||||
params_memory = Params("/dev/shm/params")
|
||||
|
||||
update_toggles = False
|
||||
|
||||
while not end_event.is_set():
|
||||
@@ -343,6 +345,10 @@ def hardware_thread(end_event, hw_queue) -> None:
|
||||
if started_ts is None:
|
||||
should_start = should_start and all(startup_conditions.values())
|
||||
|
||||
# Handle force offroad/onroad
|
||||
should_start |= params_memory.get_bool("ForceOnroad")
|
||||
should_start &= not params_memory.get_bool("ForceOffroad")
|
||||
|
||||
if should_start != should_start_prev or (count == 0):
|
||||
params.put_bool("IsEngaged", False)
|
||||
engaged_prev = False
|
||||
|
||||
Reference in New Issue
Block a user