Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Hardware & Software Help
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Hardware & Software Help Hardware & Software related questions & help.

Reply
 
Thread Tools
Old 02-29-2020, 12:35 AM   #1
vanhayes
Orbinaut
Default Pulling data from .pos, .att. and .atc files in real time

Hello everyone,

I'm a college student, and I want to recreate a spaceship cockpit to do more realistic simulations. I intend to use orbiter for this because I've played around in Orbiter for a while and I have always been happy with the results. My intention to make this happen is to create a link between the orbiter software and a third party program (yet to be decided but currently using MATLAB just to observe data in an early stage) that can interpret what is happening in the simulation and any buttons or switches pressed by me outside the simulation.

The first step to this is for me to get familiar with collecting data from the simulation while it is running. I've done some research mostly aimed at starting a recording and using the playback data in real time. I've found many documents that explain the layout of the data inside the files under the "flights" folder, but i have yet to figure out how to actually open the files and look at my own data. When i try converting them, it usually results in a few data points but with terrible resolution.

Does anyone have any opinions/ideas on how i could either A. get the data out of these files quickly and efficiently or B. get the simulation to spit out live data better than through the playback capability.

Thanks in advance

p.s. I am not a very experienced software person, part of why I'm doing this project is to try to learn some software stuff. If its a complicated solution ill probably have questions to ask.
vanhayes is offline   Reply With Quote
Old 02-29-2020, 08:27 AM   #2
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

I have no idea what Matlab allows for importing such data - could you also poll the data from a webservice for example?

If yes, you could write a plugin to provide the data.

I know that there used to be solutions for flightdeck builders, but I am not sure if they still work with the current version.

AFAIR Project Apollo has a networked telemetry module for itself, if you limit yourself to this add-on, you could use this plugin for getting the data into matlab.

This here is a client using this data.

https://github.com/indy91/telemetryClient
Urwumpe is offline   Reply With Quote
Old 02-29-2020, 05:57 PM   #3
asbjos
tuanibrO
 
asbjos's Avatar
Default

I haven't done this before, while others have. So take my advice with a grain of salt.

First, this is not what the flight recording feature was made for, so it will probably be very difficult at best to use this for the interface.
If you decide to use it, though, you can change the sampling resolution in the dialog box.

You can get out more data and better resolution by writing your own recording addon, either in C++, and possibly the Lua interface (haven't tried this myself).
It could look something like this:
PHP Code:
// When you initialise the addon
vesselLogFile oapiOpenFile("myFile.txt"FILE_OUTROOT);

// Every timestep
VECTOR3 pos// example
GetRelativePos(GetSurfaceRef(), pos); // example
char vesselLog[256];
sprintf(vesselLog"%.3f\t%.3f\t%.3f\t%.3f\t%.3f"simtpos.xpos.ypos.zGetPitch() * DEG);
oapiWriteLine(vesselLogFilevesselLog);

// When you exit the simulation
oapiCloseFile(pitchDataLogFileFILE_OUT); 
You can probably extend this to also write out any key presses.

But to actually interact with an addon, like having a physical switch for the DeltaGlider's nosecone, you will in the end need close to full access to the source code of the addon you want to connect with, or hope that every switch is backed by a keyboard shortcut.
Some addons share their sources, some do not. If they do, you'll then have to write in support for your physical switches. Difficult, but it is possible, and has been done before, as I said earlier.

But good luck, and of course you are always welcome to ask for help if encounter problems.
asbjos is offline   Reply With Quote
Old 03-02-2020, 03:48 PM   #4
vanhayes
Orbinaut
Default

So these two responses and some more research on my end make it seem like its much more viable to just program my own addon that records and transmits data, rather than hijacking an already existing method in the game like the playback files. Would there happen to be any examples of this online similar to what I'm working on?
vanhayes is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Hardware & Software Help

Tags
attitude, data, playback, position, velocity


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 07:21 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.