Search Unity

JSBSIM(FlightGear engine) with Unity

Discussion in 'Works In Progress - Archive' started by devin8, May 29, 2014.

  1. devin8

    devin8

    Joined:
    Jul 15, 2012
    Posts:
    19
    I've been working to integrate JSBSIM with Unity for the past two years. I had also released a JSBSIM based flight sim for Android devices on Google Play a year back. I've now ended up with a very simple interface that can map JSBSIM properties directly to C# objects by using attributes. For example, you can link a property named "/fcs/flaps-pos-norm" like this

    Code (csharp):
    1.  
    2. public abstract class FCS {
    3.     [SimAttribute("/fcs/flaps-pos-norm")]
    4.     public abstract float FlapsPos { get; set;}
    5. }
    6.  
    Then you can instantiate the FCS object like this
    Code (csharp):
    1.  
    2. FCS fcs = JSBSIMInstanceFactory.createInstance<FCS>();
    3.  
    To get and set values to this simulation property, simply use it like a class variable, and the inputs will be automatically propagated to JSBSIM.
    Code (csharp):
    1.  
    2. Debug.log("Flaps position : "+fcs.FlapsPos);
    3.  
    4. fcs.FlapsPos = 0.4f;
    5.  
    This simple.
    It uses dynamic code generation and complex native calls and callbacks at runtime, but runs incredibly fast.

    I was interested in knowing if anyone would like to purchase this if I put it in Asset Store. The price though would be quite steep because it took me years to build it.
     
    Last edited: May 29, 2014
  2. franky_70

    franky_70

    Joined:
    Sep 24, 2014
    Posts:
    1
    Sounds very interesting and there would be definitely a purchase interest, but sure, depending on price and quality (especially referring documentation). Years of development must count, that's clear, but expectations to cover that with a price set for one customer might be too ambitious... :)
     
  3. i9mobile

    i9mobile

    Joined:
    Aug 8, 2013
    Posts:
    54
    interested... are you still running this project?
     
  4. devin8

    devin8

    Joined:
    Jul 15, 2012
    Posts:
    19
    Thanks for your interest. I never uploaded it to Asset Store due to personal reasons, but I have all the work ready.
    There is one consideration that I should tell though.

    JSBSIM simulates in double precision geographical coordinate system that can map the entire earth. However, Unity only works in floats and assumes terrains to be planar. So you will need to write a coordinate mapping system to convert between the two, and work around Unity's single precision floats.

    The flight simulator that I wrote for Google Play using this framework uses a paged terrain system and does a dirty mapping by multiplying latitude and longitudes with constants, but that will only hold good for small distances. If you're writing a full earth or large distance capable simulator, you'll probably need to address that.

    Let me know if you need to know anything about the framework.
     
  5. i9mobile

    i9mobile

    Joined:
    Aug 8, 2013
    Posts:
    54
    Any news @devin8 ? Would you like to share your code, or make it open source?

    cheers!
     
  6. oferkel

    oferkel

    Joined:
    Jun 15, 2016
    Posts:
    1
    Hi @devin8, I am interested. Are you still there? any plans to put on Asset Store?
     
  7. exrnge

    exrnge

    Joined:
    Jun 9, 2016
    Posts:
    6
    @devin8 i am also looking for you . will you share it or put it asset store ?
     
  8. malonsoj

    malonsoj

    Joined:
    May 9, 2020
    Posts:
    1
    @devin8 Was this ever released? My goal is to build a flight simulator based on JSBSim for Deep Reinforcement Learning research. I tried using FlightGear, but the camera system is unwieldy. Unity seems like a better option, seeing as how they have ML Agents.