Git Product home page Git Product logo

ysimi's Introduction

YSIMI Interactive Tuning Tools for FlightGear's YASIM Flight Dynamics Model

Yasim FDM uses a configuration file to create its FDM and can supply tabulated Lift, Drag Tables and a solution summary text. These python tools automatically generate configuration files and plotting data while key elements of the configuration files may be adjusted on an interactive web interface.

YASim Simulator Interactive ysimi.py is the app with latest list of YASim parameters.

YSIMI

ysimi.py

ysimi.py uses python's bokeh package, it serves a live control / plotting interface shown on a web browser. Key elements in a YASim configuration file may be altered by sliders in the web app while Lift / Drag curves are updated with live plots.

At the same time an updated YASim configuration file is re-written so that a FlightGear session may instantly reload with updated configuration ready for testing.

Installation

Pip-able systems

ysimi.py is a python script, it gets served as a web page by the bokeh package. After python 3 is properly installed on your system check if the pip package manager is installed and then check for and, if needed, have pip install bokeh, pandas

For linux (Fedora)

After python3 is installed then follow the bokeh guide to installation. Use pip to install bokeh, pandas,.. if needed: install other packages, see beginning of ysimi.py

Windows

For Windows, here are some great guides. When you install python be sure to check the button to add python onto the system path

The guides show you how to check if each is installed.

Usage

It needs a copy of the FlightGear model's YASim configuration named [dddd]-yasim-inpt.xml where [dddd] is the current working directory, for example user/moi/[dddd]. Use the prefix name of the original's yasim config makes linking convenient. It is started by running in a command window:

bokeh serve ysimi.py

The command then displays on a web browser at URL: http://localhost:5006/ysimi On the browser Lift, Drag, MIas plots are updated live with slider input. The console are updated key YASim solution results that affect the model's motion.

An example workflow details are commented at the start of file: ysimi.py

Buckaroo's Yasim Reference

Running Real-Time Plots

Make a working directory with a short name denoting the model

cd user/moi
mkdir myModel; chdir myModel
copy ysimi.py into this working folder
copy / create a base configuration file from the YASim configuration file(s) of interest :
cp /pathTo/fgaddon/Aircraft/theModel/model-yasim.xml  myModel-yasim-inpt.xml

start the server:

pathToEnv/bokeh serve ysimi.py

The standard bokeh port is 5006. It is noted in command line output. Open a web browser at following URL and in a new tab http://localhost:5006/ysimi

To see the effect on Lift and Drag curves slowly adjust any pointer. Each step will trigger a yasim re-run and re-plot of the three curves while on the console a brief message reports key results: Elevator on Approach and Center of Gravity relative to Wing's MAC.

A new YASim configuration is created as adjustments are made at the browser, the new file is named: [dirName]-yasim-outp.xml.

inciMarg.py

A command line logout of Wing Incidence, derived from wheel/centerline geometry, compared to wing stall AoA values read from a named YASim configuration file:

inciMarg.py -f t6/t6-yasim.xml t6-yasim.xml CL incidence: 11.294 Wing incidence: 2.000 Total Incidence : 13.294 Wing AoaStall: 15.000 % Margin: 11.374

ysimi's People

Contributors

bitwisetech avatar kaklik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ysimi's Issues

YASim real-time FDM interaction - Rotorcraft support?

Hello,
I am very interested in your code. Do you know about a method that could be able to run YSIMI with a rotorcraft model? I am especially interested in the autogyro.
But unfortunately, the rotor in the rotorcraft model contains "hidden" values which needed to be preset, before running the simulation for a specific speed/altitude, orientation.
I know at the least about rotor RPM and rotor controls (Pitch, Roll and collective).

It is related to the question, about the possibility to run YASim simulation outside of FlightGear. Do you know about some method that could allow using YASim flight simulation without visual output?

Unable to get it work

Hi, I want to use yasimi, to tune my YASim models, but I am not able to get into work.

If I run the bokeh server I get the following No columns to parse from file error:

$ bokeh serve ysimi.py
2022-01-19 19:51:04,555 Starting Bokeh server version 2.1.1 (running on Tornado 5.1.1)
2022-01-19 19:51:04,555 User authentication hooks NOT provided (default user enabled)
2022-01-19 19:51:04,556 Bokeh app running at: http://localhost:5006/ysimi
2022-01-19 19:51:04,557 Starting Bokeh server with process id: 24022
# 1378  HS: -4.46 deg  ApElv: -0.383  CG  34% MC   15% WB  WngInc:9.4d 67.4% St @ 14.0d 
2022-01-19 19:51:11,471 Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x7f605473c490>: No columns to parse from file
File "parsers.pyx", line 521, in pandas._libs.parsers.TextReader.__cinit__:
 Traceback (most recent call last):
  File "/home/kaklik/.local/lib/python3.8/site-packages/bokeh/application/handlers/code_runner.py", line 197, in run
    exec(self._code, module.__dict__)
  File "/home/kaklik/repos/TF/ysimi/ysimi.py", line 1078, in <module>
    lvsdDfrm  = pd.read_csv(lvsdFid, sep='\t')
  File "/home/kaklik/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 605, in read_csv
    return _read(filepath_or_buffer, kwds)
  File "/home/kaklik/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 457, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/home/kaklik/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 814, in __init__
    self._engine = self._make_engine(self.engine)
  File "/home/kaklik/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 1045, in _make_engine
    return mapping[engine](self.f, **self.options)  # type: ignore[call-arg]
  File "/home/kaklik/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 1893, in __init__
    self._reader = parsers.TextReader(self.handles.handle, **kwds)
  File "pandas/_libs/parsers.pyx", line 521, in pandas._libs.parsers.TextReader.__cinit__
pandas.errors.EmptyDataError: No columns to parse from file
 
2022-01-19 19:51:11,588 WebSocket connection opened
2022-01-19 19:51:11,589 ServerConnection created

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.