Skip to content

Commit

Permalink
Using linear acceleration. (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
ATATC committed Sep 30, 2024
1 parent 8ae934d commit 7445c1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion leads_arduino/wheel_speed_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7445c1d

Please sign in to comment.