FlightGear 仿真
FlightGear is a flight simulator with powerful FDM engines. This allows FlightGear to simulate rotorcrafts under various meteorological conditions (which is why the bridge was originally developed by ThunderFly s.r.o.).
This page describes FlightGear's single-vehicle use in SITL. For information about multi-vehicle use see: Multi-Vehicle Simulation with FlightGear.
Supported Vehicles: Autogyro, Plane, Rover.
@
Installation (Ubuntu Linux)
Install the usual Development Environment on Ubuntu LTS / Debian Linux.
Install FlightGear:
This installs the latest stable FlightGear version from the PAA repository along with the FGdata package.
For some models (e.g. those with electric engines) the daily build with the newest features may be necessary. Install this using the daily build PPA.
Check that you are able to run FlightGear:
Set write permissions to the Protocols folder in the FlightGear installation directory:
Setting the permissions is required because the PX4-FlightGear-Bridge puts the communication definition file here.
Additional installation instructions can be found on FlightGear wiki.
运行仿真
Run a simulation by starting PX4 SITL, specifying the airframe configuration of your choice.
以上指令启动了一个具有完整 UI 的载具。 For example, to start a plane simulation :
The supported vehicles and make
commands are listed below (click on the links to see the vehicle images).
The commands above launch a single vehicle with the full UI. QGroundControl should be able to automatically connect to the simulated vehicle.
note The Installing Files and Code guide is a useful reference if there are build errors. :::
让飞行器起飞
你可以通过输入以下指令让飞机起飞:
Once the PX4 has started it will launch the PX4 shell as shown below. You must select enter to get the command prompt.
The console will print out status as PX4 loads the airframe-specific initialization and parameter files, wait for (and connect to) the simulator. Once there is an INFO print that [ecl/EKF] is commencing GPS fusion
the vehicle is ready to arm. At this point, you should see a FlightGear window with some view of aircraft.
例如:
使用/配置选项
You can tune your FG installation/settings by the following environment variables:
FG\_BINARY
- absolute path to FG binary to run. (It can be an AppImage)FG\_MODELS\_DIR
- absolute path to the folder containing the manually-downloaded aircraft models which should be used for simulation.FG\_ARGS\_EX
- any additional FG parameters.
Display the frame rate
In FlightGear you can display the frame rate by enabling it in: View > View Options > Show frame rate.
带光流的四旋翼
Takeoff location in SITL FlightGear can be set using additional variables. Setting the variable will override the default takeoff location.
The variables which can be set are as follows: --airport
, --runway
, and --offset-distance
. Other options can be found on FlightGear wiki
For example:
The example above starts the simulation on the Honolulu international airport
模拟一个 Wifi 无人机
Joystick and thumb-joystick are supported through QGroundControl (setup instructions here).
The joystick input in FlightGear should be disabled in otherwise there will be a "race condition" between the FG joystick input and PX4 commands.
扩展与定制
To extend or customize the simulation interface, edit the files in the *Tools/flightgear_bridge folder. The code is available in the PX4-FlightGear-Bridge repository on Github.
更多信息
Last updated