diff --git a/selfdrive/car/tests/test_car_interfaces.py b/selfdrive/car/tests/test_car_interfaces.py index 742bafc76a0ce3..bb97ac8a9ad7e0 100644 --- a/selfdrive/car/tests/test_car_interfaces.py +++ b/selfdrive/car/tests/test_car_interfaces.py @@ -62,6 +62,7 @@ def test_car_interfaces(self, car_name, data): car_params = CarInterface.get_params(car_name, args['fingerprints'], args['car_fw'], experimental_long=args['experimental_long'], docs=False) + car_params = car_params.as_reader() car_interface = CarInterface(car_params, CarController, CarState) assert car_params assert car_interface diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index f147766c91ed73..416a9aa8c5979f 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -65,8 +65,7 @@ def __init__(self, CI=None): if CI is None: cloudlog.info("controlsd is waiting for CarParams") with car.CarParams.from_bytes(self.params.get("CarParams", block=True)) as msg: - # TODO: this shouldn't need to be a builder - self.CP = msg.as_builder() + self.CP = msg cloudlog.info("controlsd got CarParams") # Uses car interface helper functions, altering state won't be considered by card for actuation diff --git a/selfdrive/controls/lib/latcontrol_torque.py b/selfdrive/controls/lib/latcontrol_torque.py index 34b0d471241750..decff2ec054283 100644 --- a/selfdrive/controls/lib/latcontrol_torque.py +++ b/selfdrive/controls/lib/latcontrol_torque.py @@ -25,7 +25,7 @@ class LatControlTorque(LatControl): def __init__(self, CP, CI): super().__init__(CP, CI) - self.torque_params = CP.lateralTuning.torque + self.torque_params = CP.lateralTuning.torque.as_builder() self.pid = PIDController(self.torque_params.kp, self.torque_params.ki, k_f=self.torque_params.kf, pos_limit=self.steer_max, neg_limit=-self.steer_max) self.torque_from_lateral_accel = CI.torque_from_lateral_accel() diff --git a/selfdrive/controls/lib/tests/test_latcontrol.py b/selfdrive/controls/lib/tests/test_latcontrol.py index 81411edec1c3d6..e12da6ed97f20e 100644 --- a/selfdrive/controls/lib/tests/test_latcontrol.py +++ b/selfdrive/controls/lib/tests/test_latcontrol.py @@ -21,7 +21,7 @@ def test_saturation(self, car_name, controller): CI = CarInterface(CP, CarController, CarState) VM = VehicleModel(CP) - controller = controller(CP, CI) + controller = controller(CP.as_reader(), CI) CS = car.CarState.new_message() CS.vEgo = 30