mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 11:38:54 +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,401 @@
|
||||
# PX4 소프트웨어 빌드
|
||||
|
||||
PX4 firmware can be built from source code on the console or in an IDE, for both simulated and hardware targets.
|
||||
|
||||
You need to build PX4 in order to use [simulators](../simulation/index.md), or if you want to modify PX4 and create a custom build.
|
||||
If you just want to try out PX4 on real hardware then [load the prebuilt binaries](../config/firmware.md) using QGroundControl (there is no need to follow these instructions).
|
||||
|
||||
:::info
|
||||
Before following these instructions you must first install the [Developer Toolchain](../dev_setup/dev_env.md) for your host operating system and target hardware.
|
||||
If you have any problems after following these steps see the [Troubleshooting](#troubleshooting) section below.
|
||||
:::
|
||||
|
||||
## PX4 소스 코드 다운로드
|
||||
|
||||
The PX4 source code is stored on Github in the [PX4/PX4-Autopilot](https://github.com/PX4/PX4-Autopilot) repository.
|
||||
|
||||
To get the _very latest_ (`main` branch) version onto your computer, enter the following command into a terminal:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
|
||||
```
|
||||
|
||||
Note that you may already have done this when installing the [Developer Toolchain](../dev_setup/dev_env.md)
|
||||
|
||||
:::info
|
||||
This is all you need to do in order to get the latest code.
|
||||
If needed you can also [get the source code specific to a particular release](../contribute/git_examples.md#get-a-specific-release).
|
||||
[GIT Examples](../contribute/git_examples.md) provides a lot more information working with releases and contributing to PX4.
|
||||
:::
|
||||
|
||||
## First Build (Using a Simulator)
|
||||
|
||||
먼저 콘솔 환경에서 시뮬레이션 대상을 빌드합니다.
|
||||
이를 통하여 실제 하드웨어와 IDE로 사용전에 시스템 설정을 검증할 수 있습니다.
|
||||
|
||||
Navigate into the **PX4-Autopilot** directory.
|
||||
Depending on your operating system you will have installed either [Gazebo SITL](../sim_gazebo_gz/index.md) or [Gazebo Classic SITL](../sim_gazebo_classic/index.md) (if you don't know which you can try both).
|
||||
|
||||
:::: tabs
|
||||
|
||||
:::tab Gazebo
|
||||
Start [Gazebo SITL](../sim_gazebo_gz/index.md) using the following command:
|
||||
|
||||
```sh
|
||||
make px4_sitl gz_x500
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
:::tab Gazebo-Classic
|
||||
Start [Gazebo SITL](../sim_gazebo_gz/index.md) using the following command:
|
||||
|
||||
```sh
|
||||
make px4_sitl gazebo-classic
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
|
||||
This will bring up the PX4 console:
|
||||
|
||||

|
||||
|
||||
:::info
|
||||
You may need to start _QGroundControl_ before proceeding, as the default PX4 configuration requires a ground control connection before takeoff.
|
||||
This can be [downloaded from here](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/getting_started/download_and_install.html).
|
||||
:::
|
||||
|
||||
The drone can be flown by typing the following command (as shown in the console above):
|
||||
|
||||
```sh
|
||||
pxh> commander takeoff
|
||||
```
|
||||
|
||||
The vehicle will take off and you'll see this in the simulator UI:
|
||||
|
||||
:::: tabs
|
||||
|
||||
:::tab Gazebo
|
||||

|
||||
:::
|
||||
|
||||
:::tab Gazebo-Classic
|
||||

|
||||
:::
|
||||
|
||||
::::
|
||||
|
||||
The drone can be landed by typing `commander land` and the whole simulation can be stopped by doing **CTRL+C** (or by entering `shutdown`).
|
||||
|
||||
Flying the simulation with the ground control station is closer to the real operation of the vehicle.
|
||||
Click on a location in the map while the vehicle is flying (takeoff flight mode) and enable the slider.
|
||||
This will reposition the vehicle.
|
||||
|
||||

|
||||
|
||||
## NuttX/Pixhawk 기반 보드
|
||||
|
||||
### NuttX용 빌드
|
||||
|
||||
To build for NuttX- or Pixhawk- based boards, navigate into the **PX4-Autopilot** directory and then call `make` with the build target for your board.
|
||||
|
||||
For example, to build for [Pixhawk 4](../flight_controller/pixhawk4.md) hardware you could use the following command:
|
||||
|
||||
```sh
|
||||
cd PX4-Autopilot
|
||||
make px4_fmu-v4_default
|
||||
```
|
||||
|
||||
A successful run will end with similar output to:
|
||||
|
||||
```sh
|
||||
-- 빌드 파일은 /home/youruser/src/PX4-Autopilot/build/px4_fmu-v4_default에 작성되었습니다.
|
||||
[954/954] Creating /home/youruser/src/PX4-Autopilot/build/px4_fmu-v4_default/px4_fmu-v4_default.px4
|
||||
```
|
||||
|
||||
The first part of the build target `px4_fmu-v4` indicates the target flight controller hardware for the firmware.
|
||||
The suffix, in this case `_default`, indicates a firmware _configuration_, such as supporting or omitting particular features.
|
||||
|
||||
:::info
|
||||
The `_default` suffix is optional.
|
||||
For example, `make px4_fmu-v5` and `px4_fmu-v5_default` result in the same firmware.
|
||||
:::
|
||||
|
||||
The following list shows the build commands for the [Pixhawk standard](../flight_controller/autopilot_pixhawk_standard.md) boards:
|
||||
|
||||
- [Holybro Pixhawk 6X-RT (FMUv6X)](../flight_controller/pixhawk6x-rt.md): `make px4_fmu-v6xrt_default`
|
||||
|
||||
- [Holybro Pixhawk 6X (FMUv6X)](../flight_controller/pixhawk6x.md): `make px4_fmu-v6x_default`
|
||||
|
||||
- [Holybro Pixhawk 6C (FMUv6C)](../flight_controller/pixhawk6c.md): `make px4_fmu-v6c_default`
|
||||
|
||||
- [Holybro Pixhawk 6C Mini (FMUv6C)](../flight_controller/pixhawk6c_mini.md): `make px4_fmu-v6c_default`
|
||||
|
||||
- [Holybro Pix32 v6 (FMUv6C)](../flight_controller/holybro_pix32_v6.md): `make px4_fmu-v6c_default`
|
||||
|
||||
- [Holybro Pixhawk 5X (FMUv5X)](../flight_controller/pixhawk5x.md): `make px4_fmu-v5x_default`
|
||||
|
||||
- [Pixhawk 4 (FMUv5)](../flight_controller/pixhawk4.md): `make px4_fmu-v5_default`
|
||||
|
||||
- [Pixhawk 4 Mini (FMUv5)](../flight_controller/pixhawk4_mini.md): `make px4_fmu-v5_default`
|
||||
|
||||
- [CUAV V5+ (FMUv5)](../flight_controller/cuav_v5_plus.md): `make px4_fmu-v5_default`
|
||||
|
||||
- [CUAV V5 nano (FMUv5)](../flight_controller/cuav_v5_nano.md): `make px4_fmu-v5_default`
|
||||
|
||||
- [Pixracer (FMUv4)](../flight_controller/pixracer.md): `make px4_fmu-v4_default`
|
||||
|
||||
- [Pixhawk 3 Pro](../flight_controller/pixhawk3_pro.md): `make px4_fmu-v4pro_default`
|
||||
|
||||
- [Pixhawk Mini](../flight_controller/pixhawk_mini.md): `make px4_fmu-v3_default`
|
||||
|
||||
- [Pixhawk 2 (Cube Black) (FMUv3)](../flight_controller/pixhawk-2.md): `make px4_fmu-v3_default`
|
||||
|
||||
- [mRo Pixhawk (FMUv3)](../flight_controller/mro_pixhawk.md): `make px4_fmu-v3_default` (supports 2MB Flash)
|
||||
|
||||
- [Holybro pix32 (FMUv2)](../flight_controller/holybro_pix32.md): `make px4_fmu-v2_default`
|
||||
|
||||
- [Pixfalcon (FMUv2)](../flight_controller/pixfalcon.md): `make px4_fmu-v2_default`
|
||||
|
||||
- [Dropix (FMUv2)](../flight_controller/dropix.md): `make px4_fmu-v2_default`
|
||||
|
||||
- [Pixhawk 1 (FMUv2)](../flight_controller/pixhawk.md): `make px4_fmu-v2_default`
|
||||
|
||||
:::warning
|
||||
You **must** use a supported version of GCC to build this board (e.g. the same as used by [CI/docker](../test_and_ci/docker.md)) or remove modules from the build. PX4가 보드의 1MB 플래시 제한에 가깝기 때문에, 지원되지 않는 GCC로 빌드가 실패할 수 있습니다.
|
||||
|
||||
:::
|
||||
|
||||
- Pixhawk 1 with 2 MB flash: `make px4_fmu-v3_default`
|
||||
|
||||
Build commands for non-Pixhawk NuttX fight controllers (and for all other-boards) are provided in the documentation for the individual [flight controller boards](../flight_controller/index.md).
|
||||
|
||||
### 펌웨어 업로드 (보드 플래싱)
|
||||
|
||||
Append `upload` to the make commands to upload the compiled binary to the autopilot hardware via USB.
|
||||
For example
|
||||
|
||||
```sh
|
||||
make px4_fmu-v4_default upload
|
||||
```
|
||||
|
||||
A successful run will end with this output:
|
||||
|
||||
```sh
|
||||
Erase : [====================] 100.0%
|
||||
Program: [====================] 100.0%
|
||||
Verify : [====================] 100.0%
|
||||
Rebooting.
|
||||
|
||||
[100%] Built target upload
|
||||
```
|
||||
|
||||
:::tip
|
||||
This is not supported when developing on WSL2.
|
||||
See [ Windows Development Environment (WSL2-Based) > Flash a Control Board](../dev_setup/dev_env_windows_wsl.md#flash-a-flight-control-board).
|
||||
:::
|
||||
|
||||
## 기타 보드
|
||||
|
||||
Build commands for other boards are given the [board-specific flight controller pages](../flight_controller/index.md) (usually under a heading _Building Firmware_).
|
||||
|
||||
You can also list all configuration targets using the command:
|
||||
|
||||
```sh
|
||||
make list_config_targets
|
||||
```
|
||||
|
||||
## 그래픽 IDE에서의 컴파일
|
||||
|
||||
[VSCode](../dev_setup/vscode.md) is the officially supported (and recommended) IDE for PX4 development.
|
||||
It is easy to set up and can be used to compile PX4 for both simulation and hardware environments.
|
||||
|
||||
## 문제 해결
|
||||
|
||||
### 일반 빌드 오류
|
||||
|
||||
Many build problems are caused by either mismatching submodules or an incompletely cleaned-up build environment.
|
||||
Updating the submodules and doing a `distclean` can fix these kinds of errors:
|
||||
|
||||
```sh
|
||||
git submodule update --recursive
|
||||
make distclean
|
||||
```
|
||||
|
||||
### Flash overflowed by XXX bytes
|
||||
|
||||
The `region 'flash' overflowed by XXXX bytes` error indicates that the firmware is too large for the target hardware platform.
|
||||
This is common for `make px4_fmu-v2_default` builds, where the flash size is limited to 1MB.
|
||||
|
||||
If you're building the _vanilla_ master branch, the most likely cause is using an unsupported version of GCC.
|
||||
In this case, install the version specified in the [Developer Toolchain](../dev_setup/dev_env.md) instructions.
|
||||
|
||||
If building your own branch, it is possible that you have increased the firmware size over the 1MB limit.
|
||||
PX4 빌드 시스템은 많은 수의 파일을 오픈하므로, 이 갯수를 초과할 수 있습니다.
|
||||
|
||||
### macOS: 열린 파일이 너무 많음 오류
|
||||
|
||||
MacOS allows a default maximum of 256 open files in all running processes.
|
||||
The PX4 build system opens a large number of files, so you may exceed this number.
|
||||
|
||||
The build toolchain will then report `Too many open files` for many files, as shown below:
|
||||
|
||||
```sh
|
||||
/usr/local/Cellar/gcc-arm-none-eabi/20171218/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: cannot find NuttX/nuttx/fs/libfs.a: Too many open files
|
||||
```
|
||||
|
||||
The solution is to increase the maximum allowed number of open files (e.g. to 300).
|
||||
You can do this in the macOS _Terminal_ for each session:
|
||||
|
||||
- Run this script [Tools/mac_set_ulimit.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/mac_set_ulimit.sh), or
|
||||
- 다음 명령어를 실행하십시오.
|
||||
|
||||
```sh
|
||||
ulimit -S -n 300
|
||||
```
|
||||
|
||||
### macOS Catalina: cmake 실행 문제
|
||||
|
||||
As of macOS Catalina 10.15.1 there may be problems when trying to build the simulator with _cmake_.
|
||||
다음을 사용하여 누락된 종속성을 확인하여 이러한 경우인지 확인할 수 있습니다.
|
||||
|
||||
```sh
|
||||
xcode-select --install
|
||||
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/
|
||||
```
|
||||
|
||||
### Ubuntu 18.04: arm_none_eabi_gcc와 관련된 컴파일 오류
|
||||
|
||||
Build issues related to `arm_none_eabi_gcc`may be due to a broken g++ toolchain installation.
|
||||
You can verify that this is the case by checking for missing dependencies using:
|
||||
|
||||
```sh
|
||||
arm-none-eabi-gcc --version
|
||||
arm-none-eabi-g++ --version
|
||||
arm-none-eabi-gdb --version
|
||||
arm-none-eabi-size --version
|
||||
```
|
||||
|
||||
Example of bash output with missing dependencies:
|
||||
|
||||
```sh
|
||||
arm-none-eabi-gdb --version
|
||||
arm-none-eabi-gdb: command not found
|
||||
```
|
||||
|
||||
This can be resolved by removing and [reinstalling the compiler](https://askubuntu.com/questions/1243252/how-to-install-arm-none-eabi-gdb-on-ubuntu-20-04-lts-focal-fossa).
|
||||
|
||||
### Ubuntu 18.04: Visual Studio Code는 이 큰 작업 영역에서 파일 변경 사항을 감시할 수 없습니다.
|
||||
|
||||
See [Visual Studio Code IDE (VSCode) > Troubleshooting](../dev_setup/vscode.md#troubleshooting).
|
||||
|
||||
### Python 패키지를 가져오지 못했습니다.
|
||||
|
||||
"Failed to import" errors when running the `make px4_sitl jmavsim` command indicates that some Python packages are not installed (where expected).
|
||||
|
||||
```sh
|
||||
Failed to import jinja2: No module named 'jinja2'
|
||||
You may need to install it using:
|
||||
pip3 install --user jinja2
|
||||
```
|
||||
|
||||
다음과 같이 종속성을 명시적으로 설치하여, 이 문제를 해결할 수 있습니다.
|
||||
|
||||
You should be able to fix this by explicitly installing the dependencies as shown:
|
||||
|
||||
```sh
|
||||
pip3 install --user pyserial empty toml numpy pandas jinja2 pyyaml pyros-genmsg packaging
|
||||
```
|
||||
|
||||
## PX4 빌드 타겟 만들기
|
||||
|
||||
The previous sections showed how you can call _make_ to build a number of different targets, start simulators, use IDEs etc.
|
||||
This section shows how _make_ options are constructed and how to find the available choices.
|
||||
|
||||
The full syntax to call _make_ with a particular configuration and initialization file is:
|
||||
|
||||
```sh
|
||||
make [VENDOR_][MODEL][_VARIANT] [VIEWER_MODEL_DEBUGGER_WORLD]
|
||||
```
|
||||
|
||||
**VENDOR_MODEL_VARIANT**: (also known as `CONFIGURATION_TARGET`)
|
||||
|
||||
- **VENDOR:** The manufacturer of the board: `px4`, `aerotenna`, `airmind`, `atlflight`, `auav`, `beaglebone`, `intel`, `nxp`, etc.
|
||||
The vendor name for Pixhawk series boards is `px4`.
|
||||
- **MODEL:** The _board model_ "model": `sitl`, `fmu-v2`, `fmu-v3`, `fmu-v4`, `fmu-v5`, `navio2`, etc.
|
||||
- **VARIANT:** Indicates particular configurations: e.g. `bootloader`, `cyphal`, which contain components that are not present in the `default` configuration.
|
||||
Most commonly this is `default`, and may be omitted.
|
||||
|
||||
:::tip
|
||||
You can get a list of _all_ available `CONFIGURATION_TARGET` options using the command below:
|
||||
|
||||
```sh
|
||||
make list_config_targets
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
**VIEWER_MODEL_DEBUGGER_WORLD:**
|
||||
|
||||
- **VIEWER:** This is the simulator ("viewer") to launch and connect: `gz`, `gazebo`, `jmavsim`, `none` <!-- , ?airsim -->
|
||||
|
||||
:::tip
|
||||
`none` can be used if you want to launch PX4 and wait for a simulator (jmavsim, Gazebo, Gazebo Classic, or some other simulator).
|
||||
For example, `make px4_sitl none_iris` launches PX4 without a simulator (but with the iris airframe).
|
||||
|
||||
:::
|
||||
|
||||
- **MODEL:** The _vehicle_ model to use (e.g. `iris` (_default_), `rover`, `tailsitter`, etc), which will be loaded by the simulator.
|
||||
The environment variable `PX4_SIM_MODEL` will be set to the selected model, which is then used in the [startup script](../simulation/index.md#startup-scripts) to select appropriate parameters.
|
||||
|
||||
- **DEBUGGER:** Debugger to use: `none` (_default_), `ide`, `gdb`, `lldb`, `ddd`, `valgrind`, `callgrind`.
|
||||
For more information see [Simulation Debugging](../debug/simulation_debugging.md).
|
||||
|
||||
- **WORLD:** (Gazebo Classic only).
|
||||
Set the world ([PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds](https://github.com/PX4/PX4-SITL_gazebo-classic/tree/main/worlds)) that is loaded.
|
||||
Default is [empty.world](https://github.com/PX4/PX4-SITL_gazebo-classic/blob/main/worlds/empty.world).
|
||||
For more information see [Gazebo Classic > Loading a Specific World](../sim_gazebo_classic/index.md#loading-a-specific-world).
|
||||
|
||||
:::tip
|
||||
You can get a list of _all_ available `VIEWER_MODEL_DEBUGGER_WORLD` options using the command below:
|
||||
|
||||
```sh
|
||||
make px4_sitl list_vmd_make_targets
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
|
||||
- Most of the values in the `CONFIGURATION_TARGET` and `VIEWER_MODEL_DEBUGGER` have defaults, and are hence optional.
|
||||
For example, `gazebo-classic` is equivalent to `gazebo-classic_iris` or `gazebo-classic_iris_none`.
|
||||
- 두 개의 다른 설정 사이에 기본값을 지정하려는 경우에는, 세 개의 밑줄을 사용할 수 있습니다.
|
||||
For example, `gazebo-classic___gdb` is equivalent to `gazebo-classic_iris_gdb`.
|
||||
- You can use a `none` value for `VIEWER_MODEL_DEBUGGER` to start PX4 and wait for a simulator.
|
||||
For example start PX4 using `make px4_sitl_default none` and jMAVSim using `./Tools/simulation/jmavsim/jmavsim_run.sh -l`.
|
||||
|
||||
:::
|
||||
|
||||
The `VENDOR_MODEL_VARIANT` options map to particular _px4board_ configuration files in the PX4 source tree under the [/boards](https://github.com/PX4/PX4-Autopilot/tree/main/boards) directory.
|
||||
Specifically `VENDOR_MODEL_VARIANT` maps to a configuration file **boards/VENDOR/MODEL/VARIANT.px4board**
|
||||
(e.g. `px4_fmu-v5_default` corresponds to [boards/px4/fmu-v5/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/default.px4board)).
|
||||
|
||||
추가 make 대상은 관련 섹션에서 설명합니다.
|
||||
|
||||
- `bloaty_compare_master`: [Binary Size Profiling](../debug/binary_size_profiling.md)
|
||||
- ...
|
||||
|
||||
## Firmware Version & Git Tags
|
||||
|
||||
The _PX4 Firmware Version_ and _Custom Firmware Version_ are published using the MAVLink [AUTOPILOT_VERSION](https://mavlink.io/en/messages/common.html#AUTOPILOT_VERSION) message, and displayed in the _QGroundControl_ **Setup > Summary** airframe panel:
|
||||
|
||||

|
||||
|
||||
These are extracted at build time from the active _git tag_ for your repo tree.
|
||||
The git tag should be formatted as `<PX4-version>-<vendor-version>` (e.g. the tag in the image above was set to `v1.8.1-2.22.1`).
|
||||
|
||||
:::warning
|
||||
If you use a different git tag format, versions information may not be displayed properly.
|
||||
:::
|
||||
@@ -0,0 +1,58 @@
|
||||
# Initial Setup & Configuration
|
||||
|
||||
개발자는 아래(또는 이와 유사한)에 설명된 기본 장비와 소프트웨어를 사용하는 것이 좋습니다.
|
||||
|
||||
## 기본 장비
|
||||
|
||||
:::tip
|
||||
PX4 can be used with a much wider range of equipment than described here, but new developers will benefit from going with one of the standard setups.
|
||||
A Taranis RC and a mid-range Android tablet make a very inexpensive field kit.
|
||||
:::
|
||||
|
||||
아래 장비를 적극 권장합니다.
|
||||
|
||||
- **RC controller** for the safety pilot
|
||||
- [Taranis Plus](https://www.frsky-rc.com/product/taranis-x9d-plus-2/) RC control (or equivalent)
|
||||
|
||||
- **Development computer**
|
||||
|
||||
::: info
|
||||
The listed computers have acceptable performance, but a more recent and powerful computer is recommended.
|
||||
|
||||
:::
|
||||
|
||||
- Lenovo Thinkpad with i5-core running Windows 11
|
||||
- MacBook Pro (early 2015 and later) with macOS 10.15 or later
|
||||
- Lenovo Thinkpad i5 with Ubuntu Linux 20.04 or later
|
||||
|
||||
- **Ground control station** (computer or tablet):
|
||||
- iPad (may require Wifi telemetry adapter)
|
||||
- 모든 MacBook 또는 Ubuntu Linux 노트북(개발 컴퓨터일 수 있음)
|
||||
- A recent mid-range Android tablet or phone with a large enough screen to run _QGroundControl_ effectively (6 inches).
|
||||
|
||||
- **Vehicle capable of running PX4**:
|
||||
- [Get a prebuilt vehicle](../complete_vehicles_mc/index.md)
|
||||
- [Build your own](../frames_multicopter/kits.md)
|
||||
|
||||
- **Safety glasses**
|
||||
|
||||
- **Tether** (multicopter only - for more risky tests)
|
||||
|
||||
## 기체 설정
|
||||
|
||||
Install the [QGroundControl Daily Build](../dev_setup/qgc_daily_build.md) for a **desktop OS**.
|
||||
|
||||
기체를 설정하려면:
|
||||
|
||||
1. [Install PX4 firmware](../config/firmware.md#installing-px4-main-beta-or-custom-firmware) (including "custom" firmware with your own changes).
|
||||
2. [Start with the airframe](../config/airframe.md) that best-matches your vehicle from the [airframe reference](../airframes/airframe_reference.md).
|
||||
3. [Basic Configuration](../config/index.md) explains how to perform basic configuration.
|
||||
4. [Parameter Configuration](../advanced_config/parameters.md) explains how you can find and modify individual parameters.
|
||||
|
||||
::: info
|
||||
|
||||
- _QGroundControl_ mobile variants do not support vehicle configuration.
|
||||
- The _daily build_ includes development tools and new features that are not available in the official release.
|
||||
- Configuration in the airframe reference have been flown on real vehicles, and are a good starting point for "getting off the ground".
|
||||
|
||||
:::
|
||||
@@ -0,0 +1,30 @@
|
||||
# 파일 및 코드 설치개발자 환경 설정 (툴체인)
|
||||
|
||||
The _supported platforms_ for PX4 development are:
|
||||
|
||||
- [Ubuntu Linux (22.04/20.04/18.04)](../dev_setup/dev_env_linux_ubuntu.md) — Recommended
|
||||
- [Windows (10/11)](../dev_setup/dev_env_windows_wsl.md) — via WSL2
|
||||
- [Mac OS](../dev_setup/dev_env_mac.md)
|
||||
|
||||
## 지원 대상
|
||||
|
||||
아래 표는 각 OS에서 구축 가능한 PX 대상을 보여줍니다.
|
||||
|
||||
| 대상 | Linux (Ubuntu) | Mac | 윈도우 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------: | :-: | :-: |
|
||||
| **NuttX based hardware:** [Pixhawk Series](../flight_controller/pixhawk_series.md), [Crazyflie](../complete_vehicles_mc/crazyflie2.md) | ✓ | ✓ | ✓ |
|
||||
| **Linux-based hardware:** [Raspberry Pi 2/3](../flight_controller/raspberry_pi_navio2.md) | ✓ | | |
|
||||
| **Simulation:** [Gazebo SITL](../sim_gazebo_gz/index.md) | ✓ | ✓ | ✓ |
|
||||
| **Simulation:** [Gazebo Classic SITL](../sim_gazebo_classic/index.md) | ✓ | ✓ | ✓ |
|
||||
| **Simulation:** [ROS with Gazebo Classic](../simulation/ros_interface.md) | ✓ | | ✓ |
|
||||
| **Simulation:** ROS 2 with Gazebo | ✓ | | ✓ |
|
||||
|
||||
Experienced Docker users can also build with the containers used by our continuous integration system: [Docker Containers](../test_and_ci/docker.md)
|
||||
|
||||
## 다음 단계
|
||||
|
||||
위의 명령줄 도구 모음 중 하나를 설정하고, 다음 단계를 실행합니다.
|
||||
|
||||
- Install [VSCode](../dev_setup/vscode.md) (if you prefer using an IDE to the command line).
|
||||
- Install the [QGroundControl Daily Build](../dev_setup/qgc_daily_build.md)
|
||||
- Continue to [Building PX4 Software](../dev_setup/building_px4.md).
|
||||
@@ -0,0 +1,36 @@
|
||||
# 고급 Linux 사용 사례
|
||||
|
||||
## JTAG 프로그래밍 어댑터 사용
|
||||
|
||||
Linux 사용자는 JTAG 프로그래밍 어댑터용 USB 버스에 대한 액세스를 허용하여야 합니다.
|
||||
|
||||
:::info
|
||||
For Archlinux: replace the group plugdev with uucp in the following commands
|
||||
:::
|
||||
|
||||
Run a simple `ls` in `sudo` mode to ensure the commands below succeed:
|
||||
|
||||
```sh
|
||||
sudo ls
|
||||
```
|
||||
|
||||
Then with `sudo` rights temporarily granted, run this command:
|
||||
|
||||
```sh
|
||||
cat > $HOME/rule.tmp <<_EOF
|
||||
# All 3D Robotics (includes PX4) devices
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="26AC", GROUP="plugdev"
|
||||
# FTDI (and Black Magic Probe) Devices
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", GROUP="plugdev"
|
||||
# Olimex Devices
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="15ba", GROUP="plugdev"
|
||||
_EOF
|
||||
sudo mv $HOME/rule.tmp /etc/udev/rules.d/10-px4.rules
|
||||
sudo /etc/init.d/udev restart
|
||||
```
|
||||
|
||||
The user needs to be added to the group **plugdev**:
|
||||
|
||||
```sh
|
||||
sudo usermod -a -G plugdev $USER
|
||||
```
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="dev_env_linux_ubuntu" />
|
||||
@@ -0,0 +1,50 @@
|
||||
# Arch Linux 개발 환경
|
||||
|
||||
:::warning
|
||||
This development environment is [community supported and maintained](../advanced/community_supported_dev_env).
|
||||
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.
|
||||
:::
|
||||
|
||||
The PX4-Autopilot repository provides a convenient script to set your Arch installation up for PX4 development: [Tools/setup/arch.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/setup/arch.sh). <!-- NEED px4_version -->
|
||||
|
||||
The script installs (by default) all tools to build PX4 for NuttX targets and run simulation with [JMAVSim](../sim_jmavsim/index.md).
|
||||
You can additionally install the [Gazebo Classic](../sim_gazebo_classic/index.md) simulator by specifying the command line argument: `--gazebo`.
|
||||
|
||||

|
||||
|
||||
:::info
|
||||
The instructions have been tested on [Manjaro](https://manjaro.org/) (Arch based distribution) as it is much easier to set up than Arch Linux.
|
||||
:::
|
||||
|
||||
스크립트를 가져와 실행하려면 다음 중 하나를 실행합니다.
|
||||
|
||||
- [Download PX4 Source Code](../dev_setup/building_px4.md) and run the scripts in place:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/PX4-Autopilot.git
|
||||
bash PX4-Autopilot/Tools/setup/arch.sh
|
||||
```
|
||||
|
||||
- 필요한 스크립트만 다운로드하여 실행합니다.
|
||||
|
||||
```sh
|
||||
wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/arch.sh
|
||||
wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/requirements.txt
|
||||
bash arch.sh
|
||||
```
|
||||
|
||||
스크립트는 다음의 매개변수를 사용합니다.
|
||||
|
||||
- `--gazebo`: Add this parameter to install Gazebo from the [AUR](https://aur.archlinux.org/packages/gazebo/).
|
||||
|
||||
::: info
|
||||
Gazebo gets compiled from source.
|
||||
It takes some time to install and requires entering the `sudo` password multiple times (for dependencies).
|
||||
|
||||
:::
|
||||
|
||||
- `--no-nuttx`: Do not install the NuttX/Pixhawk toolchain (i.e. if only using simulation).
|
||||
|
||||
- `--no-sim-tools`: Do not install jMAVSim/Gazebo (i.e. if only targeting Pixhawk/NuttX targets)
|
||||
@@ -0,0 +1,99 @@
|
||||
# CentOS 개발 환경
|
||||
|
||||
:::warning
|
||||
This development environment is [community supported and maintained](../advanced/community_supported_dev_env.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.
|
||||
:::
|
||||
|
||||
빌드에는 Python 2.7.5가 필요합니다. 따라서, 이 글을 쓰는 시점에서 Centos 7을 사용하여야 합니다.
|
||||
(이전 Centos 릴리스의 경우 Python v2.7.5를 설치할 수 있습니다. 하지만 yum을 깨뜨릴 수 있으므로 권장하지 않습니다.)
|
||||
|
||||
## 공통 종속성
|
||||
|
||||
EPEL 저장소는 openocd libftdi-devel libftdi-python에 필요합니다.
|
||||
|
||||
```sh
|
||||
wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
|
||||
sudo yum install epel-release-7-5.noarch.rpm
|
||||
yum update
|
||||
yum groupinstall “Development Tools”
|
||||
yum install python-setuptools python-numpy
|
||||
easy_install pyserial
|
||||
easy_install pexpect
|
||||
easy_install toml
|
||||
easy_install pyyaml
|
||||
easy_install cerberus
|
||||
yum install openocd libftdi-devel libftdi-python python-argparse flex bison-devel ncurses-devel ncurses-libs autoconf texinfo libtool zlib-devel cmake vim-common
|
||||
```
|
||||
|
||||
:::info
|
||||
You may want to also install `python-pip` and `screen`.
|
||||
:::
|
||||
|
||||
## GCC 툴체인 설치
|
||||
|
||||
<!-- GCC toolchain documentation used for all Linux platforms to build NuttX -->
|
||||
|
||||
아래 스크립트로 GCC 7-2017-q4를 설치합니다.
|
||||
|
||||
:::warning
|
||||
This version of GCC is out of date.
|
||||
At time of writing the current version on Ubuntu is `9-2020-q2-update` (see [focal nuttx docker file](https://github.com/PX4/PX4-containers/blob/master/docker/Dockerfile_nuttx-focal#L28))
|
||||
:::
|
||||
|
||||
```sh
|
||||
pushd .
|
||||
cd ~
|
||||
wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
|
||||
tar -jxf gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
|
||||
exportline="export PATH=$HOME/gcc-arm-none-eabi-7-2017-q4-major/bin:\$PATH"
|
||||
if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
|
||||
popd
|
||||
```
|
||||
|
||||
이제 시스템을 다시 시작하십시오.
|
||||
|
||||
**Troubleshooting**
|
||||
|
||||
다음 명령을 입력하여 버전을 확인하십시오.
|
||||
|
||||
```sh
|
||||
arm-none-eabi-gcc --version
|
||||
```
|
||||
|
||||
출력 결과는 다음과 비슷하여야 합니다.
|
||||
|
||||
```sh
|
||||
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
|
||||
Copyright (C) 2017 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
```
|
||||
|
||||
<!-- import docs ninja build system -->
|
||||
|
||||
## Ninja 빌드 시스템
|
||||
|
||||
[Ninja](https://ninja-build.org/) is a faster build system than _Make_ and the PX4 _CMake_ generators support it.
|
||||
|
||||
Ubuntu Linux에서는 일반 저장소에서 자동으로 설치할 수 있습니다.
|
||||
|
||||
```sh
|
||||
sudo apt-get install ninja-build -y
|
||||
```
|
||||
|
||||
다른 시스템은 패키지 관리자에 Ninja를 포함하지 않을 수 있습니다.
|
||||
이 경우 대안은 바이너리를 다운로드하여 경로에 추가하는 것입니다.
|
||||
|
||||
```sh
|
||||
mkdir -p $HOME/ninja
|
||||
cd $HOME/ninja
|
||||
wget https://github.com/martine/ninja/releases/download/v1.6.0/ninja-linux.zip
|
||||
unzip ninja-linux.zip
|
||||
rm ninja-linux.zip
|
||||
exportline="export PATH=$HOME/ninja:\$PATH"
|
||||
if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
|
||||
. ~/.profile
|
||||
```
|
||||
@@ -0,0 +1,123 @@
|
||||
# 우분투 개발 환경
|
||||
|
||||
The following instructions use a bash script to set up the PX4 development environment on the [Ubuntu Linux LTS](https://wiki.ubuntu.com/LTS) versions supported by PX4: Ubuntu 22.04 (Jammy Jellyfish), 20.04 (Focal Fossa), and 18.04 (Bionic Beaver).
|
||||
|
||||
The environment includes:
|
||||
|
||||
- [Gazebo Simulator](../sim_gazebo_gz/index.md) ("Harmonic") on Ubuntu 22.04
|
||||
- [Gazebo Classic Simulator](../sim_gazebo_classic/index.md) on Ubuntu 20.04 and Ubuntu 18.04
|
||||
- [Build toolchain for Pixhawk (and other NuttX-based hardware)](../dev_setup/building_px4.md#nuttx-pixhawk-based-boards).
|
||||
|
||||
:::info
|
||||
The build toolchain for other flight controllers, simulators, and working with ROS are discussed in the [Other Targets](#other-targets) section below.
|
||||
:::
|
||||
|
||||
:::tip
|
||||
if you need to use Gazebo on Ubuntu 20.04 you can [manually install Gazebo "Garden"](../sim_gazebo_gz/index.md#installation-ubuntu-linux), with the caveat that this is end-of-life in November 2024.
|
||||
If you want to use Gazebo Classic on Ubuntu 22.04 (say) then you can manually install it by following the instructions in [Gazebo Classic > Installation](../sim_gazebo_classic/index.md#installation).
|
||||
:::
|
||||
|
||||
## Simulation and NuttX (Pixhawk) Targets
|
||||
|
||||
Use the [ubuntu.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/setup/ubuntu.sh) script to set up a development environment that allows you to build for simulators and/or the [NuttX/Pixhawk](../dev_setup/building_px4.md#nuttx-pixhawk-based-boards) toolchain.
|
||||
|
||||
:::tip
|
||||
The script is intended to be run on _clean_ Ubuntu LTS installations, and may not work if run "on top" of an existing system, or on a different Ubuntu release.
|
||||
:::
|
||||
|
||||
툴체인을 설치하려면:
|
||||
|
||||
1. [Download PX4 Source Code](../dev_setup/building_px4.md):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
|
||||
```
|
||||
|
||||
::: info
|
||||
The environment setup scripts in the source usually work for recent PX4 releases.
|
||||
If working with an older version of PX4 you may need to [get the source code specific to your release](../contribute/git_examples.md#get-a-specific-release).
|
||||
|
||||
:::
|
||||
|
||||
2. Run the **ubuntu.sh** with no arguments (in a bash shell) to install everything:
|
||||
|
||||
```sh
|
||||
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
|
||||
```
|
||||
|
||||
- 스크립트가 진행되는 동안 모든 프롬프트를 확인합니다.
|
||||
- You can use the `--no-nuttx` and `--no-sim-tools` options to omit the NuttX and/or simulation tools.
|
||||
|
||||
3. 완료되면 컴퓨터를 재부팅합니다.
|
||||
|
||||
:::details
|
||||
Additional notes
|
||||
These notes are provided "for information only":
|
||||
|
||||
- This setup is supported by the PX4 Dev Team.
|
||||
The instructions may also work on other Debian Linux based systems.
|
||||
|
||||
- You can verify the NuttX installation by confirming the `gcc` version as shown:
|
||||
|
||||
```sh
|
||||
$arm-none-eabi-gcc --version
|
||||
|
||||
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
```
|
||||
|
||||
- 어쨌든 PX4 소스 코드가 필요합니다.
|
||||
But if you just wanted to set up the development environment without getting all the source code you could instead just download [ubuntu.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/setup/ubuntu.sh) and [requirements.txt](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/setup/requirements.txt) and then run **ubuntu.sh**:
|
||||
|
||||
```sh
|
||||
wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/ubuntu.sh
|
||||
wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/requirements.txt
|
||||
bash ubuntu.sh
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
## 영상 가이드
|
||||
|
||||
This video shows how to install the toolchain for NuttX and simulation targets ([as covered below](#simulation-and-nuttx-pixhawk-targets)) along with the basic testing covered in [Building PX4 Software](../dev_setup/building_px4.md).
|
||||
|
||||
:::warning
|
||||
The video suggests that you build source using JMAVSim, entering the command: `make px4_sitl jmavsim`.
|
||||
As JMAVSim is now community-supported, you should instead build using Gazebo or Gazebo Classic, as shown in [Building the Code](../dev_setup/building_px4.md#first-build-using-a-simulator)
|
||||
:::
|
||||
|
||||
<lite-youtube videoid="OtValQdAdrU" title=" Setting up your PX4 development environment on Linux"/>
|
||||
|
||||
## Other Targets
|
||||
|
||||
The Ubuntu development environment for ROS, other simulators, and other hardware targets, is covered in their respective documentation.
|
||||
A subset of the relevant topics are linked below.
|
||||
|
||||
라즈베리파이
|
||||
|
||||
- [Raspberry Pi 2/3 Navio2 Autopilot > PX4 Development Environment](../flight_controller/raspberry_pi_navio2.md#px4-development-environment)
|
||||
- [Raspberry Pi 2/3/4 PilotPi Shield](../flight_controller/raspberry_pi_pilotpi.md).
|
||||
|
||||
ROS
|
||||
|
||||
- ROS 2: [ROS 2 User Guide > Installation & Setup](../ros2/user_guide.md#installation-setup).
|
||||
- ROS (1): [ROS (1) Installation Guide](../ros/mavros_installation.md)
|
||||
|
||||
## 다음 단계
|
||||
|
||||
명령줄 도구 모음 설정후, 다음을 수행합니다.
|
||||
|
||||
- Install [VSCode](../dev_setup/vscode.md) (if you prefer using an IDE to the command line).
|
||||
|
||||
- Install the [QGroundControl Daily Build](../dev_setup/qgc_daily_build.md)
|
||||
|
||||
:::tip
|
||||
The _daily build_ includes development tools that hidden in release builds.
|
||||
또한, 릴리스 빌드에서 아직 지원되지 않는 새로운 PX4 기능에 대한 액세스를 제공할 수도 있습니다.
|
||||
|
||||
:::
|
||||
|
||||
- Continue to the [build instructions](../dev_setup/building_px4.md).
|
||||
@@ -0,0 +1,129 @@
|
||||
# MacOS 개발 환경
|
||||
|
||||
아래에서 macOS용 PX4 개발 환경 설정 방법을 설명합니다.
|
||||
PX4 빌드에 사용되어 집니다.
|
||||
|
||||
- Pixhawk와 기타 NuttX 기반 하드웨어
|
||||
- [Gazebo Classic Simulation](../sim_gazebo_classic/index.md)
|
||||
|
||||
:::tip
|
||||
This setup is supported by the PX4 dev team.
|
||||
To build other targets you will need to use a [different OS](../dev_setup/dev_env.md#supported-targets) (or an [unsupported development environment](../advanced/community_supported_dev_env.md)).
|
||||
:::
|
||||
|
||||
## 영상 가이드
|
||||
|
||||
<lite-youtube videoid="tMbMGiMs1cQ" title="Setting up your PX4 development environment on macOS"/>
|
||||
|
||||
## Base Setup
|
||||
|
||||
The "base" macOS setup installs the tools needed for building firmware, and includes the common tools that will be needed for installing/using the simulators.
|
||||
|
||||
### Environment Setup
|
||||
|
||||
:::details
|
||||
Apple Silicon Macbook users!
|
||||
If you have an Apple M1, M2 etc. Macbook, make sure to run the terminal as x86 by setting up an x86 terminal:
|
||||
|
||||
1. Locate the Terminal application within the Utilities folder (**Finder > Go menu > Utilities**)
|
||||
2. Select _Terminal.app_ and right-click on it, then choose **Duplicate**.
|
||||
3. Rename the duplicated Terminal app, e.g. to _x86 Terminal_
|
||||
4. Now select the renamed _x86 Terminal_ app and right-click and choose \*_Get Info_
|
||||
5. Check the box for **Open using Rosetta**, then close the window
|
||||
6. Run the _x86 Terminal_ as usual, which will fully support the current PX4 toolchain
|
||||
|
||||
:::
|
||||
|
||||
First set up the environment
|
||||
|
||||
1. Enable more open files by appending the following line to the `~/.zshenv` file (creating it if necessary):
|
||||
|
||||
```sh
|
||||
echo ulimit -S -n 2048 >> ~/.zshenv
|
||||
```
|
||||
|
||||
::: info
|
||||
If you don't do this, the build toolchain may report the error: `"LD: too many open files"`
|
||||
|
||||
:::
|
||||
|
||||
2. Enforce Python 3 by appending the following lines to `~/.zshenv`
|
||||
|
||||
```sh
|
||||
# Point pip3 to MacOS system python 3 pip
|
||||
alias pip3=/usr/bin/pip3
|
||||
```
|
||||
|
||||
### 공통 도구
|
||||
|
||||
To setup the environment to be able to build for Pixhawk/NuttX hardware (and install the common tools for using simulators):
|
||||
|
||||
1. Install Homebrew by following these [installation instructions](https://brew.sh).
|
||||
|
||||
2. Run these commands in your shell to install the common tools:
|
||||
|
||||
```sh
|
||||
brew tap PX4/px4
|
||||
brew install px4-dev
|
||||
```
|
||||
|
||||
3. Install the required Python packages:
|
||||
|
||||
```sh
|
||||
# install required packages using pip3
|
||||
python3 -m pip install --user pyserial empty toml numpy pandas jinja2 pyyaml pyros-genmsg packaging kconfiglib future jsonschema
|
||||
# if this fails with a permissions error, your Python install is in a system path - use this command instead:
|
||||
sudo -H python3 -m pip install --user pyserial empty toml numpy pandas jinja2 pyyaml pyros-genmsg packaging kconfiglib future jsonschema
|
||||
```
|
||||
|
||||
## Gazebo Classic Simulation
|
||||
|
||||
To setup the environment for [Gazebo Classic](../sim_gazebo_classic/index.md) simulation:
|
||||
|
||||
1. Run the following commands in your shell:
|
||||
|
||||
```sh
|
||||
brew unlink tbb
|
||||
sed -i.bak '/disable! date:/s/^/ /; /disable! date:/s/./#/3' $(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula/tbb@2020.rb
|
||||
brew install tbb@2020
|
||||
brew link tbb@2020
|
||||
```
|
||||
|
||||
::: info
|
||||
September 2021: The commands above are a workaround to this bug: [PX4-Autopilot#17644](https://github.com/PX4/PX4-Autopilot/issues/17644).
|
||||
They can be removed once it is fixed (along with this note).
|
||||
|
||||
:::
|
||||
|
||||
2. To install SITL simulation with Gazebo Classic:
|
||||
|
||||
```sh
|
||||
brew install --cask temurin
|
||||
brew install --cask xquartz
|
||||
brew install px4-sim-gazebo
|
||||
```
|
||||
|
||||
3. Run the macOS setup script: `PX4-Autopilot/Tools/setup/macos.sh`
|
||||
The easiest way to do this is to clone the PX4 source, and then run the script from the directory, as shown:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
|
||||
cd PX4-Autopilot/Tools/setup
|
||||
sh macos.sh
|
||||
```
|
||||
|
||||
## 다음 단계
|
||||
|
||||
명령줄 도구 모음 설정후, 다음을 수행합니다.
|
||||
|
||||
- Install [VSCode](../dev_setup/vscode.md) (if you prefer using an IDE to the command line).
|
||||
|
||||
- Install the [QGroundControl Daily Build](../dev_setup/qgc_daily_build.md)
|
||||
|
||||
:::tip
|
||||
The _daily build_ includes development tools that are hidden in release builds.
|
||||
또한, 릴리스 빌드에서 아직 지원되지 않는 새로운 PX4 기능에 대한 액세스를 제공할 수도 있습니다.
|
||||
|
||||
:::
|
||||
|
||||
- Continue to the [build instructions](../dev_setup/building_px4.md).
|
||||
@@ -0,0 +1 @@
|
||||
<Redirect to="dev_env_windows_wsl" />
|
||||
@@ -0,0 +1,155 @@
|
||||
# Windows Development Environment (Cygwin-based)
|
||||
|
||||
:::warning
|
||||
This development environment is [community supported and maintained](../advanced/community_supported_dev_env.md).
|
||||
It may or may not work with current versions of PX4.
|
||||
|
||||
The toolchain was previously recommended, but does not work with PX4 v1.12 and later due to packaging issues.
|
||||
The [Windows WSL2-Based Development Environment](../dev_setup/dev_env_windows_wsl.md) should be used by preference.
|
||||
|
||||
See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team.
|
||||
:::
|
||||
|
||||
다음 지침은 Windows 10에서 (Cygwin 기반) PX4 개발 환경 설정 방법을 설명합니다.
|
||||
PX4 빌드에 사용되어 집니다.
|
||||
|
||||
- Pixhawk와 기타 NuttX 기반 하드웨어
|
||||
- [jMAVSim Simulation](../sim_jmavsim/index.md)
|
||||
|
||||
<a id="installation"></a>
|
||||
|
||||
## 설치 방법
|
||||
|
||||
1. Download the latest version of the ready-to-use MSI installer from: [Github releases](https://github.com/PX4/windows-toolchain/releases) or [Amazon S3](https://s3-us-west-2.amazonaws.com/px4-tools/PX4+Windows+Cygwin+Toolchain/PX4+Windows+Cygwin+Toolchain+0.9.msi) (fast download).
|
||||
|
||||
2. Run it, choose your desired installation location, let it install:
|
||||
|
||||

|
||||
|
||||
3. Tick the box at the end of the installation to _clone the PX4 repository, build and run simulation with jMAVSim_ (this simplifies the process to get you started).
|
||||
|
||||
::: info
|
||||
If you missed this step you will need to [clone the PX4-Autopilot repository manually](#getting-started).
|
||||
|
||||
:::
|
||||
|
||||
:::warning
|
||||
At time of writing the installer is missing some dependencies (and cannot yet be rebuilt to add them - see [PX4-windows-toolchain#31](https://github.com/PX4/PX4-windows-toolchain/issues/31)).
|
||||
|
||||
To add these yourself:
|
||||
|
||||
1. 도구 모음 설치 디렉터리로 이동합니다(기본값 **C:\\PX4\\**).
|
||||
2. Run **run-console.bat** (double click) to start the linux-like Cygwin bash console
|
||||
3. Enter the following command in the console:
|
||||
|
||||
```sh
|
||||
pip3 install --user kconfiglib jsonschema future
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
## 시작하기
|
||||
|
||||
The toolchain uses a specially configured console window (started by running the **run-console.bat** script) from which you can call the normal PX4 build commands:
|
||||
|
||||
1. 도구 모음 설치 디렉터리로 이동합니다(기본값 **C:\\PX4\\**).
|
||||
|
||||
2. Run **run-console.bat** (double click) to start the linux-like Cygwin bash console (you must use this console to build PX4).
|
||||
|
||||
3. Clone the PX4 PX4-Autopilot repository from within the console:
|
||||
|
||||
::: info
|
||||
Skip this step if you ticked the installer option to _clone the PX4 repository, build and run simulation with jMAVSim_.
|
||||
Cloning only needs to be done once!
|
||||
|
||||
:::
|
||||
|
||||
```sh
|
||||
# Clone the PX4-Autopilot repository into the home folder & loads submodules in parallel
|
||||
git clone --recursive -j8 https://github.com/PX4/PX4-Autopilot.git
|
||||
```
|
||||
|
||||
You can now use the console/PX4-Autopilot repository to build PX4.
|
||||
|
||||
4. For example, to run JMAVSim:
|
||||
|
||||
```sh
|
||||
# Navigate to PX4-Autopilot repo
|
||||
cd Firmware
|
||||
# Build and runs SITL simulation with jMAVSim to test the setup
|
||||
make px4_sitl jmavsim
|
||||
```
|
||||
|
||||
The console will then display:
|
||||
|
||||

|
||||
|
||||
## 다음 단계
|
||||
|
||||
명령줄 도구 모음 설정후, 다음을 수행합니다.
|
||||
|
||||
- Install the [QGroundControl Daily Build](../dev_setup/qgc_daily_build.md)
|
||||
- Continue to the [build instructions](../dev_setup/building_px4.md).
|
||||
|
||||
## 문제 해결
|
||||
|
||||
### 파일 모니터링 도구와 툴체인 속도
|
||||
|
||||
Antivirus and other background file monitoring tools can significantly slow down both installation of the toolchain and PX4 build times.
|
||||
|
||||
You may wish to halt them temporarily during builds (at your own risk).
|
||||
|
||||
### Windows & Git Special Cases
|
||||
|
||||
#### Windows CR+LF 대 Unix LF 줄 끝
|
||||
|
||||
We recommend that you force Unix style LF endings for every repository you're working with using this toolchain (and use an editor which preserves them when saving your changes - e.g. Eclipse or VS Code).
|
||||
Compilation of source files also works with CR+LF endings checked out locally, but there are cases in Cygwin (e.g. execution of shell scripts) that require Unix line endings (otherwise you get errors like `$'\r': Command not found.`).
|
||||
Luckily git can do this for you when you execute the two commands in the root directory of your repo:
|
||||
|
||||
```sh
|
||||
git config core.autocrlf false
|
||||
git config core.eol lf
|
||||
```
|
||||
|
||||
If you work with this toolchain on multiple repositories you can also set these two configurations globally for your machine:
|
||||
|
||||
```sh
|
||||
git config --global ...
|
||||
```
|
||||
|
||||
This is not recommended because it may affect any other (unrelated) git use on your Windows machine.
|
||||
|
||||
#### 유닉스 권한 실행 비트
|
||||
|
||||
Under Unix there's a flag in the permissions of each file that tells the OS whether or not the file is allowed to be executed.
|
||||
_git_ under Cygwin supports and cares about that bit (even though the Windows NTFS file system does not use it).
|
||||
This often results in _git_ finding "false-positive" differences in permissions.
|
||||
The resulting diff might look like this:
|
||||
|
||||
```sh
|
||||
diff --git ...
|
||||
old mode 100644
|
||||
new mode 100755
|
||||
```
|
||||
|
||||
We recommend globally disabling the permission check on Windows to avoid the problem:
|
||||
|
||||
```sh
|
||||
# 머신에 대해 전역적으로 실행 비트 검사를 비활성화합니다.
|
||||
git config --global core.fileMode false
|
||||
```
|
||||
|
||||
For existing repositories that have this problem caused by a local configuration, additionally:
|
||||
|
||||
```sh
|
||||
# remove the local option for this repository to apply the global one
|
||||
git config --unset core.filemode
|
||||
|
||||
# remove the local option for all submodules
|
||||
git submodule foreach --recursive git config --unset core.filemode
|
||||
```
|
||||
|
||||
<!--
|
||||
Instructions for building/updating this toolchain are covered in [Windows Cygwin Development Environment (Maintenance Instructions)](../dev_setup/dev_env_windows_cygwin_packager_setup.md)
|
||||
-->
|
||||
@@ -0,0 +1,167 @@
|
||||
# Windows Cygwin Development Environment (Maintenance Instructions)
|
||||
|
||||
:::warning
|
||||
This development environment is [community supported and maintained](../advanced/community_supported_dev_env.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 construct and extend the development environment used for the no-longer-supported [Cygwin-based Windows Development Environment](../dev_setup/dev_env_windows_cygwin.md).
|
||||
|
||||
## 추가 정보
|
||||
|
||||
### Features / Issues
|
||||
|
||||
The following features are known to work (version 2.0):
|
||||
|
||||
- Building and running SITL with jMAVSim with significantly better performance than a VM (it generates a native windows binary **px4.exe**).
|
||||
- Building and uploading NuttX builds (e.g.: px4_fmu-v2 and px4_fmu-v4)
|
||||
- Style check with _astyle_ (supports the command: `make format`)
|
||||
- Command line auto completion
|
||||
- Non-invasive installer! The installer does NOT affect your system and global path (it only modifies the selected installation directory e.g. \*\*C:\PX4\*\* and uses a temporary local path).
|
||||
- The installer supports updating to a new version keeping your personal changes inside the toolchain folder
|
||||
|
||||
Omissions:
|
||||
|
||||
- Simulation: Gazebo and ROS are not supported.
|
||||
- Only NuttX and JMAVSim/SITL builds are supported.
|
||||
- [Known problems](https://github.com/orgs/PX4/projects/6) (Also use to report issues).
|
||||
|
||||
### Shell Script Installation
|
||||
|
||||
You can also install the environment using shell scripts in the Github project.
|
||||
|
||||
1. Make sure you have [Git for Windows](https://git-scm.com/download/win) installed.
|
||||
|
||||
2. Clone the repository https://github.com/PX4/windows-toolchain to the location you want to install the toolchain. Default location and naming is achieved by opening the `Git Bash` and executing:
|
||||
|
||||
```sh
|
||||
cd /c/
|
||||
git clone https://github.com/PX4/windows-toolchain PX4
|
||||
```
|
||||
|
||||
3. If you want to install all components navigate to the freshly cloned folder and double click on the script `install-all-components.bat` located in the folder `toolchain`. If you only need certain components and want to safe Internet traffic and or disk space you can navigate to the different component folders like e.g. `toolchain\cygwin64` and click on the **install-XXX.bat** scripts to only fetch something specific.
|
||||
|
||||
4. Continue with [Getting Started](../dev_setup/dev_env_windows_cygwin.md#getting-started).
|
||||
|
||||
### Manual Installation (for Toolchain Developers)
|
||||
|
||||
This section describes how to setup the Cygwin toolchain manually yourself while pointing to the corresponding scripts from the script based installation repo.
|
||||
The result should be the same as using the scripts or MSI installer.
|
||||
|
||||
:::info
|
||||
The toolchain gets maintained and hence these instructions might not cover every detail of all the future changes.
|
||||
:::
|
||||
|
||||
1. Create the _folders_: \*\*C:\PX4\*\*, \*\*C:\PX4\toolchain\*\* and \*\*C:\PX4\home\*\*
|
||||
|
||||
2. Download the _Cygwin installer_ file [setup-x86_64.exe](https://cygwin.com/setup-x86_64.exe) from the [official Cygwin website](https://cygwin.com/install.html)
|
||||
|
||||
3. Run the downloaded setup file
|
||||
|
||||
4. In the wizard choose to install into the folder: \*\*C:\PX4\toolchain\cygwin64\*\*
|
||||
|
||||
5. Select to install the default Cygwin base and the newest available version of the following additional packages:
|
||||
|
||||
- **Category:Packagename**
|
||||
- Devel:cmake (3.3.2 gives no deprecated warnings, 3.6.2 works but has the warnings)
|
||||
- Devel:gcc-g++
|
||||
- Devel:gdb
|
||||
- Devel:git
|
||||
- Devel:make
|
||||
- Devel:ninja
|
||||
- Devel:patch
|
||||
- Editors:xxd
|
||||
- Editors:nano (unless you're the vim pro)
|
||||
- Python:python2
|
||||
- Python:python2-pip
|
||||
- Python:python2-numpy
|
||||
- Python:python2-jinja2
|
||||
- Python:python2-pyyaml
|
||||
- Python:python2-cerberus
|
||||
- Archive:unzip
|
||||
- Utils:astyle
|
||||
- Shells:bash-completion
|
||||
- Web:wget
|
||||
|
||||
::: info
|
||||
Do not select as many packages as possible which are not on this list, there are some which conflict and break the builds.
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
That's what [cygwin64/install-cygwin-px4.bat](https://github.com/MaEtUgR/PX4Toolchain/blob/master/toolchain/cygwin64/install-cygwin-px4.bat) does.
|
||||
|
||||
:::
|
||||
|
||||
6. Write up or copy the **batch scripts** [`run-console.bat`](https://github.com/MaEtUgR/PX4Toolchain/blob/master/run-console.bat) and [`setup-environment.bat`](https://github.com/PX4/windows-toolchain/blob/master/toolchain/scripts/setup-environment.bat).
|
||||
|
||||
The reason to start all the development tools through the prepared batch script is they preconfigure the starting program to use the local, portable Cygwin environment inside the toolchain's folder.
|
||||
This is done by always first calling the script [**setup-environment.bat**](https://github.com/PX4/windows-toolchain/blob/master/toolchain/scripts/setup-environment.bat) and the desired application like the console after that.
|
||||
|
||||
The script [setup-environment.bat](https://github.com/PX4/windows-toolchain/blob/master/toolchain/scripts/setup-environment.bat) locally sets environmental variables for the workspace root directory `PX4_DIR`, all binary locations `PATH`, and the home directory of the unix environment `HOME`.
|
||||
|
||||
7. Add necessary **python packages** to your setup by opening the Cygwin toolchain console (double clicking **run-console.bat**) and executing
|
||||
|
||||
```sh
|
||||
pip2 install toml
|
||||
pip2 install pyserial
|
||||
pip2 install pyulog
|
||||
```
|
||||
|
||||
::: info
|
||||
That's what [cygwin64/install-cygwin-python-packages.bat](https://github.com/MaEtUgR/PX4Toolchain/blob/master/toolchain/cygwin64/install-cygwin-python-packages.bat) does.
|
||||
|
||||
:::
|
||||
|
||||
8. Download the [**ARM GCC compiler**](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads) as zip archive of the binaries for Windows and unpack the content to the folder `C:\PX4\toolchain\gcc-arm`.
|
||||
|
||||
::: info
|
||||
This is what the toolchain does in: [gcc-arm/install-gcc-arm.bat](https://github.com/MaEtUgR/PX4Toolchain/blob/master/toolchain/gcc-arm/install-gcc-arm.bat).
|
||||
|
||||
:::
|
||||
|
||||
9. Install the JDK:
|
||||
|
||||
- Download Java 14 from [Oracle](https://www.oracle.com/java/technologies/javase-jdk14-downloads.html) or [AdoptOpenJDK](https://adoptopenjdk.net/).
|
||||
- Because sadly there is no portable archive containing the binaries directly you have to install it.
|
||||
- Find the binaries and move/copy them to **C:\PX4\toolchain\jdk**.
|
||||
- You can uninstall the Kit from your Windows system again, we only needed the binaries for the toolchain.
|
||||
|
||||
::: info
|
||||
This is what the toolchain does in: [jdk/install-jdk.bat](https://github.com/MaEtUgR/PX4Toolchain/blob/master/toolchain/jdk/install-jdk.bat).
|
||||
|
||||
:::
|
||||
|
||||
10. Download [**Apache Ant**](https://ant.apache.org/bindownload.cgi) as zip archive of the binaries for Windows and unpack the content to the folder `C:\PX4\toolchain\apache-ant`.
|
||||
|
||||
:::tip
|
||||
Make sure you don't have an additional folder layer from the folder which is inside the downloaded archive.
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
This is what the toolchain does in: [apache-ant/install-apache-ant.bat](https://github.com/MaEtUgR/PX4Toolchain/blob/master/toolchain/apache-ant/install-apache-ant.bat).
|
||||
|
||||
:::
|
||||
|
||||
11. Download, build and add _genromfs_ to the path:
|
||||
|
||||
- Clone the source code to the folder **C:\PX4\toolchain\genromfs\genromfs-src** with
|
||||
|
||||
```sh
|
||||
cd /c/toolchain/genromfs
|
||||
git clone https://github.com/chexum/genromfs.git genromfs-src
|
||||
```
|
||||
|
||||
- Compile it with:
|
||||
|
||||
```sh
|
||||
cd genromfs-src
|
||||
make all
|
||||
```
|
||||
|
||||
- Copy the resulting binary **genromfs.exe** one folder level out to: **C:\PX4\toolchain\genromfs**
|
||||
|
||||
12. Make sure all the binary folders of all the installed components are correctly listed in the `PATH` variable configured by [**setup-environment.bat**](https://github.com/PX4/windows-toolchain/blob/master/toolchain/scripts/setup-environment.bat).
|
||||
@@ -0,0 +1,124 @@
|
||||
# Windows 가상 머신 호스팅 도구 모음
|
||||
|
||||
:::warning
|
||||
This development environment is [community supported and maintained](../advanced/community_supported_dev_env.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.
|
||||
:::
|
||||
|
||||
Windows 개발자는 Linux를 게스트 운영 체제로 사용하는 가상 머신(VM)에서 PX4 툴체인을 실행할 수 있습니다.
|
||||
가상 머신을 설정한 후, 가상 머신내의 PX4 설치 및 설정은 일반 Linux 환경에서의 설정과 동일합니다.
|
||||
|
||||
가상 머신을 사용하는 것은 펌웨어 구축 환경을 설정과 테스트가 매우 편리하지만, 사용자는 다음 사항에 유의하여야 합니다.
|
||||
|
||||
1. 펌웨어 빌드는 Linux에서 빌드하는 것보다 조금 느립니다.
|
||||
2. The JMAVSim simulation, frame rate be much slower than on native Linux.
|
||||
경우에 따라서, 가상 머신 리소스 부족과 관련된 문제로 차량이 충돌할 수 있습니다.
|
||||
3. Gazebo와 ROS는 설치할 수 있지만, 사용할 수 없을 정도로 느립니다.
|
||||
|
||||
:::tip
|
||||
Allocate as many CPU cores and memory resources to the VM as possible.
|
||||
:::
|
||||
|
||||
시스템에서 PX4 실행을 위한 가상 머신을 설정하는 방법에는 여러 가지가 있습니다.
|
||||
이 가이드는 VMWare 설정 방법을 설명합니다.
|
||||
There is also an incomplete section for VirtualBox at the end (we'd welcome expansion of this section from a community member).
|
||||
|
||||
## VMWare Setup
|
||||
|
||||
VMWare performance is acceptable for basic usage (building Firmware) but not for running ROS or Gazebo Classic.
|
||||
|
||||
1. Download [VMWare Player Freeware](https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html)
|
||||
|
||||
2. 윈도우 시스템에 설치합니다.
|
||||
|
||||
3. Download the desired version of [Ubuntu Desktop ISO Image](https://www.ubuntu.com/download/desktop).
|
||||
(see [Linux Instructions Page](../dev_setup/dev_env_linux.md) for recommended Ubuntu version).
|
||||
|
||||
4. Open _VMWare Player_.
|
||||
|
||||
5. Enable 3D acceleration in the VM's settings: **VM > Settings > Hardware > Display > Accelerate 3D graphics**
|
||||
|
||||
::: info
|
||||
This option is required to properly run 3D simulation environments like jMAVSim and Gazebo Classic.
|
||||
가상 환경에 Linux를 설치하기 전에 이 작업을 수행하는 것이 좋습니다.
|
||||
|
||||
:::
|
||||
|
||||
6. 새 가상 머신을 생성하는 메뉴를 선택합니다.
|
||||
|
||||
7. 가상 머신 생성 마법사에서 다운로드한 Ubuntu ISO 이미지를 설치 매체로 선택하면, 사용하려는 운영 체제가 자동으로 감지됩니다.
|
||||
|
||||
8. 마법사에서 실행 중인 가상 머신에 할당할 리소스를 선택합니다.
|
||||
가상 머신에 최대한 많은 메모리와 CPU 코어를 할당하십시오.
|
||||
|
||||
9. 마법사가 종료시 새 가상 머신을 실행하고, 설정 지침에 따라 Ubuntu를 설치합니다.
|
||||
모든 설정은 호스트 운영 체제에서 사용하기 위한 것이므로, 네트워크 공격의 위험을 증가시키지 않는 화면 보호기 및 로컬 워크스테이션 보안 기능을 비활성화할 수 있습니다.
|
||||
|
||||
10. Once the new VM is booted up make sure you install _VMWare tools drivers and tools extension_ inside your guest system.
|
||||
이렇게 하면 다음과 같은 VM 사용의 성능과 유용성들이 향상됩니다.
|
||||
|
||||
- 크게 향상된 그래픽 성능
|
||||
- Proper support for hardware device usage like USB port allocation (important for target upload), proper mouse wheel scrolling, sound support
|
||||
- 창 크기에 따른 게스트 디스플레이 해상도 조정
|
||||
- 호스트 시스템 클립보드 공유
|
||||
- 호스트 시스템 파일 공유
|
||||
|
||||
11. Continue with [PX4 environment setup for Linux](../dev_setup/dev_env_linux.md)
|
||||
|
||||
## VirtualBox 7 Setup
|
||||
|
||||
The setup for VirtualBox is similar to VMWare.
|
||||
Community members, we'd welcome a step-by-step guide here!
|
||||
|
||||
### USB passthrough for QGroundControl / Firmware Flashing
|
||||
|
||||
:::tip
|
||||
This section has been tested for VirtualBox 7 running Ubuntu 20.04 LTS on a Windows 10 host machine.
|
||||
:::
|
||||
|
||||
One limitation of virtual machines is that you can't automatically connect to a flight controller attached to the host computer USB port in order to [build and upload PX4 firmware from a terminal](../dev_setup/building_px4.md#uploading-firmware-flashing-the-board).
|
||||
You also can't connect to the flight controller from QGroundControl in the virtual machine.
|
||||
|
||||
To allow this, you need to configure USB passthrough settings:
|
||||
|
||||
1. Ensure that the user has been added to the dialout group in the VM using the terminal command:
|
||||
|
||||
```sh
|
||||
sudo usermod -a -G dialout $USER
|
||||
```
|
||||
|
||||
Then restart Ubuntu in the virtual machine.
|
||||
|
||||
2. Enable serial port(s) in VM: **VirtualBox > Settings > Serial Ports 1/2/3/etc...**
|
||||
|
||||
3. Enable USB controller in VM: **VirtualBox > Settings > USB**
|
||||
|
||||
4. Add USB filters for the bootloader in VM: **VirtualBox > Settings > USB > Add new USB filter**.
|
||||
|
||||
- Open the menu and plug in the USB cable connected to your autopilot.
|
||||
Select the `...Bootloader` device when it appears in the UI.
|
||||
|
||||
::: info
|
||||
The bootloader device only appears for a few seconds after connecting USB.
|
||||
If it disappears before you can select it, disconnect and then reconnect USB.
|
||||
|
||||
:::
|
||||
|
||||
- Select the `...Autopilot` device when it appears (this happens after the bootloader completes).
|
||||
|
||||
5. Select the device in the VM instance's dropdown menu **VirtualBox > Devices > your_device**
|
||||
|
||||
If successful, your device will show up with `lsusb` and QGroundControl will connect to the device automatically.
|
||||
You should also be able to build and upload firmware using a command like:
|
||||
|
||||
```sh
|
||||
make px4_fmu-v5_default upload
|
||||
```
|
||||
|
||||
### Telemetry over WiFi for QGroundControl
|
||||
|
||||
If using _QGroundControl_ within a virtual machine you should set the VM networking settings to "Bridged Adapter" mode.
|
||||
This gives the guest OS direct access to networking hardware on the host.
|
||||
If you use the Network Address Translation (NAT), which is set by default for VirtualBox 7 running Ubuntu 20.04 LTS, this will block the outbound UDP packets that QGroundControl uses to communicate with the vehicle.
|
||||
@@ -0,0 +1,352 @@
|
||||
# Windows Development Environment (WSL2-Based)
|
||||
|
||||
The following instructions explain how to set up a PX4 development environment on Windows 10 or 11, running on Ubuntu Linux within [WSL2](https://docs.microsoft.com/en-us/windows/wsl/about).
|
||||
|
||||
PX4 빌드에 사용되어 집니다.
|
||||
|
||||
- [Pixhawk and other NuttX-based hardware](../dev_setup/building_px4.md#nuttx-pixhawk-based-boards)
|
||||
- [Gazebo Simulation](../sim_gazebo_gz/index.md)
|
||||
- [Gazebo-Classic Simulation](../sim_gazebo_classic/index.md)
|
||||
|
||||
:::tip
|
||||
This setup is supported by the PX4 dev team.
|
||||
The environment should in theory be able to build any target that can be built on Ubuntu.
|
||||
The list above are those targets that are regularly tested.
|
||||
:::
|
||||
|
||||
## 개요
|
||||
|
||||
The [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about) ([WSL2](https://docs.microsoft.com/en-us/windows/wsl/compare-versions)) allows users to install and run the [Ubuntu Development Environment](../dev_setup/dev_env_linux_ubuntu.md) on Windows, _almost_ as though we were running it on a Linux computer.
|
||||
|
||||
With this environment developers can:
|
||||
|
||||
- Build any simulator or hardware target supported by [Ubuntu Development Environment](../dev_setup/dev_env_linux_ubuntu.md) in the WSL Shell.
|
||||
(Ubuntu is the best supported and tested PX4 development platform).
|
||||
- Debug code in [Visual Studio Code](dev_env_windows_wsl.md#visual-studio-code-integration) running on Windows.
|
||||
- Monitor a _simulation_ using _QGroundControl for Linux_ running in WSL.
|
||||
QGC for Linux connects automatically to the simulation.
|
||||
|
||||
_QGroundControl for Windows_ is additionally required if you need to:
|
||||
|
||||
- [Update firmware](#flash-a-flight-control-board) on a real vehicle.
|
||||
- Monitor a real vehicle.
|
||||
Note that you can also use it to monitor a simulation, but you must manually [connect to the simulation running in WSL](#qgroundcontrol-on-windows).
|
||||
|
||||
:::info
|
||||
Connecting to a USB device from within WSL is not supported, so you can't update firmware using the [`upload`](../dev_setup/building_px4.md#uploading-firmware-flashing-the-board) option when building on the command line, or from _QGroundControl for Linux_.
|
||||
:::
|
||||
|
||||
:::info
|
||||
The approach is similar to installing PX4 in your _own_ virtual machine, as described in [Windows VM-Hosted Toolchain](../dev_setup/dev_env_windows_vm.md).
|
||||
The benefit of WSL2 is that its virtual machine is deeply integrated into Windows, system-managed, and performance optimised.
|
||||
:::
|
||||
|
||||
## 설치
|
||||
|
||||
### Install WSL2
|
||||
|
||||
To install WSL2 with Ubuntu on a new installation of Windows 10 or 11:
|
||||
|
||||
1. Make sure your computer your computer's virtualization feature is enabled in the BIOS.
|
||||
It's usually referred as "Virtualization Technology", "Intel VT-x" or "AMD-V" respectively
|
||||
|
||||
2. Open _cmd.exe_ as administrator.
|
||||
This can be done by pressing the start key, typing `cmd`, right-clicking on the _Command prompt_ entry and selecting **Run as administrator**.
|
||||
|
||||
3. Execute the following commands to install WSL2 and a particular Ubuntu version:
|
||||
|
||||
- Default version (Ubuntu 22.04):
|
||||
|
||||
```sh
|
||||
wsl --install
|
||||
```
|
||||
|
||||
- Ubuntu 20.04 ([Gazebo-Classic Simulation](../sim_gazebo_classic/index.md))
|
||||
|
||||
```sh
|
||||
wsl --install -d Ubuntu-20.04
|
||||
```
|
||||
|
||||
- Ubuntu 22.04 ([Gazebo Simulation](../sim_gazebo_gz/index.md))
|
||||
|
||||
```sh
|
||||
wsl --install -d Ubuntu-22.04
|
||||
```
|
||||
|
||||
::: info
|
||||
You can also install[Ubuntu 20.04](https://www.microsoft.com/store/productId/9MTTCL66CPXJ) and [Ubuntu 22.04](https://www.microsoft.com/store/productId/9PN20MSR04DW) from the store, which allows you to delete the application using the normal Windows Add/Remove settings:
|
||||
|
||||
:::
|
||||
|
||||
4. WSL will prompt you for a user name and password for the Ubuntu installation.
|
||||
Record these credentials as you will need them later on!
|
||||
|
||||
The command prompt is now a terminal within the newly installed Ubuntu environment.
|
||||
|
||||
### Opening a WSL Shell
|
||||
|
||||
All operations to install and build PX4 must be done within a WSL Shell (you can use the same shell that was used to install WSL2 or open a new one).
|
||||
|
||||
If you're using [Windows Terminal](https://learn.microsoft.com/en-us/windows/terminal/install) you can open a shell into an installed WSL environment as shown, and exit it by closing the tab.
|
||||
|
||||

|
||||
|
||||
To open a WSL shell using a command prompt:
|
||||
|
||||
1. Open a command prompt:
|
||||
|
||||
- Press the Windows **Start** key.
|
||||
- Type `cmd` and press **Enter** to open the prompt.
|
||||
|
||||
2. To start WSL and access the WSL shell, execute the command:
|
||||
|
||||
```sh
|
||||
wsl -d <distribution_name>
|
||||
```
|
||||
|
||||
예:
|
||||
|
||||
```sh
|
||||
wsl -d Ubuntu
|
||||
```
|
||||
|
||||
```sh
|
||||
wsl -d Ubuntu-20.04
|
||||
```
|
||||
|
||||
If you only have one version of Ubuntu, you can just use `wsl`.
|
||||
|
||||
Enter the following commands to first close the WSL shell, and then shut down WSL:
|
||||
|
||||
```sh
|
||||
exit
|
||||
wsl -d <distribution_name> --shutdown
|
||||
```
|
||||
|
||||
Alternatively, after entering `exit` you can just close the prompt.
|
||||
|
||||
### Install PX4 Toolchain
|
||||
|
||||
Next we download the PX4 source code within the WSL2 environment, and use the normal _Ubuntu installer script_ to set up the developer environment.
|
||||
This will install the toolchain for Gazebo Classic simulation and Pixhawk/NuttX hardware.
|
||||
|
||||
To install the development toolchain:
|
||||
|
||||
1. [Open a WSL2 Shell](#opening-a-wsl-shell) (if it is still open you can use the same one that was used to install WSL2).
|
||||
|
||||
2. Execute the command `cd ~` to switch to the home folder of WSL for the next steps.
|
||||
|
||||
:::warning
|
||||
This is important!
|
||||
If you work from a location outside of the WSL file system you'll run into issues such as very slow execution and access right/permission errors.
|
||||
|
||||
:::
|
||||
|
||||
3. Download the PX4 source code using `git` (which is already installed in WSL2):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
|
||||
```
|
||||
|
||||
::: info
|
||||
The environment setup scripts in the source usually work for recent PX4 releases.
|
||||
If working with an older version of PX4 you may need to [get the source code specific to your release](../contribute/git_examples.md#get-a-specific-release).
|
||||
|
||||
:::
|
||||
|
||||
4. Run the **ubuntu.sh** installer script and acknowledge any prompts as the script progresses:
|
||||
|
||||
```sh
|
||||
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
|
||||
```
|
||||
|
||||
::: info
|
||||
This installs tools to build PX4 for Pixhawk and either Gazebo or Gazebo Classic targets:
|
||||
|
||||
- You can use the `--no-nuttx` and `--no-sim-tools` options to omit the NuttX and/or simulation tools.
|
||||
- Other Linux build targets are untested (you can try these by entering the appropriate commands in [Ubuntu Development Environment](../dev_setup/dev_env_linux_ubuntu.md) into the WSL shell).
|
||||
|
||||
:::
|
||||
|
||||
5. Restart the "WSL computer" after the script completes (exit the shell, shutdown WSL, and restart WSL):
|
||||
|
||||
```sh
|
||||
exit
|
||||
wsl --shutdown
|
||||
wsl
|
||||
```
|
||||
|
||||
6. Switch to the PX4 repository in the WSL home folder:
|
||||
|
||||
```sh
|
||||
cd ~/PX4-Autopilot
|
||||
```
|
||||
|
||||
7. Build the PX4 SITL target and test your environment:
|
||||
|
||||
```sh
|
||||
make px4_sitl
|
||||
```
|
||||
|
||||
For more build options see [Building PX4 Software](../dev_setup/building_px4.md).
|
||||
|
||||
## Visual Studio Code Integration
|
||||
|
||||
VS Code running on Windows is well integrated with WSL.
|
||||
|
||||
To set up the integration:
|
||||
|
||||
1. [Download](https://code.visualstudio.com/) and install Visual Studio Code (VS Code) on Windows,
|
||||
|
||||
2. Open _VS Code_.
|
||||
|
||||
3. Install the extension called [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) (marketplace)
|
||||
|
||||
4. [Open a WSL shell](#opening-a-wsl-shell)
|
||||
|
||||
5. In the WSL shell, switch to the PX4 folder:
|
||||
|
||||
```sh
|
||||
cd ~/PX4-Autopilot
|
||||
```
|
||||
|
||||
6. In the WSL shell, start VS Code:
|
||||
|
||||
```sh
|
||||
code .
|
||||
```
|
||||
|
||||
This will open the IDE fully integrated with the WSL shell.
|
||||
|
||||
Make sure you always open the PX4 repository in the Remote WSL mode.
|
||||
|
||||
7. Next time you want to develop WSL2 you can very easily open it again in Remote WSL mode by selecting **Open Recent** (as shown below).
|
||||
This will start WSL for you.
|
||||
|
||||

|
||||
|
||||
Note however that the IP address of the WSL virtual machine will have changed, so you won't be able to monitor simulation from QGC for Windows (you can still monitor using QGC for Linux)
|
||||
|
||||
## QGroundControl
|
||||
|
||||
You can run QGroundControl in either WSL or Windows to connect to the running simulation.
|
||||
If you need to [flash a flight control board](#flash-a-flight-control-board) with new firmware you can only do this from the QGroundControl for Windows.
|
||||
|
||||
### QGroundControl in WSL
|
||||
|
||||
The easiest way to set up and use QGroundControl is to download the Linux version into your WSL.
|
||||
|
||||
You can do this from within the WSL shell.
|
||||
|
||||
1. In a web browser, navigate to the QGC [Ubuntu download section](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/getting_started/download_and_install.html#ubuntu)
|
||||
|
||||
2. Right-click on the **QGroundControl.AppImage** link, and select "Copy link address".
|
||||
This will be something like _https://d176td9ibe4jno.cloudfront.net/builds/master/QGroundControl.AppImage_
|
||||
|
||||
3. [Open a WSL shell](#opening-a-wsl-shell) and enter the following commands to download the appimage and make it executable (replace the AppImage URL where indicated):
|
||||
|
||||
```sh
|
||||
cd ~
|
||||
wget <the_copied_AppImage_URL>
|
||||
chmod +x QGroundControl.AppImage
|
||||
```
|
||||
|
||||
4. Run QGroundControl:
|
||||
|
||||
```sh
|
||||
./QGroundControl.AppImage
|
||||
```
|
||||
|
||||
QGroundControl will launch and automatically connect to a running simulation and allow you to monitor and control your vehicle(s).
|
||||
|
||||
You will not be able to use it to install PX4 firmware because WSL does not allow access to serial devices.
|
||||
|
||||
### QGroundControl on Windows
|
||||
|
||||
Install [QGroundControl on Windows](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/getting_started/download_and_install.html#windows) if you want to be able to update hardware with firmware created within PX4.
|
||||
|
||||
These steps describe how you can connect to the simulation running in the WSL:
|
||||
|
||||
1. [Open a WSL shell](#opening-a-wsl-shell)
|
||||
|
||||
2. Check the IP address of the WSL virtual machine by running the command `ip addr | grep eth0`:
|
||||
|
||||
```sh
|
||||
$ ip addr | grep eth0
|
||||
|
||||
6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
|
||||
inet 172.18.46.131/20 brd 172.18.47.255 scope global eth0
|
||||
```
|
||||
|
||||
Copy the first part of the `eth0` interface `inet` address to the clipboard.
|
||||
In this case: `172.18.46.131`.
|
||||
|
||||
3. In QGC go to **Q > Application Settings > Comm Links**
|
||||
|
||||
4. Add a UDP Link called "WSL" to port `18570` of the IP address copied above.
|
||||
|
||||
5. Save it and connect to it.
|
||||
|
||||
:::info
|
||||
You will have to update the WSL comm link in QGC every time WSL restarts (because it gets a dynamic IP address).
|
||||
:::
|
||||
|
||||
## Flash a Flight Control Board
|
||||
|
||||
Flashing a custom built PX4 binary has to be done using [QGroundControl for Windows](#qgroundcontrol-on-windows).
|
||||
|
||||
:::info
|
||||
WSL2 does not natively offer direct access to serial/USB devices like Pixhawk flight controllers connected to your computer.
|
||||
That means you can't connect QGC running inside WSL2 to a flight controller to install firmware, or use the `upload` command to [upload firmware as it is built](../dev_setup/building_px4.md#uploading-firmware-flashing-the-board).
|
||||
Instead you connect [QGroundControl for Windows](#qgroundcontrol-on-windows) to PX4 running in WSL2 and to the Flight controller in order to upload the firmware.
|
||||
:::
|
||||
|
||||
Do the following steps to flash your custom binary built in WSL:
|
||||
|
||||
1. If you haven't already built the binary in WSL e.g. with a [WSL shell](dev_env_windows_wsl.md#opening-a-wsl-shell) and by running:
|
||||
|
||||
```sh
|
||||
cd ~/PX4-Autopilot
|
||||
make px4_fmu-v5
|
||||
```
|
||||
|
||||
::: tip
|
||||
Use the correct `make` target for your board.
|
||||
`px4_fmu-v5` can be used for a Pixhawk 4 board.
|
||||
|
||||
:::
|
||||
|
||||
2. Detach the USB cable of your Pixhawk board from the computer if it was connected.
|
||||
|
||||
3. Open QGC and navigate to **Q > Vehicle Setup > Firmware**.
|
||||
|
||||
4. Plug your Pixhawk board via USB
|
||||
|
||||
5. Once connected select "PX4 Flight Stack", check **Advanced settings** and choose _Custom firmware file ..._ from the drop down below.
|
||||
|
||||
6. Continue and select the firmware binary you just built in WSL.
|
||||
|
||||
In the open dialog look for the "Linux" location with the penguin icon in the left pane.
|
||||
It's usually all the way at the bottom.
|
||||
Choose the file in the path: `Ubuntu\home\{your WSL user name}\PX4-Autopilot\build\{your build target}\{your build target}.px4`
|
||||
|
||||
::: info
|
||||
You can add the folder to the favourites to access it quickly next time.
|
||||
|
||||
:::
|
||||
|
||||
7. Start the flashing.
|
||||
|
||||
For more information see [Installing PX4 Main, Beta or Custom Firmware (Loading Firmware)](../config/firmware.md#installing-px4-main-beta-or-custom-firmware).
|
||||
|
||||
## 문제 해결
|
||||
|
||||
If you have any problems with your setup, check the current [Microsoft WSL installation documentation](https://learn.microsoft.com/en-us/windows/wsl/install).
|
||||
|
||||
We also recommend that you have the latest Windows GPU drivers installed and also install a recent version of [kisak mesa](https://launchpad.net/~kisak/+archive/ubuntu/kisak-mesa) in your Ubuntu environment so that most OpenGL features get emulated:
|
||||
|
||||
```sh
|
||||
sudo add-apt-repository ppa:kisak/kisak-mesa
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
# 시작하기
|
||||
|
||||
이 섹션에는 PX4 개발에 관련된 주제가 포함되어 있습니다.
|
||||
|
||||
- [Initial Setup](../dev_setup/config_initial.md)
|
||||
- [Toolchain Installation](../dev_setup/dev_env.md)
|
||||
- [Building the Code](../dev_setup/building_px4.md)
|
||||
- [Writing an Application](../modules/hello_sky.md)
|
||||
- [Application/Module Template](../modules/module_template.md)
|
||||
@@ -0,0 +1,9 @@
|
||||
# QGroundControl Daily Build
|
||||
|
||||
The QGroundControl _Daily Build_ includes development tools that are hidden in release builds, and provides access to new PX4 features that are not yet supported in release builds.
|
||||
|
||||

|
||||
|
||||
It should be used instead of the stable release when working with new code forked from the PX4 `main` branch.
|
||||
|
||||
- [Download daily builds](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/releases/daily_builds.html)
|
||||
@@ -0,0 +1,59 @@
|
||||
# Qt Creator IDE
|
||||
|
||||
:::warning
|
||||
This development environment is [community supported and maintained](../advanced/community_supported_dev_env.md).
|
||||
It may or may not work with current versions of PX4.
|
||||
|
||||
Qt Creator has been replaced by [VSCode](../dev_setup/vscode.md) as the officially supported (and recommended) IDE for PX4 development.
|
||||
See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team.
|
||||
:::
|
||||
|
||||
[Qt Creator](https://www.qt.io/download-open-source) is a popular cross-platform open-source IDE that can be used to compile and debug PX4.
|
||||
|
||||
## Qt Creator 기능
|
||||
|
||||
Qt Creator는 클릭 가능한 기호, 전체 코드베이스의 자동 완성, 펌웨어 빌드 및 플래싱을 제공합니다.
|
||||
|
||||

|
||||
|
||||
아래 비디오는 사용 방법을 보여줍니다.
|
||||
|
||||
<lite-youtube videoid="Bkk8zttWxEI" title="(Qt Creator) PX4 Flight Stack Build Experience"/>
|
||||
|
||||
## IDE 설정
|
||||
|
||||
### 리눅스용 Qt Creator
|
||||
|
||||
Before starting Qt Creator, the [project file](https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/Generator-Specific-Information#codeblocks-generator) needs to be created:
|
||||
|
||||
```sh
|
||||
cd ~/src/PX4-Autopilot
|
||||
mkdir ../Firmware-build
|
||||
cd ../Firmware-build
|
||||
cmake ../PX4-Autopilot -G "CodeBlocks - Unix Makefiles"
|
||||
```
|
||||
|
||||
Then load the CMakeLists.txt in the root PX4-Autopilot folder via **File > Open File or Project** (Select the CMakeLists.txt file).
|
||||
|
||||
After loading, the **play** button can be configured to run the project by selecting 'custom executable' in the run target configuration and entering 'make' as executable and 'upload' as argument.
|
||||
|
||||
### Windows용 Qt Creator
|
||||
|
||||
:::info
|
||||
Windows has not been tested for PX4 development with Qt Creator.
|
||||
:::
|
||||
|
||||
### Mac OS용 Qt Creator
|
||||
|
||||
Before starting Qt Creator, the [project file](https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/Generator-Specific-Information#codeblocks-generator) needs to be created:
|
||||
|
||||
```sh
|
||||
cd ~/src/PX4-Autopilot
|
||||
mkdir -p build/creator
|
||||
cd build/creator
|
||||
cmake ../.. -G "CodeBlocks - Unix Makefiles"
|
||||
```
|
||||
|
||||
끝났습니다! Start _Qt Creator_ and then set up the project to build.
|
||||
|
||||
<!-- note, video here was removed/made private, and in any case out of date. Just hoping people can work it out -->
|
||||
@@ -0,0 +1,142 @@
|
||||
# 비주얼 스튜디오 코드 IDE(VSCode)
|
||||
|
||||
[Visual Studio Code](https://code.visualstudio.com/) is a powerful cross-platform source code editor/IDE that can be used for PX4 development on Ubuntu, Windows, and macOS.
|
||||
|
||||
PX4 개발에 VSCode를 사용하는 데에는 많은 이유가 있습니다.
|
||||
|
||||
- Getting setup _really_ only takes a few minutes.
|
||||
- A rich extension ecosystem that enables a huge range of tools needed for PX4 development: C/C++ (with solid _cmake_ integration), _Python_, _Jinja2_, ROS messages, and even DroneCAN dsdl.
|
||||
- 뛰어난 Github 통합 기능
|
||||
|
||||
IDE를 설정과 개발 방법에 대하여 설명합니다.
|
||||
|
||||
:::info
|
||||
There are other powerful IDEs, but they typically take more effort to integrate with PX4.
|
||||
With _VScode_, configuration is stored in the PX4/PX4-Autopilot tree ([PX4-Autopilot/.vscode](https://github.com/PX4/PX4-Autopilot/tree/main/.vscode)) so the setup process is as simple as adding the project folder.
|
||||
:::
|
||||
|
||||
## 전제 조건
|
||||
|
||||
You must already have installed the command line [PX4 developer environment](../dev_setup/dev_env.md) for your platform and downloaded the _Firmware_ source code repo.
|
||||
|
||||
## Installation & Setup
|
||||
|
||||
1. [Download and install VSCode](https://code.visualstudio.com/) (you will be offered the correct version for your OS).
|
||||
|
||||
2. Open VSCode and add the PX4 source code:
|
||||
|
||||
- Select _Open folder ..._ option on the welcome page (or using the menu: **File > Open Folder**):
|
||||

|
||||
- A file selection dialog will appear.
|
||||
Select the **PX4-Autopilot** directory and then press **OK**.
|
||||
|
||||
The project files and configuration will then load into _VSCode_.
|
||||
|
||||
3. Press **Install All** on the _This workspace has extension recommendations_ prompt (this will appear on the bottom right of the IDE).
|
||||

|
||||
|
||||
VSCode will open the _Extensions_ panel on the left hand side so you can watch the progress of installation.
|
||||
|
||||

|
||||
|
||||
4. 오른쪽 하단에 여러 알림/프롬프트가 나타날 수 있습니다.
|
||||
|
||||
:::tip
|
||||
If the prompts disappear, click the little "alarm" icon on the right of the bottom blue bar.
|
||||
|
||||
:::
|
||||
|
||||
- If prompted to install a new version of _cmake_:
|
||||
- Say **No** (the right version is installed with the [PX4 developer environment](../dev_setup/dev_env.md)).
|
||||
- If prompted to sign into _github.com_ and add your credentials:
|
||||
- 이것은 당신에게 달려 있습니다! Github와 IDE 간의 긴밀한 통합을 제공하여 워크플로를 단순화할 수 있습니다.
|
||||
- Other prompts are optional, and may be installed if they seem useful. <!-- perhaps add screenshot of these prompts -->
|
||||
|
||||
<a id="building"></a>
|
||||
|
||||
## PX4 빌드
|
||||
|
||||
빌드를 진행하려면:
|
||||
|
||||
1. Select your build target ("cmake build config"):
|
||||
|
||||
- The current _cmake build target_ is shown on the blue _config_ bar at the bottom (if this is already your desired target, skip to next step).
|
||||

|
||||
|
||||
::: info
|
||||
The cmake target you select affects the targets offered for when [building/debugging](#debugging) (i.e. for hardware debugging you must select a hardware target like `px4_fmu-v6`).
|
||||
|
||||
:::
|
||||
|
||||
- Click the target on the config bar to display other options, and select the one you want (this will replace any selected target).
|
||||
|
||||
- _Cmake_ will then configure your project (see notification in bottom right).
|
||||

|
||||
|
||||
- Wait until configuration completes.
|
||||
When this is done the notification will disappear and you'll be shown the build location:
|
||||
.
|
||||
|
||||
2. You can then kick off a build from the config bar (select either **Build** or **Debug**).
|
||||

|
||||
|
||||
After building at least once you can now use [code completion](#code completion) and other _VSCode_ features.
|
||||
|
||||
## 디버깅
|
||||
|
||||
<a id="debugging_sitl"></a>
|
||||
|
||||
### SITL 디버깅
|
||||
|
||||
SITL에서 PX4를 디버깅하려면:
|
||||
|
||||
1. Select the debug icon on the sidebar (marked in red) to display the debug panel.
|
||||

|
||||
|
||||
2. Then choose your debug target (e.g. _Debug SITL (Gazebo Iris)_) from the top bar debug dropdown (purple box).
|
||||
|
||||
::: info
|
||||
The debug targets that are offered (purple box) match your build target (yellow box on the bottom bar).
|
||||
예를 들어, SITL 대상을 디버그하려면 빌드 대상에 SITL이 포함되어야 합니다.
|
||||
|
||||
:::
|
||||
|
||||
3. 디버그 "재생" 화살표(상단 막대의 디버그 대상 옆 - 분홍색 상자)를 클릭하여 디버깅을 시작합니다.
|
||||
|
||||
디버깅하는 동안 중단점을 설정하고, 코드를 건너뛰고, 그렇지 않으면 정상적으로 개발할 수 있습니다.
|
||||
|
||||
### 하드웨어 디버깅
|
||||
|
||||
The instructions in [SWD Debug Port](../debug/swd_debug.md) explain how to connect to the SWD interface on common flight controllers (for example, using the Dronecode or Blackmagic probes).
|
||||
|
||||
After connecting to the SWD interface, hardware debugging in VSCode is then the same as for [SITL Debugging](#debugging_sitl) except that you select a debug target appropriate for your debugger type (and firmware) - e.g. `jlink (px4_fmu-v5)`.
|
||||
|
||||
:::tip
|
||||
To see the `jlink` option you must have selected a [cmake target for building firmware](#building-px4).
|
||||
:::
|
||||
|
||||

|
||||
|
||||
<a id="code completion"></a>
|
||||
|
||||
## 코드 완성
|
||||
|
||||
In order for the code completion to work (and other IntelliSense magic) you need an active configuration and to have [built the code](#building).
|
||||
|
||||
이 작업이 완료되면 다른 작업을 수행할 필요가 없습니다.
|
||||
툴체인은 입력시 자동으로 기호를 제공합니다.
|
||||
|
||||

|
||||
|
||||
## 문제 해결
|
||||
|
||||
이 섹션에는 설정 및 빌드 오류에 대한 지침이 포함되어 있습니다.
|
||||
|
||||
### Ubuntu 18.04: "Visual Studio Code는 이 큰 작업 영역에서 파일 변경 사항을 감시할 수 없습니다."
|
||||
|
||||
이 오류는 시작시에 나타납니다.
|
||||
On some systems, there is an upper-limit of 8192 file handles imposed on applications, which means that VSCode might not be able to detect file modifications in `/PX4-Autopilot`.
|
||||
|
||||
메모리 소비를 희생시키면서 오류를 방지하기 위해 이 제한을 늘릴 수 있습니다.
|
||||
Follow the [instructions here](https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc).
|
||||
값 65536이면 충분합니다.
|
||||
Reference in New Issue
Block a user