Menu

#16 Help with getting JSBSim to reload data on the fly

None
open
nobody
None
5
2017-03-11
2015-12-10
Ben
No

Hi there,

I'm pretty new to C++ coding and JSBSim, but I'm looking to try and use JSBSim in a project.

My plan is to get JSBSim to re-read the aircraft model file (or just the relevant properties) when given a signal to poll, while running. The aim of this is to allow an external programme to push new data to JSBSim on the fly while it powers FlightGear, so that an easy user interface can be written for people to play around with different aircraft parameters?

Should I just write my own super simplified FDM (which could make it easy to change different aircraft paramters) in MATLAB (and compile to C) and use that power FlightGear to save myself the hassle? Are there any existing FDMs that are both powerful like JSBSim that'd be easier for this? Or should I stick with working with JSBSim and can you help? (I didn't have too much trouble getting it compile, but as soon as I tried to simply get it reload an aircraft file after initialising while running in realtime mode, I got stuck).

Thank you in advance!!!

Ben

Discussion

  • Ben

    Ben - 2015-12-10

    Quick update:

    I figured it out :) my JSBSim now reads the aircraft model file again on demand when I change a "flush" file in the aircraft directory that it reads on each iteration from containing "0" to "1". It then changes it back to a "0" once it's refreshed.

    I don't know if this is useful to others and should be commit to main the codebase - I'd have thought others may want a more robust way to implement this - for me - I like that the trigger is outside of the FDM socket to FlightGear because it makes it easy for me to use an external piece of software altogether to write to the aircraft file and then update this file and have everything refresh automagically.

     
  • PIYUSH RAJ

    PIYUSH RAJ - 2016-10-15

    Hi Ben. I am new to software developement. I am doing a simulator project. I need to extract only few required data and send it to display using sockets at a certain interval(0.02 seconds). I am facing same problem. Can Any One Please guide.

     
    • Ben

      Ben - 2016-10-15

      Hi Piyush,

      Check out this:
      https://bitbucket.org/ukblewis/flightgear/commits/ece3be8ed6699cb63fb501de65a262f3854063f4

      I forked the FlightGear repository to try and implement this feature in
      JSBSim. It appeared to work, but I was only doing it file-wide, i.e. the
      trigger of the "1" in the flush file causes JSBSim to reload the entire
      model data.

      Best of luck!

      Warmest regards,

      Ben

      On Sat, 15 Oct 2016 at 13:43 PIYUSH RAJ piyushme19@users.sf.net wrote:

      Hi Ben. I am new to software developement. I am doing a simulator project.
      I need to extract only few required data and send it to display using
      sockets at a certain interval(0.02 seconds). I am facing same problem. Can
      Any One Please guide.


      Status: open
      Group:
      Created: Thu Dec 10, 2015 03:11 AM UTC by Ben

      Last Updated: Thu Dec 10, 2015 11:28 PM UTC
      Owner: nobody

      Hi there,

      I'm pretty new to C++ coding and JSBSim, but I'm looking to try and use
      JSBSim in a project.

      My plan is to get JSBSim to re-read the aircraft model file (or just the
      relevant properties) when given a signal to poll, while running. The aim of
      this is to allow an external programme to push new data to JSBSim on the
      fly while it powers FlightGear, so that an easy user interface can be
      written for people to play around with different aircraft parameters?

      Should I just write my own super simplified FDM (which could make it easy
      to change different aircraft paramters) in MATLAB (and compile to C) and
      use that power FlightGear to save myself the hassle? Are there any existing
      FDMs that are both powerful like JSBSim that'd be easier for this? Or
      should I stick with working with JSBSim and can you help? (I didn't have
      too much trouble getting it compile, but as soon as I tried to simply get
      it reload an aircraft file after initialising while running in realtime
      mode, I got stuck).

      Thank you in advance!!!

      Ben

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/jsbsim/feature-requests/94/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Bertrand Coconnier

    Ticket moved from /p/jsbsim/feature-requests/94/

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.