mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 01:45:55 +08:00
docs(i18n): PX4 guide translations (Crowdin) - ko (#26688)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
@@ -12,13 +12,15 @@ These are covered in [Application/Module Template](../modules/module_template.md
|
||||
|
||||
다음과 같은 것이 필요합니다.
|
||||
|
||||
- [PX4 SITL Simulator](../simulation/index.md) _or_ a [PX4-compatible flight controller](../flight_controller/index.md).
|
||||
- [Gazebo Simulator](../sim_gazebo_gz/index.md) (or another [PX4 SITL Simulator](../simulation/index.md)) _or_ a [PX4-compatible flight controller](../flight_controller/index.md).
|
||||
- [PX4 Development Toolchain](../dev_setup/dev_env.md) for the desired target.
|
||||
- [Download the PX4 Source Code](../dev_setup/building_px4.md#download-the-px4-source-code) from Github
|
||||
|
||||
The source code [PX4-Autopilot/src/examples/px4_simple_app](https://github.com/PX4/PX4-Autopilot/tree/main/src/examples/px4_simple_app) directory contains a completed version of this tutorial that you can review if you get stuck.
|
||||
|
||||
- Rename (or delete) the **px4_simple_app** directory.
|
||||
:::tip
|
||||
Rename (or delete) the **px4_simple_app** directory.
|
||||
:::
|
||||
|
||||
## 간단한 어플리케이션
|
||||
|
||||
@@ -34,7 +36,7 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2012-2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -67,7 +69,7 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too
|
||||
```
|
||||
|
||||
- 기본 헤더 아래에 다음 코드를 복사합니다.
|
||||
이것은 기여한 모든 파일에 첨부하여야 합니다.
|
||||
Similar code should be present in all contributed files!
|
||||
|
||||
```c
|
||||
/**
|
||||
@@ -150,6 +152,9 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too
|
||||
)
|
||||
```
|
||||
|
||||
Note that in your own modules you'd use the current copyright year!
|
||||
We're using `2015` here to match the example.
|
||||
|
||||
The `px4_add_module()` method builds a static library from a module description.
|
||||
|
||||
- The `MODULE` block is the Firmware-unique name of the module (by convention the module name is prefixed by parent directories back to `src`).
|
||||
@@ -170,7 +175,7 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too
|
||||
4. Create and open a new _Kconfig_ definition file named **Kconfig** and define your symbol for naming (see [Kconfig naming convention](../hardware/porting_guide_config.md#px4-kconfig-symbol-naming-convention)).
|
||||
아래 텍스트를 복사하십시오.
|
||||
|
||||
```text
|
||||
```txt
|
||||
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
||||
bool "px4_simple_app"
|
||||
default n
|
||||
@@ -185,27 +190,34 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too
|
||||
Applications are added to the build/firmware in the appropriate board-level _px4board_ file for your target:
|
||||
|
||||
- PX4 SITL (Simulator): [PX4-Autopilot/boards/px4/sitl/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/sitl/default.px4board)
|
||||
- Pixhawk v1/2: [PX4-Autopilot/boards/px4/fmu-v2/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v2/default.px4board)
|
||||
- Pixracer (px4/fmu-v4): [PX4-Autopilot/boards/px4/fmu-v4/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v4/default.px4board)
|
||||
- Pixhawk 6X (px4/fmu-v6x): [PX4-Autopilot/boards/px4/fmu-v6x/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v6x/default.px4board)
|
||||
- _px4board_ files for other boards can be found in [PX4-Autopilot/boards/](https://github.com/PX4/PX4-Autopilot/tree/main/boards)
|
||||
|
||||
To enable the compilation of the application into the firmware add the corresponding Kconfig key `CONFIG_EXAMPLES_PX4_SIMPLE_APP=y` in the _px4board_ file or run [boardconfig](../hardware/porting_guide_config.md#px4-menuconfig-setup) `make px4_fmu-v4_default boardconfig`:
|
||||
To enable the compilation of the application into the firmware add the corresponding Kconfig key `CONFIG_EXAMPLES_PX4_SIMPLE_APP=y` in the _px4board_ file or run [boardconfig](../hardware/porting_guide_config.md#px4-menuconfig-setup).
|
||||
|
||||
For example, to edit the board config for FMUv6x you would do:
|
||||
|
||||
```sh
|
||||
make fmu-v6x_default boardconfig
|
||||
```
|
||||
|
||||
And then enable the app in the _boardconfig_ UI as shown:
|
||||
|
||||
```txt
|
||||
examples --->
|
||||
[x] PX4 Simple app ----
|
||||
```
|
||||
|
||||
:::info
|
||||
The line will already be present for most files, because the examples are included in firmware by default.
|
||||
Examples are opt-in and not included in firmware by default (although they are in SITL).
|
||||
You must explicitly enable them as shown above.
|
||||
:::
|
||||
|
||||
보드별 명령어를 사용하여, 예제를 빌드합니다.
|
||||
|
||||
- jMAVSim Simulator: `make px4_sitl_default jmavsim`
|
||||
- Pixhawk v1/2: `make px4_fmu-v2_default` (or just `make px4_fmu-v2`)
|
||||
- Pixhawk v3: `make px4_fmu-v4_default`
|
||||
- Other boards: [Building the Code](../dev_setup/building_px4.md#building-for-nuttx)
|
||||
- Gazebo Simulator: `make px4_sitl gz_x500`
|
||||
- Pixhawk 6X: `make px4_fmu-v6x_default`
|
||||
- Other boards: [Building the Code](../dev_setup/building_px4.md)
|
||||
|
||||
## 앱 테스트(하드웨어)
|
||||
|
||||
@@ -213,8 +225,7 @@ The line will already be present for most files, because the examples are includ
|
||||
|
||||
업로더를 활성화한 다음 보드를 재설정합니다.
|
||||
|
||||
- Pixhawk v1/2: `make px4_fmu-v2_default upload`
|
||||
- Pixhawk v3: `make px4_fmu-v4_default upload`
|
||||
- Pixhawk 6X: `make px4_fmu-v6x_default upload`
|
||||
|
||||
보드 재설정전에 컴파일 메시지를 인쇄하고 마지막에 다음을 인쇄합니다.
|
||||
|
||||
@@ -299,14 +310,14 @@ The benefits of the PX4 hardware abstraction comes into play here!
|
||||
센서 드라이버와 어떤 식으로든 상호 작용할 필요가 없으며, 보드 또는 센서가 업데이트된 경우 앱을 업데이트할 필요도 없습니다.
|
||||
:::
|
||||
|
||||
Individual message channels between applications are called [topics](../middleware/uorb.md). For this tutorial, we are interested in the [SensorCombined](https://github.com/PX4/PX4-Autopilot/blob/main/msg/SensorCombined.msg) topic, which holds the synchronized sensor data of the complete system.
|
||||
Individual message channels between applications are called [topics](../middleware/uorb.md). For this tutorial, we are interested in the [VehicleAcceleration](https://github.com/PX4/PX4-Autopilot/blob/main/msg/versioned/VehicleAcceleration.msg) topic, which holds the filtered vehicle acceleration data.
|
||||
|
||||
주제 구독은 간단합니다.
|
||||
|
||||
```cpp
|
||||
#include <uORB/topics/sensor_combined.h>
|
||||
#include <uORB/topics/vehicle_acceleration.h>
|
||||
..
|
||||
int sensor_sub_fd = orb_subscribe(ORB_ID(sensor_combined));
|
||||
int sensor_sub_fd = orb_subscribe(ORB_ID(vehicle_acceleration));
|
||||
```
|
||||
|
||||
The `sensor_sub_fd` is a topic handle and can be used to very efficiently perform a blocking wait for new data.
|
||||
@@ -317,9 +328,9 @@ Adding `poll()` to the subscription looks like (_pseudocode, look for the full i
|
||||
|
||||
```cpp
|
||||
#include <poll.h>
|
||||
#include <uORB/topics/sensor_combined.h>
|
||||
#include <uORB/topics/vehicle_acceleration.h>
|
||||
..
|
||||
int sensor_sub_fd = orb_subscribe(ORB_ID(sensor_combined));
|
||||
int sensor_sub_fd = orb_subscribe(ORB_ID(vehicle_acceleration));
|
||||
|
||||
/* one could wait for multiple topics with this technique, just using one here */
|
||||
px4_pollfd_struct_t fds[] = {
|
||||
@@ -327,26 +338,26 @@ px4_pollfd_struct_t fds[] = {
|
||||
};
|
||||
|
||||
while (true) {
|
||||
/* wait for sensor update of 1 file descriptor for 1000 ms (1 second) */
|
||||
int poll_ret = px4_poll(fds, 1, 1000);
|
||||
..
|
||||
if (fds[0].revents & POLLIN) {
|
||||
/* obtained data for the first file descriptor */
|
||||
struct sensor_combined_s raw;
|
||||
/* copy sensors raw data into local buffer */
|
||||
orb_copy(ORB_ID(sensor_combined), sensor_sub_fd, &raw);
|
||||
PX4_INFO("Accelerometer:\t%8.4f\t%8.4f\t%8.4f",
|
||||
(double)raw.accelerometer_m_s2[0],
|
||||
(double)raw.accelerometer_m_s2[1],
|
||||
(double)raw.accelerometer_m_s2[2]);
|
||||
}
|
||||
/* wait for sensor update of 1 file descriptor for 1000 ms (1 second) */
|
||||
int poll_ret = px4_poll(fds, 1, 1000);
|
||||
..
|
||||
if (fds[0].revents & POLLIN) {
|
||||
/* obtained data for the first file descriptor */
|
||||
struct vehicle_acceleration_s accel;
|
||||
/* copy sensors raw data into local buffer */
|
||||
orb_copy(ORB_ID(vehicle_acceleration), sensor_sub_fd, &accel);
|
||||
PX4_INFO("Accelerometer:\t%8.4f\t%8.4f\t%8.4f",
|
||||
(double)accel.xyz[0],
|
||||
(double)accel.xyz[1],
|
||||
(double)accel.xyz[2]);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
아래의 명령어로 앱을 다시 컴파일합니다.
|
||||
|
||||
```sh
|
||||
make
|
||||
make px4_sitl_default
|
||||
```
|
||||
|
||||
### uORB 구독 테스트
|
||||
@@ -405,7 +416,7 @@ The [complete example code](https://github.com/PX4/PX4-Autopilot/blob/main/src/e
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2019 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2012-2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -454,7 +465,7 @@ The [complete example code](https://github.com/PX4/PX4-Autopilot/blob/main/src/e
|
||||
#include <math.h>
|
||||
|
||||
#include <uORB/uORB.h>
|
||||
#include <uORB/topics/sensor_combined.h>
|
||||
#include <uORB/topics/vehicle_acceleration.h>
|
||||
#include <uORB/topics/vehicle_attitude.h>
|
||||
|
||||
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
|
||||
@@ -463,8 +474,8 @@ int px4_simple_app_main(int argc, char *argv[])
|
||||
{
|
||||
PX4_INFO("Hello Sky!");
|
||||
|
||||
/* subscribe to sensor_combined topic */
|
||||
int sensor_sub_fd = orb_subscribe(ORB_ID(sensor_combined));
|
||||
/* subscribe to vehicle_acceleration topic */
|
||||
int sensor_sub_fd = orb_subscribe(ORB_ID(vehicle_acceleration));
|
||||
/* limit the update rate to 5 Hz */
|
||||
orb_set_interval(sensor_sub_fd, 200);
|
||||
|
||||
@@ -505,20 +516,20 @@ int px4_simple_app_main(int argc, char *argv[])
|
||||
|
||||
if (fds[0].revents & POLLIN) {
|
||||
/* obtained data for the first file descriptor */
|
||||
struct sensor_combined_s raw;
|
||||
struct vehicle_acceleration_s accel;
|
||||
/* copy sensors raw data into local buffer */
|
||||
orb_copy(ORB_ID(sensor_combined), sensor_sub_fd, &raw);
|
||||
orb_copy(ORB_ID(vehicle_acceleration), sensor_sub_fd, &accel);
|
||||
PX4_INFO("Accelerometer:\t%8.4f\t%8.4f\t%8.4f",
|
||||
(double)raw.accelerometer_m_s2[0],
|
||||
(double)raw.accelerometer_m_s2[1],
|
||||
(double)raw.accelerometer_m_s2[2]);
|
||||
(double)accel.xyz[0],
|
||||
(double)accel.xyz[1],
|
||||
(double)accel.xyz[2]);
|
||||
|
||||
/* set att and publish this information for other apps
|
||||
the following does not have any meaning, it's just an example
|
||||
*/
|
||||
att.q[0] = raw.accelerometer_m_s2[0];
|
||||
att.q[1] = raw.accelerometer_m_s2[1];
|
||||
att.q[2] = raw.accelerometer_m_s2[2];
|
||||
att.q[0] = accel.xyz[0];
|
||||
att.q[1] = accel.xyz[1];
|
||||
att.q[2] = accel.xyz[2];
|
||||
|
||||
orb_publish(ORB_ID(vehicle_attitude), att_pub, &att);
|
||||
}
|
||||
@@ -530,7 +541,6 @@ int px4_simple_app_main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
PX4_INFO("exiting");
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
@@ -22,7 +22,8 @@ PX4-Autopilot contains a template for writing a new application (module) that ru
|
||||
요약
|
||||
|
||||
1. Specify the dependency on the work queue library in the cmake definition file ([CMakeLists.txt](https://github.com/PX4/PX4-Autopilot/blob/main/src/examples/work_item/CMakeLists.txt)):
|
||||
```
|
||||
|
||||
```txt
|
||||
...
|
||||
DEPENDS
|
||||
px4_work_queue
|
||||
@@ -48,9 +49,11 @@ PX4-Autopilot contains a template for writing a new application (module) that ru
|
||||
|
||||
4. Implement the `ScheduledWorkItem::Run()` method to perform "work".
|
||||
|
||||
5. Implement the `task_spawn` method, specifying that the task is a work queue (using the `task_id_is_work_queue` id.
|
||||
5. Implement the `task_spawn` method, specifying that the task is a work queue (using the `task_id_is_work_queue` id).
|
||||
|
||||
6. Schedule the work queue task using one of the scheduling methods (in the example we use `ScheduleOnInterval` from within the `init` method).
|
||||
6. Schedule the work queue task using one of the scheduling methods.
|
||||
In the example, `init()` calls `registerCallback()` on a uORB subscription so that `Run()` is triggered whenever a new `sensor_accel` message is published.
|
||||
`ScheduleOnInterval` is an alternative for fixed-rate scheduling.
|
||||
|
||||
## 작업
|
||||
|
||||
@@ -66,6 +69,6 @@ PX4/PX4-Autopilot contains a template for writing a new application (module) tha
|
||||
[startup script](../concept/system_startup.md).
|
||||
- 명령줄 인수 구문 분석.
|
||||
- Documentation: the `PRINT_MODULE_*` methods serve two purposes (the API is
|
||||
documented [in the source code](https://github.com/PX4/PX4-Autopilot/blob/v1.8.0/src/platforms/px4_module.h#L381)):
|
||||
documented [in the source code](https://github.com/PX4/PX4-Autopilot/blob/v1.17/platforms/common/include/px4_platform_common/module.h)):
|
||||
- They are used to print the command-line usage when entering `module help` on the console.
|
||||
- They are automatically extracted via script to generate the [Modules & Commands Reference](../modules/modules_main.md) page.
|
||||
|
||||
@@ -926,7 +926,7 @@ that can be accepted by most ESCs and servos.
|
||||
It is typically started with:
|
||||
|
||||
```
|
||||
pca9685_pwm_out start -a 0x40 -b 1
|
||||
pca9685_pwm_out start -X -a 0x40 -b 1
|
||||
```
|
||||
|
||||
### Usage {#pca9685_pwm_out_usage}
|
||||
|
||||
@@ -130,6 +130,32 @@ adis16507 <command> [arguments...]
|
||||
status print status info
|
||||
```
|
||||
|
||||
## adis16607
|
||||
|
||||
Source: [drivers/imu/analog_devices/adis16607](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/analog_devices/adis16607)
|
||||
|
||||
### Usage {#adis16607_usage}
|
||||
|
||||
```
|
||||
adis16607 <command> [arguments...]
|
||||
Commands:
|
||||
start
|
||||
[-s] Internal SPI bus(es)
|
||||
[-S] External SPI bus(es)
|
||||
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
|
||||
(default=1))
|
||||
[-c <val>] chip-select pin (for internal SPI) or index (for external SPI)
|
||||
[-m <val>] SPI mode
|
||||
[-f <val>] bus frequency in kHz
|
||||
[-q] quiet startup (no message if no device found)
|
||||
[-R <val>] Rotation
|
||||
default: 0
|
||||
|
||||
stop
|
||||
|
||||
status print status info
|
||||
```
|
||||
|
||||
## bmi055
|
||||
|
||||
Source: [drivers/imu/bosch/bmi055](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/bosch/bmi055)
|
||||
|
||||
Reference in New Issue
Block a user