Skip to content

Conversation

Copy link

Copilot AI commented Dec 20, 2025

Pull request type

  • Code changes (bugfix, features)
  • Code maintenance (refactoring, formatting, tests)

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

RocketPy cannot simulate rockets with motor delay charges (fixed-time deployment) like model rocket motors or high-power motors without avionics. Users must resort to workarounds or cannot accurately simulate kits like Loc-IV powered by Aerotech motors with delay elements.

New behavior

Parachute triggers now accept time-based string formats:

  • "launch + X" - deploys X seconds after t=0
  • "burnout + X" - deploys X seconds after motor burnout

Implementation:

  • Extended Parachute.__evaluate_trigger_function() to parse time-based triggers
  • Added t (current time) and rocket (motor access) parameters to trigger function signature
  • Maintained backward compatibility via parameter count detection (existing pattern)
  • Updated all four call sites in Flight class to pass additional parameters (two original + two added in recent merge)
  • Fixed duplicate documentation line introduced during merge

Example usage:

# Model rocket with 3-second motor delay (like Estes C6-3)
rocket.add_parachute(
    name="Main",
    cd_s=10.0,
    trigger="burnout + 3",
    sampling_rate=100,
    lag=1.5,
)

# Simple timer deployment 5 seconds after launch
rocket.add_parachute(
    name="Drogue",
    cd_s=1.0,
    trigger="launch + 5",
    sampling_rate=100,
    lag=0.5,
)

Testing:

  • 11 unit tests covering parsing, functionality, edge cases, backward compatibility
  • 4 integration tests demonstrating full flight simulations with time-based triggers
  • All existing tests pass including backward compatibility verification

Breaking change

  • Yes
  • No

Additional information

Existing trigger types (callable, float altitude, "apogee") remain unchanged. The trigger function signature extension uses optional parameters with defaults, ensuring zero-impact to existing code.

Merge Compatibility: The implementation has been verified and updated to work correctly with the latest develop branch changes, including new code paths for parachute trigger checking introduced in recent Flight class refactoring.

Original prompt

create a new branch to solve the following issue:

Is your feature request related to a problem? Please describe.

I am simulating a Loc-IV kit powered off of a Aerotech 38mm HP SU DMS Motor - H100W-14A

This kit has no avionics, and instead uses a fixed time delay charge in order to deploy the parachute.

Currently RocketPy does not have the functionality to define the parachute deploy charge as a fixed time event.

This can be either a fixed time from burnout, or fixed time from launch. This depends on if the motor is a core burner or end burner.

Describe the solution you'd like

I would like to be able to specify a time delay, here are the approaches I can come up with.

Adding T to the state vector given in Parachute.triggerfunc().
Adding key word support for flight phases, similar to apogee. IE: Launch then adding a lag.
Adding delay charge to motor characteristics.
Additional context

Here is the code base I am currently working to which this problem is relevant.
https://github.com/AidanPowers/AAE-439-Traj


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add fixed time delay for parachute deployment Add time-based parachute triggers for delay charge simulation Dec 20, 2025
Copilot AI requested a review from aZira371 December 20, 2025 17:13
@aZira371 aZira371 changed the base branch from master to develop December 23, 2025 19:57
@aZira371
Copy link
Owner

@copilot please check the branch is healthy or not check that the code implementation hasnt change due to base brancjh change

Copy link
Author

Copilot AI commented Dec 23, 2025

@copilot please check the branch is healthy or not check that the code implementation hasnt change due to base brancjh change

Branch health check complete ✅

Status: The implementation is intact and working correctly after the merge from develop.

Issues Found & Fixed:

  1. Two new triggerfunc call sites (lines 1064 & 1473 in flight.py) were missing the new t and rocket parameters
  2. Duplicate documentation line in parachute.py

Verification:

  • All 15 tests pass (11 unit + 4 integration)
  • Backward compatibility confirmed with existing flight tests
  • Core time-based trigger functionality intact

Fixed in commit 89d23b9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants