|
3 | 3 | from math import fabs
|
4 | 4 | from panda import Panda
|
5 | 5 |
|
6 |
| -from common.numpy_fast import interp |
7 | 6 | from common.conversions import Conversions as CV
|
8 | 7 | from selfdrive.car import STD_CARGO_KG, create_button_event, scale_tire_stiffness, get_safety_config
|
9 | 8 | from selfdrive.car.gm.radar_interface import RADAR_HEADER_MSG
|
10 | 9 | from selfdrive.car.gm.values import CAR, CruiseButtons, CarControllerParams, EV_CAR, CAMERA_ACC_CAR, CanBus
|
11 |
| -from selfdrive.car.interfaces import CarInterfaceBase, TorqueFromLateralAccelCallbackType, FRICTION_THRESHOLD |
12 |
| -from selfdrive.controls.lib.drive_helpers import apply_center_deadzone |
| 10 | +from selfdrive.car.interfaces import CarInterfaceBase |
13 | 11 |
|
14 | 12 | ButtonType = car.CarState.ButtonEvent.Type
|
15 | 13 | EventName = car.CarEvent.EventName
|
@@ -46,43 +44,6 @@ def get_steer_feedforward_function(self):
|
46 | 44 | else:
|
47 | 45 | return CarInterfaceBase.get_steer_feedforward_default
|
48 | 46 |
|
49 |
| - @staticmethod |
50 |
| - def torque_from_lateral_accel_bolt(lateral_accel_value, torque_params, lateral_accel_error, lateral_accel_deadzone, vego, friction_compensation): |
51 |
| - friction_interp = interp( |
52 |
| - apply_center_deadzone(lateral_accel_error, lateral_accel_deadzone), |
53 |
| - [-FRICTION_THRESHOLD, FRICTION_THRESHOLD], |
54 |
| - [-torque_params.friction, torque_params.friction] |
55 |
| - ) |
56 |
| - friction = friction_interp if friction_compensation else 0.0 |
57 |
| - steer_torque = lateral_accel_value / torque_params.latAccelFactor |
58 |
| - |
59 |
| - # TODO: |
60 |
| - # 1. Learn the correction factors from data |
61 |
| - # 2. Generalize the logic to other GM torque control platforms |
62 |
| - steer_break_pts = [-1.0, -0.9, -0.75, -0.5, 0.0, 0.5, 0.75, 0.9, 1.0] |
63 |
| - steer_lataccel_factors = [1.5, 1.15, 1.02, 1.0, 1.0, 1.0, 1.02, 1.15, 1.5] |
64 |
| - steer_correction_factor = interp( |
65 |
| - steer_torque, |
66 |
| - steer_break_pts, |
67 |
| - steer_lataccel_factors |
68 |
| - ) |
69 |
| - |
70 |
| - vego_break_pts = [0.0, 10.0, 15.0, 20.0, 100.0] |
71 |
| - vego_lataccel_factors = [1.5, 1.5, 1.25, 1.0, 1.0] |
72 |
| - vego_correction_factor = interp( |
73 |
| - vego, |
74 |
| - vego_break_pts, |
75 |
| - vego_lataccel_factors, |
76 |
| - ) |
77 |
| - |
78 |
| - return (steer_torque + friction) / (steer_correction_factor * vego_correction_factor) |
79 |
| - |
80 |
| - def torque_from_lateral_accel(self) -> TorqueFromLateralAccelCallbackType: |
81 |
| - if self.CP.carFingerprint == CAR.BOLT_EUV: |
82 |
| - return self.torque_from_lateral_accel_bolt |
83 |
| - else: |
84 |
| - return self.torque_from_lateral_accel_linear |
85 |
| - |
86 | 47 | @staticmethod
|
87 | 48 | def _get_params(ret, candidate, fingerprint, car_fw, experimental_long):
|
88 | 49 | ret.carName = "gm"
|
@@ -227,7 +188,7 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long):
|
227 | 188 | ret.steerRatio = 16.8
|
228 | 189 | ret.centerToFront = ret.wheelbase * 0.4
|
229 | 190 | tire_stiffness_factor = 1.0
|
230 |
| - ret.steerActuatorDelay = 0.12 |
| 191 | + ret.steerActuatorDelay = 0.2 |
231 | 192 | CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
232 | 193 |
|
233 | 194 | elif candidate == CAR.SILVERADO:
|
|
0 commit comments