mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
86 lines
7.4 KiB
Markdown
86 lines
7.4 KiB
Markdown
# Керівництво з перенесення контролера польоту
|
|
|
|
This topic is for developers who want to port PX4 to work with _new_ flight controller hardware.
|
|
|
|
## Архітектура системи PX4
|
|
|
|
PX4 consists of two main layers: The [board support and middleware layer](../middleware/index.md) on top of the host OS (NuttX, Linux or any other POSIX platform like Mac OS), and the applications (Flight Stack in [src/modules](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules)\).
|
|
Please reference the [PX4 Architectural Overview](../concept/architecture.md) for more information.
|
|
|
|
Цей посібник спрямований лише на операційну систему хоста та проміжне програмне забезпечення, оскільки програми/стек польоту будуть працювати на будь-якій цільовій платі.
|
|
|
|
## Налаштування режиму польоту файлової структури
|
|
|
|
Board startup and configuration files are located under [/boards](https://github.com/PX4/PX4-Autopilot/tree/main/boards/) in each board's vendor-specific directory (i.e. **boards/_VENDOR_/_MODEL_/**).
|
|
|
|
Наприклад, для FMUv5:
|
|
|
|
- (All) Board-specific files: [/boards/px4/fmu-v5](https://github.com/PX4/PX4-Autopilot/tree/main/boards/px4/fmu-v5).<!-- NEED px4_version -->
|
|
- Build configuration: [/boards/px4/fmu-v5/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/default.px4board).<!-- NEED px4_version -->
|
|
- Board-specific initialisation file: [/boards/px4/fmu-v5/init/rc.board_defaults](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/init/rc.board_defaults) <!-- NEED px4_version -->
|
|
- A board-specific initialisation file is automatically included in startup scripts if found under the boards directory at **init/rc.board**.
|
|
- Файл використовується для запуску сенсорів (та інших речей), які існують лише на конкретній платі.
|
|
Це також може бути використано для встановлення параметрів за замовчуванням дошки, відображень UART та будь-яких інших виняткових випадків.
|
|
- Для FMUv5 ви можете побачити, як запускаються всі датчики Pixhawk 4, а також встановлюється більший LOGGER_BUF.
|
|
|
|
## Конфігурація операційної системи хоста
|
|
|
|
Цей розділ описує призначення та місцезнаходження файлів конфігурації, необхідних для кожної підтримуваної операційної системи хоста, щоб перенести їх на нове апаратне засіб керування польотом.
|
|
|
|
### NuttX
|
|
|
|
See [NuttX Board Porting Guide](porting_guide_nuttx.md).
|
|
|
|
### Linux
|
|
|
|
Плати Linux не включають ОС та конфігурацію ядра.
|
|
Ці дані вже надаються зображенням Linux, доступним для плати (яке повинно підтримувати інерційні сенсори з коробки).
|
|
|
|
- [boards/px4/raspberrypi/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/raspberrypi/default.px4board) - RPi cross-compilation. <!-- NEED px4_version -->
|
|
|
|
## Компоненти та конфігурація проміжного програмного забезпечення
|
|
|
|
Цей розділ описує різноманітні компоненти проміжного програмного забезпечення та необхідні оновлення файлів конфігурації для перенесення їх на нове апаратне засіб керування польотом.
|
|
|
|
### QuRT / Шестикутник
|
|
|
|
- The start script is located in [posix-configs/](https://github.com/PX4/PX4-Autopilot/tree/main/posix-configs). <!-- NEED px4_version -->
|
|
- Конфігурація ОС є частиною стандартного образу Linux (TODO: Вказати місце розташування ОБРАЗУ LINUX та інструкції щодо прошивки).
|
|
- The PX4 middleware configuration is located in [src/boards](https://github.com/PX4/PX4-Autopilot/tree/main/boards). <!-- NEED px4_version --> TODO: ADD BUS CONFIG
|
|
|
|
## Рекомендації з підключення RC UART
|
|
|
|
Зазвичай рекомендується підключати RC через окремі піни RX та TX до мікроконтролера.
|
|
Якщо, проте, RX та TX з'єднані разом, UART повинен бути переведений в режим одножильного кабелю, щоб уникнути будь-яких конфліктів.
|
|
Це робиться за допомогою конфігураційної дошки та файлів маніфесту.
|
|
One example is [px4fmu-v5](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/src/manifest.c). <!-- NEED px4_version -->
|
|
|
|
## Getting Your Board Supported
|
|
|
|
This page covers the _technical_ work of porting PX4 to new hardware.
|
|
The _process_ for getting that port reviewed, merged, and listed on the PX4 website, including board IDs, USB VID/PID, flight-test evidence, and maintenance expectations, is documented separately:
|
|
|
|
- [Manufacturer's PX4 Board Support Guide](../hardware/board_support_guide.md)
|
|
|
|
In short: build your own firmware target based on PX4, demonstrate stable flight on the current release, and open a pull request with your board support code, documentation, and flight logs.
|
|
The board support guide explains each step.
|
|
|
|
The PX4 project supports and maintains the [FMU standard reference hardware](../hardware/reference_design.md) and any boards compatible with the standard, including the [Pixhawk series](../flight_controller/pixhawk_series.md) (see the [full list of supported hardware](../flight_controller/index.md)). Boards merged into PX4 benefit from a port in the repository, firmware builds accessible from _QGroundControl_, compatibility with the rest of the ecosystem, and automated CI checks.
|
|
|
|
:::tip
|
|
The cost of maintaining a port is proportional to how far it diverges from the standard.
|
|
Consider that cost before deviating: staying close to the reference design lets you benefit from day-to-day PX4 development with minimal maintenance burden.
|
|
:::
|
|
|
|
Manufacturers are responsible for keeping their port up to date and working across PX4 releases.
|
|
The PX4 project reserves the right to refuse or remove ports that do not meet the project's requirements, and all contributors are expected to follow the [Code of Conduct](https://github.com/PX4/PX4-Autopilot/blob/main/CODE_OF_CONDUCT.md).
|
|
|
|
## Пов'язана інформація
|
|
|
|
- [Device Drivers](../middleware/drivers.md) - How to support new peripheral hardware (device drivers)
|
|
- [Building the Code](../dev_setup/building_px4.md) - How to build source and upload firmware
|
|
- Підтримувані автопілоти включають:
|
|
- [Autopilot Hardware](../flight_controller/index.md)
|
|
- [Supported boards list](https://github.com/PX4/PX4-Autopilot/#supported-hardware) (Github) - Boards for which PX4-Autopilot has specific code
|
|
- [Supported Peripherals](../peripherals/index.md)
|