G-Seat with Orbiter

Phil Smith

Donator
Donator
Joined
Jun 5, 2011
Messages
273
Reaction score
101
Points
58
Location
UK
Hey guys,

Just curious, is it possible to make a g-seat working with Orbiter?
Have some ambitious ideas using that one in my sim pit (which is still being build btw, very slooowly though, updates to follow):
https://bergisons.simpit.info/motion-integrated-g-seat

Theoretically all accelerations values can be extracted from Orbiter sim and send to the seat controller via some driver software. Is there any information regarding this topic? Any help will be much appreciated.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
The general setup I would try is something like this:
Write a simple add-on, that reads the acceleration data you need, then transforms them into the data the seat needs:
Something like:
C++:
double threshold = 0.001; // or whatever
void SeatInterface::clbkPreStep (double simt, double simdt, double mjd)
{
  static VECTOR3 F_last;
  VECTOR3 F;
  VESSEL vessel = oapiGetFocusInterface(); // checks etc. left out for clarity
  vessel->GetLinearMoment (F);
  // transmitt only if change is big enough, to avoid flooding the seat with noise...
  if ( abs(F_last - F) > threshold) {
    // sanity check to avoid HUGE jumps throw you out of your seat ;)
    // ...and possibly time-limit as well (once every 500 ms e.g.)
    if (is_ok()) {
      transmitToSeatViaUSB(F);
    }
    F_last = F;
  }
}
...that's it ;)
How exactly those "translation" (transmitToSeatViaUSB) works and wether you actually use USB or Serial or IOWarrior or ... is of course just details you have to decide.
 

Phil Smith

Donator
Donator
Joined
Jun 5, 2011
Messages
273
Reaction score
101
Points
58
Location
UK
The general setup I would try is something like this:
Write a simple add-on, that reads the acceleration data you need, then transforms them into the data the seat needs:
Something like:
C++:
double threshold = 0.001; // or whatever
void SeatInterface::clbkPreStep (double simt, double simdt, double mjd)
{
  static VECTOR3 F_last;
  VECTOR3 F;
  VESSEL vessel = oapiGetFocusInterface(); // checks etc. left out for clarity
  vessel->GetLinearMoment (F);
  // transmitt only if change is big enough, to avoid flooding the seat with noise...
  if ( abs(F_last - F) > threshold) {
    // sanity check to avoid HUGE jumps throw you out of your seat ;)
    // ...and possibly time-limit as well (once every 500 ms e.g.)
    if (is_ok()) {
      transmitToSeatViaUSB(F);
    }
    F_last = F;
  }
}
...that's it ;)
How exactly those "translation" (transmitToSeatViaUSB) works and wether you actually use USB or Serial or IOWarrior or ... is of course just details you have to decide.
Wow, that sounds promising :) Thank you Kuddel. Will definitely take a look into it; glad it is not a dead end(y)
 
Top