mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-05 21:42:05 +08:00
remove blank whitespace (#25921)
old-commit-hash: 7df0e3efcfd2926405f5eaa872d03a652f9c66f9
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
||||
#include "common/mat.h"
|
||||
#include "system/hardware/hw.h"
|
||||
|
||||
const int TRAJECTORY_SIZE = 33;
|
||||
const int TRAJECTORY_SIZE = 33;
|
||||
const int LAT_MPC_N = 16;
|
||||
const int LON_MPC_N = 32;
|
||||
const float MIN_DRAW_DISTANCE = 10.0;
|
||||
|
||||
@@ -595,7 +595,7 @@ class Controls:
|
||||
CC.enabled = self.enabled
|
||||
# Check which actuators can be enabled
|
||||
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
|
||||
|
||||
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
|
||||
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']
|
||||
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]
|
||||
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,
|
||||
-max_curvature_rate,
|
||||
max_curvature_rate)
|
||||
-max_curvature_rate,
|
||||
max_curvature_rate)
|
||||
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
|
||||
|
||||
@@ -50,10 +50,6 @@ def long_control_state_trans(CP, active, long_control_state, v_ego, v_target,
|
||||
elif started_condition:
|
||||
long_control_state = LongCtrlState.pid
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return long_control_state
|
||||
|
||||
|
||||
|
||||
@@ -352,7 +352,7 @@ class LongitudinalMpc:
|
||||
|
||||
x_and_cruise = np.column_stack([x, cruise_target])
|
||||
x = np.min(x_and_cruise, axis=1)
|
||||
|
||||
|
||||
self.source = 'e2e' if x_and_cruise[0,0] < x_and_cruise[0,1] else 'cruise'
|
||||
|
||||
else:
|
||||
@@ -386,7 +386,6 @@ class LongitudinalMpc:
|
||||
(lead_1_obstacle[0] - lead_0_obstacle[0]):
|
||||
self.source = 'lead1'
|
||||
|
||||
|
||||
|
||||
def update_with_xva(self, x, v, a):
|
||||
self.params[:,0] = -10.
|
||||
|
||||
Reference in New Issue
Block a user