Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add post-simulation step callback #758

Open
CWood-sdf opened this issue Dec 20, 2024 · 2 comments
Open

ENH: Add post-simulation step callback #758

CWood-sdf opened this issue Dec 20, 2024 · 2 comments

Comments

@CWood-sdf
Copy link

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

I'm using rocketpy to test airbrake control code that will eventually fly on a rocket. One thing I am working on is the ability to have a ground station that receives updates from a radio. I am simulating this in rocketpy by invoking the airbrakes control code and radio update code in the airbrakes controller function. However, the airbakes controller function is not invoked past apogee, which does not run my code, which causes me to have a data cutoff at apogee.

I could fix this by going over the rocketpy sensor data lists afterward, finding the apogee point, then reinvoking my code with the rest of the sensor data points, but that feels really ugly and bug prone. I would really like to avoid something like this because I would like to eventually test my program's entire lifecycle (launch, burnout, parachute deployment, landing) in rocketpy.

Describe the solution you'd like

The first possible solution is to allow the airbrakes controller function to be called after apogee. However, this feels like a very ugly solution

What I think would be a better solution is to allow the user to specify a callback that is invoked either after every simulation step or after some amount of time has passed in the simulation (similar to the sensor update rates).

Additional context

@Gui-FernandesBR
Copy link
Member

I really recommend you to spend some time reading the Flight class, as most of your answers will be found there.

RocketPy has different flight phases (rail, free flight, descent under parachute).
When a parachute is deployed, there's no reason - simulation-wise - to keep feeding the airbakes, since they will no longer be used.

Just to be clear: are you saying the air brakes do not work after apogee, even when you launch the rocket without parachutes? If so, then we have a good problem to investigate.

All in all, I believe your issue's title and request seems pretty fair. We can discuss more before solving this.

@CWood-sdf
Copy link
Author

Sorry if I was not very clear, I do not want to update airbrakes code after the burnout/parachute phase. I would like something that can invoke listening/observing callbacks during the entire simulation lifecycle. I checked all the def add_ functions in the Flight class and I could not find something that matched this description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants