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

Question about extracting meaningful data from launch and exporting "Design Report" pdf with orhelper #4

Open
yuriachermann opened this issue Sep 23, 2021 · 4 comments

Comments

@yuriachermann
Copy link

Hey, SilentSys!

I was wondering if it's possible to retrieve some important values from the rocket and the launch using orhelper, like:

  • Mass
  • Stability
  • CG
  • CP
  • Altitude
  • Flight Time
  • Time to Apogee
  • Optimum Delay
  • Velocity off Pad
  • Max Velocity
  • Velocity at Deployment
  • Landing Velocity

And export as well the Design Report pdf file.

Do you have any idea on how to do that?
Thanks in advance!

Att,
-Yuri Achermann

@SilentSys
Copy link
Owner

Yes. See the FlightDataType enum in _enums.py for all that is available. You will use Helper.get_timeseries() with the enum -- lazy.py and simple_plot.py contain examples on how to use this.

As these values change with time, you will need to interpret the time series yourself depending on what you are looking for (e.g. max value of the velocity time series).

You can also use Helper.get_events() to see at what times deployment, landing, etc. occur that and then extract that value from the time series if you wish.

@SilentSys
Copy link
Owner

As for the design report PDF, orhelper currently does not have any helper methods for this. You can however look at the OpenRocket Java code and call whichever function is required. I could add this feature to orhelper in the future if it is useful.

@yuriachermann
Copy link
Author

Exporting the design report but mainly adding new motors throw the script would be amazingly useful for my applications.
I can try to implement this but I know very little of Java... If you could just point me the way would be great!

@SilentSys
Copy link
Owner

Helper.load_doc() is a great simple example on how to interact with java from Python, its quite intuitive/natural really. All the objects constructed and methods called in that function are from Java. You can look at the jpype docs if you want to learn more about this.

When referencing OpenRocket code, you want to look at commit f3440bac6846fd60da5dcac76e772f0539541e69 as that is the release for v15.03. It looks like the printing and design report stuff is in openrocket/swing/src/net/sf/openrocket/gui/print/. Aka net.sf.openrocket.gui.print in Java or accessible in the Python Helper by self.openrocket.gui.print.

Not sure exactly what you mean by adding new motors, but I recommend you clone the OpenRocket repo, checkout that commit hash, and then use a Java IDE to search around for what you need.

If you use an IDE like PyCharm, I find it useful to place a breakpoint somewhere in your Python project and then you can use the evaluation feature to inspect and play with all the Java classes and variables.

If you do implement this, please open a pull request so that we can make that feature available to everyone.

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

No branches or pull requests

2 participants