GithubHelp home page GithubHelp logo

qtrocket / qtrocket Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 3.0 17.76 MB

Model Rocket Simulator written in C++ and Qt

License: GNU General Public License v3.0

C++ 99.68% CMake 0.32%
rocket rocketry simulation simulator

qtrocket's Introduction

qtrocket

An open source model Rocket Simulator written in C++ and Qt Toolkit, coming soon!

Why?

Because it's fun! Model and High Power rocketry are enjoyable hobbies that teach model building and inspire people to keep learning. For me, part of that learning process includes learning more about the aerodynamics of rocket flight, and what better way to learn than write a simulator?

There are already open source rocket simulators out there (e.g. OpenRocket), but this is another take on that idea. For one, this is written in C++ and OpenRocket is written in Java, but more importantly, I hope to engineer this in a way that is as modular as possible from the standpoint of the parts, components, and concepts involved in modeling a rocket. That way, this can serve not only as a model rocket design program, but a platform for people to learn about how rockets fly by building and integrating their own test parts and models easily. This way QtRocket may serve as a learning platform not just for me, but for others as well.

Why Release An Unfinished Product?

Well, first of all it isn't actually released yet. But it is public because I'm always interested in getting any feedback others may have. I'm doing this to learn as well, and if you have any pointers, I'd love to hear them! And if you want to contribute, well, please do! Let's talk :)

External Build Dependencies

  • Boost libraries. On Windows this is hardcoded to v1.82.0, but only because I'm not sure how dependencies work on Windows
  • Qt6 (You can download it for free for Open Source use here: https://www.qt.io/download)
  • Other dependencies are handled within the CMake build system
  • Maybe something else I'm forgetting about? If you find something not listed that isn't a standard install, let me know

How To Use It

First, it's still in the very early stages of development, but it can propagate objects through an atomosphere with a given coefficient of drag, mass, and motor.

When you first open qtrocket, you're presented with the main window: Main Window

The main window thus far has been centered around testing the core physics engin. As you can see, there are several fields that you can edit:

  • Initial Velocity - This is an initial vertical velocity off the launch rod or rail
  • Angle - Currently disabled. If the rocket launches at an angle, this would be it. Currently it is disabled and set at 90 degrees from horizontal, aka vertical.
  • mass - The mass of the rocket in kilograms (not including the motor)
  • Cd - The coefficient of drag of the rocket
  • Time Step - The time step used by the simulator, in seconds. Defaults to 0.01 seconds.

Once you fill out these fields (or just accept their defaults), you are ready to load a motor. The "Load RSE Database File" button will open a file browser to allow you to select a RockSim engine database file. One is included in the data/ directory of qtrocket that holds some AeroTech motors. After selecting a motor, you can click on the "Set Motor" button. This will add the selected motor to the rocket, and use it to launch the rocket.

Once you have selected and added the rocket motor, click "Calculate Trajectory". A new dialog will appear (if the plot is empty, just click the "Plot Altitude" button): Alt text From here you can also plot velocity by clicking "Plot Velocity": Alt text

And, plot the thrust curve of the motor you selected.

Thrustcurve.org integration

There is another feature, in that qtrocket integrates with the excellent online motor database thrustcurve.org. From the main window, click "Get Thrustcurve Motor Data". A new window will open:

Alt text

In order to use it, you first must click "Get Metadata". Then you can select the manufacturer, motor diameter, and impulse class.

After filling out those combo boxes, click "Search". From there, you can search all available motors with those criteria. After choosing one in the combo box, click "setMotor", and that motor's thrust curve will be displayed in the plot.

Known Issues

  • It doesn't do much
    • I know, but it's just a little fella and it's still growing ;)

qtrocket's People

Contributors

cthunter01 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

qtrocket's Issues

Add NoseCone Part

Add NoseCone abstract part. It should have a getAeroForces() virtual method, and a getWeightedCM() method that returns the product of mass and CM (center of mass)

Add ConicalNosecone implementation. It should implement getAeroForces() and getWeightedCM() for a conical nose cone.

Add this to the model::Rocket class so that the propagator takes into account the new methods in determining forces and accelerations.

Add local level coordinate frame to propagator

