Skip to content

Commit

Permalink
Add models submodules in models directory. Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
slimonslimon committed Apr 28, 2020
1 parent 03887d2 commit 3606832
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 22 deletions.
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "models/FlightGear-Rascal"]
path = models/FlightGear-Rascal
url = https://github.com/ThunderFly-aerospace/FlightGear-Rascal.git
[submodule "models/FlightGear-TF-G1"]
path = models/TF-G1
url = https://github.com/ThunderFly-aerospace/FlightGear-TF-G1.git
[submodule "models/FlightGear-TF-R1"]
path = models/TF-R1
url = https://github.com/ThunderFly-aerospace/FlightGear-TF-R1.git
18 changes: 3 additions & 15 deletions FG_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#get FGFS MODEL dir
fgmodelsdir=os.getenv("FG_MODELS_DIR")
if fgmodelsdir is None:
fgmodelsdir=fgroot+'/Aircraft'
fgmodelsdir='./models'

#get FGFS EXTRA PARAMS dir
fgargsex=os.getenv("FG_ARGS_EX")
Expand All @@ -52,12 +52,6 @@
print('Cannot Write into direcotry: '+ protocols)
exit(-1)

#models=fgdata+'/Aircraft'
#if not os.access(models, os.W_OK):
# print('Cannot Write into direcotry: '+ protocols)
# exit(-1)


############################ Parse Config ######################################

with open(filename) as json_file:
Expand All @@ -71,10 +65,6 @@
for c in controls:
print(c[0]+' '+c[1]+' '+c[2])


############################ Download Model #####################################
#if not exists -- not implemend yet

############################ Create FG Input Protocol ###########################
propertyList=ET.Element('PropertyList')
generic= ET.SubElement(propertyList, 'generic')
Expand Down Expand Up @@ -127,7 +117,7 @@
"--disable-clouds",
"--disable-clouds3d",
"--fog-fastest",
"--visibility=5000",
"--visibility=2000",
"--disable-distance-attenuation",
"--disable-real-weather-fetch",
"--prop:/sim/rendering/particles=0",
Expand All @@ -143,10 +133,8 @@
"--disable-horizon-effect"
]

#without FG output
commnad=fgbin+" "+fgargsex+" "+" ".join(parameters)+" 2> /dev/null & echo $! > /tmp/px4fgfspid_"+str(px4id)
#with FG output
#commnad=fgbin+" "+fgargsex+" "+" ".join(parameters)+" & echo $! > /tmp/px4fgfspid_"+str(px4id)
commnad=fgbin+" "+fgargsex+" "+" ".join(parameters)+" & echo $! > /tmp/px4fgfspid_"+str(px4id)

print(commnad)
os.system(commnad)
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ It connects to FG (over UDP generic protocol) and transforms the data to TCP MAV
### How to run the development version:

#### Install:
1) Install FlightGear.
2) Install Models. Run ```fgfs --launcher``` on tab Add-ons add new a hangar http://location_of_oour_hangar. Install Rascal model from this hangar.
3) Set write permissions to the `Protocols` folder of the FlightGear Data. On Ubuntu run ```sudo chmod a+w /usr/share/games/flightgear/Protocols ```
1) Install FlightGear. In Ubuntu You can use install last stable FG from PAA repository by folowing commands: ```sudo add-apt-repository -y -u ppa:saiarcot895/flightgear``` and ```sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install flightgear```
2) Set write permissions to the `Protocols` folder of the FlightGear Data. On Ubuntu run ```sudo chmod a+w /usr/share/games/flightgear/Protocols```
#### Run:
1) Open [QgroundControl](http://qgroundcontrol.com/)
2) In PX4Firmware folder run: ```make px4_sitl_nolockstep flightgear_rascal``` for plane.
3) Wait until FlightGear fully loads.
#### Known issue:
1) If you have FPS lower than 20 it will not work correctly. Check your FPS. In FlightGear bridge look set View->View Options->Show frame rate
2) Multiple models in hangar (with eletric engine) need up-to-date FlightGear from nightly budils.
3) If you set-up mission take off to oposite direction than aircraft current heading, than the aircraft will fly directly forever.
4) Internally starting scripts run ```fgfs``` with set of parameters to reduce graphic and connect FG to bridge. But before that, the starting script search for FG-Data folder by running ```fgfs --version```. If your output of this command does not contains FG_ROOT line, the script will not work. Check how is your FG run in system, by ```which fgfs```.
2) You can use wild set of FG version - we tested instalation with FG 2019.1.1 and Nextgen FG (nightly builds). But in past I shorly tested basic functionality on Debian 9, FG 2016.1.1 from distribution repository, with some Racal (JSBSim) model.
3) Default models used by bridge is placed in bridge models subdirectory (as git submodules). Multiple models in this directory need up-to-date FlightGear from nightly budils (e.g.: these with eletric engine).
4) If you set-up mission take off to oposite direction than aircraft current heading, than the aircraft will fly directly forever. (maybe in other scenarios too). Nobody knows why.
5) Internally starting scripts run ```fgfs``` with set of parameters to reduce graphic, connect FG to bridge and use model from subdirectory. But before that, the starting script search for FG-Data folder by running ```fgfs --version```. If your output of this command does not contains FG_ROOT line, the startup script and whole bridge will not work. Check how your system runs FG by commnad ```which fgfs```. Advanced Options of bridge may help.
6) If you want more friendly plane, you can switch Rascal model from YASim physical engine to JSBSim physical engine by editing file ```models/rascal.json```. Substitue ```Rascal110-YASim``` by ```Rascal110-JSBSim```.

### Advanced Options

Expand Down
1 change: 1 addition & 0 deletions models/FlightGear-Rascal
Submodule FlightGear-Rascal added at 13da7d
1 change: 1 addition & 0 deletions models/TF-G1
Submodule TF-G1 added at 4540de
1 change: 1 addition & 0 deletions models/TF-R1
Submodule TF-R1 added at 158e42
File renamed without changes.
2 changes: 1 addition & 1 deletion rascal.json → models/rascal.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"FgModel":"Rascal110-JSBSim",
"FgModel":"Rascal110-YASim",
"Url":"https://github.com/ThunderFly-aerospace/FlightGear-Rascal/archive/master.zip",
"Controls": [
["5","/controls/flight/aileron","-1"],
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 3606832

Please sign in to comment.