Skip to content

Commit

Permalink
September 16th, 2024 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogAi committed Sep 17, 2024
1 parent e9442a7 commit cd82332
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions selfdrive/controls/lib/longitudinal_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def parse_model(model_msg, model_error, v_ego, taco_tune):

return x, v, a, j

def update(self, clairvoyant_driver, clairvoyant_driver_v2, e2e_longitudinal_model, radarless_model, sm, tomb_raider, frogpilot_toggles):
def update(self, clairvoyant_driver, e2e_longitudinal_model, radarless_model, sm, tomb_raider, frogpilot_toggles):
self.mpc.mode = 'blended' if sm['controlsState'].experimentalMode and not clairvoyant_driver else 'acc'

v_ego = sm['carState'].vEgo
Expand Down Expand Up @@ -204,7 +204,7 @@ def update(self, clairvoyant_driver, clairvoyant_driver_v2, e2e_longitudinal_mod
# Prevent divergence, smooth in current v_ego
self.v_desired_filter.x = max(0.0, self.v_desired_filter.update(v_ego))
# Compute model v_ego error
self.v_model_error = 0.0 if e2e_longitudinal_model else get_speed_error_clairvoyant(sm['modelV2'], v_ego) if (clairvoyant_driver_v2 or tomb_raider) else get_speed_error(sm['modelV2'], v_ego)
self.v_model_error = 0.0 if e2e_longitudinal_model else get_speed_error_clairvoyant(sm['modelV2'], v_ego) if tomb_raider else get_speed_error(sm['modelV2'], v_ego)

if force_slow_decel:
v_cruise = 0.0
Expand Down
5 changes: 2 additions & 3 deletions selfdrive/controls/plannerd.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ def plannerd_thread():
FrogPilotVariables.update_frogpilot_params()

clairvoyant_driver = frogpilot_toggles.clairvoyant_driver
clairvoyant_driver_v2 = frogpilot_toggles.clairvoyant_driver_v2
tomb_raider = frogpilot_toggles.tomb_raider
e2e_longitudinal_model = clairvoyant_driver or clairvoyant_driver_v2 or frogpilot_toggles.secretgoodopenpilot_model or tomb_raider
e2e_longitudinal_model = clairvoyant_driver or frogpilot_toggles.secretgoodopenpilot_model or tomb_raider
radarless_model = frogpilot_toggles.radarless_model

update_toggles = False

while True:
sm.update()
if sm.updated['modelV2']:
longitudinal_planner.update(clairvoyant_driver, clairvoyant_driver_v2, e2e_longitudinal_model, radarless_model, sm, tomb_raider, frogpilot_toggles)
longitudinal_planner.update(clairvoyant_driver, e2e_longitudinal_model, radarless_model, sm, tomb_raider, frogpilot_toggles)
longitudinal_planner.publish(e2e_longitudinal_model, sm, pm)
publish_ui_plan(sm, pm, longitudinal_planner)

Expand Down

0 comments on commit cd82332

Please sign in to comment.