Closed MateusStano closed 1 month ago
Attention: Patch coverage is 94.73684%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 73.33%. Comparing base (
fc6804c
) to head (d730b40
). Report is 3 commits behind head on develop.
Files | Patch % | Lines |
---|---|---|
rocketpy/simulation/flight.py | 93.75% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Trying to build the docs here... look what I've got:
This seems to be due to terminate_on_apogee
making the simulation stop before calling the extra udot with post processing. I will fix it soon
This PR may present a conflict with the #581 , given that both deal with the postprocessing methods. I think we might need to merge some ideas here.
@Gui-FernandesBR ready for a new review!
This PR may present a conflict with the #581 , given that both deal with the postprocessing methods. I think we might need to merge some ideas here.
The best option is to merge your PR first, and then I can change what is necessary here. Its not a big conflict
@MateusStano please let me know when this gets ready for a re-review
@Gui-FernandesBR its ready
@Gui-FernandesBR its ready
Ok, I want to test it locally before approving, so I will take a little longer time to review it.
Pull request type
Checklist
black rocketpy/ tests/
) has passed locallypytest tests -m slow --runslow
) have passed locallyCHANGELOG.md
has been updated (if relevant)Current behavior
The calculations of post-processed variable (i.e. accelerations, forces and moments) are considering only the last state of the air brakes, instead of reconsidering its deployment level.
New behavior
Fixing this issue was quite challenging since we wanted to maintain the freedom of the
Controller
class without big/breaking changes. The complexity here has to do with the fact that whatever object is being controlled (in this case the air brakes) has a state that varies throughout the simulation. There are two ways to go about dealing with this:@cached_property
The second option was implemented. The following was changed on the code:
_reset
method was added to theAirBrakes
class that resets the deployment level to its initial value. This guarantees that running the air brakes will behave equally if twoFlight
initializations are run consecutivelytime_overshoot=False
__retrieve_arrays
method was created that unitesretrieve_acceleration_arrays
andretrieve_temporary_values_arrays
into only one loop and optimizes it. This was done so that the in-simulation post-processing for controllers could be done in only one udot call.Breaking change
Additional information
One thing was changed that changes simulation results. The accelerations used to always be initialized with.
I do not know what this was for and it seems wrong at a first glance. I changed it to be initialized with empty lists instead and all tests are passing.
The initialization with
[[0, 0]]
was introduced in #295, commit https://github.com/RocketPy-Team/RocketPy/pull/295/commits/291d479124bba13599040cd7a673d41cf3f8f721. Maybe @Gui-FernandesBR knows what this was for?