Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Pages: [1] 2 3 ... 5

Author Topic: JSBSim Interface & Interaction  (Read 76175 times)

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
JSBSim Interface & Interaction
« on: December 23, 2012, 04:27:39 pm »

Brano, Angrypig...

I've been spelunking around inside the JSBSim Reference Guide, attempting to correlate the interface that my cockpit currently uses to interact with X-Plane to what it would need to interface and interact with JSBSim.

My understanding at this point is that I would need to connect to JSBSim via a socket, and that the socket would be configured in XML scripts for the aircraft that I'm flying in Anteworld. 

Would it be fair to deduce at this point that Anteworld fully integrates JSBSim, and that the methods one would use to communicate with JSBSim/Anteworld are those found in the JSBSim Reference Guide?  I find that the mental gymnastics might be easier if I consider Anteworld to be the same as JSBSim operating in server mode.

Naturally, any light you can shed on this will be useful.  The learning curve to get to where I am with X-Plane was rather steep, and I can tell that the curve to get to the same place in Anteworld is going to be a good deal steeper.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: JSBSim Interface & Interaction
« Reply #1 on: December 24, 2012, 03:01:16 am »

Angrypig will have to clarify it, as it's his part, but we are using JSBSim as a library. Normally JSBSim can be compiled as an executable or a static library. In order to satisfy the license we are wrapping the static library in a thin dll wrapper, so one can make his own JSBSim derivative and link it with OT.

However, I'm not sure if in this mode it can operate in server mode.
Logged

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: JSBSim Interface & Interaction
« Reply #2 on: December 24, 2012, 12:41:01 pm »

Thanks, Brano.  I'm just trying to drill down to the architecture of how I'm going to establish that link, whether with my own compilation of JSBSim or with a new interface that talks to Anteworld as it runs.  The link's the thing.  I have a hunch that if you've incorporated the full JSBSim code base, even as a DLL, then the data sharing functionality is likely intact. 

It just seems to me that there will be a lot of flight simulation enthusiasts that will appreciate the Anteworld/Outerra environment when it's complete.   A lot of natural phenomenon to explore and enjoy.  Other flight sim worlds seem so "dead" by comparison.  And there's a subset of FS enthusiasts that build up full cockpit systems to sit in and really "suspend disbelief."  I look forward to enjoying this world very much.
« Last Edit: December 24, 2012, 12:44:25 pm by Steve.Wilson »
Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2520
  • #1 Outerra Fan Boy
    • My Youtube
Re: JSBSim Interface & Interaction
« Reply #3 on: December 24, 2012, 01:04:14 pm »

It just seems to me that there will be a lot of flight simulation enthusiasts that will appreciate the Anteworld/Outerra environment when it's complete.   A lot of natural phenomenon to explore and enjoy.

The most interesting part is going to be when you fly boys land and can actually get out of your aircraft to admire it all. It will be very forth wall breaking for you guys I am sure.
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: JSBSim Interface & Interaction
« Reply #4 on: December 24, 2012, 02:11:08 pm »

Indeed.  I can envision a virtual campfire, virtual hotdogs, virtual marshmallows and sleeping out under the virtual stars!  ;)
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: JSBSim Interface & Interaction
« Reply #5 on: December 24, 2012, 04:35:57 pm »

Thanks, Brano.  I'm just trying to drill down to the architecture of how I'm going to establish that link, whether with my own compilation of JSBSim or with a new interface that talks to Anteworld as it runs.  The link's the thing.  I have a hunch that if you've incorporated the full JSBSim code base, even as a DLL, then the data sharing functionality is likely intact. 
I imagine you could use JSBSim, but there will be also our own interface to talk to OT vehicle simulation core. One interface for using OT as an IG, for example. And while currently one can bind to OT interfaces via c++ and javascript, we will have also a networked connection to it. It should give a plenty of options how to connect in various environments. I wonder what kind of connection or what kind of client would be best/simplest to use for hobbyists here.

Logged

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: JSBSim Interface & Interaction
« Reply #6 on: December 24, 2012, 05:06:19 pm »

What kind of interface would hobbyists want?  One that's easy!   8)

Fortunately, anyone trying to connect an external process to Anteworld is likely to be a fairly technically capable individual, with C/C++ at their disposal, as well as maybe Java, Python and other scripting languages. 

My vote, of course, is for the C/C++ based interface since it's the most commonly supported and what I've been using exclusively.  Keep in mind that a good deal of the external interfaces - mainly for LED's and special controllers - all have their own SDK, and in my experience I've seen them mainly support C/C++ and Python.  Those two give the best of both worlds:  a lower level coding capability with lots of power, and access to predefined functions through a more straightforward scripting facility.

