Files
PX4-Autopilot/docs/zh/sim_flightgear/vehicles.md
Crowdin Bot 588fd9d684
Build all targets / Scan for Board Targets (push) Has been cancelled
Build all targets / Build Group [${{ matrix.group }}][${{ matrix.arch == 'nuttx' && 'x86' || 'arm64' }}] (push) Has been cancelled
Build all targets / Upload Artifacts to S3 (push) Has been cancelled
Build all targets / Create Release and Upload Artifacts (push) Has been cancelled
Checks / build (NO_NINJA_BUILD=1 px4_fmu-v5_default) (push) Has been cancelled
Checks / build (NO_NINJA_BUILD=1 px4_sitl_default) (push) Has been cancelled
Checks / build (check_format) (push) Has been cancelled
Checks / build (check_newlines) (push) Has been cancelled
Checks / build (module_documentation) (push) Has been cancelled
Checks / build (px4_fmu-v2_default stack_check) (push) Has been cancelled
Checks / build (px4_sitl_allyes) (push) Has been cancelled
Checks / build (shellcheck_all) (push) Has been cancelled
Checks / build (tests) (push) Has been cancelled
Checks / build (tests_coverage) (push) Has been cancelled
Checks / build (validate_module_configs) (push) Has been cancelled
Clang Tidy / build (push) Has been cancelled
MacOS build / build (px4_fmu-v5_default) (push) Has been cancelled
MacOS build / build (px4_sitl) (push) Has been cancelled
Ubuntu environment build / Build and Test (ubuntu:22.04) (push) Has been cancelled
Ubuntu environment build / Build and Test (ubuntu:24.04) (push) Has been cancelled
Container build / Set Tags and Variables (push) Has been cancelled
Container build / Build Container (amd64) (push) Has been cancelled
Container build / Build Container (arm64) (push) Has been cancelled
Container build / Deploy To Registry (push) Has been cancelled
EKF Update Change Indicator / unit_tests (push) Has been cancelled
Failsafe Simulator Build / build (failsafe_web) (push) Has been cancelled
FLASH usage analysis / Analyzing px4_fmu-v5x (push) Has been cancelled
FLASH usage analysis / Analyzing px4_fmu-v6x (push) Has been cancelled
FLASH usage analysis / Publish Results (push) Has been cancelled
ITCM check / Checking nxp_tropic-community (push) Has been cancelled
ITCM check / Checking px4_fmu-v5x (push) Has been cancelled
ITCM check / Checking px4_fmu-v6xrt (push) Has been cancelled
MAVROS Mission Tests / build (map[mission:MC_mission_box vehicle:iris]) (push) Has been cancelled
MAVROS Mission Tests / build (map[mission:rover_mission_1 vehicle:rover]) (push) Has been cancelled
MAVROS Offboard Tests / build (map[test_file:mavros_posix_tests_offboard_posctl.test vehicle:iris]) (push) Has been cancelled
Nuttx Target with extra env config / build (px4_fmu-v5_default) (push) Has been cancelled
Python CI Checks / build (push) Has been cancelled
ROS Integration Tests / build (push) Has been cancelled
ROS Translation Node Tests / Build and test (map[ros_version:humble ubuntu:jammy]) (push) Has been cancelled
ROS Translation Node Tests / Build and test (map[ros_version:jazzy ubuntu:noble]) (push) Has been cancelled
SITL Tests / Testing PX4 tailsitter (push) Has been cancelled
SITL Tests / Testing PX4 iris (push) Has been cancelled
SITL Tests / Testing PX4 standard_vtol (push) Has been cancelled
ClusterFuzzLite batch fuzzing / BatchFuzzing (address) (push) Has been cancelled
ClusterFuzzLite batch fuzzing / BatchFuzzing (memory) (push) Has been cancelled
ClusterFuzzLite batch fuzzing / BatchFuzzing (undefined) (push) Has been cancelled
New Crowdin translations - zh-CN
2025-07-07 09:04:54 +10:00

5.6 KiB

FlightGear 机体

:::warning This simulator is community supported and maintained. It may or may not work with current versions of PX4.

