Skip to content

Conversation

@MateusStano
Copy link
Member

@MateusStano MateusStano commented Jun 19, 2022

Pull request type

Please check the type of change your PR introduces:

  • Code base additions (bugfix, features)
  • Code maintenance (refactoring, formatting, renaming, tests)
  • ReadMe, Docs and GitHub maintenance
  • Other (please describe):

Pull request checklist

Please check if your PR fulfills the following requirements, depending on the type of PR:

  • Code base additions (for bug fixes / features):

    • Tests for the changes have been added
    • Docs have been reviewed and added / updated if needed
    • Lint (black rocketpy) has passed locally and any fixes were made
    • All tests (pytest --runslow) have passed locally

What is the current behavior?

Solving Issue #158

What is the new behavior?

The Rocket class now receives the position of the nozzle and of the center of dry mass in relation to any coordinate system. The only requirement is that the coordinate system has one of its axis aligned with the rocket center axis, and all position are in relation to that axis.

The methods Rocket.addTail(), Rocket.addNose(), Rocket.addFins() and Rocket.addRailButtons() have also been altered to receive a position as input. With the position of the CM and of the nozzle in relation to the chosen coordinate system, any other position (given in that same coordinate system) can be calculated in relation to the rockets CM, which is what is needed for the simulation

The following structure is followed for each of the aerodynamic surfaces
1 calculate the surface position in relation to the nozzle
2 calculate the surface position in relation to the dry CM
3 calculate CP as was before

Does this introduce a breaking change?

  • Yes
  • No

Other information

For the changes to work, the assumption that the center of dry mass is always at the front of the nozzle (closer to the nose cone) had to be made

Still need to change all the tests, for now I have only adapted the getting_started notebook

@MateusStano MateusStano self-assigned this Jun 19, 2022
@MateusStano MateusStano added the Enhancement New feature or request, including adjustments in current codes label Jun 19, 2022
@Gui-FernandesBR
Copy link
Member

Gui-FernandesBR commented Jun 29, 2022

@MateusStano did we get any progress here? I mean, the tests are currently not working!

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@MateusStano
Copy link
Member Author

Hey! I changed all the tests now, only one of the flight tests is not working, still looking into it.

Another big change I made is that before the situation where an aerodynamic surface is out of the rocket was not working. Now a helper function def evaluatePositionSurface_Nozzle calculates the position relative to the nozzle of each aerodynamic surface. A series of ifs and elses are needed to be able to evaluate if the surface is on or off the rocket

@Gui-FernandesBR Gui-FernandesBR changed the title Enh/distances vs positions ENH: distances vs positions Jul 3, 2022
@Gui-FernandesBR Gui-FernandesBR linked an issue Jul 3, 2022 that may be closed by this pull request
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The examples regarding apogee by mass and other analysis will have to be adapted later, but for now everything is working fine.

Really appretiate your good work @MateusStano , as someone how already had hard times with distances calculation, I hope this will be an important addition to RocketPy

@Gui-FernandesBR Gui-FernandesBR merged commit fdbb3d0 into hybrid-integration-v2 Jul 4, 2022
@Gui-FernandesBR Gui-FernandesBR deleted the enh/Distances_VS_Positions branch September 10, 2022 22:26
@giovaniceotto giovaniceotto restored the enh/Distances_VS_Positions branch November 10, 2022 01:05
@giovaniceotto giovaniceotto mentioned this pull request Nov 11, 2022
21 tasks
@Gui-FernandesBR Gui-FernandesBR deleted the enh/Distances_VS_Positions branch January 7, 2023 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request, including adjustments in current codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Distances vs. Positions...

4 participants