Board index FlightGear Support Interfacing

Interfacing JSBsim with Flightgear  Topic is solved

Connecting two computers, using generic protocol, connecting with Matlab?

Interfacing JSBsim with Flightgear

Postby kevinl » Fri Jan 25, 2013 10:17 am

Hi,

For a project at university we modelled an UAV in JSBsim. All JSB output seems fine.
Now I made a connection between JSBsim and Flightgear using:

In Flightgear:
--native-fdm=socket,in,60,,5500,tcp
--fdm=external

In my aircraft file which is run by JSBsim:
<output name="localhost" type="FLIGHTGEAR" port="5500" rate="60"/>

This also works fine, the aircraft's flight is visualized perfectly. There is just one problem: flightgear performs the simulation at about 16-20 times the speed it should be. So my 100 sec simulation is completed in Flightgear within 5-7 sec.

Any thoughts on this?

Best regards,
Kevin Lamers
kevinl
 
Posts: 2
Joined: Fri Jan 25, 2013 10:10 am

Re: Interfacing JSBsim with Flightgear  

Postby AndersG » Fri Jan 25, 2013 7:28 pm

You need to add --realtime to the command line arguments you give to JSBSim. Without it JSBSim will run the simulated time as fast as it can.

/Anders
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

Re: Interfacing JSBsim with Flightgear

Postby kevinl » Sat Jan 26, 2013 9:40 am

Thanks, that helped! The simulation now runs at the right speed.
Best regards,
Kevin
kevinl
 
Posts: 2
Joined: Fri Jan 25, 2013 10:10 am

Re: Interfacing JSBsim with Flightgear

Postby dhar.eterno.mahee » Fri Jun 06, 2014 1:21 pm

I want to know the procedure of interfacing jsbsim with flightgear from strarting. Please help me in interfacing jsbsim with flightgear.
dhar.eterno.mahee
 
Posts: 16
Joined: Fri Feb 07, 2014 8:14 am

Re: Interfacing JSBsim with Flightgear

Postby Hooray » Fri Jun 06, 2014 5:09 pm

dhar.eterno.mahee wrote in Fri Jun 06, 2014 1:21 pm:I want to know the procedure of interfacing jsbsim with flightgear from strarting. Please help me in interfacing jsbsim with flightgear.

kevinl wrote in Fri Jan 25, 2013 10:17 am:Now I made a connection between JSBsim and Flightgear using:

In Flightgear:
--native-fdm=socket,in,60,,5500,tcp
--fdm=external

In my aircraft file which is run by JSBsim:
<output name="localhost" type="FLIGHTGEAR" port="5500" rate="60"/>
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Interfacing JSBsim with Flightgear

Postby dhar.eterno.mahee » Mon Jun 09, 2014 6:41 am

is aircraft file refers to the jsbsim/aircraft/aircraft.xml(eg for f16 f16.xml). I am running JSBSim from command promt(--realtime added) with that I am running Flightgear also but in output selected Aircraft is stationary Do I need to configure JSBSim with keyboard or joystick so that user can provide inputs.while running jsbsim I am getting error as "Debugging assertion failed" I ignored this error by clicking on ignore button nd by doing this jsbsim is running do I need to bother about this error or just ignore :) .
dhar.eterno.mahee
 
Posts: 16
Joined: Fri Feb 07, 2014 8:14 am

Re: Interfacing JSBsim with Flightgear

Postby AndersG » Mon Jun 09, 2014 5:45 pm

To my knowledge JSBSim doesn't have native support for interactive input. There might be ways to stream information in, though.
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

Re: Interfacing JSBsim with Flightgear

Postby dhar.eterno.mahee » Thu Jun 12, 2014 5:52 am

I tried to integrate jsbsim with flightgear but my aircraft is not moving it is stationary. the procedure I am following is as follows:
in c172x.xml I put
<output name="IP address" type="FLIGHTGEAR" port="5500" protocol="udp" rate="50">

<simulation> OFF </simulation>
<atmosphere> ON </atmosphere>
<massprops> ON</massprops>
<rates> ON </rates>
<velocities> ON</velocities>
<forces> ON</forces>
<moments> ON </moments>
<position> ON </position>
<propulsion> ON </propulsion>
<aerosurfaces> ON </aerosurfaces>
<fcs> ON </fcs>
<ground_reactions> ON</ground_reactions>
<coefficients> ON </coefficients>
<property> position/h-agl-ft </property>
<property> velocities/vc-kts </property>
<property> attitude/phi-rad </property>
<property> fcs/attitude/sensor/phi-rad </property>
</output>
and in flightgear I selected native-fdm protocol and flightmodel I selected as external and port no is 5500. Please help me in solving this problem
dhar.eterno.mahee
 
Posts: 16
Joined: Fri Feb 07, 2014 8:14 am

Re: Interfacing JSBsim with Flightgear

Postby EliasTarasov » Wed Jul 23, 2014 1:21 pm

Have the same problem. Cessna doesn't move.

1. Windows 7 4GB Intel Core i7.
2. FlightGear 3.0.0
2. JSBSim command line options are:
--script=C:/JSBSim/scripts/c172_elevation_test --realtime
3. Aircraft configuration file for above script is c172p.xml and it has output options:
<output name="localhost" type="FLIGHTGEAR" port="5500" protocol="TCP" rate="30">
4. Input options FG are:
--fdm=external
--native-fdm=socket,in,30,localhost,5500,tcp
5. I read similar topics on forum and wiki.flightgear and changed some options:
--fdm=null
--native=socket,in,30,,5500,udp (or tcp)
--native=socket,in,30,localhost,5500,udp (or tcp)
...etc.
Try to omit protocol="TCP" and "localhost" at Input FG option (as i read on a forum) and so on.

But anyway it doesn't work.
What's wrong?

Appreciate any help.
EliasTarasov
 
Posts: 16
Joined: Sun Mar 16, 2014 8:16 am

Re: Interfacing JSBsim with Flightgear

Postby EliasTarasov » Thu Jul 24, 2014 5:45 pm

Solved.

It's quite shameful but the reason was at the misspelled config file. I chose c172p while it should be c172x. Now it's ok. :D
EliasTarasov
 
Posts: 16
Joined: Sun Mar 16, 2014 8:16 am

Re: Interfacing JSBsim with Flightgear

Postby gholamifarshad98 » Wed May 24, 2017 7:55 am

Hi Kevinl
I would like to model UAV in JSBsim, like the things you have done befor.

Could you give me your code that you have modeled an UAV in JSBsim ?!!!!

Please help me ...
my email address is gholamifarshad98 (cinnamon bun) yahoo (dot) com

With the best Regards
Last edited by Johan G on Sun May 28, 2017 9:41 pm, edited 2 times in total.
Reason: Obfuscating the email address
gholamifarshad98
 
Posts: 3
Joined: Wed May 24, 2017 7:29 am


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 3 guests