See Toolchain Installation for information about the environments and tools supported by the core development team. :::

This topic lists/displays the vehicles supported by the PX4 FlightGear simulation, and the make commands required to run them (the commands are run from terminal in the PX4-Autopilot directory). The supported types are: plane, autogyro and rover (there are specific frames within these types).

:::tip For the full list of build targets run make px4_sitl list_vmd_make_targets (filter out those that start with flightgear_). :::

:::info The FlightGear page shows how to install and use FlightGear in more detail (this page is a summary of vehicle-specific features). :::

Standard Plane

FlightGear has models for many planes. The most suitable one for UAV development is currently the Rascal RC plane (which also exists in multiple variants).

Rascal plane in FlightGear

The variants differ mainly by the FDM model. All variants have a common feature selection table that can be activated by pressing the = key on the computer keyboard.

There is a pop-up table that could be used for advanced features activation.

Rascal plane FlightGear advanced options

The most relevant option is:

  • Smoke - generates a smoke trail to enhance the visibility of aircraft in the air (smoke and particles option needs to be activated in FG View > rendering options > Particles checkbox).
  • Trajectory markers - displays orthogonal markers along the trajectory of flight.

Trajectory markers show the absolute flight path in the world coordinates, and the smoke trail shows the relative path in the air mass.

Rascal 110 YASim

The primary variant of the Rascal model has a combustion piston-engine model. This results in a non-zero idle power causing a rotation of propeller on idle engine RPM.

The launch command is:

make px4_sitl_nolockstep flightgear_rascal

Rascal 110 Electric YASim

A Rascal vehicle with an electric engine.

make px4_sitl_nolockstep flightgear_rascal-electric

:::info This variant needs the latest FlightGear code (sources at least from 26 April 2020). Otherwise, the FlightGear crashes because of an unexpected definition of electric engine. :::

Rascal 110 JSBsim

Rascal JSBsim variant.

This variant does not have a direct make option but can be manually selected in the rascal.json configuration file (part of PX4-FlightGear-Bridge). Simply change Rascal110-YASim to Rascal110-JSBSim in this file.

飞机

The only UAV autogyro model supported by FlightGear is TF-G1 Autogyro.

make px4_sitl_nolockstep flightgear_tf-g1

TF-G1 in FlightGear

Ackerman vehicle (UGV/Rover)

TF-R1 Ground support Rover

This rover is equipped with a towing hitch and might be used for aero-towing of other vehicles.

make px4_sitl_nolockstep flightgear_tf-r1

TF-R1 rover in FlightGear

Quadrotor

There is only an incomplete multirotor model. This is not yet usable (it is numerically unstable and needs an additional work).

Adding a New Vehicle

A new vehicle model needs to be included as a git submodule into PX4-FlightGear-Bridge/models/ directory. This directory contains an control channel definition JSON file.

{
  "FgModel": "Rascal110-YASim",
  "Url": "https://github.com/ThunderFly-aerospace/FlightGear-Rascal/archive/master.zip",
  "Controls": [
    ["5", "/controls/flight/aileron", "-1"],
    ["7", "/controls/flight/elevator", "-1"],
    ["2", "/controls/flight/rudder", "1"],
    ["4", "/controls/engines/engine/throttle", "1"]
  ]
}

The file content meaning is as follows:

  • FgModel - a precise case sensitive name of the FlightGear model corresponding to "XXXX-set.xml" in the model directory (where XXXX is the model name).
  • Url is optional and it is not currently used. It is intended for future use to auto-download the models from web
  • Controls - the most important part of the process of adding a vehicle. This section contains the mapping between the PX4 mixer file and FlightGear property tree.
    • The first number in a list selects a PX4 mixer output.
    • Path string is a FlightGear variable location in the property tree.
  • The last number in a list is a multiplier, allowing inversion or scaling of mixer input.

After preparing all these files a new vehicle need to be included in the PX4 make system.

The PX4 configuration is in /platforms/posix/cmake/sitl_target.cmake. The new vehicle's json name should be added to the list.