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:
Hamish Willee
2025-03-13 16:08:27 +11:00
committed by GitHub
co-authored by Ramon Roche
parent 8e6d2ebe4a
commit 88d623bedb
5176 changed files with 558771 additions and 2 deletions
+551
View File
@@ -0,0 +1,551 @@
# 搭建你的第一个应用(Hello Shy)
本文主要说明如何创建并运行你的第一个板载应用程序。
它涵盖了 PX4 应用程序开发所需的所有基本概念和 API。
:::info
For simplicity, more advanced features like start/stop functionality and command-line arguments are omitted.
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).
- [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.
## 最小的应用程序
In this section we create a _minimal application_ that just prints out `Hello Sky!`.
This consists of a single _C_ file and a _cmake_ definition (which tells the toolchain how to build the application).
1. Create a new directory **PX4-Autopilot/src/examples/px4_simple_app**.
2. Create a new C file in that directory named **px4_simple_app.c**:
- Copy in the default header to the top of the page.
该注释应出现在所有贡献的文件中!
```c
/****************************************************************************
*
* Copyright (c) 2012-2022 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
```
- 将下面的代码复制到头部注释的下方,
该注释应出现在所有贡献的文件中!
```c
/**
* @file px4_simple_app.c
* Minimal application example for PX4 autopilot
*
* @author Example User <mail@example.com>
*/
#include <px4_platform_common/log.h>
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
int px4_simple_app_main(int argc, char *argv[])
{
PX4_INFO("Hello Sky!");
return OK;
}
```
:::tip
The main function must be named `<module_name>_main` and exported from the module as shown.
:::
:::tip
`PX4_INFO` is the equivalent of `printf` for the PX4 shell (included from **px4_platform_common/log.h**).
There are different log levels: `PX4_INFO`, `PX4_WARN`, `PX4_ERR`, `PX4_DEBUG`.
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
:::
3. Create and open a new _cmake_ definition file named **CMakeLists.txt**.
复制下面的文本:
```cmake
############################################################################
#
# Copyright (c) 2015 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
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
px4_add_module(
MODULE examples__px4_simple_app
MAIN px4_simple_app
STACK_MAIN 2000
SRCS
px4_simple_app.c
DEPENDS
)
```
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`).
- The `MAIN` block lists the entry point of the module, which registers the command with NuttX so that it can be called from the PX4 shell or SITL console.
:::tip
The `px4_add_module()` format is documented in [PX4-Autopilot/cmake/px4_add_module.cmake](https://github.com/PX4/PX4-Autopilot/blob/main/cmake/px4_add_module.cmake). <!-- NEED px4_version -->
:::
::: info
If you specify `DYNAMIC` as an option to `px4_add_module`, a _shared library_ is created instead of a static library on POSIX platforms (these can be loaded without having to recompile PX4, and shared to others as binaries rather than source code).
Your app will not become a builtin command, but ends up in a separate file called `examples__px4_simple_app.px4mod`.
You can then run your command by loading the file at runtime using the `dyn` command: `dyn ./examples__px4_simple_app.px4mod`
:::
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)).
复制下面的文本:
```
menuconfig EXAMPLES_PX4_SIMPLE_APP
bool "px4_simple_app"
default n
---help---
Enable support for px4_simple_app
```
## 编译应用程序/固件
应用程序的编写至此完成。
为了运行它,您首先需要确保它是作为 PX4 的一部分构建的。
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)
- _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`:
```
examples --->
[x] PX4 Simple app ----
```
:::info
The line will already be present for most files, because the examples are included in firmware by default.
:::
使用特定板的命令构建示例:
- 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)
## 测试应用(硬件)
### 将固件上传至飞控板
启用上传器,然后重启飞控板:
- Pixhawk v1/2: `make px4_fmu-v2_default upload`
- Pixhawk v3: `make px4_fmu-v4_default upload`
在您重启飞控板之前,它应该打印一些编译消息,并在最后打印:
```sh
Loaded firmware for X,X, waiting for the bootloader...
```
一旦飞控板被重启并完成了固件的上传,命令行界面将输出:
```sh
Erase : [====================] 100.0%
Program: [====================] 100.0%
Verify : [====================] 100.0%
Rebooting.
[100%] Built target upload
```
### 连接至控制台
Now connect to the [system console](../debug/system_console.md) either via serial or USB.
Hitting **ENTER** will bring up the shell prompt:
```sh
nsh>
```
输入“help”并按回车键
```sh
nsh> help
help usage: help [-v] [<cmd>]
[ df kill mkfifo ps sleep
? echo losetup mkrd pwd test
cat exec ls mh rm umount
cd exit mb mount rmdir unset
cp free mkdir mv set usleep
dd help mkfatfs mw sh xd
Builtin Apps:
reboot
perf
top
..
px4_simple_app
..
sercon
serdis
```
Note that `px4_simple_app` is now part of the available commands.
Start it by typing `px4_simple_app` and ENTER:
```sh
nsh> px4_simple_app
Hello Sky!
```
该应用程序现在已正确注册到系统中,并且可以扩展以实际执行实用的任务。
## 测试应用(SITL)
If you're using SITL the _PX4 console_ is automatically started (see [Building the Code > First Build (Using a Simulator)](../dev_setup/building_px4.md#first-build-using-a-simulator)).
As with the _nsh console_ (see previous section) you can type `help` to see the list of built-in apps.
Enter `px4_simple_app` to run the minimal app.
```sh
pxh> px4_simple_app
INFO [px4_simple_app] Hello Sky!
```
现在可以扩展该应用程序以实际执行实用的任务
## 订阅传感器数据
为了做一些实用的事情,应用程序需要订阅输入和发布输出(例如电机或伺服命令)。
:::tip
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.
订阅主题很简单:
```cpp
#include <uORB/topics/sensor_combined.h>
..
int sensor_sub_fd = orb_subscribe(ORB_ID(sensor_combined));
```
The `sensor_sub_fd` is a topic handle and can be used to very efficiently perform a blocking wait for new data.
当前线程进入休眠状态,一旦有新数据可用就会被调度器自动唤醒,等待时不消耗任何 CPU 周期。
To do this, we use the [poll()](http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.html) POSIX system call.
Adding `poll()` to the subscription looks like (_pseudocode, look for the full implementation below_):
```cpp
#include <poll.h>
#include <uORB/topics/sensor_combined.h>
..
int sensor_sub_fd = orb_subscribe(ORB_ID(sensor_combined));
/* one could wait for multiple topics with this technique, just using one here */
px4_pollfd_struct_t fds[] = {
{ .fd = sensor_sub_fd, .events = POLLIN },
};
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]);
}
}
```
再次编译应用程序可以输入:
```sh
make
```
### 测试 uORB 消息订阅
最后一步是通过在 nsh shell 中键入以下内容来启动您的应用程序作为后台进程/任务:
```sh
px4_simple_app &
```
您的应用程序将在控制台中显示 5 个传感器值(译者注:需要使用后面的完整示例中的代码,如果使用上面的伪代码会连续输出并无法退出),然后退出:
```sh
[px4_simple_app] Accelerometer: 0.0483 0.0821 0.0332
[px4_simple_app] Accelerometer: 0.0486 0.0820 0.0336
[px4_simple_app] Accelerometer: 0.0487 0.0819 0.0327
[px4_simple_app] Accelerometer: 0.0482 0.0818 0.0323
[px4_simple_app] Accelerometer: 0.0482 0.0827 0.0331
[px4_simple_app] Accelerometer: 0.0489 0.0804 0.0328
```
:::tip
The [Module Template for Full Applications](../modules/module_template.md) can be used to write background process that can be controlled from the command line.
:::
## 发布数据
To use the calculated outputs, the next step is to _publish_ the results.
下面我们将展示如何发布姿态主题。
:::info
We've chosen `attitude` because we know that the _mavlink_ app forwards it to the ground control station - providing an easy way to look at the results.
:::
The interface is pretty simple: initialize the `struct` of the topic to be published and advertise the topic:
```c
#include <uORB/topics/vehicle_attitude.h>
..
/* advertise attitude topic */
struct vehicle_attitude_s att;
memset(&att, 0, sizeof(att));
orb_advert_t att_pub_fd = orb_advertise(ORB_ID(vehicle_attitude), &att);
```
在主循环中,随时发布信息:
```c
orb_publish(ORB_ID(vehicle_attitude), att_pub_fd, &att);
```
## 完整的示例代码
The [complete example code](https://github.com/PX4/PX4-Autopilot/blob/main/src/examples/px4_simple_app/px4_simple_app.c) is now:
```c
/****************************************************************************
*
* Copyright (c) 2012-2019 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/**
* @file px4_simple_app.c
* Minimal application example for PX4 autopilot
*
* @author Example User <mail@example.com>
*/
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/tasks.h>
#include <px4_platform_common/posix.h>
#include <unistd.h>
#include <stdio.h>
#include <poll.h>
#include <string.h>
#include <math.h>
#include <uORB/uORB.h>
#include <uORB/topics/sensor_combined.h>
#include <uORB/topics/vehicle_attitude.h>
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
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));
/* limit the update rate to 5 Hz */
orb_set_interval(sensor_sub_fd, 200);
/* advertise attitude topic */
struct vehicle_attitude_s att;
memset(&att, 0, sizeof(att));
orb_advert_t att_pub = orb_advertise(ORB_ID(vehicle_attitude), &att);
/* one could wait for multiple topics with this technique, just using one here */
px4_pollfd_struct_t fds[] = {
{ .fd = sensor_sub_fd, .events = POLLIN },
/* there could be more file descriptors here, in the form like:
* { .fd = other_sub_fd, .events = POLLIN },
*/
};
int error_counter = 0;
for (int i = 0; i < 5; i++) {
/* wait for sensor update of 1 file descriptor for 1000 ms (1 second) */
int poll_ret = px4_poll(fds, 1, 1000);
/* handle the poll result */
if (poll_ret == 0) {
/* this means none of our providers is giving us data */
PX4_ERR("Got no data within a second");
} else if (poll_ret < 0) {
/* this is seriously bad - should be an emergency */
if (error_counter < 10 || error_counter % 50 == 0) {
/* use a counter to prevent flooding (and slowing us down) */
PX4_ERR("ERROR return value from poll(): %d", poll_ret);
}
error_counter++;
} else {
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]);
/* 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];
orb_publish(ORB_ID(vehicle_attitude), att_pub, &att);
}
/* there could be more file descriptors here, in the form like:
* if (fds[1..n].revents & POLLIN) {}
*/
}
}
PX4_INFO("exiting");
return 0;
}
```
## 运行完整的示例
最后运行你的应用程序:
```sh
px4_simple_app
```
If you start _QGroundControl_, you can check the sensor values in the real time plot ([Analyze > MAVLink Inspector](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/analyze_view/mavlink_inspector.html)).
## 总结
本教程涵盖了所有开发基本 PX4 自动驾驶仪应用程序的内容。
Keep in mind that the full list of uORB messages/topics is [available here](https://github.com/PX4/PX4-Autopilot/tree/main/msg/) and that the headers are well documented and serve as reference.
Further information and troubleshooting/common pitfalls can be found here: [uORB](../middleware/uorb.md).
下一页提供了一个模板,用于编写具有启动和停止功能的完整应用程序。
+6
View File
@@ -0,0 +1,6 @@
<Redirect to="modules_main" />
# Modules
This is a placholder for modules docs.
Built but not in sidebar.
+71
View File
@@ -0,0 +1,71 @@
# 适用于开发完整应用的模版
An application can be written to run as either a _task_ (a module with its own stack and process priority) or as a _work queue task_ (a module that runs on a work queue thread, sharing the stack and thread priority with other tasks on the work queue).
在大多数情况下,可以使用工作队列任务,因为这会减少资源的使用。
:::info
[Architectural Overview > Runtime Environment](../concept/architecture.md#runtime-environment) provides more information about tasks and work queue tasks.
:::
:::info
All the things learned in the [First Application Tutorial](../modules/hello_sky.md) are relevant for writing a full application.
:::
## 工作队列任务
PX4-Autopilot contains a template for writing a new application (module) that runs as a _work queue task_:
[src/examples/work_item](https://github.com/PX4/PX4-Autopilot/tree/main/src/examples/work_item).
工作队列任务应用程序与普通(任务)应用程序相同。 除了它需要指定它是一个工作队列任务,并在初始化期间运行调度它本身。
示例显示了如何操作。
总结:
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)):
```
...
DEPENDS
px4_work_queue
```
2. In addition to `ModuleBase`, the task should also derive from `ScheduledWorkItem` (included from [ScheduledWorkItem.hpp](https://github.com/PX4/PX4-Autopilot/blob/main/platforms/common/include/px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp))
3. 在构造函数初始化中指定要添加任务的队列。
The [work_item](https://github.com/PX4/PX4-Autopilot/blob/main/src/examples/work_item/WorkItemExample.cpp#L42) example adds itself to the `wq_configurations::test1` work queue as shown below:
```cpp
WorkItemExample::WorkItemExample() :
ModuleParams(nullptr),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::test1)
{
}
```
::: info
The available work queues (`wq_configurations`) are listed in [WorkQueueManager.hpp](https://github.com/PX4/PX4-Autopilot/blob/main/platforms/common/include/px4_platform_common/px4_work_queue/WorkQueueManager.hpp#L49).
:::
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.
6. Schedule the work queue task using one of the scheduling methods (in the example we use `ScheduleOnInterval` from within the `init` method).
## 任务
PX4/PX4-Autopilot contains a template for writing a new application (module) that runs as a task on its own stack:
[src/templates/template_module](https://github.com/PX4/PX4-Autopilot/tree/main/src/templates/template_module).
该模板演示了完整应用程序所需或有用的以下附加功能/方面:
- 访问参数并对参数更新做出反应。
- 订阅、等待 topic 更新。
- Controlling the task that runs in the background via `start`/`stop`/`status`.
The `module start [<arguments>]` command can then be directly added to the
[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)):
- 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.
+42
View File
@@ -0,0 +1,42 @@
# Modules Reference: Autotune
## fw_autotune_attitude_control
Source: [modules/fw_autotune_attitude_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/fw_autotune_attitude_control)
### 描述
<a id="fw_autotune_attitude_control_usage"></a>
### 用法
```
fw_autotune_attitude_control <command> [arguments...]
Commands:
start
[vtol] VTOL mode
stop
status print status info
```
## mc_autotune_attitude_control
Source: [modules/mc_autotune_attitude_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/mc_autotune_attitude_control)
### 描述
<a id="mc_autotune_attitude_control_usage"></a>
### 用法
```
mc_autotune_attitude_control <command> [arguments...]
Commands:
start
stop
status print status info
```
+721
View File
@@ -0,0 +1,721 @@
# 模块参考:命令(Command)
## actuator_test
Source: [systemcmds/actuator_test](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/actuator_test)
用于测试执行器的实用程序
警告:在使用此命令之前移除所有螺旋桨。
<a id="actuator_test_usage"></a>
### 用法
```
actuator_test <command> [arguments...]
Commands:
set Set an actuator to a specific output value
The actuator can be specified by motor, servo or function directly:
[-m <val>] Motor to test (1...8)
[-s <val>] Servo to test (1...8)
[-f <val>] Specify function directly
-v <val> value (-1...1)
[-t <val>] Timeout in seconds (run interactive if not set)
default: 0
iterate-motors Iterate all motors starting and stopping one after the other
iterate-servos Iterate all servos deflecting one after the other
```
## bl_update
Source: [systemcmds/bl_update](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/bl_update)
Utility to flash the bootloader from a file <a id="bl_update_usage"></a>
### 用法
```
bl_update [arguments...]
setopt Set option bits to unlock the FLASH (only needed if in locked
state)
<file> Bootloader bin file
```
## bsondump
Source: [systemcmds/bsondump](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/bsondump)
Utility to read BSON from a file and print or output document size. <a id="bsondump_usage"></a>
### 用法
```
bsondump [arguments...]
<file> The BSON file to decode and print.
```
## dumpfile
Source: [systemcmds/dumpfile](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/dumpfile)
转储文件实用程序。 以二进制模式(不要用 CR LF 替换 LF)将文件大小和内容打印到标准输出。 <a id="dumpfile_usage"></a>
### 用法
```
dumpfile [arguments...]
<file> File to dump
```
## dyn
Source: [systemcmds/dyn](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/dyn)
### 描述
加载并运行一个没有被编译进 PX4 的二进制文件的动态 PX4 模块
### Example
```
dyn ./hello.px4mod start
```
<a id="dyn_usage"></a>
### 用法
```
dyn [arguments...]
<file> File containing the module
[arguments...] Arguments to the module
```
## failure
Source: [systemcmds/failure](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/failure)
### 描述
向系统中注入故障。
### 实现
此系统命令通过 uORB 发送一个机体命令来出发故障。
### 示例
通过停止GPS来测试GPS故障保护:
failure gps off
<a id="failure_usage"></a>
### 用法
```
failure [arguments...]
help Show this help text
gps|... Specify component
ok|off|... Specify failure type
[-i <val>] sensor instance (0=all)
default: 0
```
## gpio
Source: [systemcmds/gpio](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/gpio)
### 描述
此命令用于读写GPIO
```
gpio read <PORT><PIN>/<DEVICE> [PULLDOWN|PULLUP] [--force]
gpio write <PORT><PIN>/<DEVICE> <VALUE> [PUSHPULL|OPENDRAIN] [--force]
```
### 示例
读取配置为上拉的 PH4 引脚,它的值为高
```
gpio read H4 PULLUP
```
1 OK
设置 PE7 的输出值为高
```
gpio write E7 1 --force
```
Set the output value on device /dev/gpio1 to high
```
gpio write /dev/gpio1 1
```
<a id="gpio_usage"></a>
### 用法
```
gpio [arguments...]
read
<PORT><PIN>/<DEVICE> GPIO port and pin or device
[PULLDOWN|PULLUP] Pulldown/Pullup
[--force] Force (ignore board gpio list)
write
<PORT> <PIN> GPIO port and pin
<VALUE> Value to write
[PUSHPULL|OPENDRAIN] Pushpull/Opendrain
[--force] Force (ignore board gpio list)
```
## hardfault_log
Source: [systemcmds/hardfault_log](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/hardfault_log)
Hardfault 实用程序
在启动脚本中用于处理 hardfaults。
<a id="hardfault_log_usage"></a>
### 用法
```
hardfault_log <command> [arguments...]
Commands:
check Check if there's an uncommitted hardfault
rearm Drop an uncommitted hardfault
fault Generate a hardfault (this command crashes the system :)
[0|1|2|3] Hardfault type: 0=divide by 0, 1=Assertion, 2=jump to 0x0,
3=write to 0x0 (default=0)
commit Write uncommitted hardfault to /fs/microsd/fault_%i.txt (and
rearm, but don't reset)
count Read the reboot counter, counts the number of reboots of an
uncommitted hardfault (returned as the exit code of the
program)
reset Reset the reboot counter
```
## hist
Source: [systemcmds/hist](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/hist)
Command-line tool to show the px4 message history. There are no arguments. <a id="hist_usage"></a>
### 用法
```
hist [arguments...]
```
## i2cdetect
Source: [systemcmds/i2cdetect](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/i2cdetect)
Utility to scan for I2C devices on a particular bus. <a id="i2cdetect_usage"></a>
### 用法
```
i2cdetect [arguments...]
[-b <val>] I2C bus
default: 1
```
## led_control
Source: [systemcmds/led_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/led_control)
### 描述
Command-line tool to control & test the (external) LED's.
要使用它,请确保有一个处理 led_control 的 uorb 主题的设备正在运行。
有不同的优先级,例如一个模块可以设置低优先级的颜色,另一个模块可以高优先级闪烁 N 次,闪烁后 LED 自动返回低优先级状态。 The `reset` command can also be used to return to a lower priority.
### 示例
第一个 LED 闪烁蓝光 5 次:
```
led_control blink -c blue -l 0 -n 5
```
<a id="led_control_usage"></a>
### 用法
```
led_control <command> [arguments...]
Commands:
test Run a test pattern
on Turn LED on
off Turn LED off
reset Reset LED priority
blink Blink LED N times
[-n <val>] Number of blinks
default: 3
[-s <val>] Set blinking speed
values: fast|normal|slow, default: normal
breathe Continuously fade LED in & out
flash Two fast blinks and then off with frequency of 1Hz
The following arguments apply to all of the above commands except for 'test':
[-c <val>] color
values: red|blue|green|yellow|purple|amber|cyan|white, default:
white
[-l <val>] Which LED to control: 0, 1, 2, ... (default=all)
[-p <val>] Priority
default: 2
```
## listener
Source: [systemcmds/topic_listener](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/topic_listener)
监听 uORB 主题并将数据打印到控制台的实用程序。
可以通过按 Ctrl+C、Esc 或 Q 随时退出侦听器。
<a id="listener_usage"></a>
### 用法
```
listener <command> [arguments...]
Commands:
<topic_name> uORB topic name
[-i <val>] Topic instance
default: 0
[-n <val>] Number of messages
default: 1
[-r <val>] Subscription rate (unlimited if 0)
default: 0
```
## mfd
Source: [systemcmds/mft](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/mft)
Utility interact with the manifest <a id="mfd_usage"></a>
### 用法
```
mfd <command> [arguments...]
Commands:
query Returns true if not existed
```
## mft_cfg
Source: [systemcmds/mft_cfg](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/mft_cfg)
Tool to set and get manifest configuration <a id="mft_cfg_usage"></a>
### 用法
```
mft_cfg <command> [arguments...]
Commands:
get get manifest configuration
set set manifest configuration
reset reset manifest configuration
hwver|hwrev Select type: MTD_MTF_VER|MTD_MTF_REV
-i <val> argument to set extended hardware id (id == version for
<hwver>, id == revision for <hwrev> )
```
## mtd
Source: [systemcmds/mtd](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/mtd)
Utility to mount and test partitions (based on FRAM/EEPROM storage as defined by the board) <a id="mtd_usage"></a>
### 用法
```
mtd <command> [arguments...]
Commands:
status Print status information
readtest Perform read test
rwtest Perform read-write test
erase Erase partition(s)
The commands 'readtest' and 'rwtest' have an optional instance index:
[-i <val>] storage index (if the board has multiple storages)
default: 0
The commands 'readtest', 'rwtest' and 'erase' have an optional parameter:
[<partition_name1> [<partition_name2> ...]] Partition names (eg.
/fs/mtd_params), use system default if not provided
```
## nshterm
Source: [systemcmds/nshterm](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/nshterm)
在指定端口启动一个 NSH shell。
该命令此前被用于在 USB 串口端口开启一个 shell。
现在运行mavlink,并且可以在mavlink 上使用shell。
<a id="nshterm_usage"></a>
### 用法
```
nshterm [arguments...]
<file:dev> Device on which to start the shell (eg. /dev/ttyACM0)
```
## param
Source: [systemcmds/param](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/param)
### 描述
通过 shell 或脚本访问和操作参数的命令。
例如,这在启动脚本中用于设置特定于机身的参数。
Parameters are automatically saved when changed, eg. with `param set`. 它们通常存储在 FRAM 或 SD 卡中。 `param select` can be used to change the storage location for subsequent saves (this will
need to be (re-)configured on every boot).
If the FLASH-based backend is enabled (which is done at compile time, e.g. for the Intel Aero or Omnibus),
`param select` has no effect and the default is always the FLASH backend. However `param save/load <file>`
can still be used to write to/read from files.
每个参数有一个“已使用”的标志,此标志在启动过程参数被读取后被置位。 它只是用于向地面控制站显示相关参数。
### 示例
更改机身并确保已加载机身的默认参数:
```
param set SYS_AUTOSTART 4001
param set SYS_AUTOCONFIG 1
reboot
```
<a id="param_usage"></a>
### 用法
```
param <command> [arguments...]
Commands:
load Load params from a file (overwrite all)
[<file>] File name (use default if not given)
import Import params from a file
[<file>] File name (use default if not given)
save Save params to a file
[<file>] File name (use default if not given)
select Select default file
[<file>] File name
select-backup Select default file
[<file>] File name
show Show parameter values
[-a] Show all parameters (not just used)
[-c] Show only changed params (unused too)
[-q] quiet mode, print only param value (name needs to be exact)
[<filter>] Filter by param name (wildcard at end allowed, eg. sys_*)
show-for-airframe Show changed params for airframe config
status Print status of parameter system
set Set parameter to a value
<param_name> <value> Parameter name and value to set
[fail] If provided, let the command fail if param is not found
set-default Set parameter default to a value
[-s] If provided, silent errors if parameter doesn't exists
<param_name> <value> Parameter name and value to set
[fail] If provided, let the command fail if param is not found
compare Compare a param with a value. Command will succeed if equal
[-s] If provided, silent errors if parameter doesn't exists
<param_name> <value> Parameter name and value to compare
greater Compare a param with a value. Command will succeed if param is
greater than the value
[-s] If provided, silent errors if parameter doesn't exists
<param_name> <value> Parameter name and value to compare
<param_name> <value> Parameter name and value to compare
touch Mark a parameter as used
[<param_name1> [<param_name2>]] Parameter name (one or more)
reset Reset only specified params to default
[<param1> [<param2>]] Parameter names to reset (wildcard at end allowed)
reset_all Reset all params to default
[<exclude1> [<exclude2>]] Do not reset matching params (wildcard at end
allowed)
index Show param for a given index
<index> Index: an integer >= 0
index_used Show used param for a given index
<index> Index: an integer >= 0
find Show index of a param
<param> param name
```
## payload_deliverer
Source: [modules/payload_deliverer](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/payload_deliverer)
### 描述
Handles payload delivery with either Gripper or a Winch with an appropriate timeout / feedback sensor setting,
and communicates back the delivery result as an acknowledgement internally
<a id="payload_deliverer_usage"></a>
### 用法
```
payload_deliverer <command> [arguments...]
Commands:
start
gripper_test Tests the Gripper's release & grabbing sequence
gripper_open Opens the gripper
gripper_close Closes the gripper
stop
status print status info
```
## perf
Source: [systemcmds/perf](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/perf)
Tool to print performance counters <a id="perf_usage"></a>
### 用法
```
perf [arguments...]
reset Reset all counters
latency Print HRT timer latency histogram
Prints all performance counters if no arguments given
```
## reboot
Source: [systemcmds/reboot](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/reboot)
Reboot the system <a id="reboot_usage"></a>
### 用法
```
reboot [arguments...]
[-b] Reboot into bootloader
[-i] Reboot into ISP (1st stage bootloader)
[lock|unlock] Take/release the shutdown lock (for testing)
```
## sd_bench
Source: [systemcmds/sd_bench](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/sd_bench)
Test the speed of an SD Card <a id="sd_bench_usage"></a>
### 用法
```
sd_bench [arguments...]
[-b <val>] Block size for each read/write
default: 4096
[-r <val>] Number of runs
default: 5
[-d <val>] Duration of a run in ms
default: 2000
[-k] Keep the test file
[-s] Call fsync after each block (default=at end of each run)
[-u] Test performance with unaligned data
[-U] Test performance with forced byte unaligned data
[-v] Verify data and block number
```
## sd_stress
Source: [systemcmds/sd_stress](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/sd_stress)
Test operations on an SD Card <a id="sd_stress_usage"></a>
### 用法
```
sd_stress [arguments...]
[-r <val>] Number of runs
default: 5
[-b <val>] Number of bytes
default: 100
```
## serial_passthru
Source: [systemcmds/serial_passthru](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/serial_passthru)
把数据从一个设备传输到另一个设备。
This can be used to use u-center connected to USB with a GPS on a serial port.
<a id="serial_passthru_usage"></a>
### 用法
```
serial_passthru [arguments...]
-e <val> External device path
values: <file:dev>
-d <val> Internal device path
values: <file:dev>
[-b <val>] Baudrate
default: 115200
[-t] Track the External devices baudrate on internal device
```
## 系统时间
Source: [systemcmds/system_time](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/system_time)
### 描述
Command-line tool to set and get system time.
### 示例
Set the system time and read it back
```
system_time set 1600775044
system_time get
```
<a id="system_time_usage"></a>
### 用法
```
system_time <command> [arguments...]
Commands:
set Set the system time, provide time in unix epoch time format
get Get the system time
```
## top
Source: [systemcmds/top](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/top)
Monitor running processes and their CPU, stack usage, priority and state <a id="top_usage"></a>
### 用法
```
top [arguments...]
once print load only once
```
## usb_connected
Source: [systemcmds/usb_connected](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/usb_connected)
Utility to check if USB is connected. Was previously used in startup scripts.
A return value of 0 means USB is connected, 1 otherwise. <a id="usb_connected_usage"></a>
### 用法
```
usb_connected [arguments...]
```
## ver
Source: [systemcmds/ver](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/ver)
Tool to print various version information <a id="ver_usage"></a>
### 用法
```
ver <command> [arguments...]
Commands:
hw Hardware architecture
mcu MCU info
git git version information
bdate Build date and time
gcc Compiler info
bdate Build date and time
px4guid PX4 GUID
uri Build URI
all Print all versions
hwcmp Compare hardware version (returns 0 on match)
<hw> [<hw2>] Hardware to compare against (eg. PX4_FMU_V4). An OR comparison
is used if multiple are specified
hwtypecmp Compare hardware type (returns 0 on match)
<hwtype> [<hwtype2>] Hardware type to compare against (eg. V2). An OR
comparison is used if multiple are specified
hwbasecmp Compare hardware base (returns 0 on match)
<hwbase> [<hwbase2>] Hardware type to compare against (eg. V2). An OR
comparison is used if multiple are specified
```
+167
View File
@@ -0,0 +1,167 @@
# 模块参考:通信(Communication)
## frsky_telemetry
Source: [drivers/telemetry/frsky_telemetry](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/telemetry/frsky_telemetry)
FrSky 数传支持, FrSky Telemetry support. Auto-detects D or S.PORT protocol. <a id="frsky_telemetry_usage"></a>
### 用法
```
frsky_telemetry <command> [arguments...]
Commands:
start
[-d <val>] Select Serial Device
values: <file:dev>, default: /dev/ttyS6
[-t <val>] Scanning timeout [s] (default: no timeout)
default: 0
[-m <val>] Select protocol (default: auto-detect)
values: sport|sport_single|sport_single_invert|dtype, default:
auto
stop
status
```
## mavlink
Source: [modules/mavlink](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/mavlink)
### 描述
此模块实现了 MAVLink 协议,该协议可在串口或 UDP 网络上使用。
This module implements the MAVLink protocol, which can be used on a Serial link or UDP network connection. It communicates with the system via uORB: some messages are directly handled in the module (eg. mission protocol), others are published via uORB (eg. vehicle_command).
流(Stream)被用来以特定速率发送周期性的消息,例如飞机姿态信息。
Streams are used to send periodic messages with a specific rate, such as the vehicle attitude. When starting the mavlink instance, a mode can be specified, which defines the set of enabled streams with their rates. For a running instance, streams can be configured via <code>mavlink stream</code> command.
For a running instance, streams can be configured via `mavlink stream` command.
可以存在多个该模块的实例,每个实例连接到一个串口设备或者网络端口。
### 实现
命令的具体实现使用了两个线程,分别为数据发送线程和接收线程。 The sender runs at a fixed rate and dynamically
reduces the rates of the streams if the combined bandwidth is higher than the configured rate (`-r`) or the
physical link becomes saturated. This can be checked with `mavlink status`, see if `rate mult` is less than 1.
**Careful**: some of the data is accessed and modified from both threads, so when changing code or extend the
functionality, this needs to be take into account, in order to avoid race conditions and corrupt data.
### 示例
在 ttyS1 串口启动 mavlink ,并设定波特率为 921600、最大发送速率为 80kB/s:
```
mavlink start -d /dev/ttyS1 -b 921600 -m onboard -r 80000
```
在 UDP 端口 14556 启动 mavlink 并启用 50Hz 的 HIGHRES_IMU 消息:
```
mavlink start -u 14556 -r 1000000
mavlink stream -u 14556 -s HIGHRES_IMU -r 50
```
<a id="mavlink_usage"></a>
### 用法
```
mavlink <command> [arguments...]
Commands:
start Start a new instance
[-d <val>] Select Serial Device
values: <file:dev>, default: /dev/ttyS1
[-b <val>] Baudrate (can also be p:<param_name>)
default: 57600
[-r <val>] Maximum sending data rate in B/s (if 0, use baudrate / 20)
default: 0
[-p] Enable Broadcast
[-u <val>] Select UDP Network Port (local)
default: 14556
[-o <val>] Select UDP Network Port (remote)
default: 14550
[-t <val>] Partner IP (broadcasting can be enabled via -p flag)
default: 127.0.0.1
[-m <val>] Mode: sets default streams and rates
values: custom|camera|onboard|osd|magic|config|iridium|minimal|
extvision|extvisionmin|gimbal|uavionix, default: normal
[-n <val>] wifi/ethernet interface name
values: <interface_name>
[-c <val>] Multicast address (multicasting can be enabled via
MAV_{i}_BROADCAST param)
values: Multicast address in the range
[239.0.0.0,239.255.255.255]
[-F <val>] Sets the transmission frequency for iridium mode
default: 0.0
[-f] Enable message forwarding to other Mavlink instances
[-w] Wait to send, until first message received
[-x] Enable FTP
[-z] Force hardware flow control always on
[-Z] Force hardware flow control always off
stop-all Stop all instances
stop Stop a running instance
[-u <val>] Select Mavlink instance via local Network Port
[-d <val>] Select Mavlink instance via Serial Device
values: <file:dev>
status Print status for all instances
[streams] Print all enabled streams
stream Configure the sending rate of a stream for a running instance
[-u <val>] Select Mavlink instance via local Network Port
[-d <val>] Select Mavlink instance via Serial Device
values: <file:dev>
-s <val> Mavlink stream to configure
-r <val> Rate in Hz (0 = turn off, -1 = set to default)
boot_complete Enable sending of messages. (Must be) called as last step in
startup script.
```
## uorb
Source: [systemcmds/uorb](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/uorb)
### 描述
uORB 是各模块之间进行通讯的基于 发布-订阅 机制的内部消息传递系统。
### 实现
The implementation is asynchronous and lock-free, ie. a publisher does not wait for a subscriber and vice versa.
This is achieved by having a separate buffer between a publisher and a subscriber.
The code is optimized to minimize the memory footprint and the latency to exchange messages.
Messages are defined in the `/msg` directory. They are converted into C/C++ code at build-time.
该接口基于文件描述符(file descriptor)实现:它在内部使用 <code>read</code>、<code>write</code> 和 <code>ioctl</code>。 The interface is based on file descriptors: internally it uses <code>read</code>, <code>write</code> and <code>ioctl</code>. Except for the publications, which use <code>orb_advert_t</code> handles, so that they can be used from interrupts as well (on NuttX).
### 示例
Messages are defined in the <code>/msg</code> directory. They are converted into C/C++ code at build-time. Besides `top`, this is an important command for general system inspection:
```
uorb top
```
<a id="uorb_usage"></a>
### 用法
```
uorb <command> [arguments...]
Commands:
status Print topic statistics
top Monitor topic publication rates
[-a] print all instead of only currently publishing topics with
subscribers
[-1] run only once, then exit
[<filter1> [<filter2>]] topic(s) to match (implies -a)
```
+501
View File
@@ -0,0 +1,501 @@
# 模块参考:控制器
## fw_att_control
Source: [modules/airship_att_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/airship_att_control)
### 描述
This implements the airship attitude and rate controller. Ideally it would
take attitude setpoints (`vehicle_attitude_setpoint`) or rate setpoints (in acro mode
via `manual_control_setpoint` topic) as inputs and outputs actuator control messages.
Currently it is feeding the `manual_control_setpoint` topic directly to the actuators.
### 实现
To reduce control latency, the module directly polls on the gyro topic published by the IMU driver.
<a id="airship_att_control_usage"></a>
### 用法
```
airship_att_control <command> [arguments...]
Commands:
start
stop
status print status info
```
## control_allocator
Source: [modules/control_allocator](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/control_allocator)
### 描述
This implements control allocation. It takes torque and thrust setpoints
as inputs and outputs actuator setpoint messages.
<a id="control_allocator_usage"></a>
### 用法
```
control_allocator <command> [arguments...]
Commands:
start
stop
status print status info
```
## fw_pos_control_l1
Source: [modules/flight_mode_manager](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/flight_mode_manager)
### 描述
This implements the setpoint generation for all modes. It takes the current mode state of the vehicle as input
and outputs setpoints for controllers.
<a id="flight_mode_manager_usage"></a>
### 用法
```
flight_mode_manager <command> [arguments...]
Commands:
start
stop
status print status info
```
## mc_att_control
Source: [modules/fw_att_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/fw_att_control)
### 描述
fw_att_control is the fixed wing attitude controller.
<a id="fw_att_control_usage"></a>
### 用法
```
fw_att_control <command> [arguments...]
Commands:
start
[vtol] VTOL mode
stop
status print status info
```
## fw_pos_control
Source: [modules/fw_pos_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/fw_pos_control)
### 描述
fw_pos_control is the fixed-wing position controller.
<a id="fw_pos_control_usage"></a>
### 用法
```
fw_pos_control <command> [arguments...]
Commands:
start
[vtol] VTOL mode
stop
status print status info
```
## fw_rate_control
Source: [modules/fw_rate_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/fw_rate_control)
### 描述
fw_rate_control is the fixed-wing rate controller.
<a id="fw_rate_control_usage"></a>
### 用法
```
fw_rate_control <command> [arguments...]
Commands:
start
[vtol] VTOL mode
stop
status print status info
```
## mc_att_control
Source: [modules/mc_att_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/mc_att_control)
### 描述
This implements the multicopter attitude controller. It takes attitude
setpoints (`vehicle_attitude_setpoint`) as inputs and outputs a rate setpoint.
The controller has a P loop for angular error
The different internal modes are implemented as separate classes that inherit from a common base class <code>NavigatorMode</code>. The member <code>_navigation_mode</code> contains the current active mode.
https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/154099/eth-7387-01.pdf
<a id="mc_att_control_usage"></a>
### 用法
```
mc_att_control <command> [arguments...]
Commands:
start
[vtol] VTOL mode
stop
status print status info
```
## navigator
Source: [modules/mc_pos_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/mc_pos_control)
### 描述
The controller has two loops: a P loop for position error and a PID loop for velocity error.
Output of the velocity controller is thrust vector that is split to thrust direction
(i.e. rotation matrix for multicopter orientation) and thrust scalar (i.e. multicopter thrust itself).
The controller doesn't use Euler angles for its work, they are generated only for more human-friendly control and
logging.
<a id="mc_pos_control_usage"></a>
### 用法
```
mc_pos_control <command> [arguments...]
Commands:
start
[vtol] VTOL mode
stop
status print status info
```
## mc_rate_control
Source: [modules/mc_rate_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/mc_rate_control)
### 描述
This implements the multicopter rate controller. It takes rate setpoints (in acro mode
via `manual_control_setpoint` topic) as inputs and outputs actuator control messages.
The controller has a PID loop for angular rate error.
<a id="mc_rate_control_usage"></a>
### 用法
```
mc_rate_control <command> [arguments...]
Commands:
start
[vtol] VTOL mode
stop
status print status info
```
## navigator
Source: [modules/navigator](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/navigator)
### 描述
Module that is responsible for autonomous flight modes. This includes missions (read from dataman),
takeoff and RTL.
It is also responsible for geofence violation checking.
### 实现
The different internal modes are implemented as separate classes that inherit from a common base class `NavigatorMode`.
The member `_navigation_mode` contains the current active mode.
Navigator publishes position setpoint triplets (`position_setpoint_triplet_s`), which are then used by the position
controller.
<a id="navigator_usage"></a>
### 用法
```
navigator <command> [arguments...]
Commands:
start
fencefile load a geofence file from SD card, stored at etc/geofence.txt
fake_traffic publishes 24 fake transponder_report_s uORB messages
stop
status print status info
```
## rover_ackermann
Source: [modules/rover_ackermann](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/rover_ackermann)
### 描述
Rover ackermann module.
<a id="rover_ackermann_usage"></a>
### 用法
```
rover_ackermann <command> [arguments...]
Commands:
start
stop
status print status info
```
## rover_differential
Source: [modules/rover_differential](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/rover_differential)
### 描述
Rover differential module.
<a id="rover_differential_usage"></a>
### 用法
```
rover_differential <command> [arguments...]
Commands:
start
stop
status print status info
```
## rover_mecanum
Source: [modules/rover_mecanum](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/rover_mecanum)
### 描述
Rover mecanum module.
<a id="rover_mecanum_usage"></a>
### 用法
```
rover_mecanum <command> [arguments...]
Commands:
start
stop
status print status info
```
## rover_pos_control
Source: [modules/rover_pos_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/rover_pos_control)
### 描述
Controls the position of a ground rover using an L1 controller.
Publishes `vehicle_thrust_setpoint (only in x) and vehicle_torque_setpoint (only yaw)` messages at IMU_GYRO_RATEMAX.
### 实现
Currently, this implementation supports only a few modes:
- Full manual: Throttle and yaw controls are passed directly through to the actuators
- Auto mission: The rover runs missions
- Loiter: The rover will navigate to within the loiter radius, then stop the motors
### 示例
CLI usage example:
```
rover_pos_control start
rover_pos_control status
rover_pos_control stop
```
<a id="rover_pos_control_usage"></a>
### 用法
```
rover_pos_control <command> [arguments...]
Commands:
start
stop
status print status info
```
## spacecraft
Source: [modules/spacecraft](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/spacecraft)
```
### Description
This implements control allocation for spacecraft vehicles.
It takes torque and thrust setpoints as inputs and outputs
actuator setpoint messages.
```
<a id="spacecraft_usage"></a>
### 用法
```
spacecraft <command> [arguments...]
Commands:
start
stop
status print status info
```
## uuv_att_control
Source: [modules/uuv_att_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/uuv_att_control)
### 描述
Controls the attitude of an unmanned underwater vehicle (UUV).
Publishes `vehicle_thrust_setpont` and `vehicle_torque_setpoint` messages at a constant 250Hz.
### 实现
Currently, this implementation supports only a few modes:
- Full manual: Roll, pitch, yaw, and throttle controls are passed directly through to the actuators
- Auto mission: The uuv runs missions
### 示例
CLI usage example:
```
uuv_att_control start
uuv_att_control status
uuv_att_control stop
```
<a id="uuv_att_control_usage"></a>
### 用法
```
uuv_att_control <command> [arguments...]
Commands:
start
stop
status print status info
```
## uuv_pos_control
Source: [modules/uuv_pos_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/uuv_pos_control)
### 描述
Controls the attitude of an unmanned underwater vehicle (UUV).
Publishes `attitude_setpoint` messages.
### 实现
Currently, this implementation supports only a few modes:
- Full manual: Roll, pitch, yaw, and throttle controls are passed directly through to the actuators
- Auto mission: The uuv runs missions
### 示例
CLI usage example:
```
uuv_pos_control start
uuv_pos_control status
uuv_pos_control stop
```
<a id="uuv_pos_control_usage"></a>
### 用法
```
uuv_pos_control <command> [arguments...]
Commands:
start
stop
status print status info
```
## vtol_att_control
Source: [modules/vtol_att_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/vtol_att_control)
### 描述
fw_att_control is the fixed wing attitude controller.
<a id="vtol_att_control_usage"></a>
### 用法
```
vtol_att_control <command> [arguments...]
Commands:
stop
status print status info
```
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,195 @@
# Modules Reference: Airspeed Sensor (Driver)
## asp5033
Source: [drivers/differential_pressure/asp5033](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/differential_pressure/asp5033)
### 描述
Driver to enable an external [ASP5033]
(https://www.qio-tek.com/index.php/product/qiotek-asp5033-dronecan-airspeed-and-compass-module/)
TE connected via I2C.
This is not included by default in firmware. It can be included with terminal command: "make <your_board> boardconfig"
or in default.px4board with adding the line: "CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_ASP5033=y"
It can be enabled with the "SENS_EN_ASP5033" parameter set to 1.
<a id="asp5033_usage"></a>
### 用法
```
asp5033 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 109
stop
status print status info
```
## auav
Source: [drivers/differential_pressure/auav](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/differential_pressure/auav)
<a id="auav_usage"></a>
### 用法
```
auav <command> [arguments...]
Commands:
start
[-D] Differential pressure sensing
[-A] Absolute pressure sensing
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 38
stop
status print status info
```
## ets_airspeed
Source: [drivers/differential_pressure/ets](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/differential_pressure/ets)
<a id="ets_airspeed_usage"></a>
### 用法
```
ets_airspeed <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 117
stop
status print status info
```
## ms4515
Source: [drivers/differential_pressure/ms4515](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/differential_pressure/ms4515)
<a id="ms4515_usage"></a>
### 用法
```
ms4515 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 70
stop
status print status info
```
## ms4525do
Source: [drivers/differential_pressure/ms4525do](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/differential_pressure/ms4525do)
<a id="ms4525do_usage"></a>
### 用法
```
ms4525do <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 40
stop
status print status info
```
## ms5525dso
Source: [drivers/differential_pressure/ms5525dso](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/differential_pressure/ms5525dso)
<a id="ms5525dso_usage"></a>
### 用法
```
ms5525dso <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 118
stop
status print status info
```
## sdp3x
Source: [drivers/differential_pressure/sdp3x](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/differential_pressure/sdp3x)
<a id="sdp3x_usage"></a>
### 用法
```
sdp3x <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 33
[-k] if initialization (probing) fails, keep retrying periodically
stop
status print status info
```
+466
View File
@@ -0,0 +1,466 @@
# Modules Reference: Baro (Driver)
## bmp280
Source: [drivers/barometer/bmp280](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/bmp280)
<a id="bmp280_usage"></a>
### 用法
```
bmp280 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 118
[-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)
stop
status print status info
```
## bmp388
Source: [drivers/barometer/bmp388](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/bmp388)
<a id="bmp388_usage"></a>
### 用法
```
bmp388 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 118
stop
status print status info
```
## bmp581
Source: [drivers/barometer/bmp581](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/bmp581)
<a id="bmp581_usage"></a>
### 用法
```
bmp581 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 70
stop
status print status info
```
## dps310
Source: [drivers/barometer/dps310](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/dps310)
<a id="dps310_usage"></a>
### 用法
```
dps310 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 119
[-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)
stop
status print status info
```
## icp101xx
Source: [drivers/barometer/invensense/icp101xx](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/invensense/icp101xx)
<a id="icp101xx_usage"></a>
### 用法
```
icp101xx <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 99
stop
status print status info
```
## icp201xx
Source: [drivers/barometer/invensense/icp201xx](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/invensense/icp201xx)
<a id="icp201xx_usage"></a>
### 用法
```
icp201xx <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 99
stop
status print status info
```
## lps22hb
Source: [drivers/barometer/lps22hb](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/lps22hb)
<a id="lps22hb_usage"></a>
### 用法
```
lps22hb <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
stop
status print status info
```
## lps25h
Source: [drivers/barometer/lps25h](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/lps25h)
<a id="lps25h_usage"></a>
### 用法
```
lps25h <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
stop
status print status info
```
## lps33hw
Source: [drivers/barometer/lps33hw](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/lps33hw)
<a id="lps33hw_usage"></a>
### 用法
```
lps33hw <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 93
[-k] if initialization (probing) fails, keep retrying periodically
stop
status print status info
```
## mpc2520
Source: [drivers/barometer/maiertek/mpc2520](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/maiertek/mpc2520)
<a id="mpc2520_usage"></a>
### 用法
```
mpc2520 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 118
stop
status print status info
```
## mpl3115a2
Source: [drivers/barometer/mpl3115a2](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/mpl3115a2)
<a id="mpl3115a2_usage"></a>
### 用法
```
mpl3115a2 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 96
stop
status print status info
```
## ms5611
Source: [drivers/barometer/ms5611](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/ms5611)
<a id="ms5611_usage"></a>
### 用法
```
ms5611 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-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)
[-T <val>] Device type
values: 5607|5611, default: 5611
stop
status print status info
```
## ms5837
Source: [drivers/barometer/ms5837](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/ms5837)
<a id="ms5837_usage"></a>
### 用法
```
ms5837 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
stop
status print status info
```
## spa06
Source: [drivers/barometer/goertek/spa06](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/goertek/spa06)
<a id="spa06_usage"></a>
### 用法
```
spa06 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 118
[-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)
stop
status print status info
```
## spl06
Source: [drivers/barometer/goertek/spl06](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/barometer/goertek/spl06)
<a id="spl06_usage"></a>
### 用法
```
spl06 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 118
[-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)
stop
status print status info
```
+53
View File
@@ -0,0 +1,53 @@
# Modules Reference: Camera (Driver)
## camera_trigger
Source: [drivers/camera_trigger](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/camera_trigger)
### 描述
Camera trigger driver.
This module triggers cameras that are connected to the flight-controller outputs,
or simple MAVLink cameras that implement the MAVLink trigger protocol.
The driver responds to the following MAVLink trigger commands being found in missions or recieved over MAVLink:
- `MAV_CMD_DO_TRIGGER_CONTROL`
- `MAV_CMD_DO_DIGICAM_CONTROL`
- `MAV_CMD_DO_SET_CAM_TRIGG_DIST`
- `MAV_CMD_OBLIQUE_SURVEY`
The commands cause the driver to trigger camera image capture based on time or distance.
Each time an image capture is triggered, the `CAMERA_TRIGGER` MAVLink message is emitted.
A "simple MAVLink camera" is one that supports the above command set.
When configured for this kind of camera, all the driver does is emit the `CAMERA_TRIGGER` MAVLink message as expected.
The incoming commands must be forwarded to the MAVLink camera, and are automatically emitted to MAVLink channels
when found in missions.
The driver is configured using [Camera Trigger parameters](../advanced_config/parameter_reference.md#camera-trigger).
In particular:
- `TRIG_INTERFACE` - How the camera is connected to flight controller (PWM, GPIO, Seagull, MAVLink)
- `TRIG_MODE` - Distance or time based triggering, with values set by `TRIG_DISTANCE` and `TRIG_INTERVAL`.
[Setup/usage information](../camera/index.md).
<a id="camera_trigger_usage"></a>
### 用法
```
camera_trigger <command> [arguments...]
Commands:
start
stop Stop driver
status Print driver status information
test Trigger one image (not logged or forwarded to GCS)
test_power Toggle power
```
@@ -0,0 +1,605 @@
# Modules Reference: Distance Sensor (Driver)
## afbrs50
Source: [drivers/distance_sensor/broadcom/afbrs50](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/broadcom/afbrs50)
### 描述
Driver for the Broadcom AFBRS50.
### 示例
Attempt to start driver on a specified serial device.
```
afbrs50 start
```
设置/使用 信息: https://docs.px4.io/master/en/sensor/leddar_one.html
```
afbrs50 stop
```
<a id="afbrs50_usage"></a>
### 用法
```
afbrs50 <command> [arguments...]
Commands:
start Start driver
-d <val> Serial device
[-r <val>] Sensor rotation - downward facing by default
default: 25
test Test driver
stop Stop driver
```
## gy_us42
Source: [drivers/distance_sensor/gy_us42](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/gy_us42)
<a id="gy_us42_usage"></a>
### 用法
```
gy_us42 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-R <val>] Sensor rotation - downward facing by default
default: 25
stop
status print status info
```
## leddar_one
Source: [drivers/distance_sensor/leddar_one](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/leddar_one)
### 描述
Serial bus driver for the LeddarOne LiDAR.
针对 Lightware SFxx 系列 LIDAR 测距仪的 I2C 总线驱动: SF10/a, SF10/b, SF10/c, SF11/c, SF/LW20。
Setup/usage information: https://docs.px4.io/main/en/sensor/leddar_one.html
### 示例
Attempt to start driver on a specified serial device.
```
leddar_one start -d /dev/ttyS1
```
设置/使用 信息: https://docs.px4.io/master/en/sensor/leddar_one.html
```
leddar_one stop
```
<a id="leddar_one_usage"></a>
### 用法
```
leddar_one <command> [arguments...]
Commands:
start Start driver
-d <val> Serial device
[-r <val>] Sensor rotation - downward facing by default
default: 25
stop Stop driver
```
## lightware_laser_i2c
Source: [drivers/distance_sensor/lightware_laser_i2c](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/lightware_laser_i2c)
### 描述
设置/使用 信息: https://docs.px4.io/master/en/sensor/sfxx_lidar.html
Setup/usage information: https://docs.px4.io/main/en/sensor/sfxx_lidar.html
<a id="lightware_laser_i2c_usage"></a>
### 用法
```
lightware_laser_i2c <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 102
[-R <val>] Sensor rotation - downward facing by default
default: 25
stop
status print status info
```
## lightware_laser_serial
Source: [drivers/distance_sensor/lightware_laser_serial](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/lightware_laser_serial)
### 描述
Serial bus driver for the LightWare SF02/F, SF10/a, SF10/b, SF10/c, SF11/c Laser rangefinders.
Most boards are configured to enable/start the driver on a specified UART using the SENS_SF0X_CFG parameter.
Setup/usage information: https://docs.px4.io/main/en/sensor/sfxx_lidar.html
### 示例
Attempt to start driver on a specified serial device.
```
lightware_laser_serial start -d /dev/ttyS1
```
设置/使用 信息: https://docs.px4.io/master/en/sensor/leddar_one.html
```
lightware_laser_serial stop
```
<a id="lightware_laser_serial_usage"></a>
### 用法
```
lightware_laser_serial <command> [arguments...]
Commands:
start Start driver
-d <val> Serial device
[-R <val>] Sensor rotation - downward facing by default
default: 25
stop Stop driver
```
## lightware_sf45_serial
Source: [drivers/distance_sensor/lightware_sf45_serial](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/lightware_sf45_serial)
### 描述
Serial bus driver for the Lightware SF45/b Laser rangefinder.
### 示例
Attempt to start driver on a specified serial device.
```
lightware_sf45_serial start -d /dev/ttyS1
```
设置/使用 信息: https://docs.px4.io/master/en/sensor/leddar_one.html
```
lightware_sf45_serial stop
```
<a id="lightware_sf45_serial_usage"></a>
### 用法
```
lightware_sf45_serial <command> [arguments...]
Commands:
start Start driver
-d <val> Serial device
stop Stop driver
```
## ll40ls
Source: [drivers/distance_sensor/ll40ls](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/ll40ls)
### 描述
源码:<a href="https://github.com/PX4/Firmware/tree/master/src/drivers/distance_sensor/pga460">drivers/distance_sensor/pga460</a>
超声笔测距仪驱动,负责处理与设备的用心并通过 uORB 将距离信息发布出去。
Setup/usage information: https://docs.px4.io/main/en/sensor/lidar_lite.html
<a id="ll40ls_usage"></a>
### 用法
```
ll40ls <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 98
[-R <val>] Sensor rotation - downward facing by default
default: 25
regdump
stop
status print status info
```
## pga460
Source: [drivers/distance_sensor/mappydot](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/mappydot)
<a id="mappydot_usage"></a>
### 用法
```
mappydot <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
stop
status print status info
```
## mb12xx
Source: [drivers/distance_sensor/mb12xx](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/mb12xx)
<a id="mb12xx_usage"></a>
### 用法
```
mb12xx <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
set_address
[-a <val>] I2C address
default: 112
stop
status print status info
```
## pga460
Source: [drivers/distance_sensor/pga460](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/pga460)
### 描述
Ultrasonic range finder driver that handles the communication with the device and publishes the distance via uORB.
### 实现
This driver is implemented as a NuttX task. This Implementation was chosen due to the need for polling on a message
via UART, which is not supported in the work_queue. This driver continuously takes range measurements while it is
running. A simple algorithm to detect false readings is implemented at the driver levelin an attemptto improve
the quality of data that is being published. The driver will not publish data at all if it deems the sensor data
to be invalid or unstable.
<a id="pga460_usage"></a>
### 用法
```
pga460 <command> [arguments...]
Commands:
start
[device_path] The pga460 sensor device path, (e.g: /dev/ttyS6)
status
stop
help
```
## srf02
Source: [drivers/distance_sensor/srf02](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/srf02)
<a id="srf02_usage"></a>
### 用法
```
srf02 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 112
[-R <val>] Sensor rotation - downward facing by default
default: 25
stop
status print status info
```
## srf05
Source: [drivers/distance_sensor/srf05](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/srf05)
### 描述
Driver for HY-SRF05 / HC-SR05 and HC-SR04 rangefinders.
The sensor/driver must be enabled using the parameter SENS_EN_HXSRX0X.
<a id="srf05_usage"></a>
### 用法
```
srf05 <command> [arguments...]
Commands:
start Start driver
[-R <val>] Sensor rotation - downward facing by default
default: 25
status Print driver status information
stop Stop driver
stop
status print status info
```
## teraranger
Source: [drivers/distance_sensor/teraranger](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/teraranger)
### 描述
I2C bus driver for TeraRanger rangefinders.
The sensor/driver must be enabled using the parameter SENS_EN_TRANGER.
Setup/usage information: https://docs.px4.io/main/en/sensor/rangefinders.html#teraranger-rangefinders
<a id="teraranger_usage"></a>
### 用法
```
teraranger <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 48
[-R <val>] Sensor rotation - downward facing by default
default: 25
stop
status print status info
```
## tf02pro
Source: [drivers/distance_sensor/tf02pro](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/tf02pro)
<a id="tf02pro_usage"></a>
### 用法
```
tf02pro <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 16
[-R <val>] Sensor rotation - downward facing by default
default: 25
stop
status print status info
```
## tfmini
Source: [drivers/distance_sensor/tfmini](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/tfmini)
### 描述
Serial bus driver for the Benewake TFmini LiDAR.
Most boards are configured to enable/start the driver on a specified UART using the SENS_TFMINI_CFG parameter.
Setup/usage information: https://docs.px4.io/main/en/sensor/tfmini.html
### 示例
Attempt to start driver on a specified serial device.
```
tfmini start -d /dev/ttyS1
```
设置/使用 信息: https://docs.px4.io/master/en/sensor/leddar_one.html
```
tfmini stop
```
<a id="tfmini_usage"></a>
### 用法
```
tfmini <command> [arguments...]
Commands:
start Start driver
-d <val> Serial device
[-R <val>] Sensor rotation - downward facing by default
default: 25
status Driver status
stop Stop driver
test Test driver (basic functional tests)
status Print driver status
```
## ulanding_radar
Source: [drivers/distance_sensor/ulanding_radar](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/ulanding_radar)
### 描述
Serial bus driver for the Aerotenna uLanding radar.
Setup/usage information: https://docs.px4.io/main/en/sensor/ulanding_radar.html
### 示例
Attempt to start driver on a specified serial device.
```
ulanding_radar start -d /dev/ttyS1
```
设置/使用 信息: https://docs.px4.io/master/en/sensor/leddar_one.html
```
ulanding_radar stop
```
<a id="ulanding_radar_usage"></a>
### 用法
```
ulanding_radar <command> [arguments...]
Commands:
start Start driver
-d <val> Serial device
values: <file:dev>, default: /dev/ttyS3
[-R <val>] Sensor rotation - downward facing by default
default: 25
stop Stop driver
```
## vl53l0x
Source: [drivers/distance_sensor/vl53l0x](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/vl53l0x)
<a id="vl53l0x_usage"></a>
### 用法
```
vl53l0x <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 41
[-R <val>] Sensor rotation - downward facing by default
default: 25
stop
status print status info
```
## vl53l1x
Source: [drivers/distance_sensor/vl53l1x](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/distance_sensor/vl53l1x)
<a id="vl53l1x_usage"></a>
### 用法
```
vl53l1x <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 41
[-R <val>] Sensor rotation - downward facing by default
default: 25
stop
status print status info
```
+990
View File
@@ -0,0 +1,990 @@
# Modules Reference: Imu (Driver)
## adis16448
Source: [drivers/imu/analog_devices/adis16448](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/analog_devices/adis16448)
<a id="adis16448_usage"></a>
### 用法
```
adis16448 <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
```
## adis16470
Source: [drivers/imu/analog_devices/adis16470](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/analog_devices/adis16470)
<a id="adis16470_usage"></a>
### 用法
```
adis16470 <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
```
## adis16477
Source: [drivers/imu/analog_devices/adis16477](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/analog_devices/adis16477)
<a id="adis16477_usage"></a>
### 用法
```
adis16477 <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
```
## adis16497
Source: [drivers/imu/analog_devices/adis16497](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/analog_devices/adis16497)
<a id="adis16497_usage"></a>
### 用法
```
adis16497 <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
```
## adis16507
Source: [drivers/imu/analog_devices/adis16507](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/analog_devices/adis16507)
<a id="adis16507_usage"></a>
### 用法
```
adis16507 <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)
<a id="bmi055_usage"></a>
### 用法
```
bmi055 <command> [arguments...]
Commands:
start
[-A] Accel
[-G] Gyro
[-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
```
## bmi085
Source: [drivers/imu/bosch/bmi085](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/bosch/bmi085)
<a id="bmi085_usage"></a>
### 用法
```
bmi085 <command> [arguments...]
Commands:
start
[-A] Accel
[-G] Gyro
[-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
```
## bmi088
Source: [drivers/imu/bosch/bmi088](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/bosch/bmi088)
<a id="bmi088_usage"></a>
### 用法
```
bmi088 <command> [arguments...]
Commands:
start
[-A] Accel
[-G] Gyro
[-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
```
## bmi088_i2c
Source: [drivers/imu/bosch/bmi088_i2c](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/bosch/bmi088_i2c)
<a id="bmi088_i2c_usage"></a>
### 用法
```
bmi088_i2c <command> [arguments...]
Commands:
start
[-A] Accel
[-G] Gyro
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 24
[-R <val>] Rotation
default: 0
stop
status print status info
```
## bmi270
Source: [drivers/imu/bosch/bmi270](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/bosch/bmi270)
<a id="bmi270_usage"></a>
### 用法
```
bmi270 <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
```
## fxas21002c
Source: [drivers/imu/nxp/fxas21002c](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/nxp/fxas21002c)
<a id="fxas21002c_usage"></a>
### 用法
```
fxas21002c <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 32
[-R <val>] Rotation
default: 0
regdump
testerror
stop
status print status info
```
## fxos8701cq
Source: [drivers/imu/nxp/fxos8701cq](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/nxp/fxos8701cq)
<a id="fxos8701cq_usage"></a>
### 用法
```
fxos8701cq <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 30
[-R <val>] Rotation
default: 0
regdump
testerror
stop
status print status info
```
## iam20680hp
Source: [drivers/imu/invensense/iam20680hp](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/iam20680hp)
<a id="iam20680hp_usage"></a>
### 用法
```
iam20680hp <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
```
## icm20602
Source: [drivers/imu/invensense/icm20602](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm20602)
<a id="icm20602_usage"></a>
### 用法
```
icm20602 <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
```
## icm20608g
Source: [drivers/imu/invensense/icm20608g](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm20608g)
<a id="icm20608g_usage"></a>
### 用法
```
icm20608g <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
```
## icm20649
Source: [drivers/imu/invensense/icm20649](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm20649)
<a id="icm20649_usage"></a>
### 用法
```
icm20649 <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
```
## icm20689
Source: [drivers/imu/invensense/icm20689](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm20689)
<a id="icm20689_usage"></a>
### 用法
```
icm20689 <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
```
## icm20948
Source: [drivers/imu/invensense/icm20948](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm20948)
<a id="icm20948_usage"></a>
### 用法
```
icm20948 <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)
[-M] Enable Magnetometer (AK8963)
[-R <val>] Rotation
default: 0
stop
status print status info
```
## icm20948_i2c_passthrough
Source: [drivers/imu/invensense/icm20948](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm20948)
<a id="icm20948_i2c_passthrough_usage"></a>
### 用法
```
icm20948_i2c_passthrough <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 105
stop
status print status info
```
## icm40609d
Source: [drivers/imu/invensense/icm40609d](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm40609d)
<a id="icm40609d_usage"></a>
### 用法
```
icm40609d <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
```
## icm42605
Source: [drivers/imu/invensense/icm42605](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm42605)
<a id="icm42605_usage"></a>
### 用法
```
icm42605 <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
```
## icm42670p
Source: [drivers/imu/invensense/icm42670p](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm42670p)
<a id="icm42670p_usage"></a>
### 用法
```
icm42670p <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
```
## icm42688p
Source: [drivers/imu/invensense/icm42688p](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm42688p)
<a id="icm42688p_usage"></a>
### 用法
```
icm42688p <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
[-C <val>] Input clock frequency (Hz)
default: 0
[-6] Drive ICM-42686
stop
status print status info
```
## icm45686
Source: [drivers/imu/invensense/icm45686](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/icm45686)
<a id="icm45686_usage"></a>
### 用法
```
icm45686 <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
[-C <val>] Input clock frequency (Hz)
default: 0
stop
status print status info
```
## iim42652
Source: [drivers/imu/invensense/iim42652](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/iim42652)
<a id="iim42652_usage"></a>
### 用法
```
iim42652 <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
[-C <val>] Input clock frequency (Hz)
default: 0
stop
status print status info
```
## iim42653
Source: [drivers/imu/invensense/iim42653](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/iim42653)
<a id="iim42653_usage"></a>
### 用法
```
iim42653 <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
[-C <val>] Input clock frequency (Hz)
default: 0
stop
status print status info
```
## l3gd20
Source: [drivers/imu/st/l3gd20](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/st/l3gd20)
<a id="l3gd20_usage"></a>
### 用法
```
l3gd20 <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
regdump
testerror
stop
status print status info
```
## lsm303d
Source: [drivers/imu/st/lsm303d](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/st/lsm303d)
<a id="lsm303d_usage"></a>
### 用法
```
lsm303d <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
```
## lsm9ds1
Source: [drivers/imu/st/lsm9ds1](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/st/lsm9ds1)
<a id="lsm9ds1_usage"></a>
### 用法
```
lsm9ds1 <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
```
## mpu6000
Source: [drivers/imu/invensense/mpu6000](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/mpu6000)
<a id="mpu6000_usage"></a>
### 用法
```
mpu6000 <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
```
## mpu9250
Source: [drivers/imu/invensense/mpu9250](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/mpu9250)
<a id="mpu9250_usage"></a>
### 用法
```
mpu9250 <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)
[-M] Enable Magnetometer (AK8963)
[-R <val>] Rotation
default: 0
stop
status print status info
```
## mpu9250_i2c
Source: [drivers/imu/invensense/mpu9250](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/mpu9250)
<a id="mpu9250_i2c_usage"></a>
### 用法
```
mpu9250_i2c <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 104
[-R <val>] Rotation
default: 0
stop
status print status info
```
## mpu9520
Source: [drivers/imu/invensense/mpu6500](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/invensense/mpu6500)
<a id="mpu9520_usage"></a>
### 用法
```
mpu9520 <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
```
## sch16t
Source: [drivers/imu/murata/sch16t](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/murata/sch16t)
<a id="sch16t_usage"></a>
### 用法
```
sch16t <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
```
+44
View File
@@ -0,0 +1,44 @@
# Modules Reference: Ins (Driver)
## vectornav
Source: [drivers/ins/vectornav](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/ins/vectornav)
### 描述
Serial bus driver for the VectorNav VN-100, VN-200, VN-300.
Most boards are configured to enable/start the driver on a specified UART using the SENS_VN_CFG parameter.
Setup/usage information: https://docs.px4.io/main/en/sensor/vectornav.html
### 示例
Attempt to start driver on a specified serial device.
```
vectornav start -d /dev/ttyS1
```
设置/使用 信息: https://docs.px4.io/master/en/sensor/leddar_one.html
```
vectornav stop
```
<a id="vectornav_usage"></a>
### 用法
```
vectornav <command> [arguments...]
Commands:
start Start driver
-d <val> Serial device
status Driver status
stop Stop driver
status Print driver status
```
@@ -0,0 +1,438 @@
# Modules Reference: Magnetometer (Driver)
## ak09916
Source: [drivers/magnetometer/akm/ak09916](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/akm/ak09916)
<a id="ak09916_usage"></a>
### 用法
```
ak09916 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 12
[-R <val>] Rotation
default: 0
stop
status print status info
```
## ak8963
Source: [drivers/magnetometer/akm/ak8963](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/akm/ak8963)
<a id="ak8963_usage"></a>
### 用法
```
ak8963 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 12
[-R <val>] Rotation
default: 0
stop
status print status info
```
## bmm150
Source: [drivers/magnetometer/bosch/bmm150](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/bosch/bmm150)
<a id="bmm150_usage"></a>
### 用法
```
bmm150 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 16
[-R <val>] Rotation
default: 0
stop
status print status info
```
## bmm350
Source: [drivers/magnetometer/bosch/bmm350](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/bosch/bmm350)
<a id="bmm350_usage"></a>
### 用法
```
bmm350 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 20
[-R <val>] Rotation
default: 0
stop
status print status info
```
## hmc5883
Source: [drivers/magnetometer/hmc5883](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/hmc5883)
<a id="hmc5883_usage"></a>
### 用法
```
hmc5883 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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
[-T] Enable temperature compensation
stop
status print status info
```
## iis2mdc
Source: [drivers/magnetometer/st/iis2mdc](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/st/iis2mdc)
<a id="iis2mdc_usage"></a>
### 用法
```
iis2mdc <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 48
stop
status print status info
```
## ist8308
Source: [drivers/magnetometer/isentek/ist8308](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/isentek/ist8308)
<a id="ist8308_usage"></a>
### 用法
```
ist8308 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 12
[-R <val>] Rotation
default: 0
stop
status print status info
```
## ist8310
Source: [drivers/magnetometer/isentek/ist8310](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/isentek/ist8310)
<a id="ist8310_usage"></a>
### 用法
```
ist8310 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 14
[-R <val>] Rotation
default: 0
stop
status print status info
```
## lis2mdl
Source: [drivers/magnetometer/lis2mdl](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/lis2mdl)
<a id="lis2mdl_usage"></a>
### 用法
```
lis2mdl <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 30
[-R <val>] Rotation
default: 0
stop
status print status info
```
## lis3mdl
Source: [drivers/magnetometer/lis3mdl](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/lis3mdl)
<a id="lis3mdl_usage"></a>
### 用法
```
lis3mdl <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 30
[-R <val>] Rotation
default: 0
reset
stop
status print status info
```
## lsm9ds1_mag
Source: [drivers/magnetometer/lsm9ds1_mag](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/lsm9ds1_mag)
<a id="lsm9ds1_mag_usage"></a>
### 用法
```
lsm9ds1_mag <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
```
## mmc5983ma
Source: [drivers/magnetometer/memsic/mmc5983ma](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/memsic/mmc5983ma)
<a id="mmc5983ma_usage"></a>
### 用法
```
mmc5983ma <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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)
[-a <val>] I2C address
default: 48
[-R <val>] Rotation
default: 0
reset
stop
status print status info
```
## qmc5883l
Source: [drivers/magnetometer/qmc5883l](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/qmc5883l)
<a id="qmc5883l_usage"></a>
### 用法
```
qmc5883l <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 13
[-R <val>] Rotation
default: 0
stop
status print status info
```
## rm3100
Source: [drivers/magnetometer/rm3100](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/rm3100)
<a id="rm3100_usage"></a>
### 用法
```
rm3100 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-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
```
## vcm1193l
Source: [drivers/magnetometer/vtrantech/vcm1193l](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/magnetometer/vtrantech/vcm1193l)
<a id="vcm1193l_usage"></a>
### 用法
```
vcm1193l <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-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
```
@@ -0,0 +1,42 @@
# Modules Reference: Optical Flow (Driver)
## thoneflow
Source: [drivers/optical_flow/thoneflow](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/optical_flow/thoneflow)
### 描述
Serial bus driver for the ThoneFlow-3901U optical flow sensor.
Most boards are configured to enable/start the driver on a specified UART using the SENS_TFLOW_CFG parameter.
Setup/usage information: https://docs.px4.io/main/en/sensor/pmw3901.html#thone-thoneflow-3901u
### 示例
Attempt to start driver on a specified serial device.
```
thoneflow start -d /dev/ttyS1
```
设置/使用 信息: https://docs.px4.io/master/en/sensor/leddar_one.html
```
thoneflow stop
```
<a id="thoneflow_usage"></a>
### 用法
```
thoneflow <command> [arguments...]
Commands:
start Start driver
-d <val> Serial device
stop Stop driver
info Print driver information
```
@@ -0,0 +1,28 @@
# Modules Reference: Rpm Sensor (Driver)
## pcf8583
Source: [drivers/rpm/pcf8583](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/rpm/pcf8583)
<a id="pcf8583_usage"></a>
### 用法
```
pcf8583 <command> [arguments...]
Commands:
start
[-I] Internal I2C bus(es)
[-X] External I2C bus(es)
[-b <val>] board-specific bus (default=all) (external SPI: n-th bus
(default=1))
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 80
[-k] if initialization (probing) fails, keep retrying periodically
stop
status print status info
```
@@ -0,0 +1,47 @@
# Modules Reference: Transponder (Driver)
## sagetech_mxs
Source: [drivers/transponder/sagetech_mxs](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/transponder/sagetech_mxs)
```
### Description
This driver integrates the Sagetech MXS Certified Transponder to send and receive ADSB messages and traffic.
### Examples
Attempt to start driver on a specified serial device.
$ sagetech_mxs start -d /dev/ttyS1
Stop driver
$ sagetech_mxs stop
Set Flight ID (8 char max)
$ sagetech_mxs flight_id MXS12345
Set MXS Operating Mode
$ sagetech_mxs opmode off/on/stby/alt
$ sagetech_mxs opmode 0/1/2/3
Set the Squawk Code
$ sagetech_mxs squawk 1200
```
<a id="sagetech_mxs_usage"></a>
### 用法
```
sagetech_mxs <command> [arguments...]
Commands:
start Start driver
-d <val> Serial device
stop Stop driver
flightid Set Flight ID (8 char max)
ident Set the IDENT bit in ADSB-Out messages
opmode Set the MXS operating mode. ('off', 'on', 'stby', 'alt', or
numerical [0-3])
squawk Set the Squawk Code. [0-7777] Octal (no digit larger than 7)
```
+125
View File
@@ -0,0 +1,125 @@
# 模块参考:估计器
## AttitudeEstimatorQ
Source: [modules/attitude_estimator_q](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/attitude_estimator_q)
### 描述
Attitude and position estimator using an Extended Kalman Filter. It is used for Multirotors and Fixed-Wing.
<a id="AttitudeEstimatorQ_usage"></a>
### 用法
```
AttitudeEstimatorQ <command> [arguments...]
Commands:
start
stop
status print status info
```
## wind_estimator
Source: [modules/airspeed_selector](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/airspeed_selector)
### 描述
This module provides a single airspeed_validated topic, containing indicated (IAS),
calibrated (CAS), true airspeed (TAS) and the information if the estimation currently
is invalid and if based sensor readings or on groundspeed minus windspeed.
Supporting the input of multiple "raw" airspeed inputs, this module automatically switches
to a valid sensor in case of failure detection. For failure detection as well as for
the estimation of a scale factor from IAS to CAS, it runs several wind estimators
and also publishes those.
<a id="airspeed_estimator_usage"></a>
### 用法
```
airspeed_estimator <command> [arguments...]
Commands:
start
stop
status print status info
```
## ekf2
Source: [modules/ekf2](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/ekf2)
### 描述
基于扩展卡尔曼滤波器的姿态和位置估计器。 该模块同时应用于多旋翼和固定翼飞机。
The documentation can be found on the [ECL/EKF Overview & Tuning](https://docs.px4.io/main/en/advanced_config/tuning_the_ecl_ekf.html) page.
ekf2 can be started in replay mode (`-r`): in this mode, it does not access the system time, but only uses the
timestamps from the sensor topics.
<a id="ekf2_usage"></a>
### 用法
```
ekf2 <command> [arguments...]
Commands:
start
[-r] Enable replay mode
stop
status print status info
[-v] verbose (print all states and full covariance matrix)
select_instance Request switch to new estimator instance
<instance> Specify desired estimator instance
```
## local_position_estimator
Source: [modules/local_position_estimator](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/local_position_estimator)
### 描述
基于扩展卡尔曼滤波器的姿态和位置估计器。
<a id="local_position_estimator_usage"></a>
### 用法
```
local_position_estimator <command> [arguments...]
Commands:
start
stop
status print status info
```
## mc_hover_thrust_estimator
Source: [modules/mc_hover_thrust_estimator](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/mc_hover_thrust_estimator)
### 描述
<a id="mc_hover_thrust_estimator_usage"></a>
### 用法
```
mc_hover_thrust_estimator <command> [arguments...]
Commands:
start
stop
status print status info
```
+35
View File
@@ -0,0 +1,35 @@
# Modules & Commands Reference
以下页面介绍了 PX4 模块, 驱动和命令。
They describe the provided functionality, high-level implementation overview and how
to use the command-line interface.
:::info
**This is auto-generated from the source code** and contains the most recent modules documentation.
:::
It is not a complete list and NuttX provides some additional commands
as well (such as `free`). Use `help` on the console to get a list of all
available commands, and in most cases `command help` will print the usage.
Since this is generated from source, errors must be reported/fixed
in the [PX4-Autopilot](https://github.com/PX4/PX4-Autopilot) repository.
文档页可以在固件目录的根目录下运行如下命令生成:
```
make module_documentation
```
The generated files will be written to the `modules` directory.
## 分类
- [Autotune](modules_autotune.md)
- [Command](modules_command.md)
- [Communication](modules_communication.md)
- [Controller](modules_controller.md)
- [Driver](modules_driver.md)
- [Estimator](modules_estimator.md)
- [Simulation](modules_simulation.md)
- [System](modules_system.md)
- [Template](modules_template.md)
+36
View File
@@ -0,0 +1,36 @@
# 模块参考:仿真
## simulator_sih
Source: [modules/simulation/simulator_sih](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/simulation/simulator_sih)
### 描述
This module provides a simulator for quadrotors and fixed-wings running fully
inside the hardware autopilot.
This simulator subscribes to "actuator_outputs" which are the actuator pwm
signals given by the control allocation module.
模拟器发布了被真实噪声污染的传感器信号以便在环路中加入状态估计器。
### 实现
模拟器运用矩阵代数方法实现了运动方程。
姿态采用四元数表示。
积分计算采用前向欧拉法。
为避免堆栈溢出,大部分变量在 .hpp 文件中声明为全局变量。
<a id="simulator_sih_usage"></a>
### 用法
```
simulator_sih <command> [arguments...]
Commands:
start
stop
status print status info
```
File diff suppressed because it is too large Load Diff
+62
View File
@@ -0,0 +1,62 @@
# 模块参考: 模板
## 模块
Source: [templates/template_module](https://github.com/PX4/PX4-Autopilot/tree/main/src/templates/template_module)
### 描述
该部分描述所提供模块的功能。
这是一个模块的模版,该模块在后台作为任务(task)运行并且有 start/stop/status 功能。
### 实现
该部分描述模块的高层次实现。
### 示例
CLI usage example:
```
module start -f -p 42
```
<a id="module_usage"></a>
### 用法
```
module <command> [arguments...]
Commands:
start
[-f] Optional example flag
[-p <val>] Optional example parameter
default: 0
stop
status print status info
```
## work_item_example
Source: [examples/work_item](https://github.com/PX4/PX4-Autopilot/tree/main/src/examples/work_item)
### 描述
Example of a simple module running out of a work queue.
<a id="work_item_example_usage"></a>
### 用法
```
work_item_example <command> [arguments...]
Commands:
start
stop
status print status info
```