Skip to content

Commit b59f8bd

Browse files
haraschaxfelsager
andauthored
Torque control: no car specific gains (#2851)
* deprecate unused gains * remove long kf field assignment that makes hitl test fail * fix test --------- Co-authored-by: felsager <[email protected]>
1 parent 49676d0 commit b59f8bd

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

opendbc/car/car.capnp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,23 +549,23 @@ struct CarParams {
549549
}
550550

551551
struct LateralTorqueTuning {
552-
kp @1 :Float32;
553-
ki @2 :Float32;
554-
kd @8 : Float32;
555552
friction @3 :Float32;
556-
kf @4 :Float32;
557553
steeringAngleDeadzoneDeg @5 :Float32;
558554
latAccelFactor @6 :Float32;
559555
latAccelOffset @7 :Float32;
560556
useSteeringAngleDEPRECATED @0 :Bool;
557+
kpDEPRECATED @1 :Float32;
558+
kiDEPRECATED @2 :Float32;
559+
kfDEPRECATED @4 :Float32;
560+
kdDEPRECATED @8 : Float32;
561561
}
562562

563563
struct LongitudinalPIDTuning {
564564
kpBP @0 :List(Float32);
565565
kpV @1 :List(Float32);
566566
kiBP @2 :List(Float32);
567567
kiV @3 :List(Float32);
568-
kf @6 :Float32;
568+
kfDEPRECATED @6 :Float32;
569569
deadzoneBPDEPRECATED @4 :List(Float32);
570570
deadzoneVDEPRECATED @5 :List(Float32);
571571
}

opendbc/car/interfaces.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ def get_std_params(candidate: str) -> structs.CarParams:
210210
ret.stoppingDecelRate = 0.8 # brake_travel/s while trying to stop
211211
ret.vEgoStopping = 0.5
212212
ret.vEgoStarting = 0.5
213-
ret.longitudinalTuning.kf = 1.
214213
ret.longitudinalTuning.kpBP = [0.]
215214
ret.longitudinalTuning.kpV = [0.]
216215
ret.longitudinalTuning.kiBP = [0.]
@@ -225,10 +224,6 @@ def configure_torque_tune(candidate: str, tune: structs.CarParams.LateralTuning,
225224
params = get_torque_params()[candidate]
226225

227226
tune.init('torque')
228-
tune.torque.kf = 1.0
229-
tune.torque.kp = 1.0
230-
tune.torque.ki = 0.3
231-
tune.torque.kd = 0.0
232227
tune.torque.friction = params['FRICTION']
233228
tune.torque.latAccelFactor = params['LAT_ACCEL_FACTOR']
234229
tune.torque.latAccelOffset = 0.0

opendbc/car/tests/test_car_interfaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_car_interfaces(self, car_name, data):
8787
assert len(tune.pid.kiV) > 0 and len(tune.pid.kiV) == len(tune.pid.kiBP)
8888

8989
elif tune.which() == 'torque':
90-
assert not math.isnan(tune.torque.kf) and tune.torque.kf > 0
90+
assert not math.isnan(tune.torque.latAccelFactor) and tune.torque.latAccelFactor > 0
9191
assert not math.isnan(tune.torque.friction) and tune.torque.friction > 0
9292

9393
# Run car interface

0 commit comments

Comments
 (0)