Use turn desires when below the minimum lane change speed

Added toggle to use turn desires when below the minimum lane change speed for more precise turns.
This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent fe8322fd5d
commit 5e77c2dea0
7 changed files with 54 additions and 1 deletions

View File

@@ -340,6 +340,13 @@ class Controls:
LaneChangeState.laneChangeFinishing):
self.events.add(EventName.laneChange)
# Handle turning
if not CS.standstill:
if self.sm['lateralPlan'].desire == Desire.turnLeft:
self.events.add(FrogPilotEventName.turningLeft)
elif self.sm['lateralPlan'].desire == Desire.turnRight:
self.events.add(FrogPilotEventName.turningRight)
for i, pandaState in enumerate(self.sm['pandaStates']):
# All pandas must match the list of safetyConfigs, and if outside this list, must be silent or noOutput
if i < len(self.CP.safetyConfigs):