Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
slimonslimon committed Apr 28, 2020
2 parents 3606832 + ebab966 commit f7eb676
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ It connects to FG (over UDP generic protocol) and transforms the data to TCP MAV

#### Install:
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```
3) Set write permissions to the `Protocols` folder in the FlightGear instalation directory. 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) 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```.

#### Known issues:
1) If you have FPS lower than 20 the bridge will not work correctly. Check your FPS. In FlightGear display frame rate by enabling it in View->View Options->Show frame rate.
2) You can probalby use wild set of FG versions - we tested instalation with FG 2019.1.1 and Nextgen FG (nightly builds). But in past I developed basic functionality on Debian 9, FG 2016.1.1 from distribution repository, with some Racal (JSBSim) model download as zip from somewhere.
3) Multiple models packaged with bridge have an electric engine that needs up-to-date FlightGear from [nightly builds PPA repository](https://launchpad.net/~saiarcot895/+archive/ubuntu/flightgear-edge).
4) In the case, you have set-up mission take off in the opposite direction than aircraft current heading, then the aircraft [will fly directly away forever](https://github.com/ThunderFly-aerospace/PX4-FlightGear-Bridge/issues/10). May in other situations too, no one knows why.
5) Internal starting scripts run ```fgfs``` with a set of parameters to reduce graphics, connect FG to bridge and setup models directory. But before that, the starting script searches for the FG-Data folder by running ```fgfs --version```. If your output of this command does not contain the FG_ROOT line, the script will not work. Check how is your FG binaries in the system, by ```which fgfs```. Then Advanced Options of Bridge can help you.
6) If you want more friendly plane (in my opinion), 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 All @@ -35,6 +37,12 @@ You can tune your FG installation/settings by the following environment variable

FlightGear Bridge and starting script now support multiple instances of PX4. FG\_run script takes the second argument, which is PX4 ID (and automatically adjust the port numbers according to given number) and bridge binary takes this ID as the first argument before the output of get\_FGbridge\_params.py

If you want to test other aircraft with PX4, you need:
1) Add the downloaded aircraft to ```models``` subdirectory, or to other MODEL PATH searched by FG
2) In ```models``` subdirectory create ```.json``` file.
3) Add model into PX4 make system in file ```platforms/posix/cmake/sitl_target.cmake``` with same name as json file in previous step.
4) You probably will need PX4 startup script for your vehicle. (vehicle name is same name as name of .json file)

### Limitations

The PX4 is connected to FlightGear thought "[generic protocol](http://wiki.flightgear.org/Generic_protocol)", which is served synchronously to the simulator graphics engine frame rate. So the PX4 gets the sensor data in frequency, depending on graphics resources and the current scene. The source-code implements artificial upsampling of sensor data to ~100Hz in the order to avoid stale sensor detection. Random noise is added to the sensor data.
Expand Down

0 comments on commit f7eb676

Please sign in to comment.