|
|
@ -19,7 +19,6 @@ from openpilot.selfdrive.car.car_specific import CarSpecificEvents |
|
|
|
from openpilot.selfdrive.selfdrived.events import Events, ET |
|
|
|
from openpilot.selfdrive.selfdrived.events import Events, ET |
|
|
|
from openpilot.selfdrive.selfdrived.state import StateMachine |
|
|
|
from openpilot.selfdrive.selfdrived.state import StateMachine |
|
|
|
from openpilot.selfdrive.selfdrived.alertmanager import AlertManager, set_offroad_alert |
|
|
|
from openpilot.selfdrive.selfdrived.alertmanager import AlertManager, set_offroad_alert |
|
|
|
from openpilot.selfdrive.controls.lib.latcontrol import MIN_LATERAL_CONTROL_SPEED |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from openpilot.system.version import get_build_metadata |
|
|
|
from openpilot.system.version import get_build_metadata |
|
|
|
|
|
|
|
|
|
|
@ -331,7 +330,7 @@ class SelfdriveD: |
|
|
|
controlstate = self.sm['controlsState'] |
|
|
|
controlstate = self.sm['controlsState'] |
|
|
|
lac = getattr(controlstate.lateralControlState, controlstate.lateralControlState.which()) |
|
|
|
lac = getattr(controlstate.lateralControlState, controlstate.lateralControlState.which()) |
|
|
|
if lac.active and not recent_steer_pressed and not self.CP.notCar: |
|
|
|
if lac.active and not recent_steer_pressed and not self.CP.notCar: |
|
|
|
clipped_speed = max(CS.vEgo, MIN_LATERAL_CONTROL_SPEED) |
|
|
|
clipped_speed = max(CS.vEgo, 0.3) |
|
|
|
actual_lateral_accel = controlstate.curvature * (clipped_speed**2) |
|
|
|
actual_lateral_accel = controlstate.curvature * (clipped_speed**2) |
|
|
|
desired_lateral_accel = self.sm['modelV2'].action.desiredCurvature * (clipped_speed**2) |
|
|
|
desired_lateral_accel = self.sm['modelV2'].action.desiredCurvature * (clipped_speed**2) |
|
|
|
undershooting = abs(desired_lateral_accel) / abs(1e-3 + actual_lateral_accel) > 1.2 |
|
|
|
undershooting = abs(desired_lateral_accel) / abs(1e-3 + actual_lateral_accel) > 1.2 |
|
|
|