Simpit - Orbiter interface?

ahunn

New member
Joined
Jul 21, 2011
Messages
39
Reaction score
0
Points
0
Hi everyone, I have my nose buried in catalogues busily planning what I need for concept simpit featuring Orbiter 2010 SP1, and it seems to me there are a number of significant hurdles, particularly for a non-programmer like me.

Problem One, Keeping the physical simpit synchronized with the simulated vessel.
One of the biggest problems I can see is keeping the physical cockpit in sync with the simulated vessel. I have already decided that most toggle switches actually need to be center sprung momentary switches, that will reduce the chances of getting things all out of synch, but I really need to have physical lights reflect the state of the sim, for example I plan on using an illuminated red lock in push button switch as the APU control, but if the APU runs out of fuel whilst docked for example, I could refuel the APU, then when I press my APU button (which is currently on and glowing red) it will switch off and the light will go out, but the vessels APU will start.. so now I have a simpit with a physical APU off condition, but the vessels APU is running... to counter that, I could use a momentary push button with an adjacent LED that reflects the actual state of the APU..

Now how the hell do I do that?

Problem Two, Visuals and Visual Systems Readouts.
I am really hoping there is a way to provide clean (no HUD) out the window visuals for projection or big-ass TV.. and then also feed things like fuel state, hull temp, HUD graphics, etc etc into external MFD's or similar for presenting on additional (ideally networked) displays. I see Orb Connect is out there, but I have no clue if it will be of any use, A think it may be possible to hack around with some remote "area" displays but that would be a real hack and probably not something I would really want to do.

Aside from those two fairly massive hurdles, it should be a breeze :)

Anyone have solutions to the big two issues I have mentioned?
 

sitha241

Member
Joined
Feb 22, 2010
Messages
278
Reaction score
0
Points
16
Location
Zagreb

ahunn

New member
Joined
Jul 21, 2011
Messages
39
Reaction score
0
Points
0
Yep I have seen both of those threads, and so far as I know, I don't think anyone has a solid solution for the two main problems in my post. I know its possible to mitigate some of it, by using spring to center momentary switches or buttons, and being "careful" not to get the pit out of sync with the sim, but to be honest, when faced with what could be a considerable spend, I want to know that I can make it work right before I start... I want total immersion, rather than a PC sim with some physical buttons :)
 

sitha241

Member
Joined
Feb 22, 2010
Messages
278
Reaction score
0
Points
16
Location
Zagreb
I know :)
I am planing of building one like you with mfd-s and fuel gauges and switches, but your problem is lack of knowledge in electronics..messon managed to connect virtual buttons for who are not represented in physical keyboard with switches, and I saw on internet guys made real deal with backlight and on/of via arduino..
If you want external mfd check that android thing from kamaz or use web mdf..there are options just take some time to search forums, but not just here, for some things check some other simpit forums they probably have more people here and more ideas..

Cheers
 

ahunn

New member
Joined
Jul 21, 2011
Messages
39
Reaction score
0
Points
0
I know :)
I am planing of building one like you with mfd-s and fuel gauges and switches, but your problem is lack of knowledge in electronics..messon managed to connect virtual buttons for who are not represented in physical keyboard with switches, and I saw on internet guys made real deal with backlight and on/of via arduino..
If you want external mfd check that android thing from kamaz or use web mdf..there are options just take some time to search forums, but not just here, for some things check some other simpit forums they probably have more people here and more ideas..

Cheers

Actually its not the electronics that are the real problem, its figuring out if there is a way of reading the state of the vessel from Orbiter. And I have no idea if that's possible, although the fact that the scenario file which is text based contains everything I would need makes me hopeful that this is still possible.
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
One of the biggest problems I can see is keeping the physical cockpit in sync with the simulated vessel.
With my DGIV simpit, I ran into the same problem. My solution is, before the simulation starts, compare the orbiter state to the current simulator state and have the user toggle switches until the states are identical. Right now, I am manually adjusting the switches to match the orbiter state, saving a "state" file (a format I made to work with my state-checker program) and then using state files to make sure the simulator is ready to go pre-simulation.

Eventually, I want to make a scenario parser to turn simstate into a state file readable by my program. Essentialy, before the simulation starts (before clbkSimulationStart), my parser would take the scenario selected, parse into a state file, and feed it into my state checker which would pop up dialog boxes with messages like "Turn fuel hatch to off position, Set hover doors to Auto, etc" until the orbiter state and sim state were the same.

For example parsing, the DGIV ship scenario code includes the following representation of the orbiter switch positions:
Code:
  But1Cockpit 0 0 0 2 2 2 0 2 2 2 2 2 2 2 2 1 1 2 1 1 1 4
  But2Cockpit 0 0 0 0 0 0 0 0 2 2 2 2 2 0 3 0 0 0 1 1 0 0
  LifeBut1State 0 2 1 2 1 2 2 2 2 2 2 2 2 0 0
I will (hopefully) convert this into a state file which looks something like this
Code:
1,0
24,1
52,1
53,0
54,1
105,1
107,0
where the number before the comma is the physical switch number, and the number after the comma is the desired pre-simulation start state.

As to your specific problem of the APU turning off when running out of fuel, you could track the APU fuel level using the VESSELSTATUS2 method described below and send a command to your simpit to turn off the APU light when fuel remaining = 0.

ahunn; said:
I am really hoping there is a way to provide clean (no HUD) out the window visuals for projection or big-ass TV.. and then also feed things like fuel state, hull temp, HUD graphics, etc etc into external MFD's or similar for presenting on additional (ideally networked) displays. I see Orb Connect is out there, but I have no clue if it will be of any use, A think it may be possible to hack around with some remote "area" displays but that would be a real hack and probably not something I would really want to do.

I used ExternalMFD to display MFD's and used AHK to position them in the simpit.

The other things are more difficult. The VESSELSTATUS2 struct exposes information on the vessel such as vessel docked to, fuel propellent handles (can be used to get fuel state), thruster handles, current thrust, location, and velocity. Any of these could be displayed in some form throughout the simpit.
Unfortunately, the Orbiter SDK does not support heating, and every addon developer designs their own heat equations based on vessel information gathered from functions like
Code:
double VESSEL::GetDynPressure () const
double VESSEL::GetAtmDensity () const
double VESSEL::GetAirspeed () const
These calculations are inside the "black box" of the vessel's compiled module and cannot be accessed via the API.
tl;dr: No heating information can be accessed.

Good luck! :cheers:
 

ahunn

New member
Joined
Jul 21, 2011
Messages
39
Reaction score
0
Points
0
Thanks meson800, that's a very helpful post. I am not a programmer, but even so I have an idea now what I am up against, so your post is very helpful indeed, many thanks.

Time for me to go and figure out what VESSELSTATUS2 is :)
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
All of the information is in orbiter_root\Orbitersdk\doc\API_Reference.pdf

Also, when you get to fuel, you don't have to use VESSELSTATUS2. I used
Code:
PROPELLANT_HANDLE mainHandle =simVessel->GetPropellantHandleByIndex(0);


float rawMain = ((float)simVessel->GetPropellantMass(mainHandle)) / 
	((float)simVessel->GetPropellantMaxMass(mainHandle));
to get fuel remaining.

Good luck with C++ and the API! ;)
 

ahunn

New member
Joined
Jul 21, 2011
Messages
39
Reaction score
0
Points
0
Thanks again meson800, I am still juggling with how it all fits together, I am traveling for work at the moment so not getting a lot of time to dedicate to the research.

I will have a read of the API reference as you suggested :)
 
Top