kwikius / fg_ext_fdm Goto Github PK
View Code? Open in Web Editor NEWTest of controlling FlightGear externally
License: GNU General Public License v3.0
Test of controlling FlightGear externally
License: GNU General Public License v3.0
Good afternoon @kwikius
I am interested in your project, and if you allow me, I would like to ask a few questions.
I have the opportunity to fly a real aircraft, but this is a very rare event and so I decided to try to get the data I need from the simulator.
As a hobby, I sometimes fly in MSFS2020
, but as far as I know, this simulator is not suitable as a source of reliable data, and its hardware requirements are enormous.
On a real plane in flight, I receive data from gyroscopes (x, y, z - in angular velocities - dps or radians), and from accelerometers (x, y, z in 1G or 9.81 m/s/s)
The most important thing is that in real flight I can get up to 100-200 Hz
to record data samples.
Because the code algorithm on the STM32
microcontroller that I am testing requires a high frequency of data updates from MEMS
sensors in order for the Kalman
filtering algorithms to work properly.
So I was puzzled by this question and found the flightgear simulator, but I did not find enough information to get the same frequency (about 100 Hz) data about gyroscopes and accelerometers from the simulator.
I read somewhere that the frequency of data through the UDP
will be comparable to the FPS
of the simulator, and that in the best case it will be about 30 Hz
.
Although, in fact, I can get at least 30-50 Hz
and that will already be a success!
Upon requests to obtain data from the simulator, I received answers from the search engine about
I tried to output data to the serial port COM9
, but I'm probably doing something wrong.
I work in Windows 10
, but I also have Ubuntu 22.04
on a virtual machine.
My algorithm is the following.
*xml
files, I am trying to display the data specified in this file insgns-imu.xml
cmd
console into the folderC:\Program Files\FlightGear 2020.3\bin>
and I enter the command
fgfs --generic=serial,out,10,COM9,9600,insgns-imu
The flightgear simulator starts, but in the console it writes about the impossibility of opening the specified port and some strange characters.
C:\Program Files\FlightGear 2020.3\bin>Now checking for plug-in osgPlugins-3.6.5/osgdb_nvtt.dll
1.19 [WARN]:general Enabling ATI/AMD viewport hack
5.05 [ALRT]:io Error opening serial device "COM9" ═х єфрхЄё эрщЄш єърчрээ√щ Їрщы.
5.05 [ALRT]:io Error opening device: COM9
5.05 [ALRT]:io Error opening channel communication layer.
5.05 [ALRT]:io I/O Channel config failed.
22.68 [INFO]:nasal KMA20 audio panel initialized
22.70 [INFO]:nasal Hobbs system stopped
22.70 [INFO]:nasal Hobbs system stopped
22.70 [INFO]:nasal Starter off
22.71 [INFO]:nasal KI266 dme indicator #0 initialized
22.80 [INFO]:nasal Electrical system initialized
28.23 [INFO]:nasal Astro Tech LC-2 Chronometer Loaded
28.24 [ALRT]:flight Failed to save initial FDM property state
31.60 [INFO]:OSG
31.60 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
31.64 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
32.76 [INFO]:nasal Primer reset to 0
33.63 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.69 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.70 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.70 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.71 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.74 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.74 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.75 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.75 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.76 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.77 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.78 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.78 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.78 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
33.79 [WARN]:OSG PNG lib warning : iCCP: known incorrect sRGB profile
35.00 [INFO]:nasal Garmin 196 loading cities
35.88 [INFO]:nasal Garmin 196 loading cities done
After I couldn’t run simple generic protocol
examples, I started looking at what parameters could be obtained from the flightgear simulator.
I found the fdm
module, as I understand it, this is a flight data model
based on the JSBSim model?
I looked at what parameters there were, but did not clearly find the values of angular velocities from the gyroscopes (perhaps they are called differently there, some kind of angular rate, or something like that).
It became clear to me that receiving data by generic protocol
or even through UDP
would not give me the required data update frequency.
I began to search for information further and found that it is possible to receive data via the telnet
protocol - that’s actually how I found your project.
As far as I understand, you have tried to obtain data from the simulator in order to use it for your purposes, as if this data was obtained in a real flight on an airplane or close to it?
I'm still very confused in terms and technologies.
There is also some kind of Nasal
, which, as I understand it, also allows you to receive data from the simulator.
In general, is it possible to obtain data from a flightgear
, just as they do from MEMS
gyroscopes during a real airplane flight?
Could you help me understand your project with a simple example?
It’s enough for me to figure out how to get one parameter, for example, acceleration along any of the axes.
I looked at what parameters are contained in internal properties, the /orientation
section is the calculated angles in the simulator, and I need initial data from gyroscopes and accelerometers, according to their data, my code in the microcontroller will calculate the values of euler
angles or quaternions
.
On a real aircraft, I will receive this data from MEMS
sensors, like the MPU-9250
or BMI-160
or flight speed from the airspeed sensor or NED
value according to GPS
data.
In general, do you think flightgear
is suitable for replacing a real flight, for testing code, or should you choose another simulator, for example x-plane
?
I hope you are still dealing with such issues and can help me and clarify some things.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.