diff --git a/selfdrive/locationd/locationd.py b/selfdrive/locationd/locationd.py index 14a315da85..4cde1e5ad4 100755 --- a/selfdrive/locationd/locationd.py +++ b/selfdrive/locationd/locationd.py @@ -31,9 +31,8 @@ POSENET_STD_HIST_HALF = 20 def init_xyz_measurement(measurement: capnp._DynamicStructBuilder, values: np.ndarray, stds: np.ndarray, valid: bool): assert len(values) == len(stds) == 3 - for i, d in enumerate(("x", "y", "z")): - setattr(measurement, d, float(values[i])) - setattr(measurement, f"{d}Std", float(stds[i])) + measurement.x, measurement.y, measurement.z = map(float, values) + measurement.xStd, measurement.yStd, measurement.zStd = map(float, stds) measurement.valid = valid