Skip to content
Snippets Groups Projects

imu: make it part of InputState

Merged schneider requested to merge schneider/imu-inputstate into main
All threads resolved!
Files
2
+ 20
20
@@ -8,6 +8,26 @@ from st3m.power import Power
power = Power()
class IMUState:
"""
State of the Inertial Measurement Unit
Acceleration in m/s**2, roation rate in deg/s, pressure in Pascal
"""
__slots__ = ("acc", "gyro", "pressure")
def __init__(
self,
acc: Tuple[float, float, float],
gyro: Tuple[float, float, float],
pressure: float,
) -> None:
self.acc = acc
self.gyro = gyro
self.pressure = pressure
class InputState:
"""
Current state of inputs from badge user. Passed via think() to every
@@ -463,26 +483,6 @@ class TriSwitchState:
self.right._ignore_pressed()
class IMUState:
"""
State of the Inertial Measurement Unit
Acceleration in m/s**2, roation rate in deg/s, pressure in Pascal
"""
__slots__ = ("acc", "gyro", "pressure")
def __init__(
self,
acc: Tuple[float, float, float],
gyro: Tuple[float, float, float],
pressure: float,
) -> None:
self.acc = acc
self.gyro = gyro
self.pressure = pressure
class InputController:
"""
A stateful input controller. It accepts InputState updates from the Reactor
Loading