This commit is contained in:
Your Name
2024-05-12 21:56:49 -05:00
parent b4120aed2e
commit d228405bc8
4 changed files with 14 additions and 14 deletions

View File

@@ -245,7 +245,7 @@ class Controls:
# Compute actuators (runs PID loops and lateral MPC)
CC, lac_log = self.state_control(CS)
CC = self.clearpilot_state_control(CC, CS)
# Publish data
self.publish_logs(CS, start_time, CC, lac_log)
@@ -302,7 +302,7 @@ class Controls:
self.mismatch_counter += 1
return CS
def update_events(self, CS):
"""Compute onroadEvents from carState"""
@@ -393,7 +393,7 @@ class Controls:
# CLEARPILOT TODO: Make this a toggle
# Clearpilot abstract this into a behavior
NoLaneChange = False
if not NoLaneChange:
if not NoLaneChange:
if self.sm['modelV2'].meta.laneChangeState == LaneChangeState.preLaneChange:
direction = self.sm['modelV2'].meta.laneChangeDirection
if (CS.leftBlindspot and direction == LaneChangeDirection.left) or \
@@ -1233,15 +1233,11 @@ class Controls:
if (len(CS.buttonEvents) > 0):
print (CS.buttonEvents)
if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents):
exit() # Just cause a crash for testing
self.events.add(EventName.clpDebug)
# clearpilot_notice(CP_NOTICE_DEBUG, "LKAS Debug Action Invoked")
foo = "bar"
def clearpilot_state_control(self, CC, CS):
foo = "bar"
if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents):
CC.cruiseControl.resume = True
return CC
def main():