From 923077c095400ee9e9382b427bb372b0e43024bd Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 22 Jan 2025 22:05:06 -0500 Subject: [PATCH 1/5] Switch to Legacy launch 1 flight configuration --- airbrakes/constants.py | 2 +- launch_data/README.md | 5 ++++ launch_data/metadata.json | 56 +++++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- tests/conftest.py | 4 +++ 5 files changed, 67 insertions(+), 2 deletions(-) diff --git a/airbrakes/constants.py b/airbrakes/constants.py index af71a4bd..ce067a1f 100644 --- a/airbrakes/constants.py +++ b/airbrakes/constants.py @@ -166,7 +166,7 @@ class DisplayEndingType(StrEnum): motor has stopped burning if the current velocity is less than a percentage of the max velocity.""" # ----------------- Coasting to Freefall ----------------- -TARGET_ALTITUDE_METERS = 1000 +TARGET_ALTITUDE_METERS = 1 """The target altitude in meters that we want the rocket to reach. This is used with our bang-bang controller to determine when to extend and retract the airbrakes.""" diff --git a/launch_data/README.md b/launch_data/README.md index ca797003..80104e52 100644 --- a/launch_data/README.md +++ b/launch_data/README.md @@ -10,7 +10,12 @@ This folder contains the launch data of actual previous flights. These are used 3. `genesis_launch_1.csv`: This was our first attempt of a control launch with the Genesis subscale rocket. We tried to have it extend its airbrakes for most of coast and then retract them, but later analysis proved that airbrakes didn't deploy during coast. Additionally, the LandedState was incorrectly detected, so for convenience ~100 mb of useless data has been cropped out of this file. The timestamps of the LandedState packets were synced with the timestamps of the last packet in the file. See #91 for more details. 4. `genesis_launch_2.csv`: This was our second attempt of a control launch with Genesis. For this one we told the airbrakes to deploy once at around the start of CoastState and did not tell them to retract at all. When we recovered the rocket, the fins were extended, by analysis of launch data shows that the airbrakes didn't deploy in CoastState, and most likely deployed sometime either in FreeFall or once the rocket hit the ground. LandedState was mostly correctly detected. See #91 for more details. +5. `legacy_launch_1.csv`: This was the first time airbrakes physically deployed! The airbrakes were pre-programmed to stay deployed after apogee convergence. +6. `legacy_launch_2.csv`: This was the second time airbrakes physically deployed! This was a control launch where the we planned to hit a target apogee. +## Videos + +There is a video of the launch from the rocket's perspective in the `videos` folder. ## Metadata diff --git a/launch_data/metadata.json b/launch_data/metadata.json index 468aa358..8b5d9309 100644 --- a/launch_data/metadata.json +++ b/launch_data/metadata.json @@ -111,5 +111,61 @@ "apogee_meters": 463.62 }, "flight_description": "Second flight of apogee prediction code. This was very similar to first flight and airbrakes most likely failed to deploy at the intended time. See https://github.com/NCSU-High-Powered-Rocketry-Club/AirbrakesV2/issues/91 for more details." + }, + "legacy_launch_1.csv": { + "date": "2025-01-25 12:11:35.000", + "launch_site": { + "air_temperature_celsius": 4.11, + "air_pressure_mb": null, + "wind_speed_kmh": null, + "wind_speed_direction": null, + "launch_coordinates": { + "latitiude": 35.1758000, + "longitude": -76.8283400 + }, + "landed_coordinates:": { + "latitude": null, + "longitude": null + }, + "launch_rod_angle": 5.0 + }, + "imu_details": { + "imu_model": "Parker-LORD 3DM-CX5-15", + "raw_packet_frequency": 1000.0, + "est_packet_frequency": 500.0 + }, + "flight_data": { + "log_buffer_index": 5000, + "apogee_meters": null + }, + "flight_description": "" + }, + "legacy_launch_2.csv": { + "date": "2025-01-25 15:11:35.000", + "launch_site": { + "air_temperature_celsius": 3.11, + "air_pressure_mb": null, + "wind_speed_kmh": null, + "wind_speed_direction": null, + "launch_coordinates": { + "latitiude": 35.1758000, + "longitude": -76.8283400 + }, + "landed_coordinates:": { + "latitude": null, + "longitude": null + }, + "launch_rod_angle": 5.0 + }, + "imu_details": { + "imu_model": "Parker-LORD 3DM-CX5-15", + "raw_packet_frequency": 1000.0, + "est_packet_frequency": 500.0 + }, + "flight_data": { + "log_buffer_index": 5000, + "apogee_meters": null + }, + "flight_description": "" } } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a39f99f2..e3e3ebf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "AirbrakesV2" description = "Logic for airbrakes as a part of the NASA Student Launch Competition" requires-python = ">=3.13" -version = "0.1.0" +version = "1.1.0" readme = "README.md" dependencies = [ "gpiozero", diff --git a/tests/conftest.py b/tests/conftest.py index 3f78e2d9..ce7dd36d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,6 +28,8 @@ LAUNCH_DATA = list(Path("launch_data").glob("*.csv")) # Remove the genesis_launch_1.csv file since it's almost the same as genesis_launch_2.csv: LAUNCH_DATA.remove(Path("launch_data/genesis_launch_1.csv")) +# Remove the legacy_launch_2.csv file since it's almost the same as legacy_launch_1.csv: +# LAUNCH_DATA.remove(Path("launch_data/legacy_launch_2.csv")) # Use the filenames as the ids for the fixtures: LAUNCH_DATA_IDS = [log.stem for log in LAUNCH_DATA] @@ -132,6 +134,8 @@ def target_altitude(request): return 1800.0 # actual apogee was about 1854m if launch_name == "genesis_launch_2": return 413.0 # actual apogee was about 462m + # if launch_name == "legacy_launch_1": + # return 600.0 # actual apogee was about 650m return 1000.0 # Default altitude From 9ebaaeb6140acf89ffe4e2bfea93c5716f25ee6a Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 22 Jan 2025 22:26:29 -0500 Subject: [PATCH 2/5] Try to debug CI failure --- .github/workflows/integration_tests.yml | 2 +- .github/workflows/unit_tests.yml | 2 +- uv.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 5f24293f..8adf6b92 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -30,7 +30,7 @@ jobs: python-version-file: "pyproject.toml" - name: Install the project - run: uv sync + run: uv sync --verbose --group dev - name: Run integration tests timeout-minutes: 3 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 289a24c4..9650e468 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -30,7 +30,7 @@ python-version-file: "pyproject.toml" - name: Install the project - run: uv sync + run: uv sync --verbose --group dev - name: Run tests with coverage run: | diff --git a/uv.lock b/uv.lock index cb5d6667..8eb27527 100644 --- a/uv.lock +++ b/uv.lock @@ -3,7 +3,7 @@ requires-python = ">=3.13" [[package]] name = "airbrakesv2" -version = "0.1.0" +version = "1.1.0" source = { editable = "." } dependencies = [ { name = "colorama" }, From d4a735e9e98e26df0e77f4fc3ac64fbcb90b4d2d Mon Sep 17 00:00:00 2001 From: DirtyPi09 Date: Fri, 24 Jan 2025 15:38:58 -0500 Subject: [PATCH 3/5] servo --- airbrakes/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airbrakes/constants.py b/airbrakes/constants.py index ce067a1f..67c924be 100644 --- a/airbrakes/constants.py +++ b/airbrakes/constants.py @@ -28,8 +28,8 @@ class ServoExtension(Enum): MIN_EXTENSION = -0.75 MAX_EXTENSION = 0.055 - MIN_NO_BUZZ = -0.72 - MAX_NO_BUZZ = 0.05 + MIN_NO_BUZZ = -0.725 + MAX_NO_BUZZ = 0.01 # ------------------------------------------------------- From d758bc6e708e8165576f7406116f7d9ca37cc0f4 Mon Sep 17 00:00:00 2001 From: wlsanderson Date: Fri, 24 Jan 2025 19:01:11 -0500 Subject: [PATCH 4/5] sim config legacy masses --- airbrakes/simulation/sim_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbrakes/simulation/sim_config.py b/airbrakes/simulation/sim_config.py index fa46a351..d5b4ecea 100644 --- a/airbrakes/simulation/sim_config.py +++ b/airbrakes/simulation/sim_config.py @@ -96,7 +96,7 @@ def __init__( motor="AeroTech_J500G", airbrake_retracted_cd=np.array([[0.05, 0.2, 0.3], [0.5, 0.445, 0.43]]), airbrake_extended_cd=np.array([[0.05, 0.2, 0.3], [0.65, 0.595, 0.58]]), - rocket_mass=np.float64(5.103), + rocket_mass=np.float64(5.76), reference_area=np.float64(0.008107), airbrakes_reference_area=np.float64(0.00487741), air_temperature=np.float64(10), From 2537d5b9895cd8bfb2d0f1e5eda432cf5dab458f Mon Sep 17 00:00:00 2001 From: DirtyPi09 Date: Sat, 25 Jan 2025 11:42:42 -0500 Subject: [PATCH 5/5] constant change --- airbrakes/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbrakes/constants.py b/airbrakes/constants.py index 67c924be..7c778a5a 100644 --- a/airbrakes/constants.py +++ b/airbrakes/constants.py @@ -28,7 +28,7 @@ class ServoExtension(Enum): MIN_EXTENSION = -0.75 MAX_EXTENSION = 0.055 - MIN_NO_BUZZ = -0.725 + MIN_NO_BUZZ = -0.72 MAX_NO_BUZZ = 0.01