How to integrate this will be a design challenge.  But, philosophically speaking, my strongest recommendation is to implement a strategy for external interfacing that mimicks, if not outright copies, similar interfaces for something like either X-Plane or FSX.  X-Plane has a robust plugin SDK, FSX users have an application that *I think* accesses some form of shared memory, and reads/sets values by reference to offsets.  In the main, though, just don't reinvent the wheel. :)

If you have used the entire JSBSim code base as a library in Anteworld, a straightforward networking interface is already built in, and I actually think you may have connectivity available already on a per aircraft basis via XML script.  Take a look at page 58 of the JSBSim Reference Manual and see what you think.

By the way....what do you mean by "IG?" 
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: JSBSim Interface & Interaction
« Reply #7 on: December 24, 2012, 05:15:22 pm »

Image Generator. Getting lots of requests for that, people using their own physics and system simulation and wanting just the world rendering from OT. Normally IG is a simple one-directional link, but if one wants to utilize ground level detail generated by OT, there will have to be a feedback loop providing collision data.
Logged

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: JSBSim Interface & Interaction
« Reply #8 on: December 24, 2012, 05:34:16 pm »

Wow.  I see.  That brings us full circle, Brano.  When I joined this forum I was hoping to do something like that for X-Plane, although I still think that would be a tough blend since you'd have two different collision systems in play.

The ideal interface would be something that would be open source, and exposed all data for reading, writing where appropriate, and all commands.  Further, there would be the ability to create and track new data items as well as new commands.  This heavy customizing would be something completely up to the user, but would interact cleanly with Outerra/Anteworld once successfully compiled.  Hey....I can dream, can't I?  :)
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: JSBSim Interface & Interaction
« Reply #9 on: December 25, 2012, 11:25:47 am »

When I joined this forum I was hoping to do something like that for X-Plane, although I still think that would be a tough blend since you'd have two different collision systems in play.
It is definitely less ideal blend than a FDM directly integrated into OT, increased latency and problematic collisions and all that. Still, in some cases it's usable.

A better coupling will be something we call a black-box interface into OT: an interface that treats your object geometrically as some shapes you define (bounding volume) with specified mass, and gives you ability to generate forces each frame from your simulation. The first part allows integration into the existing physics system, the objects are visible to other and react as they should, gravity and inertia is accounted for.
And externally provided active and passive forces allow people to run their own simulations.

But of course most simmers can be fine with JSBSim running the simulation for them. Though technically JSBSim simulated bodies are treated internally as black boxes too.
Logged

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: JSBSim Interface & Interaction
« Reply #10 on: December 25, 2012, 01:39:33 pm »

To be sure.  In the end, the better running simulation will be the simplest one.  I have little doubt that what cannot be simulated system-wise for a cockpit by JSBSim could be relegated to external applications, as long as there is enough data and control interchange.
Logged

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: JSBSim Interface & Interaction
« Reply #11 on: December 27, 2012, 04:47:06 pm »

More! 

Brano, I just realized something.  You mentioned that you were using JSBSim as a library.  When I was wandering around the Anteworld main directory, I noticed the JSBSim.dll.  It struck me that if I could compile JSBSim as a standalone, then I should certainly be able to compile it as a .DLL.  That's what an X-Plane plugin is anyway...a DLL that the simulator loads at runtime.

So.....  if the JSBSim.dll is something I could compile....and modify to my own unique needs....then I could sidestep the whole agony of TCP/IP.

Further ....I guess I'm just wondering how much you added/changed to make this particular .DLL.  If it's just the JSBSim open source code base, life may just be a lot simpler than I was expecting after the first exchange in this thread.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: JSBSim Interface & Interaction
« Reply #12 on: December 27, 2012, 06:00:31 pm »

AFAIK it's just added dll build mode to the normal JSBSim library. Previously it was also a thin wrapper but last time Angrypig wanted to submit the necessary changes to JSBSim directly so that no extra project was needed. Going to wake him out of his Christmas mode to reply here ...
Logged

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: JSBSim Interface & Interaction
« Reply #13 on: December 27, 2012, 06:14:22 pm »

Will Jingle Bells help?  ;)

Thanks!  So are you saying that there were changes to the code that Angrypig submitted for inclusion in the JSBSim code base?  It might be a good idea to know what to look for since I've already downloaded the latest stable tarball.  Happily, it already has a Visual C project!
Logged

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: JSBSim Interface & Interaction
« Reply #14 on: December 28, 2012, 06:54:20 pm »

In the "For What It's Worth" category, I can report that I've been able to compile JSBSim as a .dll.

My question now drives to what I need to do/not do to make my version of this .dll compatible with Anteworld?  Another question for Angrypig. :)
« Last Edit: December 29, 2012, 04:18:14 am by Steve.Wilson »
Logged
Pages: [1] 2 3 ... 5