Skip to content

Commit

Permalink
November 10th, 2024 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogAi committed Nov 10, 2024
1 parent 3cfc5ec commit b596356
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ FrogPilot is a fully open-sourced fork of openpilot, featuring clear and concise
------
FrogPilot was last updated on:

**November 8th, 2024**
**November 10th, 2024**

Features
------
Expand Down
16 changes: 16 additions & 0 deletions selfdrive/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,22 @@ def calculate_speed_limit(cp_cam, frogpilot_toggles):
return 0


# Traffic signals for Speed Limit Controller - Credit goes to the DragonPilot team!
@staticmethod
def calculate_speed_limit(cp_cam, frogpilot_toggles):
signals = ["TSGN1", "SPDVAL1", "SPLSGN1", "TSGN2", "SPLSGN2", "TSGN3", "SPLSGN3", "TSGN4", "SPLSGN4"]
traffic_signals = {signal: cp_cam.vl["RSA1"].get(signal, cp_cam.vl["RSA2"].get(signal)) for signal in signals}

tsgn1 = traffic_signals.get("TSGN1")
spdval1 = traffic_signals.get("SPDVAL1")

if tsgn1 == 1 and not frogpilot_toggles.force_mph_dashboard:
return spdval1 * CV.KPH_TO_MS
elif tsgn1 == 36 or frogpilot_toggles.force_mph_dashboard:
return spdval1 * CV.MPH_TO_MS
return 0


class CarState(CarStateBase):
def __init__(self, CP):
super().__init__(CP)
Expand Down
11 changes: 11 additions & 0 deletions selfdrive/navd/navd.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,17 @@ def __init__(self, sm, pm):
self.stop_coord = []
self.stop_signal = []

# FrogPilot variables
self.frogpilot_toggles = get_frogpilot_toggles(True)

self.approaching_intersection = False
self.approaching_turn = False

self.nav_speed_limit = 0

self.stop_coord = []
self.stop_signal = []

def update(self):
self.sm.update(0)

Expand Down

0 comments on commit b596356

Please sign in to comment.