mirror of
https://github.com/infiniteCable2/opendbc.git
synced 2026-02-18 13:03:52 +08:00
GM: Sigmoidal Offsets (#3110)
* silverado * Update interface.py * quant * Update interface.py * Revert "Update interface.py" This reverts commit 5ef95213e6d71f3cfe2a2ef769c0cd0235f16d10. * Revert "quant" This reverts commit 1cc2aebd9f88b29797c00dd37434fce89c1d5f28. * Revert "silverado" This reverts commit 560d9aa6fced675c656e3377dff19cd4023aea48.
This commit is contained in:
@@ -53,10 +53,10 @@ class CarInterface(CarInterfaceBase):
|
||||
# This has big effect on the stability about 0 (noise when going straight)
|
||||
non_linear_torque_params = NON_LINEAR_TORQUE_PARAMS.get(self.CP.carFingerprint)
|
||||
assert non_linear_torque_params, "The params are not defined"
|
||||
a, b, c, _ = non_linear_torque_params
|
||||
a, b, c, d = non_linear_torque_params
|
||||
sig_input = a * lateral_acceleration
|
||||
sig = np.sign(sig_input) * (1 / (1 + exp(-fabs(sig_input))) - 0.5)
|
||||
steer_torque = (sig * b) + (lateral_acceleration * c)
|
||||
steer_torque = (sig * b) + (lateral_acceleration * c) + d
|
||||
return float(steer_torque)
|
||||
|
||||
lataccel_values = np.arange(-5.0, 5.0, 0.01)
|
||||
|
||||
Reference in New Issue
Block a user