mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 00:53:34 +08:00
Move PX4 Guide source into /docs (#24490)
* Add vitepress tree * Update existing workflows so they dont trigger on changes in the docs path * Add nojekyll, package.json, LICENCE etc * Add crowdin docs upload/download scripts * Add docs flaw checker workflows * Used docs prefix for docs workflows * Crowdin obvious fixes * ci: docs move to self hosted runner runs on a beefy server for faster builds Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: don't run build action for docs or ci changes Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: update runners Signed-off-by: Ramon Roche <mrpollo@gmail.com> * Add docs/en * Add docs assets and scripts * Fix up editlinks to point to PX4 sources * Download just the translations that are supported * Add translation sources for zh, uk, ko * Update latest tranlsation and uorb graphs * update vitepress to latest --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com> Co-authored-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
co-authored by
Ramon Roche
parent
8e6d2ebe4a
commit
88d623bedb
@@ -0,0 +1,217 @@
|
||||
# FlightGear 시뮬레이션
|
||||
|
||||
:::warning
|
||||
This simulator is [community supported and maintained](../simulation/community_supported_simulators.md).
|
||||
It may or may not work with current versions of PX4.
|
||||
|
||||
See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team.
|
||||
:::
|
||||
|
||||
[FlightGear](https://www.flightgear.org/) is a flight simulator with powerful [FDM engines](http://wiki.flightgear.org/Flight_Dynamics_Model).
|
||||
This allows FlightGear to simulate rotorcrafts under various meteorological conditions (which is why the bridge was originally developed by [ThunderFly s.r.o.](https://www.thunderfly.cz/)).
|
||||
|
||||
This page describes FlightGear's single-vehicle use in SITL.
|
||||
For information about multi-vehicle use see: [Multi-Vehicle Simulation with FlightGear](../sim_flightgear/multi_vehicle.md).
|
||||
|
||||
**Supported Vehicles:** Autogyro, Plane, Rover.
|
||||
|
||||
<lite-youtube videoid="iqdcN5Gj4wI" title="[ThunderFly] PX4 SITL with Flightgear, Rascal110 - electric version"/>
|
||||
|
||||
[](https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggTFI7XG4gIEZsaWdodEdlYXIgLS0-IEZsaWdodEdlYXItQnJpZGdlO1xuICBGbGlnaHRHZWFyLUJyaWRnZSAtLT4gTUFWTGluaztcbiAgTUFWTGluayAtLT4gUFg0X1NJVEw7XG5cdCIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9)
|
||||
|
||||
<!-- Original mermaid graph
|
||||
graph LR;
|
||||
FlightGear-- >FlightGear-Bridge;
|
||||
FlightGear-Bridge-- >MAVLink;
|
||||
MAVLink-- >PX4_SITL;
|
||||
-->
|
||||
|
||||
:::info
|
||||
See [Simulation](../simulation/index.md) for general information about simulators, the simulation environment, and simulation configuration (e.g. supported vehicles).
|
||||
:::
|
||||
|
||||
## Installation (Ubuntu Linux)
|
||||
|
||||
:::info
|
||||
These instructions were tested on Ubuntu 18.04
|
||||
:::
|
||||
|
||||
1. Install the usual [Development Environment on Ubuntu LTS / Debian Linux](../dev_setup/dev_env_linux_ubuntu.md).
|
||||
|
||||
2. Install FlightGear:
|
||||
|
||||
```sh
|
||||
sudo add-apt-repository ppa:saiarcot895/flightgear
|
||||
sudo apt update
|
||||
sudo apt install flightgear
|
||||
```
|
||||
|
||||
This installs the latest stable FlightGear version from the PAA repository along with the FGdata package.
|
||||
|
||||
:::tip
|
||||
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](https://launchpad.net/~saiarcot895/+archive/ubuntu/flightgear-edge).
|
||||
|
||||
:::
|
||||
|
||||
3. Check that you are able to run FlightGear:
|
||||
|
||||
```sh
|
||||
fgfs --launcher
|
||||
```
|
||||
|
||||
4. Set write permissions to the **Protocols** folder in the FlightGear installation directory:
|
||||
|
||||
```sh
|
||||
sudo chmod a+w /usr/share/games/flightgear/Protocol
|
||||
```
|
||||
|
||||
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](http://wiki.flightgear.org/Howto:Install_Flightgear_from_a_PPA).
|
||||
|
||||
## Running the Simulation
|
||||
|
||||
Run a simulation by starting PX4 SITL, specifying the airframe configuration of your choice.
|
||||
|
||||
The easiest way to do this is to open a terminal in the root directory of the PX4 _PX4-Autopilot_ repository and call `make` for the desired target.
|
||||
For example, to start a plane simulation :
|
||||
|
||||
```sh
|
||||
cd /path/to/PX4-Autopilot
|
||||
make px4_sitl_nolockstep flightgear_rascal
|
||||
```
|
||||
|
||||
The supported vehicles and `make` commands are listed below (click on the links to see the vehicle images).
|
||||
|
||||
| Vehicle | 통신 |
|
||||
| ------------------------------------------------------------------------------------------------------------ | -------------------------------------------- |
|
||||
| [Standard Plane](../sim_flightgear/vehicles.md#standard-plane) | `make px4_sitl_nolockstep flightgear_rascal` |
|
||||
| [Ackermann vehicle (UGV/Rover)](../sim_flightgear/vehicles.md#ackerman-vehicle-ugv-rover) | `make px4_sitl_nolockstep flightgear_tf-r1` |
|
||||
| [Autogyro](../sim_flightgear/vehicles.md#autogyro) | `make px4_sitl_nolockstep flightgear_tf-g1` |
|
||||
|
||||
The commands above launch a single vehicle with the full UI.
|
||||
_QGroundControl_ should be able to automatically connect to the simulated vehicle.
|
||||
|
||||
:::info
|
||||
For the full list of FlightGear build targets (highlighted) run:
|
||||
|
||||
```sh
|
||||
make px4_sitl_nolockstep list_vmd_make_targets | grep flightgear_
|
||||
```
|
||||
|
||||
For additional information see: [FlightGear Vehicles](../sim_flightgear/vehicles.md) (this includes information about "unsupported" vehicles, and adding new vehicles).
|
||||
:::
|
||||
|
||||
:::info
|
||||
The [Installing Files and Code](../dev_setup/dev_env.md) guide is a useful reference if there are build errors.
|
||||
:::
|
||||
|
||||
## Taking it to the Sky
|
||||
|
||||
The `make` commands mentioned above first build PX4 and then run it along with the FlightGear simulator.
|
||||
|
||||
Once the PX4 has started it will launch the PX4 shell as shown below.
|
||||
You must select enter to get the command prompt.
|
||||
|
||||
```sh
|
||||
______ __ __ ___
|
||||
| ___ \ \ \ / / / |
|
||||
| |_/ / \ V / / /| |
|
||||
| __/ / \ / /_| |
|
||||
| | / /^\ \ \___ |
|
||||
\_| \/ \/ |_/
|
||||
|
||||
px4 starting.
|
||||
|
||||
INFO [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
|
||||
INFO [param] selected parameter default file eeprom/parameters_1034
|
||||
I'm Mavlink to FlightGear Bridge
|
||||
Target Bridge Freq: 200, send data every step: 1
|
||||
4
|
||||
5 -1
|
||||
7 -1
|
||||
2 1
|
||||
4 1
|
||||
[param] Loaded: eeprom/parameters_1034
|
||||
INFO [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes
|
||||
INFO [simulator] Waiting for simulator to accept connection on TCP port 4560
|
||||
INFO [simulator] Simulator connected on TCP port 4560.
|
||||
INFO [commander] LED: open /dev/led0 failed (22)
|
||||
INFO [commander] Mission #3 loaded, 9 WPs, curr: 8
|
||||
INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550
|
||||
INFO [airspeed_selector] No airspeed sensor detected. Switch to non-airspeed mode.
|
||||
INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
|
||||
INFO [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14280 remote port 14030
|
||||
INFO [logger] logger started (mode=all)
|
||||
INFO [logger] Start file log (type: full)
|
||||
INFO [logger] Opened full log file: ./log/2020-04-28/22_03_36.ulg
|
||||
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
|
||||
INFO [px4] Startup script returned successfully
|
||||
pxh> StatsHandler::StatsHandler() Setting up GL2 compatible shaders
|
||||
Now checking for plug-in osgPlugins-3.4.1/osgdb_nvtt.so
|
||||
PX4 Communicator: PX4 Connected.
|
||||
|
||||
pxh>
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
:::info
|
||||
You can change the view by pressing **Ctrl+V**.
|
||||
:::
|
||||
|
||||

|
||||
|
||||
You can bring it into the air by typing:
|
||||
|
||||
```sh
|
||||
pxh> commander takeoff
|
||||
```
|
||||
|
||||
## Usage/Configuration Options
|
||||
|
||||
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.
|
||||
|
||||
<a id="frame_rate"></a>
|
||||
|
||||
### Display the frame rate
|
||||
|
||||
In FlightGear you can display the frame rate by enabling it in: **View > View Options > Show frame rate**.
|
||||
|
||||
### Set Custom Takeoff Location
|
||||
|
||||
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](http://wiki.flightgear.org/Command_line_options#Initial_Position_and_Orientation)
|
||||
|
||||
예:
|
||||
|
||||
```sh
|
||||
FG_ARGS_EX="--airport=PHNL" make px4_sitl_nolockstep flightgear_rascal
|
||||
```
|
||||
|
||||
The example above starts the simulation on the [Honolulu international airport](http://wiki.flightgear.org/Suggested_airports)
|
||||
|
||||
### Using a Joystick
|
||||
|
||||
Joystick and thumb-joystick are supported through _QGroundControl_ ([setup instructions here](../simulation/index.md#joystick-gamepad-integration)).
|
||||
|
||||
The joystick input in FlightGear should be disabled in otherwise there will be a "race condition" between the FG joystick input and PX4 commands.
|
||||
|
||||
## Extending and Customizing
|
||||
|
||||
To extend or customize the simulation interface, edit the files in the **Tools/simulation/flightgear/flightgear_bridge** folder.
|
||||
The code is available in the [PX4-FlightGear-Bridge repository](https://github.com/ThunderFly-aerospace/PX4-FlightGear-Bridge) on Github.
|
||||
|
||||
## 추가 정보
|
||||
|
||||
- [PX4-FlightGear-Bridge readme](https://github.com/ThunderFly-aerospace/PX4-FlightGear-Bridge)
|
||||
@@ -0,0 +1,60 @@
|
||||
# Multi-Vehicle Simulation with FlightGear
|
||||
|
||||
:::warning
|
||||
This simulator is [community supported and maintained](../simulation/community_supported_simulators.md).
|
||||
It may or may not work with current versions of PX4.
|
||||
|
||||
See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team.
|
||||
:::
|
||||
|
||||
This topic explains how to simulate multiple vehicles using FlightGear in SITL.
|
||||
All vehicle instances have parameters defined by their startup scripts.
|
||||
|
||||
:::info
|
||||
This is the most environmentally realistic way to simulate multiple vehicles running PX4, and allows easy testing of multiple different types of vehicles.
|
||||
It is suitable for testing multi-vehicle support in _QGroundControl_, [MAVSDK](https://mavsdk.mavlink.io/), etc.
|
||||
|
||||
[Multi-Vehicle Simulation with Gazebo Classic](../sim_gazebo_classic/multi_vehicle_simulation.md) should be used instead for: swarm simulations with many vehicles, and testing features like computer vision that are only supported by Gazebo Classic.
|
||||
:::
|
||||
|
||||
## How to Start Multiple Instances
|
||||
|
||||
To start multiple instances (on separate ports and IDs):
|
||||
|
||||
1. Checkout the [PX4 branch that supports multiple vehicles](https://github.com/ThunderFly-aerospace/PX4Firmware/tree/flightgear-multi) (at ThunderFly-aerospace):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/ThunderFly-aerospace/PX4Firmware.git
|
||||
cd PX4Firmware
|
||||
git checkout flightgear-multi
|
||||
```
|
||||
|
||||
2. Build the PX4 Firmware using the standard toolchain (with FlightGear installed).
|
||||
|
||||
3. Start the first instance using the [predefined scripts](https://github.com/ThunderFly-aerospace/PX4-FlightGear-Bridge/tree/master/scripts):
|
||||
|
||||
```sh
|
||||
cd ./Tools/flightgear_bridge/scripts
|
||||
./vehicle1.sh
|
||||
```
|
||||
|
||||
4. Start subsequent instances using another script:
|
||||
|
||||
```sh
|
||||
./vehicle2.sh
|
||||
```
|
||||
|
||||
Each instance should have its own startup script, which can represent a completely different vehicle type.
|
||||
For prepared scripts you should get the following view.
|
||||
|
||||

|
||||
|
||||
Ground stations such as _QGroundControl_ connect to all instances using the normal UDP port 14550 (all traffic goes to the same port).
|
||||
|
||||
The number of simultaneously running instances is limited mainly by computer resources.
|
||||
FlightGear is a single-thread application, but aerodynamics solvers consume a lot of memory.
|
||||
Therefore splitting to multiple computers and using a [multiplayer server](https://wiki.flightgear.org/Howto:Multiplayer) is probably required to run _many_ vehicle instances.
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- See [Simulation](../simulation/index.md) for more information about the port configuration.
|
||||
@@ -0,0 +1,130 @@
|
||||
# FlightGear 차량
|
||||
|
||||
:::warning
|
||||
This simulator is [community supported and maintained](../simulation/community_supported_simulators.md).
|
||||
It may or may not work with current versions of PX4.
|
||||
|
||||
See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team.
|
||||
:::
|
||||
|
||||
This topic lists/displays the vehicles supported by the PX4 [FlightGear](../sim_flightgear/index.md) 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](../sim_flightgear/index.md) page shows how to install and use FlightGear in more detail (this page is a summary of vehicle-specific features).
|
||||
:::
|
||||
|
||||
## 표준 항공기
|
||||
|
||||
FlightGear has models for many planes.
|
||||
The most suitable one for UAV development is currently the [Rascal RC plane](https://github.com/ThunderFly-aerospace/FlightGear-Rascal) (which also exists in multiple variants).
|
||||
|
||||

|
||||
|
||||
The variants differ mainly by the [FDM](http://wiki.flightgear.org/Flight_Dynamics_Model) 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.
|
||||
|
||||

|
||||
|
||||
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:
|
||||
|
||||
```sh
|
||||
make px4_sitl_nolockstep flightgear_rascal
|
||||
```
|
||||
|
||||
### Rascal 110 Electric YASim
|
||||
|
||||
A Rascal vehicle with an electric engine.
|
||||
|
||||
```sh
|
||||
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](https://github.com/ThunderFly-aerospace/PX4-FlightGear-Bridge)).
|
||||
Simply change `Rascal110-YASim` to `Rascal110-JSBSim` in [this file](https://github.com/ThunderFly-aerospace/PX4-FlightGear-Bridge/blob/master/models/rascal.json#L2).
|
||||
|
||||
## 오토자이로
|
||||
|
||||
The only UAV autogyro model supported by FlightGear is [TF-G1 Autogyro](https://github.com/ThunderFly-aerospace/TF-G1).
|
||||
|
||||
```sh
|
||||
make px4_sitl_nolockstep flightgear_tf-g1
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 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.
|
||||
|
||||
```sh
|
||||
make px4_sitl_nolockstep flightgear_tf-r1
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Quadrotor
|
||||
|
||||
There is only an [incomplete multirotor model](https://github.com/ThunderFly-aerospace/FlightGear-TF-Mx1).
|
||||
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/](https://github.com/PX4/PX4-FlightGear-Bridge/tree/master/models) directory.
|
||||
This directory contains an control channel definition [JSON file](https://github.com/PX4/PX4-FlightGear-Bridge/blob/master/models/rascal.json).
|
||||
|
||||
```json
|
||||
{
|
||||
"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](http://wiki.flightgear.org/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](https://github.com/PX4/PX4-Autopilot/blob/c5341da8137f460c84f47f0e38293667ea69a6cb/platforms/posix/cmake/sitl_target.cmake#L164-L171).
|
||||
The new vehicle's json name should be added to the list.
|
||||
Reference in New Issue
Block a user