From 7445c1dc81e7bf7c61b88cb1082b2ecce3984a2f Mon Sep 17 00:00:00 2001 From: ATATC Date: Mon, 30 Sep 2024 11:28:10 -0400 Subject: [PATCH] Using linear acceleration. (#409) --- leads_arduino/wheel_speed_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leads_arduino/wheel_speed_sensor.py b/leads_arduino/wheel_speed_sensor.py index dadac8d..3586b93 100644 --- a/leads_arduino/wheel_speed_sensor.py +++ b/leads_arduino/wheel_speed_sensor.py @@ -54,7 +54,7 @@ def update(self, data: str) -> None: t = _time() ws = rpm2kmh(float(data), self._wheel_circumference) / self._num_divisions if self._accelerometer and self._last_acceleration: - a = self._accelerometer.read().forward_acceleration + a = self._accelerometer.read().linear().forward_acceleration s = (a + self._last_acceleration) * .5 * (t - self._last_valid) if abs(ws - self._wheel_speed - s) / abs(s) > 1.5: return