diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 3220a2e1eb..f76e98cc37 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 import os -from typing import cast from math import fabs, exp from panda import Panda @@ -57,7 +56,7 @@ class CarInterface(CarInterfaceBase): # An important thing to consider is that the slope at 0 should be > 0 (ideally >1) # This has big effect on the stability about 0 (noise when going straight) # ToDo: To generalize to other GMs, explore tanh function as the nonlinear - non_linear_torque_params = NON_LINEAR_TORQUE_PARAMS.get(cast(CAR, self.CP.carFingerprint)) + non_linear_torque_params = NON_LINEAR_TORQUE_PARAMS.get(self.CP.carFingerprint) # type: ignore[call-overload] assert non_linear_torque_params, "The params are not defined" a, b, c, _ = non_linear_torque_params steer_torque = (sig(latcontrol_inputs.lateral_acceleration * a) * b) + (latcontrol_inputs.lateral_acceleration * c) diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py index 3710a1cfec..7558562d00 100644 --- a/selfdrive/car/honda/carstate.py +++ b/selfdrive/car/honda/carstate.py @@ -1,5 +1,4 @@ from collections import defaultdict -from typing import cast from opendbc.can.can_define import CANDefine from opendbc.can.parser import CANParser @@ -198,7 +197,7 @@ class CarState(CarStateBase): ret.steeringTorque = cp.vl["STEER_STATUS"]["STEER_TORQUE_SENSOR"] ret.steeringTorqueEps = cp.vl["STEER_MOTOR_TORQUE"]["MOTOR_TORQUE"] - ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD.get(cast(CAR, self.CP.carFingerprint), 1200) + ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD.get(self.CP.carFingerprint, 1200) # type: ignore[call-overload] if self.CP.carFingerprint in HONDA_BOSCH: # The PCM always manages its own cruise control state, but doesn't publish it