Coder Social home page Coder Social logo

johan-kallstrom / j6dof-flight-sim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chris-ali/j6dof-flight-sim

0.0 1.0 0.0 66.44 MB

A high fidelity 6DOF flight simulation that the user can fly themselves or run to analyze an aircraft's flight dynamics

License: GNU General Public License v3.0

Java 99.77% Shell 0.23%

j6dof-flight-sim's Introduction

Java Flight Simulator

A Six Degree of Freedom (6DOF) Flight Simulator Written in Java by Chris Ali

This program was written to apply my knowledge and background in Flight Dynamics to build my Java language skills. It can run as a simple analysis tool for flight dynamics, as well as a real time simulation for pilot-in-the-loop use. When configured as a pilot in the loop simulation, a LWJGL out-the-window display opens and the user can control the simulation using a joystick or keyboard.

One day I'd like to tie objectives or a scoring element into the simulation to make it a game as well.

flight1

flight2

flight3

analysis

Assumptions and Simplifications

  • JavaFlightSim assumes a non-rotating Earth.

  • The aircraft is a rigid body, with a constant mass.

  • A simple ground reaction model is implemented, but is unstable while on the ground stationary and on hills

  • Only a simple propeller engine model is implemented for now. No engine effects (fuel burn, propeller effects) are modeled yet

Future Ideas

  • Selectable starting locations (in air or on ground)

  • Configurable weather and time of day

  • Use of USAF Digital DATCOM to calculate stability derivatives for creating custom and/or more accurate aircraft

Libraries

  • The Apache Commons Math libraries perform the numerical integration (Runge-Kutta) necessary to make the program tick.

  • jFreeChart libraries are used to graph the aircraft's response.

  • LWJGL is used to create the out the window display and sounds using OpenGL through GLFW and OpenAL

Reference

  • The 6DOF state equations come from Small Unmanned Aircraft: Theory and Practice by Beard, R.W. and McLain, T.W.

  • Trimming method and other simulation strategies come from Principles of Flight Simulation, Allerton David

Building and Development

  • Maven is required to build project and generate natives

  • When setting up your IDE to develop, add the VM argument:

    -Djava.library.path=natives/

    and one of the two following command line arguments to run using JavaFX or Swing GUIs:

    LWJGL_SWING LWJGL_JAVAFX

  • Currently being developed with Java 11, but should be compatible with Java 14 and Java 8

  • Running the build script ./buildJavaFlightSim.sh will execute the Maven package task and package all required dependencies and natives

  • buildJavaFlightSim.sh should work in Windows if run through WSL shell or Cygwin

j6dof-flight-sim's People

Contributors

chris-ali avatar dependabot[bot] avatar

Watchers

 avatar

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.