diff --git a/Scripts/test_imu.py b/Scripts/test_imu.py index e5cc862b..d1c12079 100644 --- a/Scripts/test_imu.py +++ b/Scripts/test_imu.py @@ -4,7 +4,7 @@ For the pi, you will have to use python3 """ -from Airbrakes.imu import IMU +from airbrakes.imu import IMU # Should be checked before launch UPSIDE_DOWN = True diff --git a/Scripts/test_logger.py b/Scripts/test_logger.py index 34c90429..de2093e0 100644 --- a/Scripts/test_logger.py +++ b/Scripts/test_logger.py @@ -1,7 +1,7 @@ """Module to test the logger module.""" -from Airbrakes.imu import IMUDataPacket -from Airbrakes.logger import Logger +from airbrakes.imu import IMUDataPacket +from airbrakes.logger import Logger CSV_HEADERS = ["state", "extension", *list(IMUDataPacket(0.0).__slots__)] diff --git a/Scripts/test_servo.py b/Scripts/test_servo.py index 81502b5c..c51bb6ad 100644 --- a/Scripts/test_servo.py +++ b/Scripts/test_servo.py @@ -4,7 +4,7 @@ For the pi, you will have to use python3 """ -from Airbrakes.servo import Servo +from airbrakes.servo import Servo # The pin that the servo's data wire is plugged into, in this case the GPIO 12 pin which is used for PWM SERVO_PIN = 12 diff --git a/Airbrakes/__init__.py b/airbrakes/__init__.py similarity index 100% rename from Airbrakes/__init__.py rename to airbrakes/__init__.py diff --git a/Airbrakes/airbrakes.py b/airbrakes/airbrakes.py similarity index 92% rename from Airbrakes/airbrakes.py rename to airbrakes/airbrakes.py index e2bde5ad..a5c047e8 100644 --- a/Airbrakes/airbrakes.py +++ b/airbrakes/airbrakes.py @@ -2,10 +2,10 @@ from typing import TYPE_CHECKING -from Airbrakes.imu import IMU, IMUDataPacket, RollingAverages -from Airbrakes.logger import Logger -from Airbrakes.servo import Servo -from Airbrakes.state import StandByState, State +from airbrakes.imu import IMU, IMUDataPacket, RollingAverages +from airbrakes.logger import Logger +from airbrakes.servo import Servo +from airbrakes.state import StandByState, State if TYPE_CHECKING: import collections @@ -60,7 +60,7 @@ def update(self): data_packets: collections.deque[IMUDataPacket] = self.imu.get_imu_data_packets() # Logs the current state, extension, and IMU data - rolling_average = RollingAverages(data_packets.copy()) + RollingAverages(data_packets.copy()) # TODO: Compute state(s) for given IMU data self.logger.log(self.state.get_name(), self.current_extension, data_packets.copy()) diff --git a/Airbrakes/imu/__init__.py b/airbrakes/imu/__init__.py similarity index 100% rename from Airbrakes/imu/__init__.py rename to airbrakes/imu/__init__.py diff --git a/Airbrakes/imu/imu.py b/airbrakes/imu/imu.py similarity index 96% rename from Airbrakes/imu/imu.py rename to airbrakes/imu/imu.py index 49d4d018..723b2446 100644 --- a/Airbrakes/imu/imu.py +++ b/airbrakes/imu/imu.py @@ -6,7 +6,7 @@ import mscl -from Airbrakes.imu.imu_data_packet import EstimatedDataPacket, IMUDataPacket, RawDataPacket +from airbrakes.imu.imu_data_packet import EstimatedDataPacket, IMUDataPacket, RawDataPacket class RollingAverages: @@ -87,8 +87,11 @@ def _fetch_data_loop(self, port: str, frequency: int, _: bool): timestamp = packet.collectedTimestamp().nanoseconds() # Initialize packet with the timestamp, determines if the packet is raw or estimated - imu_data_packet = EstimatedDataPacket(timestamp) \ - if packet.descriptorSet() == self.ESTIMATED_DESCRIPTOR_SET else RawDataPacket(timestamp) + imu_data_packet = ( + EstimatedDataPacket(timestamp) + if packet.descriptorSet() == self.ESTIMATED_DESCRIPTOR_SET + else RawDataPacket(timestamp) + ) # Each of these packets has multiple data points for data_point in packet.data(): diff --git a/Airbrakes/imu/imu_data_packet.py b/airbrakes/imu/imu_data_packet.py similarity index 98% rename from Airbrakes/imu/imu_data_packet.py rename to airbrakes/imu/imu_data_packet.py index 5ebd3ff4..eede923c 100644 --- a/Airbrakes/imu/imu_data_packet.py +++ b/airbrakes/imu/imu_data_packet.py @@ -43,7 +43,7 @@ def __init__( scaledAccelZ: float | None = None, scaledGyroX: float | None = None, scaledGyroY: float | None = None, - scaledGyroZ: float | None = None + scaledGyroZ: float | None = None, ): super().__init__(timestamp) @@ -111,7 +111,7 @@ def __init__( estAngularRateZ: float | None = None, estCompensatedAccelX: float | None = None, estCompensatedAccelY: float | None = None, - estCompensatedAccelZ: float | None = None + estCompensatedAccelZ: float | None = None, ): super().__init__(timestamp) diff --git a/Airbrakes/logger.py b/airbrakes/logger.py similarity index 98% rename from Airbrakes/logger.py rename to airbrakes/logger.py index e0dde2e4..e69598c3 100644 --- a/Airbrakes/logger.py +++ b/airbrakes/logger.py @@ -5,7 +5,7 @@ import multiprocessing from pathlib import Path -from Airbrakes.imu import IMUDataPacket +from airbrakes.imu import IMUDataPacket class Logger: diff --git a/Airbrakes/servo.py b/airbrakes/servo.py similarity index 100% rename from Airbrakes/servo.py rename to airbrakes/servo.py diff --git a/Airbrakes/state.py b/airbrakes/state.py similarity index 98% rename from Airbrakes/state.py rename to airbrakes/state.py index a9062170..fd0ec1bc 100644 --- a/Airbrakes/state.py +++ b/airbrakes/state.py @@ -1,6 +1,6 @@ """Module for the finite state machine that represents which state of flight we are in.""" -from Airbrakes.airbrakes import AirbrakesContext +from airbrakes.airbrakes import AirbrakesContext class State: diff --git a/main.py b/main.py index f525ff1b..c03042c4 100644 --- a/main.py +++ b/main.py @@ -1,10 +1,10 @@ """The main file which will be run on the Raspberry Pi. It will create the AirbrakesContext object and run the main loop.""" -from Airbrakes.airbrakes import AirbrakesContext -from Airbrakes.imu import IMU, IMUDataPacket -from Airbrakes.logger import Logger -from Airbrakes.servo import Servo +from airbrakes.airbrakes import AirbrakesContext +from airbrakes.imu import IMU, IMUDataPacket +from airbrakes.logger import Logger +from airbrakes.servo import Servo # The pin that the servo's data wire is plugged into, in this case the GPIO 12 pin which is used for PWM SERVO_PIN = 12