Update conditional_experimental_mode.py

This commit is contained in:
James 2024-06-17 18:37:37 -07:00 committed by GitHub
parent 0830ee06cc
commit 105afca959
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ class ConditionalExperimentalMode:
def stop_sign_and_light(self, lead_distance, modelData, v_ego, v_lead, frogpilot_toggles):
lead_check = frogpilot_toggles.conditional_stop_lights_lead or not self.lead_slowing_down(lead_distance, v_ego, v_lead)
model_stopped = modelData.position.x[ModelConstants.IDX_N - 1] < ModelConstants.IDX_N
model_stopping = modelData.position.x[ModelConstants.IDX_N - 1] < v_ego * ModelConstants.T_IDXS[ModelConstants.IDX_N - 2]
model_stopping = modelData.position.x[ModelConstants.IDX_N - 1] < v_ego * ModelConstants.T_IDXS[ModelConstants.IDX_N - 3.3]
self.stop_light_mac.add_data((lead_check and model_stopping) or model_stopped)
self.red_light_detected = self.stop_light_mac.get_moving_average() >= PROBABILITY