remove blank whitespace (#25921)

old-commit-hash: 7df0e3efcf
taco
Lee Jong Mun 3 years ago committed by GitHub
parent 497bc99c27
commit f6700cb7ba
  1. 2
      common/modeldata.h
  2. 4
      selfdrive/controls/controlsd.py
  3. 8
      selfdrive/controls/lib/drive_helpers.py
  4. 4
      selfdrive/controls/lib/longcontrol.py
  5. 3
      selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py

@ -4,7 +4,7 @@
#include "common/mat.h" #include "common/mat.h"
#include "system/hardware/hw.h" #include "system/hardware/hw.h"
const int TRAJECTORY_SIZE = 33; const int TRAJECTORY_SIZE = 33;
const int LAT_MPC_N = 16; const int LAT_MPC_N = 16;
const int LON_MPC_N = 32; const int LON_MPC_N = 32;
const float MIN_DRAW_DISTANCE = 10.0; const float MIN_DRAW_DISTANCE = 10.0;

@ -595,7 +595,7 @@ class Controls:
CC.enabled = self.enabled CC.enabled = self.enabled
# Check which actuators can be enabled # Check which actuators can be enabled
CC.latActive = self.active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \ CC.latActive = self.active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \
CS.vEgo > self.CP.minSteerSpeed and not CS.standstill CS.vEgo > self.CP.minSteerSpeed and not CS.standstill
CC.longActive = self.active and not self.events.any(ET.OVERRIDE_LONGITUDINAL) and self.CP.openpilotLongitudinalControl CC.longActive = self.active and not self.events.any(ET.OVERRIDE_LONGITUDINAL) and self.CP.openpilotLongitudinalControl
actuators = CC.actuators actuators = CC.actuators
@ -718,7 +718,7 @@ class Controls:
recent_blinker = (self.sm.frame - self.last_blinker_frame) * DT_CTRL < 5.0 # 5s blinker cooldown recent_blinker = (self.sm.frame - self.last_blinker_frame) * DT_CTRL < 5.0 # 5s blinker cooldown
ldw_allowed = self.is_ldw_enabled and CS.vEgo > LDW_MIN_SPEED and not recent_blinker \ ldw_allowed = self.is_ldw_enabled and CS.vEgo > LDW_MIN_SPEED and not recent_blinker \
and not CC.latActive and self.sm['liveCalibration'].calStatus == Calibration.CALIBRATED and not CC.latActive and self.sm['liveCalibration'].calStatus == Calibration.CALIBRATED
model_v2 = self.sm['modelV2'] model_v2 = self.sm['modelV2']
desire_prediction = model_v2.meta.desirePrediction desire_prediction = model_v2.meta.desirePrediction

@ -125,10 +125,10 @@ def get_lag_adjusted_curvature(CP, v_ego, psis, curvatures, curvature_rates):
desired_curvature_rate = curvature_rates[0] desired_curvature_rate = curvature_rates[0]
max_curvature_rate = MAX_LATERAL_JERK / (v_ego**2) # inexact calculation, check https://github.com/commaai/openpilot/pull/24755 max_curvature_rate = MAX_LATERAL_JERK / (v_ego**2) # inexact calculation, check https://github.com/commaai/openpilot/pull/24755
safe_desired_curvature_rate = clip(desired_curvature_rate, safe_desired_curvature_rate = clip(desired_curvature_rate,
-max_curvature_rate, -max_curvature_rate,
max_curvature_rate) max_curvature_rate)
safe_desired_curvature = clip(desired_curvature, safe_desired_curvature = clip(desired_curvature,
current_curvature_desired - max_curvature_rate * DT_MDL, current_curvature_desired - max_curvature_rate * DT_MDL,
current_curvature_desired + max_curvature_rate * DT_MDL) current_curvature_desired + max_curvature_rate * DT_MDL)
return safe_desired_curvature, safe_desired_curvature_rate return safe_desired_curvature, safe_desired_curvature_rate

@ -50,10 +50,6 @@ def long_control_state_trans(CP, active, long_control_state, v_ego, v_target,
elif started_condition: elif started_condition:
long_control_state = LongCtrlState.pid long_control_state = LongCtrlState.pid
return long_control_state return long_control_state

@ -352,7 +352,7 @@ class LongitudinalMpc:
x_and_cruise = np.column_stack([x, cruise_target]) x_and_cruise = np.column_stack([x, cruise_target])
x = np.min(x_and_cruise, axis=1) x = np.min(x_and_cruise, axis=1)
self.source = 'e2e' if x_and_cruise[0,0] < x_and_cruise[0,1] else 'cruise' self.source = 'e2e' if x_and_cruise[0,0] < x_and_cruise[0,1] else 'cruise'
else: else:
@ -386,7 +386,6 @@ class LongitudinalMpc:
(lead_1_obstacle[0] - lead_0_obstacle[0]): (lead_1_obstacle[0] - lead_0_obstacle[0]):
self.source = 'lead1' self.source = 'lead1'
def update_with_xva(self, x, v, a): def update_with_xva(self, x, v, a):
self.params[:,0] = -10. self.params[:,0] = -10.

Loading…
Cancel
Save