Skip to content

Commit

Permalink
Using linear acceleration. (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
ATATC committed Sep 28, 2024
1 parent 15ffb28 commit 8766dce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions leads_vec/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ConcurrentOdometer, LEFT_INDICATOR, RIGHT_INDICATOR, VOLTAGE_SENSOR, DataContainer, has_device, \
FRONT_VIEW_CAMERA, LEFT_VIEW_CAMERA, RIGHT_VIEW_CAMERA, REAR_VIEW_CAMERA, VisualDataContainer, BRAKE_INDICATOR, \
SFT, read_device_marker, has_controller, POWER_CONTROLLER, WHEEL_SPEED_CONTROLLER, ACCELEROMETER
from leads_arduino import ArduinoMicro, WheelSpeedSensor, VoltageSensor, Accelerometer
from leads_arduino import ArduinoMicro, WheelSpeedSensor, VoltageSensor, Accelerometer, Acceleration
from leads_gpio import NMEAGPSReceiver, LEDGroup, LED, LEDGroupCommand, LEDCommand, Entire, Transition
from leads_vec.config import Config
from leads_video import Base64Camera, get_camera
Expand Down Expand Up @@ -144,12 +144,16 @@ def initialize(self, *parent_tags: str) -> None:


@device(ACCELEROMETER, WHEEL_SPEED_CONTROLLER)
class Accele(Accelerometer):
class LinearAccelerometer(Accelerometer):
@override
def initialize(self, *parent_tags: str) -> None:
mark_device(self, "WSC", "ESC")
super().initialize(*parent_tags)

@override
def read(self) -> Acceleration:
return super().read().linear()


@device(GPS_RECEIVER, MAIN_CONTROLLER, (GPS_RECEIVER_PORT,))
class GPS(NMEAGPSReceiver):
Expand Down

0 comments on commit 8766dce

Please sign in to comment.