|
|
|
@ -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) |
|
|
|
|