Board index FlightGear Development Aircraft Flight dynamics model

Ground not detected by JSBSim in external mode

Good sims require good FDMs (the "thing" that makes an aircraft behave like an aircraft).

Ground not detected by JSBSim in external mode

Postby laperss » Thu Jul 06, 2017 11:37 am

I am using JSBSim and Flightgear in my research for visualization of path planning.
The simulation is run in JSBSim/FG, some data is saved into a file from JSBSim, and then real time optimization is run to get the next control action.

I have been using this command when starting JSBSim+Flightgear: --fdm=external --native-fdm=socket,in,120,,5501,tcp

This way I am able to control the aircraft from an external script (which is what I need for my simulations).
The problem is that the airplane does not know where the ground is, and as a result it cannot land "visually" correctly.
I believe that this is a result of the separation of the FDM and the terrain information in FlightGear.

Image

Is there any way to get the external mode to work so that the ground is detected?

I found that another way of staring JSB and FG is: --fdm=jsb --native-fdm=socket,in,120,,5501,tcp .
This seems to directly incorporate the JSBSim FDM into the simulation, and JSBSim and FlightGear share information and the ground reactions are correct.
However, when running it this way I cannot control the UAV from socket and the JSBSim logging stops.
laperss
 
Posts: 1
Joined: Wed Jun 14, 2017 9:48 am
Location: Stockholm
Version: 3.4.0
OS: Ubuntu 16.04

Re: Ground not detected by JSBSim in external mode

Postby AndersG » Thu Jul 06, 2017 12:38 pm

When JSBSim runs externally it has no knowledge of FlightGear's terrain.
I think you can set the terrain elevation in your JSBSim script (the property ic/terrain-elevation-ft) so you can tweak your script to match the appearance in FlightGear for your startup location. This doesn't help if you need the terrain elevation at arbitrary locations - then I guess you need to set up communication from FlightGear and into the external JSBSim instance and I'm not sure how one would do that.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux


Return to Flight dynamics model

Who is online

Users browsing this forum: No registered users and 1 guest