The current propagator only deals works with the local body frame. This isn't (quite) a bug yet since flights are always perfectly vertical, but any deviation from vertical will cause a problem. It just happens to work currently since the body frame and local level frame are entirely coincident. Any rotation between the frames will result in meaningless values in the position component of the state vector

The first three elements of the state vector are the problem (x, y, z positions). These are in the body frame, and it doesn't make sense that they be integrated over multiple steps since that frame potentially rotates at every time step. They should only represent the change in position for a single time step, and that change needs to be integrated inside a local level coordinate frame that takes into account the proper transformation from body to LL frame, and then integrates that.

Add Fins Part

Add Fins abstract part. It should have a getAeroForces() virtual method, and a getWeightedCM() method that returns the product of mass and CM (center of mass)

Add SquareFins implementation. It should implement getAeroForces() and getWeightedCM() for a 3 Square fins.

Add this to the model::Rocket class so that the propagator takes into account the new methods in determining forces and accelerations.

Investigate using CMake in place of qmake

As the native build system for Qt, qmake was chosen as the build system for QtRocket.

CMake supports some additional features that would be useful for QtRocket, for instance, foreign repositories and automatically fetching and building third party dependencies. (see issue#1).

CMake is supported by many IDEs natively as well, and more people are likely familiar with it than they are with qmake.

Add BodyTube Part

Add BodyTube abstract part. It should have a getAeroForces() virtual method, and a getWeightedCM() method that returns the product of mass and CM (center of mass)

Add CardboardBodyTube implementation. It should implement getAeroForces() and getWeightedCM() for a cardboard body tube.

Add this to the model::Rocket class so that the propagator takes into account the new methods in determining forces and accelerations.

Help QtRocket build on Windows

As someone who primarily develops on Linux and FreeBSD, I am unfamiliar with building software for Windows. I chose Qt for its cross-platform capabilities, and focus on strict ANSI C++ so that this project might be useful to everyone.

It would take someone with Windows development experience much less time I'm sure to make QtRocket build and run on Windows than I will take to figure it out.

I anticipate this involving bundling several third party sources with the project (libcurl, libjson-cpp, fmtlib) into a third-party directory. Then building these libraries on the fly as needed, which would take care of ensuring the built libraries function and link correctly on all platforms that qtrocket is built on. This, as opposed to bundling pre-built libraries and simply just linking them in when qtrocket is built.

Connect the SimulationOptions Window to QtRocket

The SimulationOptions window currently exists, but it doesn't have any effect.

Connect the SimulationOptions to QtRocket so that changes within this window affect changes to the application. e.g. changing the Time Step in the window sets the timeStep for the simulation.

Same for the Gravity Model, and Atmospheric Model. There is currently only a single Integrator model, so it should only have RK4 in the combo box as an option. Gravity Model should have ConstantGravity and SphericalGravity, and Atmosphere Model should have Constant and USStandard76

The OK button should say "Apply", and the Cancel button should close the window without changing any values

Create a better icon

The current icon is a little lame. Anyone with graphic design skills can make a better one I'm sure. ๐Ÿ˜

Help QtRocket build and run on Mac (Big Sur or newer)

Help QtRocket build and run on Mac OS 11 or higher (Big Sur or later).

After Windows, this is the remaining big OS player. Once we have the initial builds and project files updated and supporting Linux, Windows, and Mac, it should be easy to keep these platforms supported going forward.

It'll be good to establish support for all of these early on.

Remove the Propagator from the Rocket. That relationship is inverted from what it should be

Having a propagator be a member of the Rocket model has led to a difficulty in propagating the rocket in anything other than perfectly vertical flight.

The current state vector is both body and world (because the Rocket doesn't know anything about the world). But in order to do proper 3dof and 6dof simulations, we have to track world coordinates and body coordinates independently. These are necessary components of the propagator, so the Rocket can't have a propagator. But a propagator can have a rocket... So refactor this.

First MVP is to still have successful 1DoF simulation, but utilizing the new framework. A follow-on issue will be to introduce world coordinates to the propagator, which should enable proper 3DoF.

Add MotorModel database to QtRocket class

Currently there is just a std::vectormodel::MotorModel being passed around and manipulated, but this needs to be reigned in. There should really be a single interface to the MotorModels that offers services like search, addition, retrieval.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.