diff --git a/docs/uk/SUMMARY.md b/docs/uk/SUMMARY.md index fcfce523c18..0d2f9f2a160 100644 --- a/docs/uk/SUMMARY.md +++ b/docs/uk/SUMMARY.md @@ -215,6 +215,7 @@ - [ZenFC H743](flight_controller/zenfc_h743.md) - [SIYI-UniFC-6-PICO](flight_controller/siyi-unifc-6-pico.md) - [Калібрування рівня горизонту](flight_controller/autopilot_experimental.md) + - [AIFoundry Erbium](flight_controller/aifoundry_erbium.md) - [BeagleBone Blue](flight_controller/beaglebone_blue.md) - [Raspberry Pi 2/3 Navio2](flight_controller/raspberry_pi_navio2.md) - [Raspberry Pi 2/3/4 PilotPi](flight_controller/raspberry_pi_pilotpi.md) @@ -253,7 +254,7 @@ - [Стандартний радарний висотомір Ainstein US-D1](sensor/ulanding_radar.md) - [ARK DIST SR (CAN/UART)](dronecan/ark_dist.md) - [ARK DIST MR (CAN/UART)](dronecan/ark_dist_mr.md) - - [Benewake TFmini Lidar](sensor/tfmini.md) + - [Benewake TFmini LiDAR](sensor/tfmini.md) - [LeddarOne Lidar](sensor/leddar_one.md) - [Lidar-Lite](sensor/lidar_lite.md) - [Lightware Lidars (SF/LW/GRF)](sensor/sfxx_lidar.md) @@ -311,6 +312,7 @@ - [sbgECom](sensor/sbgecom.md) - [VectorNav](sensor/vectornav.md) - [Optical Flow](sensor/optical_flow.md) + - [Agam FloRange](dronecan/agam_florange.md) - [ARK Flow](dronecan/ark_flow.md) - [ARK Flow MR](dronecan/ark_flow_mr.md) - [PMW3901](sensor/pmw3901.md) @@ -322,7 +324,6 @@ - [Актуатори](actuators/index.md) - [Розподіл приводу](config/actuators.md) - - [Motor Failure Recovery](config/motor_failure_recovery.md) - [Калібрування ESC (плати контролю двигунів)](advanced_config/esc_calibration.md) - [ESCs & Двигуни](peripherals/esc_motors.md) - [ESC Protocols](esc/esc_protocols.md) @@ -338,6 +339,8 @@ - [VESC Project ESCs](peripherals/vesc.md) - [Zubax Telega ESCs](dronecan/zubax_telega.md) - [Internal Combustion Engines](actuators/internal_combustion_engine.md) + - [Motor Failure Detection](config/motor_failure_detection.md) + - [Motor Failure Recovery](config/motor_failure_recovery.md) - [Manual Control](config/manual_control.md) - [Радіокерування (RC)](getting_started/rc_transmitter_receiver.md) @@ -609,17 +612,21 @@ - [HomePositionV0](msg_docs/HomePositionV0.md) - [HomePositionV1](msg_docs/HomePositionV1.md) - [ManualControlSetpointV0](msg_docs/ManualControlSetpointV0.md) + - [ManualControlSetpointV1](msg_docs/ManualControlSetpointV1.md) - [RegisterExtComponentReplyV0](msg_docs/RegisterExtComponentReplyV0.md) - [RegisterExtComponentRequestV0](msg_docs/RegisterExtComponentRequestV0.md) - [RegisterExtComponentRequestV1](msg_docs/RegisterExtComponentRequestV1.md) - [VehicleAttitudeSetpointV0](msg_docs/VehicleAttitudeSetpointV0.md) - [VehicleCommandAckV0](msg_docs/VehicleCommandAckV0.md) + - [VehicleCommandAckV1](msg_docs/VehicleCommandAckV1.md) + - [VehicleCommandV0](msg_docs/VehicleCommandV0.md) - [VehicleGlobalPositionV0](msg_docs/VehicleGlobalPositionV0.md) - [VehicleLocalPositionV0](msg_docs/VehicleLocalPositionV0.md) - [VehicleStatusV0](msg_docs/VehicleStatusV0.md) - [VehicleStatusV1](msg_docs/VehicleStatusV1.md) - [VehicleStatusV2](msg_docs/VehicleStatusV2.md) - [VehicleStatusV3](msg_docs/VehicleStatusV3.md) + - [VehicleStatusV4](msg_docs/VehicleStatusV4.md) - [Unversioned Messages](msg_docs/unversioned_messages.md) - [ActionRequest](msg_docs/ActionRequest.md) - [ActuatorArmed](msg_docs/ActuatorArmed.md) @@ -909,6 +916,7 @@ - [Відлагодження симуляції](debug/simulation_debugging.md) - [Надсилання дебажних значень](debug/debug_values.md) - [Відтворення усієї системи](debug/system_wide_replay.md) + - [Offline Motor Failure Replay](debug/motor_failure_replay.md) - [Профілювання](debug/profiling.md) - [Профілювання розміру бінаря](debug/binary_size_profiling.md) - [Логування](dev_log/logging.md) diff --git a/docs/uk/actuators/index.md b/docs/uk/actuators/index.md index 3eac3bb7d81..5aa07d82669 100644 --- a/docs/uk/actuators/index.md +++ b/docs/uk/actuators/index.md @@ -4,14 +4,16 @@ - [Розподіл приводів](../config/actuators.md) — Налаштування виводів керуючого контролера для конкретних функцій та типів ЕСП/сервоприводів. -- [Motor Failure Recovery](../config/motor_failure_recovery.md) — How allocation is reconfigured if a motor fails. - - [ESCs & двигуни](../peripherals/esc_motors.md) — ESCs такі як[DShot](../peripherals/dshot.md) (рекомендовано) та DroneCAN. - [ESC Калібрування](../advanced_config/esc_calibration.md) — Калібрування для ЕСП зі звичайним PWM (не потрібно для ESC/сервоприводів з DShot/CAN). - [Internal Combustion Engines](../actuators/internal_combustion_engine.md) — Petrol/nitro engines, including start/stop sequencing and idle RPM control. +- [Motor Failure Detection](../config/motor_failure_detection.md) — Detect a motor that stops producing thrust, from the current its ESC reports. + +- [Motor Failure Recovery](../config/motor_failure_recovery.md) — How allocation is reconfigured if a motor fails. + ## Дивіться також - [Периферійні пристрої](../peripherals/README.md) - включає неосновні приводи, такі як захвати, парашути, тощо. diff --git a/docs/uk/advanced_config/bootloader_secure_boot.md b/docs/uk/advanced_config/bootloader_secure_boot.md index aba76feaa1a..805a397cc03 100644 --- a/docs/uk/advanced_config/bootloader_secure_boot.md +++ b/docs/uk/advanced_config/bootloader_secure_boot.md @@ -134,6 +134,109 @@ To enable secure boot up on a board that doesn't already have a `secureboot` var The fmu-v6x variant files are kept small and self-contained for exactly this reason — they are intended to be copied as a starting point. +## Multi-Part Signed Images + + + +The layout shown above assumes the whole signed image is flashed to memory-mapped (execute-in-place, or XIP) flash at `APP_LOAD_ADDRESS`, where the bootloader can hash it in place. + +That assumption doesn't hold for boards that host images on media such as an SD card or eMMC, because the data isn't stored as a contiguous block, and the CPU can't address it directly. +Loading the whole (potentially large) image into RAM just to authenticate it would be inefficient, and may not be possible. + +To support these kinds of boards, PX4 can instead build a small, separately signed TOC block that is prepended to the signed app image on the media. +The bootloader can then authenticate this standalone TOC (which board startup code loads into a small RAM buffer) before anything else is trusted, and without having to load the whole image. +Once verified, the TOC entries tell the bootloader exactly what the rest of the image contains and how each part should be located, loaded, and verified. +In other words, this approach allows the image payload to be staged into memory and verified piece by piece, instead of all at once. + +PX4 includes an example for `px4_fmu-v6xrt`: `px4_fmu-v6xrt_bootloader_secureboot` (the secure bootloader) and `px4_fmu-v6xrt_secureboot` (firmware with a prepended, separately signed TOC). +On this board the image stays in XIP flash, so it shows the build side and TOC layout without any board-specific loading code. + +### On-Media Layout + +```txt ++---------------------------+ media offset 0 ─┐ +| Standalone TOC block | │ signed +| + signature | │ separately ++---------------------------+ ─┤ +| Signed PX4 app image | │ +| (BOOT region + SIG1) | │ signed app ++---------------------------+ ─┘ +``` + +The standalone TOC is signed with the same key as the app (`CONFIG_BOARD_SECUREBOOT_KEY`, or the `BOARD_SECUREBOOT_KEY` environment variable). + +:::warning +For multi-part images, the upload-time signature check (`VERIFY_SIG`) only verifies the standalone TOC. +The other images are verified when the bootloader boots them, because they can be flashed separately (for example, certificates updated later). +An app image with a bad signature therefore passes the upload check ("Verifying image signature... passed"), but the device stays in the bootloader after reboot. +::: + +### Relevant TOC Flag + +TOC entries normally describe their payload with an absolute address — the address the image was signed at. +That doesn't work for the standalone TOC once it's loaded into a RAM buffer, because the buffer's location is chosen at runtime by the board's bootloader startup code, not fixed at build/sign time. +[`src/include/image_toc.h`](https://github.com/PX4/PX4-Autopilot/blob/main/src/include/image_toc.h) defines a flag so that an entry can describe its payload relative to that buffer instead of with an absolute address: + +- `TOC_FLAG2_RELATIVE_ADDRESSES` — the entry's `start`/`end` are byte offsets from the base of the buffer the TOC was found in, not absolute addresses. + +Set this flag in your board's `toc.c` on the standalone TOC's own entry (entry 0) and on its signature entry. +The bootloader only applies it to those two entries: the entries after them are always resolved as absolute addresses. +Entry 0's `start` can't be greater than `BOARD_IMAGE_TOC_OFFSET` (the TOC's offset within the buffer), so it is `0` when the TOC is at the start of the block, as on fmu-v6xrt. + +Payloads that must be staged into RAM before use are marked with `TOC_FLAG1_COPY` and a `target` address instead. +The bootloader copies each such payload from its `start` address to `target` (using `BL_TOC_ENTRY_COPY()`, below) and then verifies it there. + +### Bootloader Integration + +The flag above only helps if the bootloader also knows where that RAM buffer is and how to fill it. +The common PX4 bootloader ([`platforms/nuttx/src/bootloader/common/bl.c`](https://github.com/PX4/PX4-Autopilot/blob/main/platforms/nuttx/src/bootloader/common/bl.c)) provides the following integration points for board-specific code. +None of them is set up automatically: a board that stores its image on non-XIP media must call, override, or define them itself. + +- `bl_set_toc_buffer(const void *buf, size_t len)` — function that tells the bootloader where board startup code staged the TOC block, before entering `bootloader()` / `jump_to_app()` (which then locate and verify it via `find_toc()`). + Boards where the TOC sits at `APP_LOAD_ADDRESS` in XIP flash don't need to call this, since that is the default buffer the bootloader uses. +- `BL_TOC_ENTRY_COPY(dst, src, len)` — macro used to copy the payload of each `TOC_FLAG1_COPY` entry to its `target` address, before that payload's signature is checked. + Defaults to a plain `memcpy()`, which is sufficient when the image is in XIP flash. + Override it in `hw_config.h` to define how the copy is performed, so that neither the source nor the target address needs to be directly addressable (for example, `src` can be a byte offset on SD card/eMMC that is read through the storage driver). + The bootloader doesn't check the macro's result, so a failed copy is only caught if the entry has a signature check (`TOC_FLAG1_CHECK_SIGNATURE`). +- `BOOTLOADER_SKIP_VERIFY_SIG`: define in `hw_config.h` when the full image isn't in addressable memory after upload (for example, when it is written to an SD card in chunks). + The bootloader then replies OK to the uploader's `VERIFY_SIG` request without checking anything, so the uploader reports "passed" even though no check was done. + The image is still verified before it boots. + +### Enabling the Standalone TOC on a Board + +The standalone TOC changes some of the steps in [Enabling Secure Boot on a New Board](#enabling-secure-boot-on-a-new-board). +The following steps are one-time setup for a given board, and the fmu-v6xrt files linked below can be copied as a starting point: + +1. Add a `secureboot.px4board` that sets `CONFIG_BOARD_SECUREBOOT=y` and the linker prefix, as for the embedded TOC. +2. Add an app linker script that moves the flash `ORIGIN` past the TOC block (see [`boards/px4/fmu-v6xrt/nuttx-config/scripts/secureboot-script.ld`](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v6xrt/nuttx-config/scripts/secureboot-script.ld)). + Unlike the embedded TOC, it doesn't reserve a `_main_toc` slot in the app. +3. Add [`boards///src/toc.c`](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v6xrt/src/toc.c) declaring the `image_toc_entry_t` table. + The TOC entry and its signature entry set `TOC_FLAG2_RELATIVE_ADDRESSES` (see [Relevant TOC Flag](#relevant-toc-flag) above). + Don't add `toc.c` to `drivers_board` in the board's `src/CMakeLists.txt`: the build compiles it separately (see below). +4. Add [`boards///nuttx-config/scripts/toc.ld`](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v6xrt/nuttx-config/scripts/toc.ld) — a standalone linker script for the TOC block. + It should use the `_app_start` / `_app_end` symbols to size the payload; those symbols are computed from the unsigned app `.bin` that is pulled in via `.incbin` by [`platforms/nuttx/toc/fw_image.c`](https://github.com/PX4/PX4-Autopilot/blob/main/platforms/nuttx/toc/fw_image.c). + The app address it uses (`_app_addr` on fmu-v6xrt) must match the flash `ORIGIN` in the app linker script. +5. Define `BOOTLOADER_USE_SECURITY`, `BOOTLOADER_SIGNING_ALGORITHM` and `BOARD_IMAGE_TOC_OFFSET` in the board's `hw_config.h`, gated on `PX4_CRYPTO`. + Set `BOARD_IMAGE_TOC_OFFSET` to `0x0`, because `toc.ld` places the TOC at the start of the block. +6. Add a `bootloader_secureboot.px4board`, as for the embedded TOC, and make sure the board's `src/CMakeLists.txt` builds the bootloader for any label that starts with `bootloader`. + +Once `src/toc.c` and `nuttx-config/scripts/toc.ld` exist and `CONFIG_BOARD_SECUREBOOT` is enabled, every subsequent build re-runs the build/sign/prepend pipeline below automatically (no separate command is needed). + +The build rules in [`platforms/nuttx/toc/CMakeLists.txt`](https://github.com/PX4/PX4-Autopilot/blob/main/platforms/nuttx/toc/CMakeLists.txt) then automatically: + +1. Compile `toc.c` into a standalone `board_toc` library (not linked into the app ELF). +2. Link `toc.elf` against `toc.ld`, with the unsigned app `.bin` embedded via `.incbin` so `_app_start` / `_app_end` reflect the real payload size. +3. Convert `toc.elf` to `toc.bin` with `objcopy`. +4. Sign `toc.bin` with `Tools/secure_bootloader/sign_firmware.py` using the app-signing key. +5. Prepend the signed `toc_signed.bin` to the signed app inside the `.px4` package. + +:::tip +If the board's app image lives on media the CPU can't address directly (SD card, eMMC, external SPI flash, and so on), the steps above only cover the build side. +The board's own bootloader startup code is still responsible for loading the signed TOC into a RAM buffer, calling `bl_set_toc_buffer()` to point at it, and overriding `BL_TOC_ENTRY_COPY()` so payloads are copied through the storage driver. +See [Bootloader Integration](#bootloader-integration) above. +Boards where the image stays in XIP flash need none of this. +::: + ## Дивіться також - [Оновлення бутлоадера](../advanced_config/bootloader_update.md) diff --git a/docs/uk/advanced_features/vision_target_estimator.md b/docs/uk/advanced_features/vision_target_estimator.md index f0d660fc542..513f7e8072d 100644 --- a/docs/uk/advanced_features/vision_target_estimator.md +++ b/docs/uk/advanced_features/vision_target_estimator.md @@ -13,10 +13,6 @@ For more depth see the [Vision Target Estimator deep dive](../advanced_features/ VTE is a beta feature, disabled in default board configurations, and should only be enabled on custom builds after careful bench and flight testing. ::: -## Table of Contents - -[[toc]] - ## Building the Module The estimator is not part of the default PX4 board configurations. @@ -122,7 +118,7 @@ For the full state-reset rules, the LPF exit condition, and the stale-GNSS fallb Vision and GNSS measurements often reach the autopilot with non-negligible transport or processing latency. VTE compensates for this by fusing delayed samples against the predicted state at their _original_ timestamp, rather than the current one. -This relies on an **Out-of-Sequence Measurements (OOSM)** approximation using a history-consistent projected correction strategy. +Any observations already fused with a later timestamp are then replayed in time order (**Out-of-Sequence Measurement**, or OOSM, handling). For buffer sizing and algorithm specifics, see [OOSM Implementation](../advanced_features/vision_target_estimator_advanced.md#oosm-implementation). ### Fallbacks and Timeouts @@ -158,7 +154,10 @@ When that applies: - Raise [VTE_BTOUT](../advanced_config/parameter_reference.md#VTE_BTOUT) past the expected gap if you want the filter to coast on its last estimate. Otherwise the filter is reset and will restart as soon as enabled fusion sources reappear. -Measurements timestamped in the future relative to the latest filter prediction are always rejected. +Both timeouts count from the capture time of the newest fused position or yaw sample, so a delayed sample does not extend them. + +Vision and target GNSS samples stamped less than 20 ms in the future (for example from clock-sync jitter) are fused as current measurements. +All other samples timestamped in the future are rejected. ### Measurement Freshness @@ -203,7 +202,10 @@ This applies to multicopters and to VTOLs in hover. The setpoint only moves onto the target once the takeoff ramp is complete and [MIS_TKO_PREC_DLY](../advanced_config/parameter_reference.md#MIS_TKO_PREC_DLY) has elapsed, so the vehicle is clear of the pad before it corrects sideways. Large airframes may need a longer delay. Bit 5 of [VTE_AID_MASK](../advanced_config/parameter_reference.md#VTE_AID_MASK) fuses home as the pad's absolute position during precision takeoff. PX4 normally records home from the vehicle's position at arming or takeoff; a manually assigned home is also accepted. -Home is used only while landed, with recent 3D GNSS data placing the vehicle within 5 m of it, and when target GNSS position (bit 0) is disabled. +While the precision-takeoff task is enabled, VTE caches home while landed, with recent 3D GNSS data placing the vehicle within 5 m of it. +This also runs while the task is idle, so a validated pad reference remains available if activation arrives after liftoff. +Airborne home changes do not replace the cached pad; it is revalidated on the ground and cleared if land-status data expires or the task is disabled. +Home aiding requires target GNSS position (bit 0) to be disabled. Home aiding is disabled in moving-target builds because a fixed home position cannot describe a moving pad. If no valid target estimate is available the vehicle climbs straight up as usual. @@ -459,8 +461,20 @@ On the autopilot shell, the first command to run is vision_target_estimator status ``` -which reports whether the module is alive, which task is currently active, which filters are running, and which aid sources are enabled. -It is the quickest way to confirm a configuration is taking effect before opening a log. +The command provides a compact health summary: + +- Target model, active task and hexadecimal task mask. +- Configured and effective hexadecimal aid masks. + Decode the masks using [VTE_TASK_MASK](../advanced_config/parameter_reference.md#VTE_TASK_MASK) and [VTE_AID_MASK](../advanced_config/parameter_reference.md#VTE_AID_MASK). +- Position and yaw filter enablement, availability, running state, fusion enablement and timeout state. + `enabled` reflects the current parameter value; `available` reflects enablement latched when the module started. + Changes to [VTE_POS_EN](../advanced_config/parameter_reference.md#VTE_POS_EN) and [VTE_YAW_EN](../advanced_config/parameter_reference.md#VTE_YAW_EN) require a reboot. +- For running filters: initialisation, validity and prediction/update ages in seconds (`-1` when no timestamp is available). + The position filter also reports output validity, bias readiness, bias averaging and the pre-bias reference. + +`fusing: yes` means fusion is enabled; check `vte_aid_*` for individual measurement acceptance or rejection. +State values and individual input ages are not included in this summary. +Use `listener vte_position` for position, velocity and bias, `listener vte_orientation` for yaw and yaw rate, and the input topics' timestamps to investigate input freshness. For deeper inspection, the following uORB topics are the most useful entry points into a log: @@ -469,7 +483,7 @@ For deeper inspection, the following uORB topics are the most useful entry point - `vte_orientation` provides yaw, yaw-rate, and their variances. - `vte_input` records the downsampled NED acceleration and attitude quaternion actually fed to the position prediction step. - `vte_bias_init_status` shows raw and filtered GNSS/vision bias while the initial averaging phase is active. -- Innovations published on `vte_aid_*` topics include the raw measurement, innovation, innovation variance, chi-squared test ratio, the `fusion_status` enum (per-axis on the 3D variant), and Out-of-Sequence Measurements ([OOSM](../advanced_features/vision_target_estimator_advanced.md#oosm-implementation)) diagnostics (`time_since_meas_ms`, `history_steps`). +- Innovations published on `vte_aid_*` topics include the raw measurement, innovation, innovation variance, chi-squared test ratio, the `fusion_status` enum (per-axis on the 3D variant), and Out-of-Sequence Measurements ([OOSM](../advanced_features/vision_target_estimator_advanced.md#oosm-implementation)) diagnostics (`time_since_meas_ms`, `history_steps`, `replayed_count`, `replay_revised_count`, `replay_test_ratio_max`). See [aid-source diagnostics](../advanced_features/vision_target_estimator_advanced.md#aid-source-diagnostics) for the full status table. ## Operational Notes diff --git a/docs/uk/advanced_features/vision_target_estimator_advanced.md b/docs/uk/advanced_features/vision_target_estimator_advanced.md index 805beffaca9..64543e3e359 100644 --- a/docs/uk/advanced_features/vision_target_estimator_advanced.md +++ b/docs/uk/advanced_features/vision_target_estimator_advanced.md @@ -5,10 +5,6 @@ This guide expands on the [Vision Target Estimator module overview](../advanced_features/vision_target_estimator.md) and targets advanced users who want to tune, extend, and debug the estimator in detail. It documents the system architecture of the Vision Target Estimator, and outlines workflows for log analysis and sensor integration. -## Table of Contents - -[[toc]] - ## System Architecture The module has three layers: a scheduler, a task layer, and two independent estimators. @@ -30,7 +26,7 @@ The module has three layers: a scheduler, a task layer, and two independent esti - Helper unions `SensorFusionMaskU` and `ObsValidMaskU` mirror the bit layout of [`VTE_AID_MASK`](../advanced_features/vision_target_estimator.md#sensor-fusion-selection), making it straightforward to add new observation types ([Adding new measurement sources](#adding-new-measurement-sources)). - `VTEOrientation` (`Orientation/VTEOrientation.cpp`) handles yaw fusion with the same measurement staging helpers as the position filter, on a smaller $[\psi, \dot\psi]$ state. The math lives in `Orientation/KF_orientation.cpp`. - Prediction and the transition matrix are SymForce-generated, while innovation and correction stay hand-written so yaw can be wrapped to $[-\pi, \pi]$. + Prediction is SymForce-generated, while innovation and correction stay hand-written so yaw can be wrapped to $[-\pi, \pi]$. - Shared utilities live in `common.h` and `VTEOosm.h` (templated OOSM manager, see [OOSM Implementation](#oosm-implementation)). ```text @@ -115,6 +111,9 @@ Click to view the bias initialization state machine If neither condition fires, the LPF is also accepted when [VTE_BIA_AVG_TOUT](../advanced_config/parameter_reference.md#VTE_BIA_AVG_TOUT) expires. - **Activation after averaging.** Once the LPF is accepted, the state resets via `activateBiasEstimate()`. This sets `r = pos_rel_gnss(t_vision) - b_filtered` and `b = b_filtered`. + Every bias activation resets the position and bias at `t_vision`, keeps a snapshot there so samples still in flight can be replayed, and propagates to now. + This initialisation bridge assumes constant UAV velocity and retains the current target motion estimate; it adds process noise rather than reusing an overconfident capture-time covariance. + A vision sample used to seed the position is reported as `STATUS_INITIALIZED` and is not fused again. #### Fallbacks and Recovery @@ -322,8 +321,8 @@ See [Outlier Detection](#outlier-detection). ### Outlier Detection The chi-squared gate rejects measurements that disagree strongly with the filter prediction. -It uses `test_ratio = innov² / S` with $S = H P H^T + R$, where $R$ is the observation variance. -A sample is rejected when `test_ratio` exceeds [VTE_POS_NIS_THRE](../advanced_config/parameter_reference.md#VTE_POS_NIS_THRE) (or [VTE_YAW_NIS_THRE](../advanced_config/parameter_reference.md#VTE_YAW_NIS_THRE) for yaw), and the rejection appears as `STATUS_REJECT_NIS` on the corresponding `vte_aid_*` topic. +It compares the normalized innovation squared $NIS = y^2 / S$, with $S = H P H^T + R$ where $R$ is the observation variance, against [VTE_POS_NIS_THRE](../advanced_config/parameter_reference.md#VTE_POS_NIS_THRE) (or [VTE_YAW_NIS_THRE](../advanced_config/parameter_reference.md#VTE_YAW_NIS_THRE) for yaw). +The logged `test_ratio` is $NIS$ divided by that threshold, so a sample is rejected when `test_ratio` exceeds 1, and the rejection appears as `STATUS_REJECT_NIS` on the corresponding `vte_aid_*` topic. How the gate reacts depends on $R$: @@ -419,172 +418,92 @@ If the yaw state ends up oscillating, the [Orientation Filter case study](#orien ## Time Alignment Vision and GNSS observations can arrive delayed due to transport and processing latency. -The position and orientation filters therefore support an **Out-of-Sequence Measurements (OOSM)** approximation which uses a **history-consistent projected correction** strategy. +The position and orientation filters handle out-of-sequence measurements (OOSM) by replaying subsequent observations in timestamp order. +For example, at 200 ms the filter fuses vision captured at 160 ms. +In the next cycle, at 220 ms, GNSS captured at 100 ms arrives. +The filter restores the state and covariance from history at or before 100 ms. +It predicts to 100 ms and fuses GNSS, then predicts to 160 ms and recalculates the vision update. +Finally, it predicts to 220 ms and replaces the previous estimate with this rebuilt result, so vision is counted only once. -Open the algorithm below if you need the exact six-step recipe (retrieve, predict, innovate, correct, project, apply) used to fuse a delayed sample against the historical state. +Vision and target GNSS samples stamped less than 20 ms in the future, usually from clock-sync jitter, are moved to the current time and fused as current. +Samples further in the future are dropped with a "timestamp in the future" warning. +Validity and reset timeouts count from the capture time of the newest fused position or yaw sample, so a delayed sample does not extend them. +These timestamps follow the current replay decisions: rejecting or accepting a stored sample can move freshness backwards or forwards. +The separate freshness check for EKF2 auxiliary velocity aiding likewise follows the newest accepted vision observation. - +Before forming a target-GNSS relative position, the UAV fix is propagated to the target fix time for every nonzero time offset. +The propagation uses the lever-arm-corrected GNSS velocity, with the latest valid local velocity as fallback; mismatched fixes are rejected when neither velocity is available. +The observation variance includes velocity uncertainty and UAV acceleration process noise over the offset. +Because this interface does not carry local-velocity covariance, the local fallback assumes the larger of `VTE_VEL_UNC_IN` and the squared `VTE_GPS_V_NOISE` floor. -:::details -Click to view OOSM algorithm steps +GNSS/vision bias initialisation separately aligns that relative position to the vision capture time using the latest valid velocity. +Mission references use `-v_uav`; target GNSS in a moving-target build uses `v_target - v_uav` and requires a valid target velocity whenever the timestamps differ. +This constant-velocity approximation is limited by `VTE_M_REC_TOUT`; it does not reconstruct acceleration during the alignment interval. -Each filter maintains a fixed-size ring buffer of recent state snapshots spanning roughly the last half second of operation (25 samples ≈ 0.5 s at 50 Hz). -For the position filter the snapshot stores $(t, x, P, a^{uav})$; for the orientation filter it stores $(t, x, P)$. -When a delayed scalar measurement arrives with timestamp $t_{meas}$: +### OOSM Implementation -1. **Retrieve**: fetch the closest: - $(x_{old}, P_{old}, a^{uav}_{old})$ before $t_{meas}$. +Each filter retains up to 25 post-update snapshots of the time, state, covariance and prediction input. +At 50 Hz, 25 snapshots span 480 ms from oldest to newest. +A separate fixed-size buffer stores the gated scalar observations, accepted or rejected, with their measurement matrix, variance and latest gate decision. +It keeps up to 48 observations per position axis, sized for 50 Hz vision and three 10 Hz GNSS streams over the whole window with some margin, and 25 for yaw (one per cycle). - $$ - t_{old} ≤ t_{meas} - $$ +For a delayed observation: -2. **Predict**: use the KF model to predict the state $(x_{meas}, P_{meas})$ using $\Delta t = t_{meas} - t_{old}$ (for the orientation filter the control-input term is omitted). +1. Find the newest snapshot at or before its capture time. +2. Predict to the capture time using the recorded control input, replaying the stored observations along the way. +3. Compute the innovation, innovation variance and NIS gate at that time. +4. If accepted, apply the ordinary scalar Kalman update. +5. Replay later predictions and stored observations in time order, gating each one again and recalculating every gain from the updated covariance. +6. Replace the snapshots at or after the capture time and the live state with the replayed posteriors. - $$ - \begin{aligned} - x_{meas} &= \Phi(\Delta t)\,x_{old} + G\,a^{uav}_{old} \\ - P_{meas} &= \Phi(\Delta t)\,P_{old}\,\Phi^T(\Delta t) + Q_d(\Delta t) - \end{aligned} - $$ +Each prediction advances the state and covariance using the transition matrix $\Phi$, control input $u$, input matrix $G$, and process noise $Q$: -3. **Innovate**: compute the innovation $y$ and innovation variance $S$: +$$ +x' = \Phi x + Gu, \qquad P' = \Phi P \Phi^T + Q +$$ - $$ - \begin{aligned} - y &= z - H\,x_{meas} \\ - S &= H\,P_{meas}\,H^T + R - \end{aligned} - $$ - -4. **Correct**: compute the optimal correction vector: - - $$ - \begin{aligned} - \delta x_{meas} &= K\,y \\ - K &= P_{meas}\,H^T\,S^{-1} - \end{aligned} - $$ - -5. **Project**: project this correction forward with the state transition matrix $\Phi(\Delta t)$: - - $$ - \delta x(t) = \Phi(t - t_{meas})\thinspace \delta x_{meas} = \Phi(t - t_{meas})\thinspace Ky - $$ - -6. **Apply**: apply the projected correction to the current live state _and_ to every stored history sample $i$ that occurred after $t_{meas}$, i.e. $t_{i} > t_{meas}$. - The corrected posterior at $t_{meas}$ is also written back into the history (replacing or inserting a sample at that timestamp), so a second delayed measurement in the same interval replays from the already-corrected state instead of from the stale pre-measurement floor. - - $$ - \begin{aligned} - K_{i} &= \Phi(t_{i} - t_{meas})\,K \\ - x_{i} &= x_{i} + K_{i}\,y \\ - P_{i} &= P_{i} - K_{i}\,S\,K_{i}^T - \end{aligned} - $$ - -Updating the history buffer keeps it self-consistent for subsequent delayed measurements. -This gives the practical benefits of a lag-smoother while staying deterministic (fixed buffer, bounded runtime), without running a full backward smoother over the timeline. - -The state prediction includes the control input, $x_{k+1} = \Phi x_k + G u_k$. -When projecting the correction forward, the $Gu_{k}$ term does not need to be used explicitly because it cancels out: +The ordinary scalar update is: $$ \begin{aligned} -(x'_{k+1} - x_{k+1}) &= (\Phi\,x'_k + G\,u_k) - (\Phi\,x_k + G\,u_k) \\ -\Delta x_{k+1} &= \Phi\,(x'_k - x_k) = \Phi\,\Delta x_k +y &= z - Hx \\ +S &= HPH^T + R \\ +K &= PH^T S^{-1} \\ +x^+ &= x + Ky \\ +P^+ &= P - KSK^T \end{aligned} $$ -::: +Replaying subsequent updates preserves their information, including their effect on position/bias cross-covariance. -### OOSM Approximation Assumptions +Stored observations are gated again during replay against the replayed prior, so a decision can change in either direction. +Their published diagnostic messages are not revised. +Instead, the delayed observations that triggered the replay log how many stored observations were gated again (`replayed_count`), how many changed decision (`replay_revised_count`), and the highest test ratio among those accepted before the replay (`replay_test_ratio_max`). +If a stored observation fails during replay (invalid innovation variance), the delayed batch is discarded and history is cleared, so the failing observation cannot block later replays. +The live state is unchanged; pending and provisionally accepted delayed observations report `STATUS_REJECT_COV`, while earlier rejections keep their original status. +Fresh observations can still fuse afterwards. +On successful replay within the observation-log capacity, the result matches chronological fusion with the same gate, effective fusion times and equal-time order, up to float rounding, provided the required history is retained. +Prediction uses the stored piecewise-constant control inputs and current process-noise settings. -Two approximations make the algorithm above tractable on an autopilot. +Observations less than 20 ms from the current time take the direct-update path and are recorded at the effective fusion time (now). +Within each cycle, observations are fused in effective timestamp order, preserving source priority for equal times. +Once a delayed observation is accepted or a stored gate decision changes, the remaining delayed observations of that cycle share its replay per axis: it stops at each of them to gate and apply it, and rewrites the later snapshots once. +For example, target GNSS position and velocity share a capture time, so they cost one replay instead of two. +On successful replay within the observation-log capacity, the final state and covariance match fusing them one at a time, oldest first, up to float rounding. +Replay diagnostics use this shared trajectory, so an older observation's `replay_test_ratio_max` can include the influence of later observations accepted in the same batch. +Other new batch observations are not included in `replayed_count`; it counts only previously stored observations. +Observations outside the available history or the 500 ms maximum delay are rejected. +Stored observations at or before the oldest usable posterior are discarded: that posterior already contains the accepted ones, and their decisions can no longer change. +When the buffer is full, the oldest usable snapshot advances to the first snapshot at or after the oldest observation, and observations through that snapshot are discarded. +This shrinks the replay window: delayed observations captured before that snapshot are rejected as `STATUS_REJECT_TOO_OLD`. +If no snapshot contains the oldest observation yet, history restarts from the live posterior instead. +Observations are dropped after a cycle's replay, so this only limits later cycles. +The cap limits each replay to at most 48 distinct stored observations per position axis; rejected candidates can cause repeated gate evaluations, as described below. -- First, the OOSM gain is treated as the standard Kalman gain at the measurement time, propagated forward by the state transition matrix. -- Second, the past-state estimate is taken from the stored snapshot rather than from a full backward smoother over all intermediate measurements. - -:::details -Click to view OOSM mathematical proofs - -The notation follows _Zhang et al., Optimal Update with Out-of-Sequence Measurements_. - -In Algorithm I of the paper, the optimal gain for an Out-of-Sequence Measurement depends on $U_{k,d}$, the cross-covariance between the current state $x_k$ and the past-state error $\tilde{x}_{d|k}$: - -$$ -\begin{aligned} -\hat{x}_{k|k,d} &= \hat{x}_{k|k} + K_d\,(z_d - H_d\,\hat{x}_{d|k}) \\ -K_d &= U_{k,d}\,H_d^T\,S_d^{-1} -\end{aligned} -$$ - -With the optimal recursion (Eq. 5): - -$$ -U_{n+1,d} = (I - K_{n+1} H_{n+1})\,F_{n+1,n}\,U_{n,d} -$$ - -$F_{n+1,n}$ propagates the correlation forward in time based on system dynamics. -$(I - K_{n+1}H_{n+1})$ reduces the correlation based on the information gained from intermediate measurements processed between $t_d$ and $t_k$. - -#### First approximation: projected gain - -To avoid the computational complexity and storage required to track every intermediate gain $K_n$ and measurement matrix $H_n$, the implementation approximates the cross-covariance term. -The reduction in correlation due to intermediate updates is assumed negligible for the purpose of the OOSM projection. -Mathematically: - -$$ -(I - K_{n}H_{n}) \approx I -$$ - -Under this assumption, the recursion in Eq. (5) simplifies to pure dynamic propagation: - -$$U_{n+1,d} \approx F_{n+1,n}\,U_{n,d}$$ - -Iterating this from the measurement time $d$ to the current time $k$, and recognising that the initial cross-covariance $U_{d,d}$ corresponds to the prediction covariance $P_{d|d-1}$ (or $P_{d|k-l}$ in the paper's notation, Eq. 6): - -$$U_{k,d} \approx F_{k,d}\,U_{d,d} \approx \Phi_{k,d}\,P_{d|d-1}$$ - -Substituting back into the gain formula: - -$$K_d \approx (\Phi_{k,d}\,P_{d|d-1})\,H_d^T\,S_d^{-1}$$ - -Since the standard Kalman gain at time $d$ is $K = P_{d|d-1}\,H_d^T\,S_d^{-1}$, the OOSM gain simplifies to: - -$$K_d \approx \Phi_{k,d}\,K$$ - -This justifies the "Project" step in the implementation: the correction vector is computed from the snapshot at $t_{meas}$ and propagated forward by the state transition matrix $\Phi(\Delta t)$ ($F_{k,d}$), ignoring the coupling from intermediate measurements that the optimal recursion accounts for. -The storage cost drops from $O(N)$ matrices to a fixed-size circular buffer of snapshots, and the correction stays consistent with the system's motion model. - -#### Second approximation: stored prediction instead of full smoothing - -The paper's globally optimal update uses the smoothed past-state estimate and covariance. - -- **Optimal innovation.** The innovation in Eq. (3) is - - $$\tilde{z}_{d|k} = z_d - H_d\,\hat{x}_{d|k}$$ - - where $\hat{x}_{d|k}$ is the estimate of the state at time $d$ conditioned on all measurements up to time $k$. - -- **Optimal covariance.** The innovation covariance $S_d$ in Eq. (4) uses $P_{d|k}$, the error covariance at time $d$ given all data up to $k$. - -The current implementation calculates the innovation using a snapshot retrieved from history ($x_{old}$) and predicted to the measurement time ($x_{meas}$). -Since this snapshot was saved before the subsequent measurements $z_{d+1}, \dots, z_k$ were processed, it only contains information available up to time $d$. - -- **State approximation.** The predicted state $\hat{x}_{d|d^-}$ (or filtered state $\hat{x}_{d|d}$) is substituted for the smoothed state: - - $$\hat{x}_{d|k} \approx \hat{x}_{d|d^-}$$ - -- **Covariance approximation.** Similarly, $S$ is calculated using $P_{meas}$ (which is $P_{d|d^-}$), substituting the prediction covariance for the smoothed covariance: - - $$P_{d|k} \approx P_{d|d^-}$$ - -Calculating the exact $\hat{x}_{d|k}$ and $P_{d|k}$ would require the backward-smoothing machinery described in Section 4.1 of the paper, which means storing every intermediate measurement and transition matrix. -The stored snapshot avoids that overhead. -The approximation assumes that the measurements received between $t_{meas}$ and $t_{now}$ would not have significantly altered the estimate at $t_{meas}$ had they been available. - -::: +When all `B` delayed observations in a cycle are accepted, each axis requires at most `N_snapshots + N_observations + B + 1` predictions and `N_observations + B` measurement updates. +Here, `N_snapshots` counts snapshots after the floor of the oldest one (at most 24), and `N_observations` counts stored observations replayed from that floor to now. +The extra predictions advance to each delayed observation and then to now; predictions with no elapsed time are skipped. +Until a delayed observation is accepted or a stored gate decision changes, rejected candidates are checked independently from their own floor snapshots and may replay stored observations more than once. ## Moving-target Mode (experimental) @@ -705,7 +624,7 @@ For example plots of what a healthy and a degraded filter look like, see [Expect - `vte_input`: downsampled acceleration in NED and the quaternion fed to each prediction step. Can be used to correlate estimator behaviour with vehicle attitude changes. - `vte_aid_*`: one topic per fused source (`vte_aid_gps_pos_target`, `vte_aid_gps_pos_mission`, `vte_aid_gps_vel_uav`, `vte_aid_gps_vel_target`, `vte_aid_fiducial_marker`, `vte_aid_ev_yaw`). - Each publishes the observation, observation variance, innovation, innovation variance, chi-squared `test_ratio`, the `fusion_status` outcome code (per-axis on the 3D variant), and OOSM diagnostics (`time_since_meas_ms`, `history_steps`, `time_last_predict`). + Each publishes the observation, observation variance, innovation, innovation variance, chi-squared `test_ratio`, the `fusion_status` outcome code (per-axis on the 3D variant), and OOSM diagnostics (`time_since_meas_ms`, `history_steps`, `replayed_count`, `replay_revised_count`, `replay_test_ratio_max`, `time_last_predict`). See [Aid-source diagnostics](#aid-source-diagnostics) for the meaning of each `fusion_status` value. ### Aid-Source Diagnostics @@ -716,25 +635,33 @@ The `fusion_status` field records which fusion branch the filter. :::details Click to view details on how to interpret the fusion status -| Значення | Status | Значення | Typical action | -| -------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| 0 | `STATUS_IDLE` | No fusion attempted on this axis (e.g. measurement not provided for that axis). | None. | -| 1 | `STATUS_FUSED_CURRENT` | Measurement fused immediately against the live state. | Healthy. | -| 2 | `STATUS_FUSED_OOSM` | Measurement was delayed and fused via the OOSM history buffer; check `history_steps`, and `time_since_meas_ms`. | Healthy as long as `history_steps` stays below the buffer depth `kOosmHistorySize = 25`. | -| 3 | `STATUS_REJECT_NIS` | Innovation failed the chi-squared gate. | Check sensor variance, frame rotations, time skew. Compare with `test_ratio` and the matching `vte_input` sample. | -| 4 | `STATUS_REJECT_COV` | Innovation covariance was non-finite or non-positive. | Numerical issue: check process-noise parameters and that the state has not diverged. | -| 5 | `STATUS_REJECT_TOO_OLD` | Sample older than the OOSM buffer (`kOosmMaxTimeUs = 500 ms`) or older than the oldest stored snapshot. | Reduce sensor latency, raise the publication rate, or check transport timestamps. | -| 6 | `STATUS_REJECT_TOO_NEW` | Sample timestamped in the future relative to the latest filter prediction. | Time-sync problem: verify `mavlink_timesync` or the sensor clock. | -| 7 | `STATUS_REJECT_STALE` | Filter history was reset because no prediction had run for longer than the buffer span. | Expected after long pauses; otherwise investigate scheduler stalls. | -| 8 | `STATUS_REJECT_EMPTY` | History buffer not yet populated when the measurement arrived. | Expected on the first cycles after the estimator starts; persistent occurrences indicate a startup race. | +| Значення | Status | Значення | Typical action | +| -------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 0 | `STATUS_IDLE` | No fusion attempted on this axis (e.g. measurement not provided for that axis). | None. | +| 1 | `STATUS_FUSED_CURRENT` | Measurement fused immediately against the live state. | Healthy. | +| 2 | `STATUS_FUSED_OOSM` | Measurement was delayed and fused via the OOSM history buffer; check `history_steps`, and `time_since_meas_ms`. | Healthy. `history_steps` is at most 24; values close to it mean a delay near the 500 ms limit. | +| 3 | `STATUS_REJECT_NIS` | Innovation failed the chi-squared gate. | Check sensor variance, frame rotations, time skew. Compare with `test_ratio` and the matching `vte_input` sample. | +| 4 | `STATUS_REJECT_COV` | Innovation covariance was non-finite or non-positive. A stored observation failing on replay clears history. | Numerical issue: check process-noise parameters and that the state has not diverged. | +| 5 | `STATUS_REJECT_TOO_OLD` | Sample older than the OOSM buffer (`kOosmMaxTimeUs = 500 ms`) or than the oldest snapshot a replay can use. | Reduce sensor latency, raise the publication rate, or check transport timestamps. | +| 6 | `STATUS_REJECT_TOO_NEW` | Sample timestamped 20 ms or more after the latest filter prediction. | Time-sync problem: verify `mavlink_timesync` or the sensor clock. Built-in sources drop these with a warning. | +| 7 | `STATUS_REJECT_STALE` | Filter history was reset because no prediction had run for longer than the buffer span. | Expected after long pauses; otherwise investigate scheduler stalls. | +| 8 | `STATUS_REJECT_EMPTY` | History buffer not yet populated when the measurement arrived. | Expected after a history reset; position initialisation itself reports `STATUS_INITIALIZED`. | +| 9 | `STATUS_INITIALIZED` | Observation used once to seed the state and its covariance, then propagated to the current time (position and yaw). | Healthy at startup or restart. Innovation fields are NaN because no prior prediction exists. | ::: -Two additional fields make latency tractable without manual timestamp arithmetic: +Additional fields make latency and replay tractable without manual timestamp arithmetic: - `time_since_meas_ms = (time_last_predict - timestamp_sample) * 1e-3`. Negative values mean the measurement is timestamped after the latest prediction (i.e. the filter has not caught up yet). -- `history_steps` is non-zero only for `STATUS_FUSED_OOSM` and tells you how many 20 ms snapshots were replayed when projecting the correction forward. +- `history_steps` counts the retained snapshots after the capture time that were recomputed during replay (at most 24). + It is 0 for every other status, and also for `STATUS_FUSED_OOSM` when no snapshot is newer than the sample. +- `replayed_count` counts the stored observations gated again after a delayed one, and `replay_revised_count` how many of them changed decision. + `replay_test_ratio_max` is the highest `test_ratio` among those accepted before the replay (-1 if none). + A value above 1 means the replay rejected an observation accepted before (see [OOSM Implementation](#oosm-implementation)). + The delayed observations of one cycle share a replay, so their values can also reflect each other. + These counters are reported only for accepted delayed observations and exclude stored observations before their capture time. + A revised decision encountered while rebuilding a rejected observation's prior can therefore change the estimate without appearing in these counters. ### Main Input Feeds @@ -940,7 +867,7 @@ Click to view Out-of-Sequence Measurements (OOSM) plots The plot was generated by delaying each simulated measurement by a uniform random value in [0, 500] ms before reaching the autopilot. - **Top two rows (measurement latency)**: `vte_aid_fiducial_marker.time_since_meas_ms` and `vte_position.history_steps`. - With a 0-500 ms delay we observe `time_since_meas_ms` ranging up to ~450 ms and `history_steps` proportional to it (`history_steps ≈ time_since_meas_ms / 20`, capped at the 25-sample buffer). + With a 0-500 ms delay we observe `time_since_meas_ms` ranging up to ~450 ms and `history_steps` proportional to it (`history_steps ≈ time_since_meas_ms / 20`, at most 24 with the 25-snapshot buffer). - **Third row (raw vs processed observation)**: `vte_position.rel_pos` overlaid with `vte_aid_fiducial_marker.observation`. The processed observation lags the live state by roughly the measurement delay. The OOSM allows fusing old data without forcing the live state to wait for it. @@ -1142,7 +1069,8 @@ A few tips to make iteration on real hardware and SITL easier. On hardware builds, compile with the debug configuration or enable the console log level before running tests so the additional diagnostics appear on the shell. - Keep the estimator alive on the bench by setting [VTE_TASK_MASK](../advanced_config/parameter_reference.md#VTE_TASK_MASK)=3. The debug bit enables the continuous update of the position and orientation estimators (if enabled via [VTE_YAW_EN](../advanced_config/parameter_reference.md#VTE_YAW_EN) and [VTE_POS_EN](../advanced_config/parameter_reference.md#VTE_POS_EN)). -- Use shell helpers while iterating: `listener landing_target_pose`, `listener vte_bias_init_status`, `listener vte_aid_fiducial_marker` (or the relevant `vte_aid_*`) to inspect bias averaging and innovations, `listener vte_input 5` for prediction inputs, and `vision_target_estimator status` to ensure both filters are running. +- Use `vision_target_estimator status` for the compact [health summary](../advanced_features/vision_target_estimator.md#monitoring). + Inspect state values with `listener vte_position` and `listener vte_orientation`, published output with `listener landing_target_pose`, bias averaging with `listener vte_bias_init_status`, innovations with `listener vte_aid_fiducial_marker` (or the relevant `vte_aid_*`), and prediction inputs with `listener vte_input 5`. @@ -1178,7 +1106,7 @@ To integrate a new sensor: 1. **Define a uORB message** that carries the measurement in either the vehicle body frame or NED, complete with variance estimates and timestamps. 2. **Extend the fusion mask**: add a bit to `SensorFusionMaskU` (`src/modules/vision_target_estimator/common.h`) and update the parameter definition for [VTE_AID_MASK](../advanced_config/parameter_reference.md#VTE_AID_MASK) (see also [sensor fusion selection](../advanced_features/vision_target_estimator.md#sensor-fusion-selection)) in `vision_target_estimator_params.yaml`. 3. **Augment observation enums**: append the new entry to the relevant `ObsType` enum (`VTEPosition.h` or `VTEOrientation.h`), update `ObsValidMaskU`, and update helper functions such as `hasNewNonGpsPositionSensorData()` and `selectInitialPosition()` if the measurement can provide a relative position. -4. **Subscribe and validate**: add a `uORB::Subscription` to the filter, check for finite values, and reject samples that are too old `isMeasUpdated` or timestamped in the future before marking the observation valid. +4. **Subscribe and validate**: add a `uORB::Subscription` to the filter, check for finite values, move small future offsets to the current time with `alignFutureSampleTime()`, and reject samples that are too old `isMeasUpdated` or further in the future before marking the observation valid. 5. **Implement the handler** in `processObservations()`. Convert the measurement into NED coordinates, populate `TargetObs::meas_xyz`, `meas_unc_xyz`, and the observation Jacobian (`meas_h_xyz` or `meas_h_theta`), and set the fusion-mask flag only after the data passes validation. 6. **Provide tunable noise**: declare a parameter (e.g. `VTE__NOISE`) and clamp it with `kMinObservationNoise` so the estimator never believes a measurement is perfect. @@ -1238,10 +1166,10 @@ The symbolic state, prediction model, and covariance update are defined in Pytho **Generated outputs (C++ headers) used at runtime:** -| Filter | Generated headers | -| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Положення | `state.h`, `predictState.h`, `predictCov.h`, `computeInnovCov.h`, `getTransitionMatrix.h`, `applyCorrection.h` | -| Орієнтація | `predictState.h`, `predictCov.h`, `getTransitionMatrix.h` (innovation computation and correction stay hand-written in `Orientation/KF_orientation.cpp` so yaw angles can be wrapped to $[-\pi, \pi]$) | +| Filter | Generated headers | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Положення | `state.h`, `predictState.h`, `predictCov.h`, `computeInnovCov.h`, `applyCorrection.h` | +| Орієнтація | `predictState.h`, `predictCov.h` (innovation computation and correction stay hand-written in `Orientation/KF_orientation.cpp` so yaw angles can be wrapped to $[-\pi, \pi]$) | **Build-time behaviour:** @@ -1266,72 +1194,49 @@ After regenerating, rebuild the module to ensure the Jacobians and code stay in ## Runtime Performance on Hardware -Even with ~500 ms induced latency on every measurement the estimator stays inside its 20 ms loop budget on a Pixhawk 6c. -Expand below for the full per-counter breakdown (baseline vs. delayed runs). - -:::details -Click to view Pixhawk 6c performance expectations - -The estimator publishes per-section perf counters that can be read at any time on the shell: +Read the estimator's elapsed-time counters from the shell: ```sh -perf | grep "vision_target_estimator" +perf | grep "VTE" ``` -Each line reports event count, total elapsed time, average, min, max, and standard deviation in microseconds. -Six counters cover the vision target estimator: +| Counter | What It Measures | +| ---------------- | ----------------------------------------------------------------------------------------------------------------- | +| `VTE cycle` | Input handling and eligible position/yaw updates in `updateEstimators()`. | +| `VTE cycle pos` | One position update, including input preparation and `vte_input` publication. | +| `VTE cycle yaw` | One orientation update. | +| `VTE prediction` | One prediction across all three position axes. | +| `VTE update` | Fusion of all position observations of one cycle, across the three axes. | +| `VTE fusion` | Fusing one cycle's observations on one position axis: at most one history replay. | -| Counter | What it covers | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `VTE cycle ` | One full work-queue of `VisionTargetEst::Run()`. Includes input subscription polls, task scheduling, and the dispatch into the position/orientation update steps. | -| `VTE cycle pos` | The position-filter part of the cycle (every prediction or measurement update for `VTEPosition`). | -| `VTE cycle yaw` | The orientation-filter part (same scope, for `VTEOrientation`). | -| `VTE prediction` | Just the Kalman prediction inside the position filter: `Predictstate` + `Predictcov` plus OOSM history. | -| `VTE update` | The full update step in the position filter, including measurement validation, frame transforms, fusion calls for every active aid source, and OOSM history maintenance. | -| `VTE fusion` | Just the per-axis fusion inside an update: innovation, gating, gain projection, and history correction. This is where OOSM scales with `history_steps`. | +These counters overlap; do not add their elapsed times to estimate CPU usage. +Reset them with `perf reset` after warmup, and use `top` to measure the `wq:vte` CPU share. +Replay cost increases with measurement delay and the number of later stored observations (see [OOSM Implementation](#oosm-implementation)). +Check the aid-source `fusion_status` fields alongside timing to confirm that observations are being fused. -The numbers below come from a Pixhawk 6c running the static-target filter (`vte_aid_fiducial_marker` + `vte_aid_gps_pos_target` + `vte_aid_gps_vel_uav`) at the default 50 Hz cadence. + -**Baseline (no injected delay):** +:::details +Pixhawk 6C Reference Measurements -```text -VTE fusion: 20568 events, 297061us elapsed, 14.44us avg, min 1us max 88us 14.138us rms -VTE update: 6856 events, 318536us elapsed, 46.46us avg, min 3us max 163us 41.827us rms -VTE prediction: 18567 events, 105034us elapsed, 5.66us avg, min 5us max 52us 1.575us rms -VTE cycle : 92576 events, 1614647us elapsed, 17.44us avg, min 6us max 281us 27.204us rms -VTE cycle yaw: 18563 events, 125422us elapsed, 6.76us avg, min 4us max 60us 3.985us rms -VTE cycle pos: 18569 events, 803841us elapsed, 43.29us avg, min 22us max 253us 38.464us rms -``` +Measurements from 18 October 2026 used disarmed SIH with a stationary target and yaw estimation enabled. +Vision was injected at 100 Hz and target GNSS at 50 Hz; native UAV GNSS ran at approximately 8 Hz. +The moving-model trials enabled target GNSS position and velocity aiding. +Actual estimator updates ran at approximately 43 to 44 Hz. +Delayed inputs had 460 ms added to their capture age; native UAV GNSS had no added delay. -**With bounded delay (≈ 480–500 ms latency, ~20 OOSM steps on average):** +| Model / Inputs | Mean Position Update, µs | Largest Observed, µs | VTE CPU | +| -------------------------------------------- | -----------------------: | -------------------: | --------------------: | +| Static, fresh inputs | 71.5 | 301 | 0.67% | +| Static, fresh vision and delayed target GNSS | 327.1 | 570 | 1.72% | +| Static, delayed vision and target GNSS | 427.0 | 667 | 2.28% | +| Moving, fresh inputs | 117.8 | 813 | 0.87% | +| Moving, fresh vision and delayed target GNSS | 1,437.3 | 1,867 | 6.06% | -```text -VTE fusion: 31932 events, 1860362us elapsed, 58.26us avg, min 63us max 135us 23.520us rms -VTE update: 10644 events, 1894804us elapsed, 178.02us avg, min 4us max 301us 69.331us rms -VTE prediction: 29156 events, 166179us elapsed, 5.70us avg, min 5us max 52us 1.614us rms -VTE cycle : 163952 events, 4215369us elapsed, 25.71us avg, min 6us max 511us 57.621us rms -VTE cycle yaw: 32850 events, 274433us elapsed, 8.35us avg, min 1us max 86us 7.852us rms -VTE cycle pos: 32861 events, 2703185us elapsed, 82.26us avg, min 10us max 479us 96.704us rms -``` - -How to read these: - -- **`VTE prediction` stays constant** (~5.7 us). - Predictions do a fixed amount of math regardless of measurement latency. -- **`VTE fusion` jumps from ~14 us to ~58 us** (≈ 4× increase). - This is the OOSM cost: the projection step touches every history sample after `t_meas`, so the runtime grows roughly linearly in `history_steps`. - With ~20 history steps the per-fusion cost is still well under 100 us on average. -- **`VTE update` follows the same trend** (~46 us → ~178 us) since it wraps multiple fusion calls. - The worst-case (~300 us) corresponds to a cycle where every aid source hits the OOSM path. -- **`VTE cycle pos` (~43 us → ~82 us)** confirms the same behaviour at the cycle level. - A full position cycle still completes in well under 0.5 ms even in the worst case, which is small relative to the 20 ms (50 Hz) loop budget. -- **`VTE cycle ` and `VTE cycle yaw` see only minor changes**: these counters are dominated by lightweight scheduling and yaw-only fusion that does not involve OOSM history projection. - -A few things to keep in mind when interpreting your own numbers: - -- The total `VTE cycle ` event count is roughly five times the `VTE cycle pos` count because `Run()` is woken on every input topic update, but the position estimator only ticks at 50 Hz. -- `history_steps` saturates at the buffer depth (`kOosmHistorySize = 25`). - If you see it pinned at 25 in the logs, the measurement is older than 500 ms and is being rejected as `STATUS_REJECT_TOO_OLD` rather than fused. +Each row summarises three 30-second trials; CPU includes position and yaw work, sampled in three approximately 1.2-second `top` windows per trial. +Fresh inputs have no added delay, but transport and scheduling can still move them across the 20 ms OOSM threshold. +These numbers predate the shared replay: rows with two delayed observations per cycle (delayed vision and target GNSS, or moving-mode target GNSS position and velocity) replayed the window twice per axis. +These are reference measurements, not worst-case timing limits; measure your own board with its expected source rates and delays. ::: diff --git a/docs/uk/companion_computer/companion_computer_peripherals.md b/docs/uk/companion_computer/companion_computer_peripherals.md index af8ce87b556..53fcbfb055f 100644 --- a/docs/uk/companion_computer/companion_computer_peripherals.md +++ b/docs/uk/companion_computer/companion_computer_peripherals.md @@ -54,8 +54,8 @@ Cameras are used image and video capture, and more generally to provide data for Серед популярних стереокамер: -- [Intel® RealSense™ Depth Camera D435](https://www.realsenseai.com/products/stereo-depth-camera-d435/) -- [Intel® RealSense™ Depth Camera D415](https://www.realsenseai.com/products/stereo-depth-camera-d415/) +- [Intel® RealSense™ Depth Camera D435](https://www.realsenseai.com/product-family/430-series/) +- [Intel® RealSense™ Depth Camera D415](https://www.realsenseai.com/product-family/d415-family/) - [DUO MLX](https://duo3d.com/product/duo-minilx-lv1) ### VIO Камера/Сенсори diff --git a/docs/uk/complete_vehicles_mc/crazyflie21.md b/docs/uk/complete_vehicles_mc/crazyflie21.md index bbfa457a54e..fb964259804 100644 --- a/docs/uk/complete_vehicles_mc/crazyflie21.md +++ b/docs/uk/complete_vehicles_mc/crazyflie21.md @@ -1,6 +1,6 @@ # Crazyflie 2.1 - +[](../flight_controller/autopilot_experimental.md) :::warning PX4 не розробляє цей (або будь-який інший) автопілот. diff --git a/docs/uk/config/motor_failure_detection.md b/docs/uk/config/motor_failure_detection.md new file mode 100644 index 00000000000..2442a96b3f6 --- /dev/null +++ b/docs/uk/config/motor_failure_detection.md @@ -0,0 +1,244 @@ +# Motor Failure Detection + + + +PX4 can detect a motor that has stopped producing the thrust it was commanded to give, as caused by a stalled motor, a lost or broken propeller, a seized bearing, a rubbing blade, and so on. + +The mechanism works by comparing the current each ESC reports against the current expected for the command that motor was given. +A motor whose current stays too far from that expectation for long enough is flagged as failed. +The failure is reported to the ground station, and can be [acted on](#failure-action) by removing the motor from the control allocation or by running a failsafe action. + +Failure detection is supported for DShot and DroneCAN ESC provided the following [requirements](#requirements) are met. +It is disabled by default ([FD_ACT_EN](#FD_ACT_EN)). + +:::warning +The thresholds are airframe specific, and the defaults are not a working configuration. +Values tuned for one vehicle will either false-trip or go blind on another, because both the expected current and the size of the healthy current fluctuations depend on the motors, propellers, ESCs and battery. +Always calibrate on logs from the vehicle you are configuring: see [Choosing Parameter Values](#choosing-parameter-values). +::: + +## Вимоги + +- ESCs that report **per-motor current**, and are configured so that PX4 knows which motor each ESC drives. + + For DShot ESC this needs either a [telemetry wire](../peripherals/dshot.md#esc-telemetry) or [Extended DShot Telemetry](../peripherals/dshot.md#extended-dshot-telemetry-edt). + [DroneCAN ESC](../dronecan/escs.md) report current as part of their status. + ESC that report no current, or only report RPM, cannot be checked. + +- Motors, not servos: only outputs assigned to a motor function are checked. + +- No vehicle-type restriction: a VTOL's multirotor motors and its forward-flight motor are both checked, in every flight mode. + Only the [failure actions](#failure-action) are multirotor-specific, since they assume the vehicle has rotors to spare. + +- Recorded flight logs from the vehicle, to calibrate the model and the thresholds. + +## How Detection Works + +For every armed motor, the check runs the following four steps at 10 Hz in [commander](../modules/modules_system.md#commander): + +1. **Compute expected current.** + + For each motor, the current expected for the command that the control allocator sent to it: + + ```text + I_expected = MOTFAIL_C2T * u + MOTFAIL_IDLE + ``` + + where `u` is the normalized motor command in the range 0 to 1. + The _commanded_ signal is used rather than the measured RPM, so the expectation stays valid even when telemetry degrades. + +2. **Compute residual.** + + The difference between reported and expected current, `I_measured - I_expected`, is low-pass filtered with a fixed 0.2 s time constant. + The filter suppresses single noisy samples, so that the thresholds can be set close to the healthy fluctuation band. + +3. **Compute two trip bands.** + + The filtered residual fluctuates around zero even on a healthy motor, from noise and model error. + A trip happens when it leaves that band and stays out, with a separate width and trigger time per direction: + + ```text + undercurrent: LPF(I_measured - I_expected) < -MOTFAIL_UNDER held for MOTFAIL_UND_TIME + overcurrent: LPF(I_measured - I_expected) > MOTFAIL_OVER held for MOTFAIL_OVR_TIME + ``` + + Undercurrent means the motor drew less than expected, as a stalled or damaged one would. + Overcurrent means it drew more, which healthy motors also do during sharp throttle increases. + +4. **Latch the fail flag if either band trips.** + + A motor that satisfies either condition is flagged as failed, and reported as `Motor N undercurrent detected` or `Motor N overcurrent detected`. + The flag is held until the vehicle disarms. + It is not cleared in flight, because reacting to a motor failure changes what that motor is commanded to do, which removes the evidence the check runs on: a motor that has been switched off would immediately look healthy again. + +Special cases: + +- A motor is not judged until its ESC has reported a non-zero current at least once, so ESC that only report while spinning do not trip the check on the ground. +- A motor is skipped while its command is `NaN` (the allocation has switched it off), and while it is in reversible mode. +- The filter runs on the ESC sample timestamp, so an interruption in ESC telemetry freezes it instead of integrating stale current. + A gap longer than 0.4 s, the time after which an ESC counts as offline, resets the filter and cancels a pending trip. + Complete loss of ESC telemetry is a separate check, enabled with [COM_ARM_CHK_ESCS](../advanced_config/parameter_reference.md#COM_ARM_CHK_ESCS). + +:::details +Why the Bands Are Not Symmetric + +The overcurrent and undercurrent directions do not carry the same information, so a single threshold for both serves neither well. + +**The fault side is bounded.** +Current cannot fall below zero, so the largest undercurrent residual that can physically exist is `I_expected` itself. +On a vehicle drawing 8 A per motor in hover, a rotor that stops producing thrust at hover throttle is a residual of at most 8 A, and a partial loss is proportionally smaller. + +**The nuisance side is not bounded.** +A fast throttle increase draws acceleration current that a static command-to-current model cannot predict. +The largest residuals seen in perfectly healthy flight are therefore positive, and there is no ceiling on them. + +A single band has to clear those positive excursions, and can end up above the largest negative signal a real fault can produce. +That makes a stopped motor structurally undetectable rather than merely slow to detect. +Splitting the bands lets the undercurrent side sit where the faults are, while the overcurrent side stays above the transients. + +::: + +## Failure Action + +Two parameters configure what happens when a failure is detected: + +- [CA_FAILURE_MODE](#CA_FAILURE_MODE) selects what the [control allocator](../concept/control_allocation.md) does, such as removing the failed motor from the allocation. +- [COM_ACT_FAIL_ACT](#COM_ACT_FAIL_ACT) selects a failsafe action, in the same way as the other [failsafes](../config/safety.md#motor-failure-trigger). + +A quadrotor that loses a rotor cannot hold yaw, so the realistic responses there are landing or termination. +Vehicles with more rotors than the minimum can keep flying with one removed. + +## Choosing Parameter Values + +There are two things to calibrate, in this order: the current model ([MOTFAIL_C2T](#MOTFAIL_C2T) and [MOTFAIL_IDLE](#MOTFAIL_IDLE)), then the two bands and their trigger times ([MOTFAIL_UNDER](#MOTFAIL_UNDER)/[MOTFAIL_UND_TIME](#MOTFAIL_UND_TIME) and [MOTFAIL_OVER](#MOTFAIL_OVER)/[MOTFAIL_OVR_TIME](#MOTFAIL_OVR_TIME)). +The goal is the smallest bands and shortest trigger times that still never trip across a set of healthy flights. +That is a tradeoff: a wider band held longer is more robust against false positives; a narrower band held for less time reacts sooner when a motor really does fail. + +Both stages are fitted from the vehicle's own logs, which have to come from _healthy_ flights covering the throttle range it really uses, including climbs and aggressive manoeuvres. +Those flights are what set the achievable thresholds. + +1. **Find how command maps to current.** + + The model has to say what current a healthy motor draws for a given command, so what you need is the relationship between the commanded value `u` and the reported ESC current, collected over all motors and all logs. + Use only flights in which every motor was healthy: a log from failure testing, or one with a real fault in it, describes the fault rather than the vehicle and shifts the model away from the rest of the fleet. + + Plotting the two against each other shows that relationship, and fitting a straight line through the points is a convenient way to reduce it to the two numbers the detector wants: the slope of the line goes into [MOTFAIL_C2T](#MOTFAIL_C2T), and its value at zero command into [MOTFAIL_IDLE](#MOTFAIL_IDLE). + + The [`mfd_fit` tool](../debug/motor_failure_replay.md#fitting-the-current-model) does this directly from the logs and prints the two values to set. + + One model is shared by all motors. + Differences in current draw between motors are small compared with the width of the trip bands, so there is no practical benefit in having separate models. + +2. **Set the bands from the healthy residual.** + + Use the [Offline Motor Failure Replay Tool](../debug/motor_failure_replay.md) to replay the logs through the detector and find the lowest band that produces no trips anywhere in the set, then add margin on top. + + Around 30% above the lowest false-positive-free value is a reasonable starting point, so a set that first stays clean at 3.0 A might be configured at 4.0 A. + +3. **Check the trigger time as well as the band.** + + A trip needs the residual to stay outside the band for the whole trigger time, so a longer trigger time allows a lower band. + How much it allows is very different in the two directions. + + The table below is from 6 healthy flights of one 6-rotor vehicle drawing about 8 A per motor in hover, and gives the lowest band that never trips on any motor of any of those flights: + + Undercurrent: + + | [MOTFAIL_UND_TIME](#MOTFAIL_UND_TIME) | Lowest [MOTFAIL_UNDER](#MOTFAIL_UNDER) | + | ------------------------------------------------------------------------------- | ----------------------------------------------------------- | + | 0.1 s | 3.5 A | + | 0.3 s | 3.0 A | + | 0.5 s | 3.0 A | + | 0.7 s | 3.0 A | + | 1.0 s | 2.5 A | + + Overcurrent: + + | [MOTFAIL_OVR_TIME](#MOTFAIL_OVR_TIME) | Lowest [MOTFAIL_OVER](#MOTFAIL_OVER) | + | ------------------------------------------------------------------------------- | --------------------------------------------------------- | + | 0.4 s | 6.0 A | + | 0.7 s | 3.0 A | + | 1.0 s | 2.0 A | + | 1.5 s | 1.5 A | + | 2.5 s | 1.0 A | + + The values are specific to that vehicle, but the pattern is general. + The overcurrent band gains a lot from waiting longer, from 6.0 A at 0.4 s down to 1.0 A at 2.5 s, because the healthy current transients that set it are large but brief. + The undercurrent band gains much less, 3.5 A down to 2.5 A over ten times the trigger time, and most of what it gains is already there at 0.3 s, because what limits it is steady model error and waiting does not make that go away. + A long trigger time is affordable on the overcurrent side, where the faults are thermal and a few seconds cost nothing, and not on the undercurrent side, where a stopped rotor has to be caught in about a second. + +4. **Work out what the configuration can detect.** + + A fault is only visible once it moves the current further than the band, so the undercurrent band and the expected current together set the smallest loss that can be seen, as a fraction of what the motor was drawing: + + ```text + smallest detectable loss = MOTFAIL_UNDER / I_expected + ``` + + Continuing the example, the 4.0 A band chosen in step 2 against 8 A of hover current is 50%: a rotor losing less than roughly half its current still looks healthy at hover. + The fraction gets worse as throttle drops, because `I_expected` shrinks with it. + A complete stop is the same sum with the whole current missing, so it is detectable wherever `I_expected` on its own exceeds the band, which for these numbers is any command above about half the hover command. + + If that floor is too high for the faults you care about, the only way to lower it is a better current model, not a smaller band: the band is already at the smallest width that avoids false trips on healthy motors, so it can't be reduced further. + +5. **Verify on the whole set.** + + Include logs that were not used for the fit, and confirm that no motor trips. + +:::tip +A _total_ failure is caught far more easily than the floor in step 4 suggests, because it amplifies its own signal. + +When a rotor stops producing thrust, the controller commands it harder to recover the missing lift, usually until it saturates. +`I_expected` follows the command up while the real current stays near zero, so the residual keeps growing rather than settling at the value it had at hover. + +In one flight test, a rotor that lost its propeller in hover was commanded to full throttle within about 200 ms, which took its residual to nearly 3x the trip band; the failure was flagged 1 s after it happened. + +A _partial_ loss gets none of this. +The vehicle still flies, so the command stays near hover and the residual stays small, which is why the floor in step 4 governs partial faults and not total ones. +::: + +## Обмеження + +- **Partial failures near hover are the hard case.** + The residual is bounded by the expected current, so a small loss at low throttle can be indistinguishable from model error. +- **Calibration is per airframe**, and has to be revisited when motors, propellers, ESCs or battery chemistry change. +- **Only current is used.** + A motor that draws the expected current but produces no thrust, such as one with a slipping propeller adapter, is not detected. +- **The flag is latched** until disarm, so a fault that recovers stays flagged for the rest of the flight. +- **Detection is not instantaneous.** + The 10 Hz check rate, the 0.2 s filter and the trigger time all add up. + Expect a few hundred milliseconds at best, and about a second in practice for a complete loss. + +## Параметри + +| Parameter | Опис | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [FD_ACT_EN](../advanced_config/parameter_reference.md#FD_ACT_EN) | Enable motor failure detection. Disabled by default. | +| [MOTFAIL_C2T](../advanced_config/parameter_reference.md#MOTFAIL_C2T) | Current model slope: expected current per unit of motor command (A). | +| [MOTFAIL_IDLE](../advanced_config/parameter_reference.md#MOTFAIL_IDLE) | Current model offset: expected current at zero command (A). | +| [MOTFAIL_UNDER](../advanced_config/parameter_reference.md#MOTFAIL_UNDER) | Undercurrent trip band (A): how far below the expected current a motor may run.
Set to `0` to disable undercurrent detection. | +| [MOTFAIL_UND_TIME](../advanced_config/parameter_reference.md#MOTFAIL_UND_TIME) | Time (s) the undercurrent band must be exceeded before the motor is flagged. | +| [MOTFAIL_OVER](../advanced_config/parameter_reference.md#MOTFAIL_OVER) | Overcurrent trip band (A): how far above the expected current a motor may run.
Set to `0` to disable overcurrent detection. | +| [MOTFAIL_OVR_TIME](../advanced_config/parameter_reference.md#MOTFAIL_OVR_TIME) | Time (s) the overcurrent band must be exceeded before the motor is flagged. | +| [CA_FAILURE_MODE](../advanced_config/parameter_reference.md#CA_FAILURE_MODE) | What the control allocator does on a failure, such as removing the failed motor from the allocation. | +| [COM_ACT_FAIL_ACT](../advanced_config/parameter_reference.md#COM_ACT_FAIL_ACT) | Failsafe action on a detected motor failure, such as warning, hold, return, land, or terminate. | + +## Upgrading From PX4 v1.18 + +In PX4 v1.18 and earlier, the check compared the _instantaneous_ current residual against a single symmetric threshold, `±MOTFAIL_OFF`, held for `MOTFAIL_TIME`. + +From PX4 main (v2.0), the residual is low-pass filtered before it is compared, so a sustained deviation is needed rather than isolated samples. +The single threshold is also replaced by two independent bands: [MOTFAIL_UNDER](#MOTFAIL_UNDER)/[MOTFAIL_UND_TIME](#MOTFAIL_UND_TIME) for undercurrent and [MOTFAIL_OVER](#MOTFAIL_OVER)/[MOTFAIL_OVR_TIME](#MOTFAIL_OVR_TIME) for overcurrent. +The current model also gains an offset term ([MOTFAIL_IDLE](#MOTFAIL_IDLE)), and the [offline replay tool](../debug/motor_failure_replay.md) is available to calibrate the new parameters from logs. + +`MOTFAIL_OFF` and `MOTFAIL_TIME` are not migrated: after the upgrade, all of the new parameters start at their defaults. +To keep the v1.18 shape of the check, set [MOTFAIL_OVER](#MOTFAIL_OVER) and [MOTFAIL_UNDER](#MOTFAIL_UNDER) to the old `MOTFAIL_OFF`, and [MOTFAIL_OVR_TIME](#MOTFAIL_OVR_TIME) and [MOTFAIL_UND_TIME](#MOTFAIL_UND_TIME) to the old `MOTFAIL_TIME`. + +The thresholds are worth re-deriving rather than copied: see [Choosing Parameter Values](#choosing-parameter-values). + +## Дивіться також + +- [Offline Motor Failure Replay](../debug/motor_failure_replay.md) — replaying recorded logs through the detector to calibrate and verify it. +- [Safety Configuration (Failsafes)](../config/safety.md#motor-failure-trigger) — the failure detector and its other triggers. +- [Control Allocation (Mixing)](../concept/control_allocation.md) — how a removed motor changes the actuator setpoints. +- [Actuator Configuration and Testing](../config/actuators.md) — geometry, motor order and bidirectional motors. diff --git a/docs/uk/config/safety.md b/docs/uk/config/safety.md index 59dd9670927..31aa43e7b39 100644 --- a/docs/uk/config/safety.md +++ b/docs/uk/config/safety.md @@ -419,27 +419,21 @@ If the vehicle descends more than [FD_ALT_LOSS](#FD_ALT_LOSS) meters below the s ### Motor Failure Trigger -The failure detector can be configured to detect a motor failure while armed (and trigger an associated action) if the ESC current falls outside expected threshold for more than [MOTFAIL_TIME](#MOTFAIL_TIME) seconds. -A motor flagged by this current check stays flagged until the vehicle disarms, because the reaction to a failure may stop the motor and thereby make it look healthy again. +The failure detector can be configured to detect a failed motor (or a lost or broken propeller, a seized bearing, a rubbing blade, and so on). +More specifically, it detects a motor that has stopped producing the thrust it was commanded, by comparing the current each ESC reports against the current expected for that motor's command. +A motor whose current stays too far below or above that expectation for long enough is flagged as failed, and stays flagged until the vehicle disarms, because the reaction to a failure may stop the motor and thereby make it look healthy again. -The undercurrent and overcurrent conditions are defined by: +The trigger needs ESC that report per-motor current, and thresholds calibrated for the specific airframe. +For how the check works, and how to set the `MOTFAIL_*` thresholds, see [Motor Failure Detection](../config/motor_failure_detection.md). -```text -undercurrent: {esc current} < {MOTFAIL_C2T} * {motor command [0,1]} - {MOTFAIL_OFF} -overcurrent: {esc current} > {MOTFAIL_C2T} * {motor command [0,1]} + {MOTFAIL_OFF} -``` - -The action on motor failure is set with [CA_FAILURE_MODE](#CA_FAILURE_MODE). -Actions depend on the vehicle type, and might include warning the user, removing failed motors from control allocation, disabling symmetrically opposite motors, and so on. +The action on motor failure is set with [COM_ACT_FAIL_ACT](../advanced_config/parameter_reference.md#COM_ACT_FAIL_ACT) and [CA_FAILURE_MODE](#CA_FAILURE_MODE). +Actions depend on the vehicle type, and might include warning the user, running a failsafe, removing failed motors from control allocation, disabling symmetrically opposite motors, and so on. For more information see [Motor Failure Recovery](motor_failure_recovery.md). -| Parameter | Опис | -| -------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [FD_ACT_EN](../advanced_config/parameter_reference.md#FD_ACT_EN) | Enable/disable the motor failure trigger completely. | -| [MOTFAIL_C2T](../advanced_config/parameter_reference.md#MOTFAIL_C2T) | Slope between normalized motor command [0–1] and expected steady-state current (FD_ACT_MOT_C2T at 100%) (A/%). | -| [MOTFAIL_OFF](../advanced_config/parameter_reference.md#MOTFAIL_OFF) | Under/over-current detection threshold offset (A). Added/subtracted to the expected current to form the upper and lower bounds. | -| [MOTFAIL_TIME](../advanced_config/parameter_reference.md#MOTFAIL_TIME) | Hysteresis time (s) for which the current threshold must remain exceeded before a motor failure is triggered. | -| [CA_FAILURE_MODE](../advanced_config/parameter_reference.md#CA_FAILURE_MODE) | Failure mode. See [Motor Failure Recovery](motor_failure_recovery.md). | +| Parameter | Опис | +| -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | +| [FD_ACT_EN](../advanced_config/parameter_reference.md#FD_ACT_EN) | Enable/disable the motor failure trigger completely. | +| [CA_FAILURE_MODE](../advanced_config/parameter_reference.md#CA_FAILURE_MODE) | Failure mode. See [Motor Failure Recovery](motor_failure_recovery.md). | ### External Automatic Trigger System (ATS) @@ -554,4 +548,5 @@ In addition there are a number of parameters that configure system and sensor li ## Подальша інформація -- [QGroundControl User Guide > Safety Setup](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/safety.html) +- [QGroundControl User Guide > Failsafes (PX4)](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/px4/failsafes.html) +- [QGroundControl User Guide > Return & Land (PX4)](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/px4/return_land.html) diff --git a/docs/uk/config_vtol/vtol_weathervane.md b/docs/uk/config_vtol/vtol_weathervane.md index 5594377ea3d..19e592aa687 100644 --- a/docs/uk/config_vtol/vtol_weathervane.md +++ b/docs/uk/config_vtol/vtol_weathervane.md @@ -18,8 +18,8 @@ The weather vane feature will only take effect in [Position mode](../flight_mode ## Поведінка в режимі місії -In [Mission mode](../flight_modes_vtol/mission.md) the weather vane feature will always be active when the parameter is enabled. -Будь-який кут повороту, заданий у місії, ігноруватиметься. +In [Mission mode](../flight_modes_vtol/mission.md) the weather vane feature is active (when enabled) for any mission item that does not command a yaw angle. +If a mission item commands a yaw angle, the weather vane feature is disabled for that item and the commanded yaw is used instead. diff --git a/docs/uk/debug/failure_injection.md b/docs/uk/debug/failure_injection.md index 8239880e175..c3d3b0d89d2 100644 --- a/docs/uk/debug/failure_injection.md +++ b/docs/uk/debug/failure_injection.md @@ -126,7 +126,7 @@ While the selected aux switch is on the configured failure is injected; switchin ## MAVSDK відлагоджувальний плагін The [MAVSDK failure plugin](https://mavsdk.mavlink.io/main/en/cpp/api_reference/classmavsdk_1_1_failure.html) can be used to programmatically inject failures. -It is used in [PX4 Integration Testing](../test_and_ci/integration_testing_mavsdk.md) to simulate failure cases (for example, see [PX4-Autopilot/test/mavsdk_tests/autopilot_tester.cpp](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/autopilot_tester.cpp)). +It is used in [PX4 Integration Testing](../test_and_ci/integration_testing_mavsdk.md) to simulate failure cases (for example, see [PX4-Autopilot/test/mavsdk_tests/test_multicopter_failsafe.py](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/test_multicopter_failsafe.py)). API плагіна - це пряме відображення команди збою, показаної вище, з деякими додатковими сигналами про помилки, пов'язані з підключенням. diff --git a/docs/uk/debug/motor_failure_replay.md b/docs/uk/debug/motor_failure_replay.md new file mode 100644 index 00000000000..ce950ee9fc8 --- /dev/null +++ b/docs/uk/debug/motor_failure_replay.md @@ -0,0 +1,381 @@ +# Offline Motor Failure Replay + + + +Two command line tools calibrate the [motor failure detector](../config/motor_failure_detection.md) against a vehicle's own flight logs. +`mfd_fit` derives the current model from a set of logs, and `mfd_replay` runs the real detector over a log and prints what it would have decided for each motor. + +They exist because the [threshold parameters](../config/motor_failure_detection.md#choosing-parameter-values) (`MOTFAIL_*`) are specific to an airframe, so the only place to get them is that airframe's own flights. +`mfd_replay` links the detector library itself, so a replay runs the same code that runs in flight. + +One flight is rarely enough to characterise a vehicle, so usually we run the tools over a directory of logs. + +The tools are used to: + +- Confirm a candidate configuration never trips on a set of healthy flights. +- Find the tightest thresholds a vehicle's data supports, by sweeping values and re-running. +- Check after the fact whether the detector would have flagged a motor in a flight where something went wrong. + +## Збірка + +To build the tools: + +1. Build PX4 SITL (to populate the build directory) + + ```bash + make px4_sitl_default # once, if the build directory does not exist yet + ``` + +2. Build the tool binaries: + + ```bash + cmake -DMFD_REPLAY_TOOL=ON build/px4_sitl_default + ninja -C build/px4_sitl_default mfd_replay mfd_fit + ``` + +This produces `build/px4_sitl_default/mfd_replay` and `build/px4_sitl_default/mfd_fit`. +`mfd_fit` derives the current model from logs; `mfd_replay` then runs the detector with it. + +## Fitting the Current Model + +The first step is to fit the current model: find the straight line that best predicts each motor's current from its command, since the detector flags a motor whose current strays too far from it. +To do this, run `mfd_fit` once over every healthy log you have for the airframe. +It fits the expected current `I_expected = MOTFAIL_C2T*u + MOTFAIL_IDLE` to all of them together, where `u` is the motor command, and prints the two parameter values plus the residual sigma you need later to [choose the bands](#choosing-the-bands). +The more of the vehicle's flying the logs cover, the better the fit, and there is no limit on how many you pass: a hundred logs take under a second. + +:::warning +Fit on healthy flights only. +The fit cannot tell a faulty motor from a healthy one, so a single failure-test log pulls the model toward that fault and shifts the residual of every healthy motor with it. +::: + +```bash +./build/px4_sitl_default/mfd_fit ~/logs/healthy/*.ulg +``` + +Typical output, for three healthy flights: + +```text +# 3 logs, 80697 armed samples +# I_expected = 6.91*u + 0.37 A (residual sigma 0.50 A) +# mean command 0.387, mean current 3.04 A + +MOTFAIL_C2T 6.91 +MOTFAIL_IDLE 0.37 + +# per-motor mean residual against this model [A] +# motor 1: -0.12 (sigma 0.64, n 13484) +# ... +# motor 6: -0.10 (sigma 0.46, n 13360) +# worst per-motor bias 0.12 A -- the trip bands have to clear this before any fault. +``` + +It contains: + +- The fitted model, `I_expected = 6.91*u + 0.37 A`. + `6.91` is the slope (expected current per unit of command, in A) and `0.37` is the offset (expected current at zero command, in A). +- The same slope and offset as the two parameters to set, [MOTFAIL_C2T](../config/motor_failure_detection.md#MOTFAIL_C2T) `6.91` and [MOTFAIL_IDLE](../config/motor_failure_detection.md#MOTFAIL_IDLE) `0.37`. +- The residual sigma, `0.50 A`: how far the samples scatter around the model. + This is the healthy noise the trip bands have to clear, so it caps how tight they can be. +- For each motor, its mean residual against the model (`-0.12 A` for motor 1), with that motor's own sigma and sample count `n`. +- The worst per-motor bias, `0.12 A`: the largest of the per-motor mean residuals, ignoring sign. + The detector uses one model for all motors, so this is error the bands absorb before any fault does. + +To use it: + +1. Set `MOTFAIL_C2T` and `MOTFAIL_IDLE` to the printed values. + + On some vehicles the fitted offset comes out below zero. + `MOTFAIL_IDLE` cannot be set below 0, so the tool adds a `NOTE` saying so: use 0 in that case. + Nothing is lost by it, because the bands are then chosen against the residual that results, so they absorb the difference. + +2. Keep the residual sigma for [Choosing the Bands](#choosing-the-bands). + +Use the fitted offset, not one copied from another airframe. +An offset that is too high by some amount lowers every healthy motor's residual by that same amount, which the undercurrent band then has to absorb. +For example, replaying the healthy flight shown in [Running the Detector on One Log](#running-the-detector-on-one-log) with another airframe's offset of 2.88 A, instead of the fitted 0.37 A, raises the expected current by 2.51 A. +Every residual drops by the same 2.51 A (motor 1's lowest goes from -1.79 A to -4.30 A), past the 2.25 A undercurrent band, so all six healthy motors are reported as failed: + +```text +# config (...): I_exp = 6.91*u + 2.88 A, trip if LPF(I-I_exp) < -2.25 for 0.70 s or > 1.00 for 2.50 s +# motor min[A] max[A] trips verdict + 1 -4.30 +1.69 5/5 FAILED (all phases) + ... + 6 -4.75 +1.43 5/5 FAILED (all phases) +``` + +## Running the Detector on One Log + +```bash +./build/px4_sitl_default/mfd_replay flight.ulg \ + --set MOTFAIL_C2T=6.91 --set MOTFAIL_IDLE=0.37 \ + --set MOTFAIL_UNDER=2.25 --set MOTFAIL_UND_TIME=0.7 \ + --set MOTFAIL_OVER=1.0 --set MOTFAIL_OVR_TIME=2.5 +``` + +Run without the `--set` flags it uses a built-in fallback calibration, which belongs to a different vehicle and will report failures on healthy flights. + +The log must contain `esc_status` (per-motor current) and `actuator_motors` (the motor commands). +`vehicle_status` is used to evaluate only the armed part of the flight; without it the tool says so and evaluates everything. +Fields are resolved by name from the log's own format, so one binary reads logs from any PX4 version, with 8 or 12 ESCs, without rebuilding. +A log that is not a ULog, or that is missing a needed field, is reported as an error rather than silently misread. + +Output for a healthy flight with a calibrated configuration: + +```text +# flight.ulg (5 phases, 728 armed samples each) +# config (built-in calibration, overrides: MOTFAIL_C2T MOTFAIL_IDLE MOTFAIL_OVER MOTFAIL_OVR_TIME MOTFAIL_UNDER MOTFAIL_UND_TIME): I_exp = 6.91*u + 0.37 A, trip if LPF(I-I_exp) < -2.25 for 0.70 s or > 1.00 for 2.50 s +# motor min[A] max[A] trips verdict + 1 -1.79 +4.20 0/5 ok + 2 -3.09 +2.11 0/5 ok + 3 -1.79 +2.67 0/5 ok + 4 -2.13 +2.38 0/5 ok + 5 -2.35 +2.78 0/5 ok + 6 -2.24 +3.94 0/5 ok +``` + +| Column | Значення | +| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `motor` | Motor index, counting from 1, as mapped from each ESC's actuator function. | +| `min[A]` | Deepest the filtered residual went below the model, over the whole flight and every sampling phase. This is what the undercurrent band has to clear. | +| `max[A]` | Highest it went above the model, likewise. This is what the overcurrent band has to clear. | +| `trips` | How many of the sampling phases flagged this motor. | +| `verdict` | `ok`, `FAILED (all phases)`, or `FAILED (sampling-dependent!)` when only some phases flagged it. | + +Motors are numbered from 1, the same as in the `Motor 1 undercurrent detected` message the vehicle reports. + +Exit codes make the tool usable as a check in a script: `0` if every motor stayed healthy, `1` if any motor was flagged, `2` if the log could not be used. + +### The Sampling Phase Sweep + +Every replay runs five detectors side by side over the same log (the `5 phases` in the header and the `/5` in `trips`), because a single one can miss a trip that would happen on the vehicle. + +On the vehicle the check runs at 10 Hz, so it sees only a subset of the ESC samples, and _which_ subset depends on the alignment between the check and the telemetry stream. +That alignment cannot be reconstructed from a log. + +Each detector therefore starts its 10 Hz grid at a different offset, and the tool reports the spread. +A single-phase answer would be a lower bound on the trip risk, not a verdict. + +Read the result as follows: + +- `0/5`: the configuration did not trip on this flight, and `min`/`max` say by how much it cleared each band. +- `0/5` but with a note printed below the table: one of the extremes moved by more than 30% between phases, so this run happened not to trip and the same flight could trip on the vehicle. +- `1/5` … `4/5` (`sampling-dependent!`): treat this as a false positive, not as a pass. +- `5/5`: it would have tripped. + +### Where the Configuration Comes From + +The configuration in the `# config` header line is the set of `MOTFAIL_*` values the replay ran the detector with. +For each parameter, in order of precedence: + +1. `--set NAME=value` on the command line. +2. The value recorded in the log, if the log contains the `MOTFAIL_*` parameters. +3. A built-in fallback. + +The header line always prints the configuration that was used, and names any parameter that came from `--set`. + +:::warning +The built-in fallback is an example fit for one particular vehicle, not a recommended default. +On another airframe it will report failures on perfectly healthy flights. +Always replay with the configuration you are actually evaluating. +::: + +Overriding one knob at a time is how the band sweeps below are done: + +```bash +./build/px4_sitl_default/mfd_replay flight.ulg --set MOTFAIL_UNDER=1.75 --set MOTFAIL_UND_TIME=0.7 +``` + +The accepted names are [MOTFAIL_C2T](../config/motor_failure_detection.md#MOTFAIL_C2T), [MOTFAIL_IDLE](../config/motor_failure_detection.md#MOTFAIL_IDLE), [MOTFAIL_UNDER](../config/motor_failure_detection.md#MOTFAIL_UNDER), [MOTFAIL_UND_TIME](../config/motor_failure_detection.md#MOTFAIL_UND_TIME), [MOTFAIL_OVER](../config/motor_failure_detection.md#MOTFAIL_OVER) and [MOTFAIL_OVR_TIME](../config/motor_failure_detection.md#MOTFAIL_OVR_TIME). + +## Choosing the Bands + +After [fitting the current model](#fitting-the-current-model) you have `MOTFAIL_C2T`, `MOTFAIL_IDLE` and the residual sigma, which you use with `mfd_replay` to choose the remaining four parameters: the undercurrent and overcurrent bands and their trigger times. + +The goal is the tightest bands that never trip on healthy flight, so the logs have to cover the throttle range the vehicle really flies, including climbs and aggressive manoeuvres: the largest deviation across them is what sets the achievable threshold. +As with the fit, every log has to come from a flight where all motors were healthy. + +The steps below use [`batch_replay.sh`](#replaying-a-fleet-of-logs) to replay a whole set of logs at once. + +**1. Read the healthy residual.** + +Replay each log with the fitted model and both bands disabled (`0`), so nothing trips and the `min`/`max` columns report the full excursion. +Each log prints its own header and table; one of them: + +```bash +for log in ~/logs/healthy/*.ulg; do + ./build/px4_sitl_default/mfd_replay "$log" \ + --set MOTFAIL_C2T=6.91 --set MOTFAIL_IDLE=0.37 --set MOTFAIL_OVER=0 --set MOTFAIL_UNDER=0 +done +``` + +```text +# motor min[A] max[A] trips verdict + 1 -1.36 +7.84 0/5 ok + 2 -1.32 +2.72 0/5 ok + 3 -1.85 +1.93 0/5 ok + 4 -1.37 +7.72 0/5 ok + 5 -2.17 +1.11 0/5 ok + 6 -1.55 +1.96 0/5 ok +``` + +Read the two columns separately, because they set the two sweeps. +The deepest `min` across all logs and motors is what the undercurrent band has to clear, and the highest `max` is what the overcurrent band has to clear. +On this vehicle they are very different, about −2.2 A against +7.8 A, which is the whole reason for two bands. + +**2. Sweep each band against its trigger time.** + +`sweep_matrix.sh` sweeps one direction while disabling the other, and prints +how many logs false-trip at each (trigger time, band) pair. +The first `0` in a row is the lowest band that trigger time supports. + +```bash +export C2T=6.91 IDLE=0.37 # the model you fitted +src/lib/motor_failure_detector/tools/sweep_matrix.sh ~/logs/healthy under +src/lib/motor_failure_detector/tools/sweep_matrix.sh ~/logs/healthy over +``` + +Set the grid from the `min`/`max` you just read, with `TRIGGER_TIMES` and `BANDS`: + +- **Bands** run from the healthy noise up to that side's extreme. + Roughly twice the residual sigma makes a sensible bottom, since below that every log trips. + On the undercurrent side the top is the expected current at hover: a band above it cannot be reached even by a rotor that has stopped completely. + The overcurrent side has no such ceiling, so start at its `max` and come down by spending trigger time instead of amplitude. +- **Trigger times** come from the latency you can accept. + A latch takes about `0.1 s` of sampling plus `0.2 s` of filter plus the trigger time, so a fault that destabilises the vehicle wants well under a second, while a thermal fault can wait seconds. + +```bash +TRIGGER_TIMES="0.1 0.3 0.5 0.7 1.0" BANDS="1.0 1.25 1.5 1.75 2.0 2.5 3.0" \ + src/lib/motor_failure_detector/tools/sweep_matrix.sh ~/logs/healthy under +``` + +```text +trigger[s] 1.0 1.25 1.5 1.75 2.0 2.5 3.0 <- MOTFAIL_UNDER [A] (logs tripped) +0.1 3 2 2 2 2 1 0 +0.3 2 2 2 2 1 1 0 +0.5 2 2 1 1 1 0 0 +0.7 2 1 1 0 0 0 0 +1.0 1 1 1 0 0 0 0 +``` + +Each row gives one answer. +Walk it from left to right and stop at the first `0`: + +| trigger time | lowest band with no trips | +| --------------------- | ------------------------- | +| 0.1 s | 3.0 A | +| 0.3 s | 3.0 A | +| 0.5 s | 2.5 A | +| 0.7 s | 1.75 A | +| 1.0 s | 1.75 A | + +Now compare each floor against this side's ceiling, the expected current at hover, which is about 3.0 A here. + +That makes the top two rows unusable rather than merely cautious: the smallest band that avoids false positives is already the band a total failure at hover cannot reach. +The 0.5 s row sits just under the ceiling, which leaves almost nothing for a partial loss. +By 0.7 s the floor has dropped to 1.75 A, which leaves real room below the ceiling, and a longer trigger time gains nothing. +That is what picks 0.7 s here, rather than taste. + +**Sweep coarse, then refine.** +The first grid only has to show which zone is interesting; a second, finer pass finds the edge. + +The overcurrent side is the example. +Run on the default grid, `sweep_matrix.sh ~/logs/healthy over` puts every zero in the 2.5 s row, which says the floor is 0.5 A or lower and the trigger time that reaches it is 2.5 s or shorter, but not what either actually is. +Re-running with finer trigger times and smaller bands: + +```bash +TRIGGER_TIMES="1.5 1.75 2.0 2.25 2.5" BANDS="0.2 0.3 0.5 0.75 1.0 1.5 2.0 3.0" \ + src/lib/motor_failure_detector/tools/sweep_matrix.sh ~/logs/healthy over +``` + +```text +trigger[s] 0.2 0.3 0.5 0.75 1.0 1.5 2.0 3.0 <- MOTFAIL_OVER [A] (logs tripped) +1.5 3 3 2 1 1 1 1 1 +1.75 2 1 0 0 0 0 0 0 +2.0 2 1 0 0 0 0 0 0 +2.25 2 1 0 0 0 0 0 0 +2.5 2 1 0 0 0 0 0 0 +``` + +Two things are readable now. +The floor is 0.5 A, since 0.3 A still trips a log. +And it arrives abruptly between 1.5 s and 1.75 s: at 1.5 s even a 3.0 A band trips, at 1.75 s a 0.5 A band is clean, and every longer trigger time is identical. + +That second part is physics rather than a coincidence of the grid. +The benign excursion that sets this side must last between 1.5 s and 1.75 s, so a trigger time past it rejects the excursion completely while a trigger time just short of it rejects nothing. + +Choosing from a pair of tables like these: + +- On the **fault side**, latency decides the trigger time, and the band takes some margin above the floor. + How much is your call, and it depends on how much data the floor came from. + A floor measured on three flights is a sample rather than the worst case, so something like 30% hedges against the next flight going deeper, turning a 1.75 A floor into 2.25 A. + With hundreds of flights behind it, the measured floor is already close to the real one and you can sit nearer to it. +- On the **nuisance side** there is no ceiling from physics, so the band is set by what you want to catch rather than by what a fault can reach. + Pick the smallest over-draw worth flagging, find the shortest trigger time whose floor is below it, then go a little longer than that. + The floor drops at whatever trigger time outlasts the benign excursion, so the shortest trigger time that works is sitting on its edge. + The extra trigger time costs only latency, and these faults are thermal. + +:::warning +If you write your own sweep instead of using the script, write it in `bash` and pass the `--set` flags +literally or through an array. +In `zsh` an unquoted variable holding `--set A=1 --set B=2` arrives as a single argument, so the tool +prints a usage error and exits without a verdict table, and a loop that only counts failures reads that +as "nothing tripped". +Assert that a table was produced before trusting a zero, as the script's `grep -q` guard does. +::: + +**3. Verify.** + +Re-run the whole set of flight logs with the chosen configuration, including logs that were not used for the fit, and confirm every motor is `ok` with no phase-dependent verdicts. +Then check the detection floor the configuration implies: the undercurrent band divided by the per-motor hover current is the smallest current loss that can be seen at hover. + +## Replaying a Fleet of Logs + +A single flight doesn't usually contain enough information to calculate thresholds, so the usual unit of work is a set of flight logs. +`batch_replay.sh` runs the tool over every `.ulg` in a directory and summarizes the verdicts: + +```bash +src/lib/motor_failure_detector/tools/batch_replay.sh ~/logs/healthy --set MOTFAIL_UNDER=1.75 --set MOTFAIL_UND_TIME=0.7 +``` + +```text +OK flight1.ulg +OK flight2.ulg +OK flight3.ulg +---- +total=3 OK=3 FAIL=0 SKIP=0 +``` + +Anything after the directory is passed straight through to `mfd_replay`. +`SKIP` counts logs with no usable ESC data. +Run it from the repository root, or set `MFD_REPLAY` to the path of the binary. + +:::details +Replaying thousands of logs +`batch_replay.sh` works through the logs one at a time, which is fine for tens of them and slow for thousands. +For a large set, run `mfd_replay` itself with one process per log, and give each its own output file so the verdict tables do not interleave: + +```bash +mkdir -p /tmp/verdicts +ls ~/logs/healthy/*.ulg | xargs -P"$(nproc)" -I{} \ + sh -c './build/px4_sitl_default/mfd_replay "$1" > /tmp/verdicts/$(basename "$1").txt' _ {} + +grep -l FAILED /tmp/verdicts/*.txt # the logs that tripped +``` + +This gives the full per-motor table for every log instead of the one-line summary, which is what you want when you then have to look at _why_ something tripped. +::: + +## What the Replay Does Not Reproduce + +- **The sampling phase**, which is why the sweep exists. +- **Real faults**, unless the log contains one. + There is no fault injection: to study the true-positive side, replay a log from a flight where a motor really failed, or modify a log so that the current of one motor reflects the fault you want to study. +- **Parameter changes during the log.** + On the vehicle the detector is reset whenever it is disarmed and reconfigured on parameter change; the replay configures it once, resets it on disarm and evaluates only the armed samples. +- **Anything outside the current check.** + The ESC telemetry timeout, the arming checks and the failure response all live elsewhere in the firmware and are not part of this tool. + +## Дивіться також + +- [Motor Failure Detection](../config/motor_failure_detection.md) — what the detector does and how it is configured on the vehicle. +- [Flight Log Analysis](../dev_log/flight_log_analysis.md) — general tooling for working with ULog files. diff --git a/docs/uk/dev_setup/building_px4.md b/docs/uk/dev_setup/building_px4.md index 9235648c78b..e49ba30e05d 100644 --- a/docs/uk/dev_setup/building_px4.md +++ b/docs/uk/dev_setup/building_px4.md @@ -208,6 +208,8 @@ To check out the commits PX4 records (for example after switching branches), run git submodule sync --recursive && git submodule update --init --recursive ``` +Set the CMake variable `PX4_GIT_SUBMODULES` to a list of submodule paths to check only those, for example when another project builds PX4 and uses only some of its libraries. +The configure step then stops if the build uses a submodule that is not checked out. Set `GIT_SUBMODULES_ARE_EVIL=1` to skip the check entirely and manage submodules yourself. ## Компіляція в графічному IDE diff --git a/docs/uk/dronecan/agam_florange.md b/docs/uk/dronecan/agam_florange.md new file mode 100644 index 00000000000..30f49eb485f --- /dev/null +++ b/docs/uk/dronecan/agam_florange.md @@ -0,0 +1,142 @@ +# Agam FloRange + + + +:::warning +PX4 does not manufacture this (or any) autopilot component. +Contact the [manufacturer](https://www.agamrobotics.com/) for hardware support or compliance issues. +::: + +Agam FloRange is [Agam Robotics'](https://www.agamrobotics.com/) [DroneCAN](index.md) [optical flow](../sensor/optical_flow.md), [distance sensor](../sensor/rangefinders.md), and IMU module. +Its primary use is to provide local positioning in the absence of global positioning devices such as GNSS modules, as well as to improve stability. + +![Agam FloRange](../../assets/hardware/sensors/optical_flow/agam_florange.png) + +## Де купити + +Замовте цей модуль з: + +- [Agam Robotics](https://www.agamrobotics.com/product-page/agam-florange-sensor) + +## Характеристики обладнання + +- Датчики + - PixArt PAA3905E1 Optical Flow Sensor + - Wide working distance from 80mm to infinity, no calibration required + - Supports synchronised multi-chip operation and automatic mode switching + - Broadcom AFBR-S50LV85D Time-of-Flight Distance Sensor ([datasheet](https://docs.broadcom.com/doc/AFBR-S50LV85D-DS)) + - Integrated 850nm laser light source, Laser Class 1 eye safe + - Receiver Field-of-View (FoV) of 12.4° x 5.4° with 32 pixels, 1.55° x 1.55° each + - Transmitter (laser) beam of 2° x 2°, illuminating 1 to 3 pixels + - Типовий діапазон відстані до 30м + - Operates in up to 200k lux ambient light + - Sensor supply: 5V, typically 33mA + - InvenSense ICM-42688-P 6-Axis IMU + - IR LED for low-light operation +- STM32F412CE MCU +- Single Pixhawk Standard CAN Connector (4 Pin JST GH) +- Software-switchable built-in CAN termination +- Роз'єм для відлагодження стандарту Pixhawk (6 контактів JST SH) +- 5V supply from the CAN connector +- Small Form Factor: 44.95mm x 29.4mm x 15.59mm +- Weight: 9.38g (including enclosure) +- Designed and manufactured in India + +![Agam FloRange block diagram](../../assets/hardware/sensors/optical_flow/agam_florange_block_diagram.svg) + +## Налаштування програмного забезпечення + +### Підключення + +Connect Agam FloRange to the flight controller's CAN bus with the provided cable. +For more information, refer to the [CAN Wiring](../can/index.md#wiring) instructions. + +:::info +Agam FloRange has a single CAN connector, so it is normally the last node on the bus. +Enable its built-in termination by setting [CANNODE_TERM](#CANNODE_TERM) to `1`. +If more than one module is connected through a CAN splitter, enable termination only on the module furthest from the flight controller. +::: + +| Pin | Сигнал | Wire | +| --- | ---------------------------- | ----- | +| 1 | VCC (+5V) | Red | +| 2 | CAN_H | Black | +| 3 | CAN_L | Black | +| 4 | GND | Black | + +Twist the VCC/GND and CAN_H/CAN_L wires as pairs to reduce electromagnetic interference and crosstalk, as described in [Cable Wiring Basics > UAVCAN cables](../assembly/cable_wiring.md#uavcan-cables). + +### Встановлення + +Mount the module with the sensors facing down and the X arrow on the enclosure pointing towards the front of the vehicle. +This corresponds to the default value (`0`) of the parameter [SENS_FLOW_ROT](../advanced_config/parameter_reference.md#SENS_FLOW_ROT). +Змініть параметр належним чином, якщо використовується інша орієнтація. + +## Налаштування прошивки + +Agam FloRange runs the [PX4 DroneCAN Firmware](px4_cannode_fw.md). +It supports firmware updates over the CAN bus and [dynamic node allocation](index.md#node-id-allocation). +Firmware can also be flashed over SWD using the [Pixhawk Debug Mini](../debug/swd_debug.md#pixhawk-debug-mini) connector, which additionally provides the [System Console](../debug/system_console.md). +Agam FloRange ships with recent firmware pre-installed, but if you want to build and flash the latest firmware yourself, see [PX4 DroneCAN Firmware > Building the Firmware](px4_cannode_fw.md#building-the-firmware). + +- Firmware target: `agam_florange_default` +- Bootloader target: `agam_florange_canbootloader` + +## Конфігурація PX4 + +:::info +Agam FloRange will not boot if the flight controller has no SD card installed when it is powered on. +::: + +### Увімкнути DroneCAN + +Кроки наступні: + +- In _QGroundControl_ set the parameter [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to `2` for dynamic node allocation (or `3` if also using [DroneCAN ESCs](../dronecan/escs.md)) and reboot (see [Finding/Updating Parameters](../advanced_config/parameters.md)). +- Connect Agam FloRange to the flight controller's CAN bus (see [Wiring](#wiring)). + +Once DroneCAN is enabled, the module is detected on boot. + +DroneCAN configuration in PX4 is explained in more detail in [DroneCAN > Enabling DroneCAN](index.md#enabling-dronecan). + +### Flow and Rangefinder Parameters + +Set the following parameters in _QGroundControl_, depending on which functions of the module you use: + +- Enable optical flow fusion with [EKF2_OF_CTRL](../advanced_config/parameter_reference.md#EKF2_OF_CTRL) (enabled by default). +- To optionally disable GPS aiding, set [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) to `0`. +- Enable [UAVCAN_SUB_FLOW](../advanced_config/parameter_reference.md#UAVCAN_SUB_FLOW). +- Enable [UAVCAN_SUB_RNG](../advanced_config/parameter_reference.md#UAVCAN_SUB_RNG). +- Set [UAVCAN_RNG_MIN](../advanced_config/parameter_reference.md#UAVCAN_RNG_MIN) to `0.08`, the minimum working distance of the flow sensor, and [UAVCAN_RNG_MAX](../advanced_config/parameter_reference.md#UAVCAN_RNG_MAX) to `30`, the maximum range of the distance sensor. +- If using the distance sensor for height aiding, enable [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) and set [EKF2_RNG_A_HMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_HMAX) to `10` and [EKF2_RNG_QLTY_T](../advanced_config/parameter_reference.md#EKF2_RNG_QLTY_T) to `0.2`. +- Set [SENS_FLOW_MINHGT](../advanced_config/parameter_reference.md#SENS_FLOW_MINHGT) to `0.08`, the minimum height of the flow sensor, and [SENS_FLOW_MAXHGT](../advanced_config/parameter_reference.md#SENS_FLOW_MAXHGT) to `30`, the maximum range of the distance sensor. +- Set [SENS_FLOW_MAXR](../advanced_config/parameter_reference.md#SENS_FLOW_MAXR) to `7.4` to match the PAA3905 maximum angular flow rate. +- The parameters [EKF2_OF_POS_X](../advanced_config/parameter_reference.md#EKF2_OF_POS_X), [EKF2_OF_POS_Y](../advanced_config/parameter_reference.md#EKF2_OF_POS_Y), [EKF2_OF_POS_Z](../advanced_config/parameter_reference.md#EKF2_OF_POS_Z) and [EKF2_RNG_POS_X](../advanced_config/parameter_reference.md#EKF2_RNG_POS_X), [EKF2_RNG_POS_Y](../advanced_config/parameter_reference.md#EKF2_RNG_POS_Y), [EKF2_RNG_POS_Z](../advanced_config/parameter_reference.md#EKF2_RNG_POS_Z) can be set to account for the offset of the module from the vehicle centre of gravity. + +When optical flow is the only source of horizontal position/velocity, reduce the horizontal position gain [MPC_XY_P](../advanced_config/parameter_reference.md#MPC_XY_P) (for example to `0.5`) to reduce oscillations. + +## Agam FloRange Configuration + +On the module, you may need to configure the following parameters: + +| Parameter | Опис | +| -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [CANNODE_NODE_ID](../advanced_config/parameter_reference.md#CANNODE_NODE_ID) | CAN node ID. Set to `0` (default) for dynamic node allocation, or to `1`-`125` for a static node ID. | +| [CANNODE_TERM](../advanced_config/parameter_reference.md#CANNODE_TERM) | Built-in CAN bus termination. Set to `1` if the module is the last node on the CAN bus (see [Wiring](#wiring)). | + +## Значення LED індикаторів + +- Solid blue indicates normal operation. +- Solid blue and red (both on) indicates a firmware update. +- Solid red indicates an error, or that the module is waiting for a node ID to be allocated (briefly, on every boot). + +If the red LED stays on, there is an error and you should check the following: + +- Переконайтеся, що у польотному контролері встановлено SD-картку. +- Make sure Agam FloRange has `agam_florange_canbootloader` installed prior to flashing `agam_florange_default`. +- Remove binaries from the root and `ufw` directories of the SD card and try to build and flash again. + +## Дивіться також + +- [DroneCAN > Node ID Allocation](index.md#node-id-allocation) +- [PX4 DroneCAN Firmware](px4_cannode_fw.md) diff --git a/docs/uk/dronecan/index.md b/docs/uk/dronecan/index.md index d9e689fa900..f18279305b5 100644 --- a/docs/uk/dronecan/index.md +++ b/docs/uk/dronecan/index.md @@ -71,8 +71,6 @@ DroneCAN was previously known as UAVCAN v0 (or just UAVCAN). - Датчики відстані - [ARK Dist](ark_dist.md) - [Ark Dist MR](ark_dist_mr.md) - - [ARK Flow](ark_flow.md) - - [Ark Flow MR](ark_flow_mr.md) - [Avionics Anonymous Laser Altimeter UAVCAN Interface](../dronecan/avanon_laser_interface.md) - [RaccoonLab uRangefidner and Rangefinders Adapter](https://docs.raccoonlab.co/guide/rangefinder/) - [Smartmicro Drone Altimeter](smartmicro_t132.md) @@ -81,6 +79,7 @@ DroneCAN was previously known as UAVCAN v0 (or just UAVCAN). - [DroneCAN Electro-Permanent Magnet (EPM)](../peripherals/gripper_epm.md) - Оптичний потік(Optical Flow) + - [Agam FloRange](agam_florange.md) - [Ark Flow](ark_flow.md) - [Ark Flow MR](ark_flow_mr.md) diff --git a/docs/uk/flight_controller/accton-godwit_ga1.md b/docs/uk/flight_controller/accton-godwit_ga1.md index f6de2222188..bc0848b01cf 100644 --- a/docs/uk/flight_controller/accton-godwit_ga1.md +++ b/docs/uk/flight_controller/accton-godwit_ga1.md @@ -68,7 +68,7 @@ This flight controller is [manufacturer supported](../flight_controller/autopilo ## Where to Buy {#store} - [Accton-IoT Godwit](https://www.accton-iot.com/godwit/) -- [sales@accton-iot.com](sales@accton-iot.com) +- [sales@accton-iot.com](mailto:sales@accton-iot.com) ## Схема розташування виводів @@ -149,5 +149,5 @@ make accton-godwit_ga1 ## More Information and Support - [Accton-IoT Godwit](https://www.accton-iot.com/godwit/) -- [sales@accton-iot.com](sales@accton-iot.com) +- [sales@accton-iot.com](mailto:sales@accton-iot.com) - [support@accton-iot.com](mailto:support@accton-iot.com) diff --git a/docs/uk/flight_controller/aifoundry_erbium.md b/docs/uk/flight_controller/aifoundry_erbium.md new file mode 100644 index 00000000000..c7e1b3df816 --- /dev/null +++ b/docs/uk/flight_controller/aifoundry_erbium.md @@ -0,0 +1,44 @@ +# AIFoundry Erbium + + + + +:::warning +PX4 не розробляє цей (або будь-який інший) автопілот. +Contact the [manufacturer](https://github.com/aifoundry-org) for hardware support or compliance issues. +::: + +[Erbium](https://erbium.readthedocs.io/en/latest/) is an AIFoundry RISC-V chip whose design is [open source](https://github.com/aifoundry-org/erbium). +Its CPU subsystem has eight dual-threaded 64-bit [ET-Minion](https://erbium.readthedocs.io/en/latest/minion/) cores (RV64IMFC), derived from the Esperanto ET-SoC-1. +The PX4 target `aifoundry_erbium_default` runs NuttX on a single hart. + +## Development Status + +Erbium silicon is not yet available. +The target only runs on the `erbium_emu` system emulator from [ET-platform](https://github.com/aifoundry-org/et-platform), and has not been tested on hardware. + +The target has no sensor or actuator drivers. +It boots the [SIH](../sim_sih/index.md) quadcopter (airframe `1100`) and keeps parameters and dataman in RAM, so they are lost on reboot. +In the emulator it has been tested to pass the preflight checks, arm, and take off. + +The target is not built in PX4 CI, because the CI image does not include a RISC-V toolchain. + +## Building Firmware {#building_firmware} + +The build uses the `riscv-none-elf` toolchain ([xPack GNU RISC-V Embedded GCC](https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack), tested with 14.3.0-1). +Add its `bin` directory to `PATH`, then [build PX4](../dev_setup/building_px4.md) for this target: + +```sh +make aifoundry_erbium_default +``` + +## Running in the Emulator + +Build `erbium_emu` as described in the [NuttX Erbium Minion documentation](https://nuttx.apache.org/docs/latest/platforms/risc-v/erbium/boards/minion/index.html), then start PX4 with: + +```sh +erbium_emu -elf_load build/aifoundry_erbium_default/aifoundry_erbium_default.elf \ + -reset_pc 0x40000200 -single_thread -max_cycles 100000000000 +``` + +The NuttX shell runs on the emulator console. diff --git a/docs/uk/flight_controller/autopilot_experimental.md b/docs/uk/flight_controller/autopilot_experimental.md index 64cfa5f66df..f25b10c4d2d 100644 --- a/docs/uk/flight_controller/autopilot_experimental.md +++ b/docs/uk/flight_controller/autopilot_experimental.md @@ -12,6 +12,7 @@ For more information about PX4 project autopilot board support levels see: [px4. This category is for experimental autopilots (and autopilot "platforms") that are _not supported_ by either the PX4 project team or by a manufacturer. +- [AIFoundry Erbium](../flight_controller/aifoundry_erbium.md) - [BeagleBone Blue](../flight_controller/beaglebone_blue.md) - [Raspberry Pi 2/3 Navio2](../flight_controller/raspberry_pi_navio2.md) - [Raspberry Pi 2/3/4 PilotPi Shield](../flight_controller/raspberry_pi_pilotpi.md) diff --git a/docs/uk/flight_controller/beaglebone_blue.md b/docs/uk/flight_controller/beaglebone_blue.md index 3378da124d0..9c4920ef311 100644 --- a/docs/uk/flight_controller/beaglebone_blue.md +++ b/docs/uk/flight_controller/beaglebone_blue.md @@ -1,6 +1,6 @@ # BeagleBone Blue - +[](../flight_controller/autopilot_experimental.md) :::warning PX4 не розробляє цей (або будь-який інший) автопілот. diff --git a/docs/uk/flight_controller/raspberry_pi_navio2.md b/docs/uk/flight_controller/raspberry_pi_navio2.md index 0895eca249c..ccf50c0234f 100644 --- a/docs/uk/flight_controller/raspberry_pi_navio2.md +++ b/docs/uk/flight_controller/raspberry_pi_navio2.md @@ -1,6 +1,6 @@ # Автопілот Raspberry Pi 2/3/4 Navio2 - +[](../flight_controller/autopilot_experimental.md) :::warning PX4 не розробляє цей (або будь-який інший) автопілот. diff --git a/docs/uk/flight_controller/raspberry_pi_pilotpi.md b/docs/uk/flight_controller/raspberry_pi_pilotpi.md index cb6262b937c..c0845a64058 100644 --- a/docs/uk/flight_controller/raspberry_pi_pilotpi.md +++ b/docs/uk/flight_controller/raspberry_pi_pilotpi.md @@ -1,6 +1,6 @@ # RPi PilotPi Shield - +[](../flight_controller/autopilot_experimental.md) :::warning PX4 не розробляє цей (або будь-який інший) автопілот. diff --git a/docs/uk/flight_controller/spracingh7extreme.md b/docs/uk/flight_controller/spracingh7extreme.md index 4e8d0614e39..b81d59de713 100644 --- a/docs/uk/flight_controller/spracingh7extreme.md +++ b/docs/uk/flight_controller/spracingh7extreme.md @@ -2,10 +2,10 @@ :::warning PX4 не розробляє цей (або будь-який інший) автопілот. -Contact the [manufacturer](https://shop.seriouslypro.com) for hardware support or compliance issues. +Contact the [manufacturer](http://seriouslypro.com) for hardware support or compliance issues. ::: -The [SPRacingH7EXTREME](https://shop.seriouslypro.com/sp-racing-h7-extreme) is a feature packed FC/PDB with DUAL ICM20602 gyros, H7 400/480Mhz(+) CPU, high-precision BMP388 barometer, SD Card socket, current sensor, 8 easily accessible motor outputs, OSD, Microphone, Audio output, and more. +The [SPRacingH7EXTREME](http://seriouslypro.com/products/spracingh7extreme) is a feature packed FC/PDB with DUAL ICM20602 gyros, H7 400/480Mhz(+) CPU, high-precision BMP388 barometer, SD Card socket, current sensor, 8 easily accessible motor outputs, OSD, Microphone, Audio output, and more. Це може бути легко використовувати для невеликих і великих квадрокоптерів, літаків, восьмикоптерів та більш розвинених конструкцій. Найкраще використовувати з окремими ESC, оскільки він має вбудовану плату розподілу живлення (PDB). diff --git a/docs/uk/flight_modes_fw/guided_course.md b/docs/uk/flight_modes_fw/guided_course.md index 4d844ed30b2..ab80576429a 100644 --- a/docs/uk/flight_modes_fw/guided_course.md +++ b/docs/uk/flight_modes_fw/guided_course.md @@ -22,6 +22,7 @@ This mode is suited to situations where an operator wants to guide a fixed-wing ## Загальний огляд On activation, the vehicle captures its current velocity over ground vector as the initial course bearing and holds altitude and airspeed from the moment of activation. +A fixed-wing [Takeoff](../flight_modes_fw/takeoff.md) with a commanded course enters this mode directly after the climbout and continues on that course instead. The vehicle then flies that course indefinitely until the operator issues a new command. There is no waypoint sequencing or autonomous path planning: the GCS guides the vehicle in real time by sending individual commands. diff --git a/docs/uk/flight_modes_fw/mission.md b/docs/uk/flight_modes_fw/mission.md index ca29ea1cd31..ee21f9d26f5 100644 --- a/docs/uk/flight_modes_fw/mission.md +++ b/docs/uk/flight_modes_fw/mission.md @@ -68,8 +68,7 @@ The following requirements must be met to arm in this mode, or to switch to this 6. Місія скине тільки тоді, коли транспортний засіб буде роззброєний або коли буде завантажена нова місія. :::tip - Щоб автоматично роззброїти транспортний засіб після посадки, у _QGroundControl_ перейдіть до [Налаштування Транспортного Засобу > Безпека](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/safety.html), перейдіть до _Налаштувань Режиму Посадки_ та позначте прапорець _Роззброювати після_. - Введіть час очікування після посадки перед відброюванням транспортного засобу. + To automatically disarm the vehicle after it lands, in _QGroundControl_ go to [Vehicle Setup > Return & Land](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/px4/return_land.html#landing) and set the _Touchdown_ disarm delay (a value of 0 or less disables it). ::: diff --git a/docs/uk/flight_modes_fw/takeoff.md b/docs/uk/flight_modes_fw/takeoff.md index ab9ed0760cf..354086f8fef 100644 --- a/docs/uk/flight_modes_fw/takeoff.md +++ b/docs/uk/flight_modes_fw/takeoff.md @@ -2,7 +2,7 @@ -The _Takeoff_ flight mode causes the vehicle to take off to a specified height and then enter [Hold mode](../flight_modes_fw/takeoff.md). +The _Takeoff_ flight mode causes the vehicle to take off to a specified height and then enter [Hold mode](../flight_modes_fw/hold.md), or [Guided Course mode](../flight_modes_fw/guided_course.md) on a commanded course. Vehicles are [hand or catapult launched](#catapult-hand-launch) by default, but can also be [configured](#RWTO_TKOFF) to use a [runway takeoff](#runway-takeoff) when supported by the hardware. @@ -34,18 +34,25 @@ To use _Takeoff mode_ you first switch to the mode, and then arm the vehicle (or - Точкою виходу є позиція транспортного засобу, коли спочатку ввімкнений режим зльоту. - The course is set to the vehicle heading on arming by default. - If a valid waypoint latitude/longitude is set the vehicle will instead track towards the waypoint. + If a valid waypoint latitude/longitude is set, the vehicle will instead track towards the waypoint during the climbout. +- After the climbout the vehicle enters [Hold mode](../flight_modes_fw/hold.md). + If a course is set (`MAV_CMD_NAV_TAKEOFF` param4, or the same field of the [VehicleCommand](../msg_docs/VehicleCommand.md) uORB topic) it instead enters [Guided Course mode](../flight_modes_fw/guided_course.md) on that course. - The clearance altitude is set to [MIS_TAKEOFF_ALT](#MIS_TAKEOFF_ALT) by default. If a valid waypoint altitude is set is set the vehicle will instead use it as the clearance altitude. By default, on takeoff the aircraft will follow the line defined by the starting point and course, climbing at the maximum climb rate ([FW_T_CLMB_MAX](../advanced_config/parameter_reference.md#FW_T_CLMB_MAX)) until reaching the clearance altitude. -Reaching the clearance altitude causes the vehicle to enter [Hold mode](../flight_modes_fw/takeoff.md). +Reaching the clearance altitude causes the vehicle to enter [Hold mode](../flight_modes_fw/hold.md). [FW_TKO_CLMB_T](#FW_TKO_CLMB_T) ends the climbout after a fixed time instead. The vehicle holds at whatever altitude it has reached by then, or climbs to the clearance altitude if it is still below it. Use it where altitude is a poor measure of when the climbout is done, such as a rocket-assisted launch. -If a valid waypoint target is set, using `MAV_CMD_NAV_TAKEOFF` or the [VehicleCommand](../msg_docs/VehicleCommand.md) uORB topic, the vehicle will instead track towards the waypoint, and enter [Hold mode](../flight_modes_fw/takeoff.md) after reaching the waypoint altitude (within the acceptance radius). +If a valid waypoint target is set, using `MAV_CMD_NAV_TAKEOFF` or the [VehicleCommand](../msg_docs/VehicleCommand.md) uORB topic, the vehicle will instead track towards the waypoint, and enter [Hold mode](../flight_modes_fw/hold.md) after reaching the waypoint altitude (within the acceptance radius). + +If a course is set in `MAV_CMD_NAV_TAKEOFF` param4 (labelled _Yaw_ in MAVLink), the vehicle enters [Guided Course mode](../flight_modes_fw/guided_course.md) after the climbout instead of Hold mode. +It continues on that course over ground, at the same altitude Hold mode would use. +The climbout stays straight, and the turn onto the course comes after it. +A waypoint latitude/longitude takes precedence over the course. :::tip If the local position is invalid or becomes invalid while executing the takeoff, the controller is not able to track a course setpoint and will instead proceed climbing while keeping the wings level until the clearance altitude is reached. diff --git a/docs/uk/flight_modes_mc/hold.md b/docs/uk/flight_modes_mc/hold.md index de847836519..62c75dc4fe8 100644 --- a/docs/uk/flight_modes_mc/hold.md +++ b/docs/uk/flight_modes_mc/hold.md @@ -31,6 +31,12 @@ The vehicle will first ascend to [NAV_MIN_LTR_ALT](#NAV_MIN_LTR_ALT) if the mode Stick movement will change the vehicle to [Position mode](../flight_modes_mc/position.md) (by [default](#MAN_OVERRIDE_SPD)). +If a region of interest (ROI) location is set, for example with [MAV_CMD_DO_SET_ROI_LOCATION](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_SET_ROI_LOCATION), the vehicle yaws so that its nose points towards it. +The heading keeps tracking the ROI while the vehicle holds or repositions, and stops updating when the vehicle is within the acceptance radius of the ROI. +Clearing the ROI with [MAV_CMD_DO_SET_ROI_NONE](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_SET_ROI_NONE) leaves the vehicle at its last heading. +A [MAV_CMD_DO_REPOSITION](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_REPOSITION) with an explicit yaw sent after the ROI overrides ROI tracking until the next ROI command. +Set [MIS_MNT_YAW_CTL](#MIS_MNT_YAW_CTL) to yaw a gimbal towards the ROI instead of the vehicle. + ### Mode Requirements @@ -55,6 +61,7 @@ The following requirements must be met to arm in this mode, or to switch to this | [NAV_MIN_LTR_ALT](../advanced_config/parameter_reference.md#NAV_MIN_LTR_ALT) | Це мінімальна висота над домашньою позицією, яку система завжди буде дотримуватися в режимі утримання, якщо перемикається в цей режим без вказівки висоти (наприклад, за допомогою перемикача на дистанційному керуванні). | | [MAN_OVERRIDE_SPD](../advanced_config/parameter_reference.md#MAN_OVERRIDE_SPD) | Speed (normalized stick travel per second) above which moving the sticks controlling a multicopter (or VTOL in hover) gives control back to the pilot by switching to [Position mode](../flight_modes_mc/position.md) (or Altitude mode if position is unavailable). At the default value of 1 a half-stick movement in ~0.5 s triggers it; lower is more sensitive. A stick held statically has zero speed and will not trigger. Set to -1 to disable. | | [MPC_AUTO_NUDGING](../advanced_config/parameter_reference.md#MPC_AUTO_NUDGING) | Bitmask enabling stick nudging in Auto modes (multicopter). Bit 0 (yaw nudging) lets the yaw stick nudge heading in Hold, held when the stick is released; switching flight mode clears the held heading. Requires stick override to be disabled ([MAN_OVERRIDE_SPD](#MAN_OVERRIDE_SPD) = -1). | +| [MIS_MNT_YAW_CTL](../advanced_config/parameter_reference.md#MIS_MNT_YAW_CTL) | If disabled (default), the vehicle yaws towards an active ROI location. If enabled, the gimbal yaws towards the ROI and the vehicle keeps its heading. | diff --git a/docs/uk/flight_modes_mc/mission.md b/docs/uk/flight_modes_mc/mission.md index d1f700c2a35..36386c344ab 100644 --- a/docs/uk/flight_modes_mc/mission.md +++ b/docs/uk/flight_modes_mc/mission.md @@ -72,8 +72,7 @@ They may also be created by a MAVLink API such as [MAVSDK](../robotics/mavsdk.md 6. Місія скине тільки тоді, коли транспортний засіб буде роззброєний або коли буде завантажена нова місія. :::tip - Щоб автоматично роззброїти транспортний засіб після посадки, у _QGroundControl_ перейдіть до [Налаштування Транспортного Засобу > Безпека](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/safety.html), перейдіть до _Налаштувань Режиму Посадки_ та позначте прапорець _Роззброювати після_. - Введіть час очікування після посадки перед відброюванням транспортного засобу. + To automatically disarm the vehicle after it lands, in _QGroundControl_ go to [Vehicle Setup > Return & Land](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/px4/return_land.html#landing) and set the _Touchdown_ disarm delay (a value of 0 or less disables it). ::: diff --git a/docs/uk/frames_airship/index.md b/docs/uk/frames_airship/index.md index b46902f296b..f1052a15805 100644 --- a/docs/uk/frames_airship/index.md +++ b/docs/uk/frames_airship/index.md @@ -1,6 +1,6 @@ # Дирижаблі - +[](../airframes/index.md#experimental-vehicles) :::warning Support for airships is [experimental](../airframes/index.md#experimental-vehicles). diff --git a/docs/uk/frames_autogyro/index.md b/docs/uk/frames_autogyro/index.md index 4e2b176f6c6..9aa4fcce1cb 100644 --- a/docs/uk/frames_autogyro/index.md +++ b/docs/uk/frames_autogyro/index.md @@ -1,6 +1,6 @@ # Автогиро Каркаси - +[](../airframes/index.md#experimental-vehicles) :::warning Support for autogyro frames is [experimental](../airframes/index.md#experimental-vehicles). diff --git a/docs/uk/frames_balloon/index.md b/docs/uk/frames_balloon/index.md index 7806b11ac64..8affe1194eb 100644 --- a/docs/uk/frames_balloon/index.md +++ b/docs/uk/frames_balloon/index.md @@ -1,6 +1,6 @@ # Повітряні кулі - +[](../airframes/index.md#experimental-vehicles) :::warning Support for balloons is [experimental](../airframes/index.md#experimental-vehicles). diff --git a/docs/uk/frames_helicopter/index.md b/docs/uk/frames_helicopter/index.md index dd5359aaae5..b2452595c43 100644 --- a/docs/uk/frames_helicopter/index.md +++ b/docs/uk/frames_helicopter/index.md @@ -1,6 +1,6 @@ # Гелікоптери - +[](../airframes/index.md#experimental-vehicles) :::warning Support for helicopters is [experimental](../airframes/index.md#experimental-vehicles). diff --git a/docs/uk/frames_rover/index.md b/docs/uk/frames_rover/index.md index e7a7c2a32c2..dc029f2ef85 100644 --- a/docs/uk/frames_rover/index.md +++ b/docs/uk/frames_rover/index.md @@ -1,6 +1,6 @@ # Марсохід - +[](../airframes/index.md#experimental-vehicles) :::warning Support for rover is [experimental](../airframes/index.md#experimental-vehicles). diff --git a/docs/uk/frames_sub/index.md b/docs/uk/frames_sub/index.md index aa1ef6725de..476c03d3699 100644 --- a/docs/uk/frames_sub/index.md +++ b/docs/uk/frames_sub/index.md @@ -1,6 +1,6 @@ # Підводні човни (Безпілотна Підводна Техніка- UUV) - +[](../airframes/index.md#experimental-vehicles) :::warning Support for UUVs is [experimental](../airframes/index.md#experimental-vehicles). diff --git a/docs/uk/mavlink/receiving_messages.md b/docs/uk/mavlink/receiving_messages.md index d539175c204..6519358d10e 100644 --- a/docs/uk/mavlink/receiving_messages.md +++ b/docs/uk/mavlink/receiving_messages.md @@ -70,6 +70,13 @@ Above we only write to the battery fields that are defined in the topic. На практиці ви оновлювали б всі поля або з дійсними, або з недійсними значеннями: це було скорочено для стислості. ::: +:::tip +If the message has a `target_system` field, don't compare the decoded field with `mavlink_system.sysid` directly. +MAVLink system IDs can be 32 bit: a target above 255 is sent in a header extension and the 8-bit payload field only holds 255. +Use `mavlink_target_system(msg, decoded.target_system)` to get the full target instead. +When sending a message to a system, use `mavlink_msg_send_struct_target()` instead of `mavlink_msg__send_struct()` so a target above 255 is not truncated. +::: + and finally make sure it is called in [MavlinkReceiver::handle_message()](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/mavlink/mavlink_receiver.cpp#L228) ```cpp diff --git a/docs/uk/mavlink/standard_modes.md b/docs/uk/mavlink/standard_modes.md index 5b47d3091c8..57ee24df487 100644 --- a/docs/uk/mavlink/standard_modes.md +++ b/docs/uk/mavlink/standard_modes.md @@ -121,7 +121,7 @@ PX4 supports these commands for changing modes on some vehicle types: - [MAV_CMD_DO_ORBIT](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT) — MC Orbit mode - [MAV_CMD_NAV_VTOL_TAKEOFF](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_VTOL_TAKEOFF) — VTOL specific takeoff mode - [MAV_CMD_DO_REPOSITION](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_REPOSITION) -- [MAV_CMD_MISSION_START](https://mavlink.io/en/messages/common.html#MAV_CMD_MISSION_START) — Starts a mission. +- [MAV_CMD_MISSION_START](https://mavlink.io/en/messages/common.html#MAV_CMD_MISSION_START) — Starts a mission (does not arm the vehicle). Note that these commands predate "standard modes" and are mapped to vehicle-specific custom modes. What that means is that even though the standard mode may be applicable to multiple vehicle types, the mode may only work for particular vehicles. diff --git a/docs/uk/middleware/dds_topics.md b/docs/uk/middleware/dds_topics.md index 71878a3c6d9..2fe92deade9 100644 --- a/docs/uk/middleware/dds_topics.md +++ b/docs/uk/middleware/dds_topics.md @@ -72,6 +72,7 @@ This document shows a markdown-rendered version of [dds_topics.yaml](https://git | `/fmu/in/rover_speed_setpoint` | [px4_msgs::msg::RoverSpeedSetpoint](../msg_docs/RoverSpeedSetpoint.md) | | `/fmu/in/rover_steering_setpoint` | [px4_msgs::msg::RoverSteeringSetpoint](../msg_docs/RoverSteeringSetpoint.md) | | `/fmu/in/rover_throttle_setpoint` | [px4_msgs::msg::RoverThrottleSetpoint](../msg_docs/RoverThrottleSetpoint.md) | +| `/fmu/in/sensor_gnss` | [px4_msgs::msg::SensorGnss](../msg_docs/SensorGnss.md) | | `/fmu/in/sensor_optical_flow` | [px4_msgs::msg::SensorOpticalFlow](../msg_docs/SensorOpticalFlow.md) | | `/fmu/in/setpoint_config` | [px4_msgs::msg::SetpointConfig](../msg_docs/SetpointConfig.md) | | `/fmu/in/telemetry_status` | [px4_msgs::msg::TelemetryStatus](../msg_docs/TelemetryStatus.md) | @@ -208,6 +209,7 @@ See messages - [MagWorkerData](../msg_docs/MagWorkerData.md) - [MagnetometerBiasEstimate](../msg_docs/MagnetometerBiasEstimate.md) - [ManualControlSetpointV0](../msg_docs/ManualControlSetpointV0.md) +- [ManualControlSetpointV1](../msg_docs/ManualControlSetpointV1.md) - [ManualControlSwitches](../msg_docs/ManualControlSwitches.md) - [MavlinkLog](../msg_docs/MavlinkLog.md) - [MavlinkTunnel](../msg_docs/MavlinkTunnel.md) @@ -270,7 +272,6 @@ See messages - [SensorAirflow](../msg_docs/SensorAirflow.md) - [SensorBaro](../msg_docs/SensorBaro.md) - [SensorCorrection](../msg_docs/SensorCorrection.md) -- [SensorGnss](../msg_docs/SensorGnss.md) - [SensorGnssRelative](../msg_docs/SensorGnssRelative.md) - [SensorGnssRf](../msg_docs/SensorGnssRf.md) - [SensorGnssSpectrum](../msg_docs/SensorGnssSpectrum.md) @@ -305,6 +306,8 @@ See messages - [VehicleAngularVelocity](../msg_docs/VehicleAngularVelocity.md) - [VehicleAttitudeSetpointV0](../msg_docs/VehicleAttitudeSetpointV0.md) - [VehicleCommandAckV0](../msg_docs/VehicleCommandAckV0.md) +- [VehicleCommandAckV1](../msg_docs/VehicleCommandAckV1.md) +- [VehicleCommandV0](../msg_docs/VehicleCommandV0.md) - [VehicleConstraints](../msg_docs/VehicleConstraints.md) - [VehicleGlobalPositionV0](../msg_docs/VehicleGlobalPositionV0.md) - [VehicleGnssHeading](../msg_docs/VehicleGnssHeading.md) @@ -320,6 +323,7 @@ See messages - [VehicleStatusV1](../msg_docs/VehicleStatusV1.md) - [VehicleStatusV2](../msg_docs/VehicleStatusV2.md) - [VehicleStatusV3](../msg_docs/VehicleStatusV3.md) +- [VehicleStatusV4](../msg_docs/VehicleStatusV4.md) - [VelocityLimits](../msg_docs/VelocityLimits.md) - [VteAidSource1d](../msg_docs/VteAidSource1d.md) - [VteAidSource3d](../msg_docs/VteAidSource3d.md) diff --git a/docs/uk/modules/modules_driver.md b/docs/uk/modules/modules_driver.md index 4fcace356b7..4528f391ca8 100644 --- a/docs/uk/modules/modules_driver.md +++ b/docs/uk/modules/modules_driver.md @@ -1123,7 +1123,7 @@ px4io [arguments...] ## rgbled -Source: [drivers/lights/rgbled_ncp5623c](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/lights/rgbled_ncp5623c) +Source: [drivers/lights/rgbled](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/lights/rgbled) ### Usage {#rgbled_usage} @@ -1140,9 +1140,7 @@ rgbled [arguments...] [-f ] bus frequency in kHz [-q] quiet startup (no message if no device found) [-a ] I2C address - default: 57 - [-o ] RGB PWM Assignment - default: 123 + default: 85 stop diff --git a/docs/uk/msg_docs/CameraStatus.md b/docs/uk/msg_docs/CameraStatus.md index a4e456c2eef..656586c296d 100644 --- a/docs/uk/msg_docs/CameraStatus.md +++ b/docs/uk/msg_docs/CameraStatus.md @@ -11,7 +11,7 @@ pageClass: is-wide-page | Назва | Тип | Unit [Frame] | Range/Enum | Опис | | --------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------- | ---------- | --------------------------------------------------------- | | timestamp | `uint64` | | | time since system start (microseconds) | -| active_sys_id | `uint8` | | | mavlink system id of the currently active camera | +| active_sys_id | `uint32` | | | mavlink system id of the currently active camera | | active_comp_id | `uint8` | | | mavlink component id of currently active camera | ## Source Message @@ -24,7 +24,7 @@ Click here to see original file ```c uint64 timestamp # time since system start (microseconds) -uint8 active_sys_id # mavlink system id of the currently active camera +uint32 active_sys_id # mavlink system id of the currently active camera uint8 active_comp_id # mavlink component id of currently active camera ``` diff --git a/docs/uk/msg_docs/DatamanRequest.md b/docs/uk/msg_docs/DatamanRequest.md index f6ffc9d476f..17c2f6c5064 100644 --- a/docs/uk/msg_docs/DatamanRequest.md +++ b/docs/uk/msg_docs/DatamanRequest.md @@ -11,7 +11,7 @@ pageClass: is-wide-page | Назва | Тип | Unit [Frame] | Range/Enum | Опис | | -------------------------------------------------------------- | ----------- | ---------------------------------------------------------------- | ---------- | --------------------------------------------------------- | | timestamp | `uint64` | | | time since system start (microseconds) | -| client_id | `uint8` | | | | +| client_id | `uint16` | | | | | request_type | `uint8` | | | id/read/write/clear | | item | `uint8` | | | dm_item_t | | index | `uint32` | | | | @@ -28,7 +28,7 @@ Click here to see original file ```c uint64 timestamp # time since system start (microseconds) -uint8 client_id +uint16 client_id uint8 request_type # id/read/write/clear uint8 item # dm_item_t uint32 index diff --git a/docs/uk/msg_docs/DatamanResponse.md b/docs/uk/msg_docs/DatamanResponse.md index cf1756a2d29..6d560878238 100644 --- a/docs/uk/msg_docs/DatamanResponse.md +++ b/docs/uk/msg_docs/DatamanResponse.md @@ -11,7 +11,7 @@ pageClass: is-wide-page | Назва | Тип | Unit [Frame] | Range/Enum | Опис | | -------------------------------------------------------------- | ----------- | ---------------------------------------------------------------- | ---------- | --------------------------------------------------------- | | timestamp | `uint64` | | | time since system start (microseconds) | -| client_id | `uint8` | | | | +| client_id | `uint16` | | | | | request_type | `uint8` | | | id/read/write/clear | | item | `uint8` | | | dm_item_t | | index | `uint32` | | | | @@ -39,7 +39,7 @@ Click here to see original file ```c uint64 timestamp # time since system start (microseconds) -uint8 client_id +uint16 client_id uint8 request_type # id/read/write/clear uint8 item # dm_item_t uint32 index diff --git a/docs/uk/msg_docs/DeviceInformation.md b/docs/uk/msg_docs/DeviceInformation.md index 68b1c2f9a26..528412b2aad 100644 --- a/docs/uk/msg_docs/DeviceInformation.md +++ b/docs/uk/msg_docs/DeviceInformation.md @@ -15,10 +15,10 @@ as well as tracking of the used firmware versions on the devices. | Назва | Тип | Unit [Frame] | Range/Enum | Опис | | ---------------------------------------------------------------------- | ---------- | ---------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| timestamp | `uint64` | | | time since system start (microseconds) | +| timestamp | `uint64` | us | | Time since system start | | device_type | `uint8` | | [DEVICE_TYPE](#DEVICE_TYPE) | Type of the device. Matches MAVLink DEVICE_TYPE enum | | name | `char[80]` | | | Name of device e.g. DroneCAN node name | -| | `uint32` | | | Unique device ID for the sensor. Does not change between power cycles. (Invalid: 0 if not available) | +| device_id | `uint32` | | | Unique device ID for the sensor. Does not change between power cycles. (Invalid: 0 if not available) | | firmware_version | `char[24]` | | | Firmware version. (Invalid: empty if not available) | | hardware_version | `char[24]` | | | Hardware version. (Invalid: empty if not available) | | serial_number | `char[33]` | | | Device serial number or unique identifier. (Invalid: empty if not available) | @@ -65,7 +65,7 @@ Click here to see original file # Can be used to uniquely associate a device_id from a sensor topic with a physical device using serial number. # as well as tracking of the used firmware versions on the devices. -uint64 timestamp # time since system start (microseconds) +uint64 timestamp # [us] Time since system start uint8 device_type # [@enum DEVICE_TYPE] Type of the device. Matches MAVLink DEVICE_TYPE enum uint8 DEVICE_TYPE_GENERIC = 0 # Generic/unknown sensor @@ -92,10 +92,10 @@ uint8 DEVICE_TYPE_STEREO_CAMERA = 19 # stereo/depth camera char[80] name # Name of device e.g. DroneCAN node name -uint32 device_id # [-] [@invalid 0 if not available] Unique device ID for the sensor. Does not change between power cycles. -char[24] firmware_version # [-] [@invalid empty if not available] Firmware version. -char[24] hardware_version # [-] [@invalid empty if not available] Hardware version. -char[33] serial_number # [-] [@invalid empty if not available] Device serial number or unique identifier. +uint32 device_id # [-] [@invalid 0 if not available] Unique device ID for the sensor. Does not change between power cycles. +char[24] firmware_version # [-] [@invalid empty if not available] Firmware version. +char[24] hardware_version # [-] [@invalid empty if not available] Hardware version. +char[33] serial_number # [-] [@invalid empty if not available] Device serial number or unique identifier. ``` ::: diff --git a/docs/uk/msg_docs/ManualControlSetpoint.md b/docs/uk/msg_docs/ManualControlSetpoint.md index 17a45a152ef..1e2b4468531 100644 --- a/docs/uk/msg_docs/ManualControlSetpoint.md +++ b/docs/uk/msg_docs/ManualControlSetpoint.md @@ -26,7 +26,7 @@ The message includes fields for the roll, pitch, yaw, throttle and flaps, along | timestamp_sample | `uint64` | | | the timestamp of the raw data (microseconds) | | valid | `bool` | | | | | data_source | `uint8` | | | | -| source_system_id | `uint8` | | | MAVLink system ID of the manual control source (Invalid: 0) | +| source_system_id | `uint32` | | | MAVLink system ID of the manual control source (Invalid: 0) | | source_component_id | `uint8` | | | MAVLink component ID of the manual control source (Invalid: 0) | | roll | `float32` | | | move right, positive roll rotation, right side down | | pitch | `float32` | | | move forward, negative pitch rotation, nose down | @@ -46,7 +46,7 @@ The message includes fields for the roll, pitch, yaw, throttle and flaps, along | Назва | Тип | Значення | Опис | | ----------------------------------------------------------------------------------------- | -------- | -------- | ---------------------------------------------------------------- | -| MESSAGE_VERSION | `uint32` | 1 | | +| MESSAGE_VERSION | `uint32` | 2 | | | SOURCE_UNKNOWN | `uint8` | 0 | | | SOURCE_RC | `uint8` | 1 | radio control (input_rc) | | SOURCE_MAVLINK_0 | `uint8` | 2 | mavlink instance 0 | @@ -76,7 +76,7 @@ Click here to see original file # # The message includes fields for the roll, pitch, yaw, throttle and flaps, along with auxiliary channels and button states. -uint32 MESSAGE_VERSION = 1 +uint32 MESSAGE_VERSION = 2 uint64 timestamp # time since system start (microseconds) uint64 timestamp_sample # the timestamp of the raw data (microseconds) @@ -93,7 +93,7 @@ uint8 SOURCE_MAVLINK_4 = 6 # mavlink instance 4 uint8 SOURCE_MAVLINK_5 = 7 # mavlink instance 5 uint8 data_source -uint8 source_system_id # [@invalid 0] MAVLink system ID of the manual control source +uint32 source_system_id # [@invalid 0] MAVLink system ID of the manual control source uint8 source_component_id # [@invalid 0] MAVLink component ID of the manual control source # Any of the channels may not be available and be set to NaN diff --git a/docs/uk/msg_docs/ManualControlSetpointV1.md b/docs/uk/msg_docs/ManualControlSetpointV1.md new file mode 100644 index 00000000000..db0af67bdbb --- /dev/null +++ b/docs/uk/msg_docs/ManualControlSetpointV1.md @@ -0,0 +1,131 @@ +--- +pageClass: is-wide-page +--- + +# ManualControlSetpointV1 (UORB message) + +Manual control input. + +This message provides a representation of manual control input sources, +such as RC controllers and MAVLink controller (Joystick). + +It defines the `manual_control_input` topic to represent each configured input, +and the `manual_control_setpoint` topic to represent the input that is currently +in charge of the vehicle (based on parameter COM_RC_IN_MODE). +`manual_control_setpoint` is the topic that is published to the controllers. + +The message includes fields for the roll, pitch, yaw, throttle and flaps, along with auxiliary channels and button states. + +**TOPICS:** manual_control_setpoint manual_control_input + +## Fields + +| Назва | Тип | Unit [Frame] | Range/Enum | Опис | +| ------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------- | +| timestamp | `uint64` | | | time since system start (microseconds) | +| timestamp_sample | `uint64` | | | the timestamp of the raw data (microseconds) | +| valid | `bool` | | | | +| data_source | `uint8` | | | | +| source_system_id | `uint8` | | | MAVLink system ID of the manual control source (Invalid: 0) | +| source_component_id | `uint8` | | | MAVLink component ID of the manual control source (Invalid: 0) | +| roll | `float32` | | | move right, positive roll rotation, right side down | +| pitch | `float32` | | | move forward, negative pitch rotation, nose down | +| yaw | `float32` | | | positive yaw rotation, clockwise when seen top down | +| throttle | `float32` | | | move up, positive thrust, -1 is minimum available 0% or -100% +1 is 100% thrust | +| flaps | `float32` | | | position of flaps switch/knob/lever [-1, 1] | +| aux1 | `float32` | | | | +| aux2 | `float32` | | | | +| aux3 | `float32` | | | | +| aux4 | `float32` | | | | +| aux5 | `float32` | | | | +| aux6 | `float32` | | | | +| sticks_moving | `bool` | | | manual control override request in an auto or offboard mode, only gets true if feature is enabled | +| buttons | `uint16` | | | From uint16 buttons field of Mavlink manual_control message | + +## Constants + +| Назва | Тип | Значення | Опис | +| ----------------------------------------------------------------------------------------- | -------- | -------- | ---------------------------------------------------------------- | +| MESSAGE_VERSION | `uint32` | 1 | | +| SOURCE_UNKNOWN | `uint8` | 0 | | +| SOURCE_RC | `uint8` | 1 | radio control (input_rc) | +| SOURCE_MAVLINK_0 | `uint8` | 2 | mavlink instance 0 | +| SOURCE_MAVLINK_1 | `uint8` | 3 | mavlink instance 1 | +| SOURCE_MAVLINK_2 | `uint8` | 4 | mavlink instance 2 | +| SOURCE_MAVLINK_3 | `uint8` | 5 | mavlink instance 3 | +| SOURCE_MAVLINK_4 | `uint8` | 6 | mavlink instance 4 | +| SOURCE_MAVLINK_5 | `uint8` | 7 | mavlink instance 5 | + +## Source Message + +[Source file (GitHub)](https://github.com/PX4/PX4-Autopilot/blob/main/msg/px4_msgs_old/msg/ManualControlSetpointV1.msg) + +:::details +Click here to see original file + +```c +# Manual control input +# +# This message provides a representation of manual control input sources, +# such as RC controllers and MAVLink controller (Joystick). +# +# It defines the `manual_control_input` topic to represent each configured input, +# and the `manual_control_setpoint` topic to represent the input that is currently +# in charge of the vehicle (based on parameter COM_RC_IN_MODE). +# `manual_control_setpoint` is the topic that is published to the controllers. +# +# The message includes fields for the roll, pitch, yaw, throttle and flaps, along with auxiliary channels and button states. + +uint32 MESSAGE_VERSION = 1 + +uint64 timestamp # time since system start (microseconds) +uint64 timestamp_sample # the timestamp of the raw data (microseconds) + +bool valid + +uint8 SOURCE_UNKNOWN = 0 +uint8 SOURCE_RC = 1 # radio control (input_rc) +uint8 SOURCE_MAVLINK_0 = 2 # mavlink instance 0 +uint8 SOURCE_MAVLINK_1 = 3 # mavlink instance 1 +uint8 SOURCE_MAVLINK_2 = 4 # mavlink instance 2 +uint8 SOURCE_MAVLINK_3 = 5 # mavlink instance 3 +uint8 SOURCE_MAVLINK_4 = 6 # mavlink instance 4 +uint8 SOURCE_MAVLINK_5 = 7 # mavlink instance 5 + +uint8 data_source +uint8 source_system_id # [@invalid 0] MAVLink system ID of the manual control source +uint8 source_component_id # [@invalid 0] MAVLink component ID of the manual control source + +# Any of the channels may not be available and be set to NaN +# to indicate that it does not contain valid data. + +# Stick positions [-1,1] +# on a common RC mode 1/2/3/4 remote/joystick the stick deflection: -1 is down/left, 1 is up/right +# Note: QGC sends throttle/z in range [0,1000] - [0,1]. The MAVLink input conversion [0,1] to [-1,1] is at the moment kept backwards compatible. +# Positive values are generally used for: +float32 roll # move right, positive roll rotation, right side down +float32 pitch # move forward, negative pitch rotation, nose down +float32 yaw # positive yaw rotation, clockwise when seen top down +float32 throttle # move up, positive thrust, -1 is minimum available 0% or -100% +1 is 100% thrust + +float32 flaps # position of flaps switch/knob/lever [-1, 1] + +float32 aux1 +float32 aux2 +float32 aux3 +float32 aux4 +float32 aux5 +float32 aux6 + +bool sticks_moving # manual control override request in an auto or offboard mode, only gets true if feature is enabled + +uint16 buttons # From uint16 buttons field of Mavlink manual_control message + +# TOPICS manual_control_setpoint manual_control_input +# DEPRECATED: float32 x +# DEPRECATED: float32 y +# DEPRECATED: float32 z +# DEPRECATED: float32 r +``` + +::: diff --git a/docs/uk/msg_docs/MavlinkTunnel.md b/docs/uk/msg_docs/MavlinkTunnel.md index e9221020f9d..c841d3bc70b 100644 --- a/docs/uk/msg_docs/MavlinkTunnel.md +++ b/docs/uk/msg_docs/MavlinkTunnel.md @@ -14,7 +14,7 @@ MAV_TUNNEL_PAYLOAD_TYPE enum. | ---------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | timestamp | `uint64` | | | Time since system start (microseconds) | | payload_type | `uint16` | | | A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. | -| target_system | `uint8` | | | System ID (can be 0 for broadcast, but this is discouraged) | +| target_system | `uint32` | | | System ID (can be 0 for broadcast, but this is discouraged) | | target_component | `uint8` | | | Component ID (can be 0 for broadcast, but this is discouraged) | | payload_length | `uint8` | | | Length of the data transported in payload | | payload | `uint8[128]` | | | Data itself | @@ -59,7 +59,7 @@ uint8 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209 # Registered for STorM3 uint64 timestamp # Time since system start (microseconds) uint16 payload_type # A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. -uint8 target_system # System ID (can be 0 for broadcast, but this is discouraged) +uint32 target_system # System ID (can be 0 for broadcast, but this is discouraged) uint8 target_component # Component ID (can be 0 for broadcast, but this is discouraged) uint8 payload_length # Length of the data transported in payload uint8[128] payload # Data itself diff --git a/docs/uk/msg_docs/Ping.md b/docs/uk/msg_docs/Ping.md index bbd0251aeef..f0dff5db33e 100644 --- a/docs/uk/msg_docs/Ping.md +++ b/docs/uk/msg_docs/Ping.md @@ -15,7 +15,7 @@ pageClass: is-wide-page | ping_sequence | `uint32` | | | Sequence number of the ping packet | | dropped_packets | `uint32` | | | Number of dropped ping packets | | rtt_ms | `float32` | | | Round trip time (in ms) | -| system_id | `uint8` | | | System ID of the remote system | +| system_id | `uint32` | | | System ID of the remote system | | component_id | `uint8` | | | Component ID of the remote system | ## Source Message @@ -31,7 +31,7 @@ uint64 ping_time # Timestamp of the ping packet uint32 ping_sequence # Sequence number of the ping packet uint32 dropped_packets # Number of dropped ping packets float32 rtt_ms # Round trip time (in ms) -uint8 system_id # System ID of the remote system +uint32 system_id # System ID of the remote system uint8 component_id # Component ID of the remote system ``` diff --git a/docs/uk/msg_docs/SensorsStatusGnss.md b/docs/uk/msg_docs/SensorsStatusGnss.md index d3386578cfc..e7ffa650621 100644 --- a/docs/uk/msg_docs/SensorsStatusGnss.md +++ b/docs/uk/msg_docs/SensorsStatusGnss.md @@ -18,9 +18,11 @@ Published by the sensors module. Describes the latest sample of each receiver: t | device_id_selected | `uint32` | | | Receiver that vehicle_gnss carries | | device_ids | `uint32[4]` | | | One entry per receiver, 0 where unused | | order | `int8[4]` | | | Fixed position of the receiver: 0 for the preferred one, otherwise for the first to publish, then in order of first publication. Changes only with the preference, -1 until the receiver publishes | -| healthy | `bool[4]` | | | Publishing, and has passed its checks for long enough | -| failed_checks | `uint16[4]` | | | Bitmask of the enabled checks that failed, VehicleGnss CHECK\_\* bits | -| strict | `bool[4]` | | | The pre-flight thresholds apply rather than the relaxed in-flight ones | +| healthy | `bool[4]` | | | Usable within the last 2 s: passed its checks for long enough and published without gaps. The selection fails over from a receiver that isn't | +| availability | `float32[4]` | | | Fraction of recent time the receiver passed its checks and published without gaps, 0 to 1 | +| failed_strict_checks | `uint16[4]` | | | Enabled checks the latest sample fails at the strict thresholds, VehicleGnss CHECK\_\* bits | +| failed_relaxed_checks | `uint16[4]` | | | Enabled checks the latest sample fails at the relaxed thresholds, VehicleGnss CHECK\_\* bits | +| strict | `bool[4]` | | | The strict checks decide whether its samples are usable, as VehicleGnss strict | | drift_rate_horizontal | `float32[4]` | m/s | | Horizontal position drift rate at rest | | drift_rate_vertical | `float32[4]` | m/s | | Vertical position drift rate at rest | | speed_horizontal_filtered | `float32[4]` | m/s | | Filtered horizontal speed at rest | @@ -51,9 +53,11 @@ uint8 MAX_RECEIVERS = 4 # Length of the per-receiver arrays uint32[4] device_ids # [-] One entry per receiver, 0 where unused int8[4] order # [-] Fixed position of the receiver: 0 for the preferred one, otherwise for the first to publish, then in order of first publication. Changes only with the preference, -1 until the receiver publishes -bool[4] healthy # Publishing, and has passed its checks for long enough -uint16[4] failed_checks # [-] Bitmask of the enabled checks that failed, VehicleGnss CHECK_* bits -bool[4] strict # The pre-flight thresholds apply rather than the relaxed in-flight ones +bool[4] healthy # Usable within the last 2 s: passed its checks for long enough and published without gaps. The selection fails over from a receiver that isn't +float32[4] availability # [-] Fraction of recent time the receiver passed its checks and published without gaps, 0 to 1 +uint16[4] failed_strict_checks # [-] Enabled checks the latest sample fails at the strict thresholds, VehicleGnss CHECK_* bits +uint16[4] failed_relaxed_checks # [-] Enabled checks the latest sample fails at the relaxed thresholds, VehicleGnss CHECK_* bits +bool[4] strict # The strict checks decide whether its samples are usable, as VehicleGnss strict float32[4] drift_rate_horizontal # [m/s] Horizontal position drift rate at rest float32[4] drift_rate_vertical # [m/s] Vertical position drift rate at rest float32[4] speed_horizontal_filtered # [m/s] Filtered horizontal speed at rest diff --git a/docs/uk/msg_docs/VehicleCommand.md b/docs/uk/msg_docs/VehicleCommand.md index 7abf2f8e50f..50ae1003828 100644 --- a/docs/uk/msg_docs/VehicleCommand.md +++ b/docs/uk/msg_docs/VehicleCommand.md @@ -21,9 +21,9 @@ Vehicle Command uORB повідомлення. Використовується | param6 | `float64` | | | Parameter 6, as defined by MAVLink uint16 VEHICLE_CMD enum. | | param7 | `float32` | | | Parameter 7, as defined by MAVLink uint16 VEHICLE_CMD enum. | | command | `uint32` | | | Command ID. | -| target_system | `uint8` | | | System which should execute the command. | +| target_system | `uint32` | | | System which should execute the command. | | target_component | `uint8` | | | Component which should execute the command, 0 for all components. | -| source_system | `uint8` | | | System sending the command. | +| source_system | `uint32` | | | System sending the command. | | source_component | `uint16` | | | Component / mode executor sending the command. | | confirmation | `uint8` | | | 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command). | | from_external | `bool` | | | | @@ -160,15 +160,15 @@ Land at location. Takeoff from ground / hand. -| Param | Units | Range/Enum | Опис | -| ----- | ----- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| 1 | | | Unused (FW pitch from FW_TKO_PITCH_MIN) | -| 2 | | | Unused | -| 3 | | | Unused | -| 4 | deg | [0 : 360] | Yaw angle in NED if yaw source available, ignored otherwise | -| 5 | | | Latitude (WGS-84) | -| 6 | | | Longitude (WGS-84) | -| 7 | m | | Altitude AMSL | +| Param | Units | Range/Enum | Опис | +| ----- | ----- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 1 | | | Unused (FW pitch from FW_TKO_PITCH_MIN) | +| 2 | | | Unused | +| 3 | | | Unused | +| 4 | deg | [0 : 360] | Multicopter: yaw angle in NED if yaw source available, ignored otherwise. Fixed-wing: course over ground to continue on in Guided Course mode after the climbout (only if no latitude/longitude is set), NaN = Hold mode | +| 5 | | | Latitude (WGS-84) | +| 6 | | | Longitude (WGS-84) | +| 7 | m | | Altitude AMSL | ### VEHICLE_CMD_NAV_PRECLAND (23) @@ -1624,7 +1624,7 @@ Change heading/course. param1: heading type (0=course-over-ground, 1=heading). p | Назва | Тип | Значення | Опис | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| MESSAGE_VERSION | `uint32` | 0 | | +| MESSAGE_VERSION | `uint32` | 1 | | | PREFLIGHT_CALIBRATION_TEMPERATURE_CALIBRATION | `uint16` | 3 | Param value for VEHICLE_CMD_PREFLIGHT_CALIBRATION to start temperature calibration. | | FUSION_SOURCE_GPS | `uint8` | 0 | GNSS (EKF2_GPS{i}\_CTRL, use instance param) | | FUSION_SOURCE_OF | `uint8` | 1 | Optical Flow (EKF2_OF_CTRL) | @@ -1706,7 +1706,7 @@ Click here to see original file # Vehicle Command uORB message. Used for commanding a mission / action / etc. # Follows the MAVLink COMMAND_INT / COMMAND_LONG definition -uint32 MESSAGE_VERSION = 0 +uint32 MESSAGE_VERSION = 1 uint64 timestamp # [us] Time since system start. @@ -1719,7 +1719,7 @@ uint16 VEHICLE_CMD_NAV_LOITER_TURNS = 18 # Loiter around this MISSION for X turn uint16 VEHICLE_CMD_NAV_LOITER_TIME = 19 # Loiter around this MISSION for time. |[s] Seconds (decimal)|Unused|Radius around MISSION [m]. If positive loiter clockwise, else counter-clockwise|Desired yaw angle.|Latitude|Longitude|Altitude| uint16 VEHICLE_CMD_NAV_RETURN_TO_LAUNCH = 20 # Return to launch location. |Unused|Unused|Unused|Unused|Unused|Unused|Unused| uint16 VEHICLE_CMD_NAV_LAND = 21 # Land at location. |Unused|Unused|Unused|Desired yaw angle.|Latitude|Longitude|Altitude| -uint16 VEHICLE_CMD_NAV_TAKEOFF = 22 # Takeoff from ground / hand. |Unused (FW pitch from FW_TKO_PITCH_MIN)|Unused|Unused|[deg] [@range 0,360] Yaw angle in NED if yaw source available, ignored otherwise|Latitude (WGS-84)|Longitude (WGS-84)|[m] Altitude AMSL| +uint16 VEHICLE_CMD_NAV_TAKEOFF = 22 # Takeoff from ground / hand. |Unused (FW pitch from FW_TKO_PITCH_MIN)|Unused|Unused|[deg] [@range 0,360] Multicopter: yaw angle in NED if yaw source available, ignored otherwise. Fixed-wing: course over ground to continue on in Guided Course mode after the climbout (only if no latitude/longitude is set), NaN = Hold mode|Latitude (WGS-84)|Longitude (WGS-84)|[m] Altitude AMSL| uint16 VEHICLE_CMD_NAV_PRECLAND = 23 # Attempt a precision landing. uint16 VEHICLE_CMD_DO_ORBIT = 34 # Start orbiting on the circumference of a circle defined by the parameters. |[m] Radius|[m/s] Velocity|[@enum ORBIT_YAW_BEHAVIOUR] Yaw behaviour|Unused|Latitude/X|Longitude/Y|Altitude/Z| uint16 VEHICLE_CMD_DO_FIGUREEIGHT = 35 # Start flying on the outline of a figure eight defined by the parameters. |[m] Major radius|[m] Minor radius|[m/s] Velocity|Orientation|Latitude/X|Longitude/Y|Altitude/Z| @@ -1947,9 +1947,9 @@ float64 param5 # Parameter 5, as defined by MAVLink uint16 VEHICLE_CMD enum. float64 param6 # Parameter 6, as defined by MAVLink uint16 VEHICLE_CMD enum. float32 param7 # Parameter 7, as defined by MAVLink uint16 VEHICLE_CMD enum. uint32 command # Command ID. -uint8 target_system # System which should execute the command. +uint32 target_system # System which should execute the command. uint8 target_component # Component which should execute the command, 0 for all components. -uint8 source_system # System sending the command. +uint32 source_system # System sending the command. uint16 source_component # Component / mode executor sending the command. uint8 confirmation # 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command). bool from_external diff --git a/docs/uk/msg_docs/VehicleCommandAck.md b/docs/uk/msg_docs/VehicleCommandAck.md index 20744586ae4..9daabbe8378 100644 --- a/docs/uk/msg_docs/VehicleCommandAck.md +++ b/docs/uk/msg_docs/VehicleCommandAck.md @@ -20,7 +20,7 @@ Follows the MAVLink COMMAND_ACK message definition | result | `uint8` | | [VEHICLE_CMD_RESULT](#VEHICLE_CMD_RESULT) | Command result | | result_param1 | `uint8` | | | Can be set with the reason why the command was denied, or the progress percentage when result is MAV_RESULT_IN_PROGRESS (%) | | result_param2 | `int32` | enum ARM_AUTH_DENIED_REASON | | Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied, or what ARM_AUTH_DENIED_REASON | -| target_system | `uint8` | | | Target system | +| target_system | `uint32` | | | Target system | | target_component | `uint16` | | | Target component / mode executor | | from_external | `bool` | | | Indicates if the command came from an external source | @@ -47,7 +47,7 @@ Used in field(s): [result](#fld_result) | Назва | Тип | Значення | Опис | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ---- | -| MESSAGE_VERSION | `uint32` | 1 | | +| MESSAGE_VERSION | `uint32` | 2 | | | ORB_QUEUE_LENGTH | `uint8` | 8 | | | ARM_AUTH_DENIED_REASON_GENERIC | `uint16` | 0 | | | ARM_AUTH_DENIED_REASON_NONE | `uint16` | 1 | | @@ -69,7 +69,7 @@ Click here to see original file # Used for acknowledging the vehicle command being received. # Follows the MAVLink COMMAND_ACK message definition -uint32 MESSAGE_VERSION = 1 +uint32 MESSAGE_VERSION = 2 uint64 timestamp # [us] time since system start @@ -101,7 +101,7 @@ uint16 ARM_AUTH_DENIED_REASON_TIMEOUT = 3 uint16 ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4 uint16 ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5 -uint8 target_system # [-] Target system +uint32 target_system # [-] Target system uint16 target_component # Target component / mode executor bool from_external # Indicates if the command came from an external source diff --git a/docs/uk/msg_docs/VehicleCommandAckV1.md b/docs/uk/msg_docs/VehicleCommandAckV1.md new file mode 100644 index 00000000000..fee8ea4a4e3 --- /dev/null +++ b/docs/uk/msg_docs/VehicleCommandAckV1.md @@ -0,0 +1,110 @@ +--- +pageClass: is-wide-page +--- + +# VehicleCommandAckV1 (UORB message) + +Vehicle Command Acknowledgement uORB message. + +Used for acknowledging the vehicle command being received. +Follows the MAVLink COMMAND_ACK message definition + +**TOPICS:** vehicle_command_ack_v1 + +## Fields + +| Назва | Тип | Unit [Frame] | Range/Enum | Опис | +| ---------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| timestamp | `uint64` | us | | time since system start | +| command | `uint32` | | | Command that is being acknowledged | +| result | `uint8` | | [VEHICLE_CMD_RESULT](#VEHICLE_CMD_RESULT) | Command result | +| result_param1 | `uint8` | | | Can be set with the reason why the command was denied, or the progress percentage when result is MAV_RESULT_IN_PROGRESS (%) | +| result_param2 | `int32` | enum ARM_AUTH_DENIED_REASON | | Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied, or what ARM_AUTH_DENIED_REASON | +| target_system | `uint8` | | | Target system | +| target_component | `uint16` | | | Target component / mode executor | +| from_external | `bool` | | | Indicates if the command came from an external source | + +## Enums + +### VEHICLE_CMD_RESULT {#VEHICLE_CMD_RESULT} + +Used in field(s): [result](#fld_result) + +| Назва | Тип | Значення | Опис | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------- | ------------------------------------------------------------------------- | +| VEHICLE_CMD_RESULT_ACCEPTED | `uint8` | 0 | Command ACCEPTED and EXECUTED | +| VEHICLE_CMD_RESULT_TEMPORARILY_REJECTED | `uint8` | 1 | Command TEMPORARY REJECTED/DENIED | +| VEHICLE_CMD_RESULT_DENIED | `uint8` | 2 | Command PERMANENTLY DENIED | +| VEHICLE_CMD_RESULT_UNSUPPORTED | `uint8` | 3 | Command UNKNOWN/UNSUPPORTED | +| VEHICLE_CMD_RESULT_FAILED | `uint8` | 4 | Command executed, but failed | +| VEHICLE_CMD_RESULT_IN_PROGRESS | `uint8` | 5 | Command being executed | +| VEHICLE_CMD_RESULT_CANCELLED | `uint8` | 6 | Command Canceled | +| VEHICLE_CMD_RESULT_COMMAND_LONG_ONLY | `uint8` | 7 | Command is only accepted when sent as a COMMAND_LONG | +| VEHICLE_CMD_RESULT_COMMAND_INT_ONLY | `uint8` | 8 | Command is only accepted when sent as a COMMAND_INT | +| VEHICLE_CMD_RESULT_UNSUPPORTED_MAV_FRAME | `uint8` | 9 | Command does not support specified frame | + +## Constants + +| Назва | Тип | Значення | Опис | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ---- | +| MESSAGE_VERSION | `uint32` | 1 | | +| ORB_QUEUE_LENGTH | `uint8` | 8 | | +| ARM_AUTH_DENIED_REASON_GENERIC | `uint16` | 0 | | +| ARM_AUTH_DENIED_REASON_NONE | `uint16` | 1 | | +| ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT | `uint16` | 2 | | +| ARM_AUTH_DENIED_REASON_TIMEOUT | `uint16` | 3 | | +| ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE | `uint16` | 4 | | +| ARM_AUTH_DENIED_REASON_BAD_WEATHER | `uint16` | 5 | | + +## Source Message + +[Source file (GitHub)](https://github.com/PX4/PX4-Autopilot/blob/main/msg/px4_msgs_old/msg/VehicleCommandAckV1.msg) + +:::details +Click here to see original file + +```c +# Vehicle Command Acknowledgement uORB message. +# +# Used for acknowledging the vehicle command being received. +# Follows the MAVLink COMMAND_ACK message definition + +uint32 MESSAGE_VERSION = 1 + +uint64 timestamp # [us] time since system start + +uint8 ORB_QUEUE_LENGTH = 8 + +uint32 command # [-] Command that is being acknowledged + +uint8 result # [@enum VEHICLE_CMD_RESULT] Command result +# VEHICLE_CMD_RESULT Result cases. Follows the MAVLink MAV_RESULT enum definition +uint8 VEHICLE_CMD_RESULT_ACCEPTED = 0 # Command ACCEPTED and EXECUTED +uint8 VEHICLE_CMD_RESULT_TEMPORARILY_REJECTED = 1 # Command TEMPORARY REJECTED/DENIED +uint8 VEHICLE_CMD_RESULT_DENIED = 2 # Command PERMANENTLY DENIED +uint8 VEHICLE_CMD_RESULT_UNSUPPORTED = 3 # Command UNKNOWN/UNSUPPORTED +uint8 VEHICLE_CMD_RESULT_FAILED = 4 # Command executed, but failed +uint8 VEHICLE_CMD_RESULT_IN_PROGRESS = 5 # Command being executed +uint8 VEHICLE_CMD_RESULT_CANCELLED = 6 # Command Canceled +uint8 VEHICLE_CMD_RESULT_COMMAND_LONG_ONLY = 7 # Command is only accepted when sent as a COMMAND_LONG +uint8 VEHICLE_CMD_RESULT_COMMAND_INT_ONLY = 8 # Command is only accepted when sent as a COMMAND_INT +uint8 VEHICLE_CMD_RESULT_UNSUPPORTED_MAV_FRAME = 9 # Command does not support specified frame + +uint8 result_param1 # [-] Can be set with the reason why the command was denied, or the progress percentage when result is MAV_RESULT_IN_PROGRESS (%) + +int32 result_param2 # [enum ARM_AUTH_DENIED_REASON] Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied, or what ARM_AUTH_DENIED_REASON +# Arming denied specific cases +uint16 ARM_AUTH_DENIED_REASON_GENERIC = 0 +uint16 ARM_AUTH_DENIED_REASON_NONE = 1 +uint16 ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2 +uint16 ARM_AUTH_DENIED_REASON_TIMEOUT = 3 +uint16 ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4 +uint16 ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5 + +uint8 target_system # [-] Target system +uint16 target_component # Target component / mode executor + +bool from_external # Indicates if the command came from an external source +``` + +::: diff --git a/docs/uk/msg_docs/VehicleCommandV0.md b/docs/uk/msg_docs/VehicleCommandV0.md new file mode 100644 index 00000000000..e5ad5a62dbd --- /dev/null +++ b/docs/uk/msg_docs/VehicleCommandV0.md @@ -0,0 +1,503 @@ +--- +pageClass: is-wide-page +--- + +# VehicleCommandV0 (UORB message) + +Vehicle Command uORB повідомлення. Використовується для управління місією / дією / тощо. Follows the MAVLink COMMAND_INT / COMMAND_LONG definition. + +**TOPICS:** vehicle_command gimbal_v1_command vehicle_command_mode_executor + +## Fields + +| Назва | Тип | Unit [Frame] | Range/Enum | Опис | +| ---------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| timestamp | `uint64` | us | | Time since system start. | +| param1 | `float32` | | | Parameter 1, as defined by MAVLink uint16 VEHICLE_CMD enum. | +| param2 | `float32` | | | Parameter 2, as defined by MAVLink uint16 VEHICLE_CMD enum. | +| param3 | `float32` | | | Parameter 3, as defined by MAVLink uint16 VEHICLE_CMD enum. | +| param4 | `float32` | | | Parameter 4, as defined by MAVLink uint16 VEHICLE_CMD enum. | +| param5 | `float64` | | | Parameter 5, as defined by MAVLink uint16 VEHICLE_CMD enum. | +| param6 | `float64` | | | Parameter 6, as defined by MAVLink uint16 VEHICLE_CMD enum. | +| param7 | `float32` | | | Parameter 7, as defined by MAVLink uint16 VEHICLE_CMD enum. | +| command | `uint32` | | | Command ID. | +| target_system | `uint8` | | | System which should execute the command. | +| target_component | `uint8` | | | Component which should execute the command, 0 for all components. | +| source_system | `uint8` | | | System sending the command. | +| source_component | `uint16` | | | Component / mode executor sending the command. | +| confirmation | `uint8` | | | 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command). | +| from_external | `bool` | | | | + +## Constants + +\| Name | Type | Value | Description | +\| --------------------------------------------------------------------------------------------------------------- | -------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------- | ---------------------------------------------------- | +\| MESSAGE_VERSION | `uint32` | 0 | +\| VEHICLE_CMD_CUSTOM_0 | `uint16` | 0 | Test command. | +\| VEHICLE_CMD_CUSTOM_1 | `uint16` | 1 | Test command. | +\| VEHICLE_CMD_CUSTOM_2 | `uint16` | 2 | Test command. | +\| VEHICLE_CMD_NAV_WAYPOINT | `uint16` | 16 | Navigate to MISSION. | [s] (decimal) Hold time. (ignored by fixed wing, time to stay at MISSION for rotary wing) | [m] Acceptance radius (if the sphere with this radius is hit, the MISSION counts as reached) | 0 to pass through the WP, if > 0 radius [m] to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control. | Desired yaw angle at MISSION (rotary wing) | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_NAV_LOITER_UNLIM | `uint16` | 17 | Loiter around this MISSION an unlimited amount of time. | Unused | Unused | [m] Radius around MISSION. If positive loiter clockwise, else counter-clockwise | Desired yaw angle. | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_NAV_LOITER_TURNS | `uint16` | 18 | Loiter around this MISSION for X turns. | Turns | Unused | Radius around MISSION [m]. If positive loiter clockwise, else counter-clockwise | Desired yaw angle. | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_NAV_LOITER_TIME | `uint16` | 19 | Loiter around this MISSION for time. | [s] Seconds (decimal) | Unused | Radius around MISSION [m]. If positive loiter clockwise, else counter-clockwise | Desired yaw angle. | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_NAV_RETURN_TO_LAUNCH | `uint16` | 20 | Return to launch location. | Unused | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_NAV_LAND | `uint16` | 21 | Land at location. | Unused | Unused | Unused | Desired yaw angle. | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_NAV_TAKEOFF | `uint16` | 22 | Takeoff from ground / hand. | Unused (FW pitch from FW_TKO_PITCH_MIN) | Unused | Unused | [deg] [@range 0,360] Yaw angle in NED if yaw source available, ignored otherwise | Latitude (WGS-84) | Longitude (WGS-84) | [m] Altitude AMSL | +\| VEHICLE_CMD_NAV_PRECLAND | `uint16` | 23 | Attempt a precision landing. | +\| VEHICLE_CMD_DO_ORBIT | `uint16` | 34 | Start orbiting on the circumference of a circle defined by the parameters. | [m] Radius | [m/s] Velocity | [@enum ORBIT_YAW_BEHAVIOUR] Yaw behaviour | Unused | Latitude/X | Longitude/Y | Altitude/Z | +\| VEHICLE_CMD_DO_FIGUREEIGHT | `uint16` | 35 | Start flying on the outline of a figure eight defined by the parameters. | [m] Major radius | [m] Minor radius | [m/s] Velocity | Orientation | Latitude/X | Longitude/Y | Altitude/Z | +\| VEHICLE_CMD_NAV_ROI | `uint16` | 80 | Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. | [@enum VEHICLE_ROI] Region of interest mode. | MISSION index/ target ID. | ROI index (allows a vehicle to manage multiple ROI's) | Unused | x the location of the fixed ROI (see MAV_FRAME) | y | z | +\| VEHICLE_CMD_NAV_PATHPLANNING | `uint16` | 81 | Control autonomous path planning on the MAV. | 0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning | 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid | Unused | [deg] [@range 0, 360] Yaw angle at goal, in compass degrees | Latitude/X of goal | Longitude/Y of goal | Altitude/Z of goal | +\| VEHICLE_CMD_NAV_VTOL_TAKEOFF | `uint16` | 84 | Takeoff from ground / hand and transition to fixed wing. | Minimum pitch (if airspeed sensor present), desired pitch without sensor | Transition heading, 0: Default, 3: Use specified transition heading | Unused | Yaw angle (if magnetometer present), ignored without magnetometer | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_NAV_VTOL_LAND | `uint16` | 85 | Transition to MC and land at location. | Unused | Unused | Unused | Desired yaw angle. | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_NAV_GUIDED_LIMITS | `uint16` | 90 | Set limits for external control. | [s] Timeout - maximum time that external controller will be allowed to control vehicle. 0 means no timeout | [m] Absolute altitude min AMSL - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit | [m] Absolute altitude max - if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit | [m] Horizontal move limit (AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit | Unused | Unused | Unused | +\| VEHICLE_CMD_NAV_GUIDED_MASTER | `uint16` | 91 | Set id of master controller. | System ID | Component ID | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_NAV_DELAY | `uint16` | 93 | Delay the next navigation command a number of seconds or until a specified time. | [s] Delay (decimal, -1 to enable time-of-day fields) | [h] hour (24h format, UTC, -1 to ignore) | minute (24h format, UTC, -1 to ignore) | second (24h format, UTC) | Unused | Unused | Unused | +\| VEHICLE_CMD_NAV_LAST | `uint16` | 95 | NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration. | Unused | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_CONDITION_DELAY | `uint16` | 112 | Delay mission state machine. | [s] Delay (decimal seconds) | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_CONDITION_CHANGE_ALT | `uint16` | 113 | Ascend/descend at rate. Delay mission state machine until desired altitude reached. | Descent / Ascend rate (m/s) | Unused | Unused | Unused | Unused | Unused | Finish Altitude | +\| VEHICLE_CMD_CONDITION_DISTANCE | `uint16` | 114 | Delay mission state machine until within desired distance of next NAV point. | Distance [m] | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_CONDITION_YAW | `uint16` | 115 | Reach a certain target angle. | [deg] [@range 0,360] Target angle. 0 is north | [deg/s] Speed during yaw change | [@range -1,1] Direction: negative: counter clockwise, positive: clockwise | [ 1,0] Relative offset or absolute angle | Unused | Unused | Unused | +\| VEHICLE_CMD_CONDITION_LAST | `uint16` | 159 | NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration. | Unused | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_CONDITION_GATE | `uint16` | 4501 | Wait until passing a threshold. | 2D coord mode: 0: Orthogonal to planned route | Altitude mode: 0: Ignore altitude | Unused | Unused | Lat | Lon | Alt | +\| VEHICLE_CMD_DO_SET_MODE | `uint16` | 176 | Set system mode. | Mode, as defined by ENUM MAV_MODE | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_JUMP | `uint16` | 177 | Jump to the desired command in the mission list. Repeat this action only the specified number of times. | Sequence number | Repeat count | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_CHANGE_SPEED | `uint16` | 178 | Change speed and/or throttle set points. | [@enum SPEED_TYPE] Speed type (0=Airspeed, 1=Ground Speed) | Speed (m/s, -1 indicates no change) | [%] Throttle ( Percent, -1 indicates no change) | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_SET_HOME | `uint16` | 179 | Changes the home location either to the current location or a specified location. | Use current (1=use current location, 0=use specified location) | Unused | Unused | Unused | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_DO_SET_PARAMETER | `uint16` | 180 | Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. | Parameter number | Parameter value | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_SET_RELAY | `uint16` | 181 | Set a relay to a condition. | Relay number | Setting (1=on, 0=off, others possible depending on system hardware) | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_REPEAT_RELAY | `uint16` | 182 | Cycle a relay on and off for a desired number of cycles with a desired period. | Relay number | Cycle count | [s] Cycle time (decimal seconds) | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_REPEAT_SERVO | `uint16` | 184 | Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. | Servo number | [us] PWM rate (1000 to 2000 typical) | Cycle count | [s] Cycle time | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_FLIGHTTERMINATION | `uint16` | 185 | Terminate flight immediately. | Flight termination activated if > 0.5 | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_CHANGE_ALTITUDE | `uint16` | 186 | Set the vehicle to Loiter mode and change the altitude to specified value. | Altitude | Frame of new altitude | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_SET_ACTUATOR | `uint16` | 187 | Sets actuators (e.g. servos) to a desired value. | Actuator 1 | Actuator 2 | Actuator 3 | Actuator 4 | Actuator 5 | Actuator 6 | Index | +\| VEHICLE_CMD_DO_LAND_START | `uint16` | 189 | Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. | Unused | Unused | Unused | Unused | Latitude | Longitude | Unused | +\| VEHICLE_CMD_DO_GO_AROUND | `uint16` | 191 | Mission command to safely abort an autonomous landing. | [m] Altitude | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_REPOSITION | `uint16` | 192 | Reposition to specific WGS84 GPS position. | [m/s] Ground speed | Bitmask | [m] Loiter radius for planes | [deg] Yaw | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_DO_PAUSE_CONTINUE | `uint16` | 193 | +\| VEHICLE_CMD_DO_SET_ROI_LOCATION | `uint16` | 195 | Sets the region of interest (ROI) to a location. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. | Unused | Unused | Unused | Unused | Latitude | Longitude | Altitude | +\| VEHICLE_CMD_DO_SET_ROI_WPNEXT_OFFSET | `uint16` | 196 | Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. | Unused | Unused | Unused | Unused | Pitch offset from next waypoint | Roll offset from next waypoint | Yaw offset from next waypoint | +\| VEHICLE_CMD_DO_SET_ROI_NONE | `uint16` | 197 | Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. | Unused | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_CONTROL_VIDEO | `uint16` | 200 | Control onboard camera system. | Camera ID (-1 for all) | Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw | Transmission mode: 0: video stream, >0: single images every n seconds (decimal seconds) | Recording: 0: disabled, 1: enabled compressed, 2: enabled raw | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_SET_ROI | `uint16` | 201 | Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. | [@enum VEHICLE_ROI] Region of interest mode. | MISSION index/ target ID. | ROI index (allows a vehicle to manage multiple ROI's) | Unused | x the location of the fixed ROI (see MAV_FRAME) | y | z | +\| VEHICLE_CMD_DO_DIGICAM_CONTROL | `uint16` | 203 | +\| VEHICLE_CMD_DO_MOUNT_CONFIGURE | `uint16` | 204 | Mission command to configure a camera or antenna mount. | [@enum MAV_MOUNT_MODE] Mount operation mode | Stabilize roll? (1 = yes, 0 = no) | Stabilize pitch? (1 = yes, 0 = no) | stabilize yaw? (1 = yes, 0 = no) | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_MOUNT_CONTROL | `uint16` | 205 | Mission command to control a camera or antenna mount. | [deg] Pitch or lat, depending on mount mode. | [deg] Roll or lon depending on mount mode | [deg]/[m] Yaw or alt depending on mount mode | Unused | Unused | Unused | [@enum MAV_MOUNT_MODE] | +\| VEHICLE_CMD_DO_SET_CAM_TRIGG_DIST | `uint16` | 206 | Mission command to set TRIG_DIST for this flight. | [m] Camera trigger distance | [ms] Shutter integration time | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_FENCE_ENABLE | `uint16` | 207 | Mission command to enable the geofence. | enable? (0=disable, 1=enable) | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_PARACHUTE | `uint16` | 208 | Mission command to trigger a parachute. | action [@enum PARACHUTE_ACTION] (0=disable, 1=enable, 2=release, for some systems see [@enum PARACHUTE_ACTION], not in general message set.) | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_MOTOR_TEST | `uint16` | 209 | Motor test command. | Instance (@range 1, ) | throttle type | throttle | timeout [s] | Motor count | Test order | Unused | +\| VEHICLE_CMD_DO_INVERTED_FLIGHT | `uint16` | 210 | Change to/from inverted flight. | inverted (0=normal, 1=inverted) | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_GRIPPER | `uint16` | 211 | Command to operate a gripper. | +\| VEHICLE_CMD_DO_AUTOTUNE_ENABLE | `uint16` | 212 | Enable autotune module. | 1 to enable | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_SET_CAM_TRIGG_INTERVAL | `uint16` | 214 | Mission command to set TRIG_INTERVAL for this flight. | [m] Camera trigger distance | Shutter integration time (ms) | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_MOUNT_CONTROL_QUAT | `uint16` | 220 | Mission command to control a camera or antenna mount, using a quaternion as reference. | q1 - quaternion param #1, w (1 in null-rotation) | q2 - quaternion param #2, x (0 in null-rotation) | q3 - quaternion param #3, y (0 in null-rotation) | q4 - quaternion param #4, z (0 in null-rotation) | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_GUIDED_MASTER | `uint16` | 221 | Set id of master controller. | System ID | Component ID | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_GUIDED_LIMITS | `uint16` | 222 | Set limits for external control. | [s] Timeout - maximum time that external controller will be allowed to control vehicle. 0 means no timeout | [m] Absolute altitude min(AMSL) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit | [m] Absolute altitude max - if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit | [m] Horizontal move limit (AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_SET_MISSION_CURRENT | `uint16` | 224 | Set the mission item with sequence number seq as current item and emit MISSION_CURRENT (whether or not the mission mode is active). ACKs FAILED if seq is out of range or there is no current mission item. | Mission sequence value to set, -1 for the current mission item (use to reset jump counters without changing the current item) | Reset repeat/jump counters and clear mission complete flag (1=true,0=false; default:0) | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_LAST | `uint16` | 240 | NOP - This command is only used to mark the upper limit of the DO commands in the enumeration. | Unused | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_PREFLIGHT_CALIBRATION | `uint16` | 241 | Trigger calibration. This command will be only accepted if in pre-flight mode. See MAVLink spec MAV_CMD_PREFLIGHT_CALIBRATION. | +\| PREFLIGHT_CALIBRATION_TEMPERATURE_CALIBRATION | `uint16` | 3 | Param value for VEHICLE_CMD_PREFLIGHT_CALIBRATION to start temperature calibration. | +\| VEHICLE_CMD_PREFLIGHT_SET_SENSOR_OFFSETS | `uint16` | 242 | Set sensor offsets. This command will be only accepted if in pre-flight mode. | Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow | X axis offset (or generic dimension 1), in the sensor's raw units | Y axis offset (or generic dimension 2), in the sensor's raw units | Z axis offset (or generic dimension 3), in the sensor's raw units | Generic dimension 4, in the sensor's raw units | Generic dimension 5, in the sensor's raw units | Generic dimension 6, in the sensor's raw units | +\| VEHICLE_CMD_PREFLIGHT_UAVCAN | `uint16` | 243 | UAVCAN configuration. If param 1 == 1 actuator mapping and direction assignment should be started. | +\| VEHICLE_CMD_PREFLIGHT_STORAGE | `uint16` | 245 | Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. | Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM | Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_PREFLIGHT_REBOOT_SHUTDOWN | `uint16` | 246 | Request the reboot or shutdown of system components. | 0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot. | 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer. | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_OBLIQUE_SURVEY | `uint16` | 260 | Mission command to set a Camera Auto Mount Pivoting Oblique Survey for this flight. | [m] Camera trigger distance | [ms] Shutter integration time | Camera minimum trigger interval | Number of positions | Roll | Pitch | Unused | +\| VEHICLE_CMD_DO_SET_STANDARD_MODE | `uint16` | 262 | Enable the specified standard MAVLink mode. | MAV_STANDARD_MODE | +\| VEHICLE_CMD_GIMBAL_DEVICE_INFORMATION | `uint16` | 283 | Command to ask information about a low level gimbal. | +\| VEHICLE_CMD_MISSION_START | `uint16` | 300 | Start running a mission. | first_item: the first mission item to run | last_item: the last mission item to run (after this item is run, the mission ends) | +\| VEHICLE_CMD_ACTUATOR_GROUP_TEST | `uint16` | 309 | Test groups of related actuators (e.g. all actuators contributing to roll torque). | [@enum ACTUATOR_TEST_GROUP] Group | [@range -1,1] Value | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_ACTUATOR_TEST | `uint16` | 310 | Actuator testing command. | [@range -1,1] value | [s] timeout | Unused | Unused | output function | +\| VEHICLE_CMD_CONFIGURE_ACTUATOR | `uint16` | 311 | Actuator configuration command. | configuration | Unused | Unused | Unused | output function | +\| VEHICLE_CMD_ESC_REQUEST_EEPROM | `uint16` | 312 | Request EEPROM data from an ESC. | ESC Index | Firmware Type | Unused | Unused | Unused | +\| VEHICLE_CMD_COMPONENT_ARM_DISARM | `uint16` | 400 | Arms / Disarms a component. | 1 to arm, 0 to disarm. | +\| VEHICLE_CMD_RUN_PREARM_CHECKS | `uint16` | 401 | Instructs a target system to run pre-arm checks. | +\| VEHICLE_CMD_INJECT_FAILURE | `uint16` | 420 | Inject artificial failure for testing purposes. | +\| VEHICLE_CMD_START_RX_PAIR | `uint16` | 500 | Starts receiver pairing. | 0:Spektrum | 0:Spektrum DSM2, 1:Spektrum DSMX | +\| VEHICLE_CMD_REQUEST_MESSAGE | `uint16` | 512 | Request to send a single instance of the specified message. | +\| VEHICLE_CMD_REQUEST_CAMERA_INFORMATION | `uint16` | 521 | Request camera information (CAMERA_INFORMATION). | 0: No action 1: Request camera capabilities | Reserved (all remaining params) | Reserved (default:0) | Reserved (default:0) | Reserved (default:0) | Reserved (default:0) | Reserved (default:0) | +\| VEHICLE_CMD_SET_CAMERA_MODE | `uint16` | 530 | Set camera capture mode (photo, video, etc.). | +\| VEHICLE_CMD_SET_CAMERA_ZOOM | `uint16` | 531 | Set camera zoom. | +\| VEHICLE_CMD_SET_CAMERA_FOCUS | `uint16` | 532 | +\| VEHICLE_CMD_EXTERNAL_ATTITUDE_ESTIMATE | `uint16` | 620 | Set an external estimate of vehicle attitude in degrees. | +\| VEHICLE_CMD_DO_GIMBAL_MANAGER_PITCHYAW | `uint16` | 1000 | Setpoint to be sent to a gimbal manager to set a gimbal pitch and yaw. | +\| VEHICLE_CMD_DO_GIMBAL_MANAGER_CONFIGURE | `uint16` | 1001 | Gimbal configuration to set which sysid/compid is in primary and secondary control. | +\| VEHICLE_CMD_IMAGE_START_CAPTURE | `uint16` | 2000 | Start image capture sequence. | +\| VEHICLE_CMD_DO_TRIGGER_CONTROL | `uint16` | 2003 | Enable or disable on-board camera triggering system. | +\| VEHICLE_CMD_VIDEO_START_CAPTURE | `uint16` | 2500 | Start a video capture. | +\| VEHICLE_CMD_VIDEO_STOP_CAPTURE | `uint16` | 2501 | Stop the current video capture. | +\| VEHICLE_CMD_LOGGING_START | `uint16` | 2510 | Start streaming ULog data. | +\| VEHICLE_CMD_LOGGING_STOP | `uint16` | 2511 | Stop streaming ULog data. | +\| VEHICLE_CMD_CONTROL_HIGH_LATENCY | `uint16` | 2600 | Control starting/stopping transmitting data over the high latency link. | +\| VEHICLE_CMD_DO_VTOL_TRANSITION | `uint16` | 3000 | Command VTOL transition. | +\| VEHICLE_CMD_DO_SET_SAFETY_SWITCH_STATE | `uint16` | 5300 | Command safety on/off. | SAFETY_SAFE (0) to activate safety, SAFETY_DANGEROUS (1) to deactivate safety and allow non-throttling actuator movement | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_ARM_AUTHORIZATION_REQUEST | `uint16` | 3001 | Request arm authorization. | +\| VEHICLE_CMD_PAYLOAD_PREPARE_DEPLOY | `uint16` | 30001 | Prepare a payload deployment in the flight plan. | +\| VEHICLE_CMD_PAYLOAD_CONTROL_DEPLOY | `uint16` | 30002 | Control a pre-programmed payload deployment. | +\| VEHICLE_CMD_FIXED_MAG_CAL_YAW | `uint16` | 42006 | Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location. | +\| VEHICLE_CMD_DO_WINCH | `uint16` | 42600 | Command to operate winch. | +\| VEHICLE_CMD_EXTERNAL_POSITION_ESTIMATE | `uint16` | 43003 | External reset of estimator global position when dead reckoning. | +\| VEHICLE_CMD_EXTERNAL_WIND_ESTIMATE | `uint16` | 43004 | +\| VEHICLE_CMD_ESTIMATOR_SENSOR_ENABLE | `uint16` | 43006 | Enable/disable estimator sensor fusion. | Source (FUSION_SOURCE_\*) | Sensor instance (0-based) | Enable (1) or Disable (0) | Estimator Instance (NaN: not used) | Empty | Empty | Empty | +\| FUSION_SOURCE_GPS | `uint8` | 0 | GNSS (EKF2_GPS{i}\_CTRL, use instance param) | +\| FUSION_SOURCE_OF | `uint8` | 1 | Optical Flow (EKF2_OF_CTRL) | +\| FUSION_SOURCE_EV | `uint8` | 2 | External Vision (EKF2_EV_CTRL) | +\| FUSION_SOURCE_AGP | `uint8` | 3 | Auxiliary Global Position (EKF2_AGP{i}\_CTRL, use instance param) | +\| FUSION_SOURCE_BARO | `uint8` | 4 | Barometer (EKF2_BARO_CTRL) | +\| FUSION_SOURCE_RNG | `uint8` | 5 | Range Finder (EKF2_RNG_CTRL) | +\| FUSION_SOURCE_MAG | `uint8` | 6 | Magnetometer (EKF2_MAG_TYPE) | +\| FUSION_SOURCE_ASPD | `uint8` | 7 | Airspeed (EKF2_ARSP_THR) | +\| FUSION_SOURCE_RNGBCN | `uint8` | 8 | Ranging Beacon | +\| VEHICLE_CMD_PX4_INTERNAL_START | `uint32` | 65537 | Start of PX4 internal only vehicle commands (> UINT16_MAX). | +\| VEHICLE_CMD_SET_GPS_GLOBAL_ORIGIN | `uint32` | 100000 | Sets the GPS coordinates of the vehicle local origin (0,0,0) position. | Unused | Unused | Unused | Unused | Latitude (WGS-84) | Longitude (WGS-84) | [m] Altitude (AMSL from GNSS, positive above ground) | +\| VEHICLE_CMD_SET_NAV_STATE | `uint32` | 100001 | Change mode by specifying nav_state directly. | nav_state | Unused | Unused | Unused | Unused | Unused | Unused | +\| VEHICLE_CMD_DO_SET_GLOBAL_ORIGIN | `uint16` | 611 | Sets GNSS coordinates of the vehicle local origin (0,0,0) position. Send as COMMAND_INT with MAV_FRAME_GLOBAL_INT. | Unused | Unused | Unused | Unused | Latitude (WGS-84) | Longitude (WGS-84) | [m] Altitude (AMSL) | +\| VEHICLE_CMD_GUIDED_CHANGE_HEADING | `uint16` | 43002 | Change heading/course. param1: heading type (0=course-over-ground, 1=heading). param2: target [deg]. param3: max rate [deg/s]. | Heading type (HEADING_TYPE enum) | [deg] Target bearing [0..360] | [deg/s] Max rate of change | Unused | Unused | Unused | Unused | +\| VEHICLE_MOUNT_MODE_RETRACT | `uint8` | 0 | Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization. | +\| VEHICLE_MOUNT_MODE_NEUTRAL | `uint8` | 1 | Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | +\| VEHICLE_MOUNT_MODE_MAVLINK_TARGETING | `uint8` | 2 | Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization. | +\| VEHICLE_MOUNT_MODE_RC_TARGETING | `uint8` | 3 | Load neutral position and start RC Roll,Pitch,Yaw control with stabilization. | +\| VEHICLE_MOUNT_MODE_GPS_POINT | `uint8` | 4 | Load neutral position and start to point to Lat,Lon,Alt. | +\| VEHICLE_MOUNT_MODE_ENUM_END | `uint8` | 5 | +\| VEHICLE_ROI_NONE | `uint8` | 0 | No region of interest. | +\| VEHICLE_ROI_WPNEXT | `uint8` | 1 | Point toward next MISSION. | +\| VEHICLE_ROI_WPINDEX | `uint8` | 2 | Point toward given MISSION. | +\| VEHICLE_ROI_LOCATION | `uint8` | 3 | Point toward fixed location. | +\| VEHICLE_ROI_TARGET | `uint8` | 4 | Point toward target. | +\| VEHICLE_ROI_ENUM_END | `uint8` | 5 | +\| ACTUATOR_CONFIGURATION_NONE | `uint8` | 0 | Do nothing. | +\| ACTUATOR_CONFIGURATION_BEEP | `uint8` | 1 | Command the actuator to beep now. | +\| ACTUATOR_CONFIGURATION_3D_MODE_ON | `uint8` | 2 | Permanently set the actuator (ESC) to 3D mode (reversible thrust). | +\| ACTUATOR_CONFIGURATION_3D_MODE_OFF | `uint8` | 3 | Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust). | +\| ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 | `uint8` | 4 | Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise). | +\| ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 | `uint8` | 5 | Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1). | +\| PARACHUTE_ACTION_DISABLE | `uint8` | 0 | +\| PARACHUTE_ACTION_ENABLE | `uint8` | 1 | +\| PARACHUTE_ACTION_RELEASE | `uint8` | 2 | +\| FAILURE_UNIT_SENSOR_GYRO | `uint8` | 0 | +\| FAILURE_UNIT_SENSOR_ACCEL | `uint8` | 1 | +\| FAILURE_UNIT_SENSOR_MAG | `uint8` | 2 | +\| FAILURE_UNIT_SENSOR_BARO | `uint8` | 3 | +\| FAILURE_UNIT_SENSOR_GPS | `uint8` | 4 | +\| FAILURE_UNIT_SENSOR_OPTICAL_FLOW | `uint8` | 5 | +\| FAILURE_UNIT_SENSOR_VIO | `uint8` | 6 | +\| FAILURE_UNIT_SENSOR_DISTANCE_SENSOR | `uint8` | 7 | +\| FAILURE_UNIT_SENSOR_AIRSPEED | `uint8` | 8 | +\| FAILURE_UNIT_SYSTEM_BATTERY | `uint8` | 100 | +\| FAILURE_UNIT_SYSTEM_MOTOR | `uint8` | 101 | +\| FAILURE_UNIT_SYSTEM_SERVO | `uint8` | 102 | +\| FAILURE_UNIT_SYSTEM_AVOIDANCE | `uint8` | 103 | +\| FAILURE_UNIT_SYSTEM_RC_SIGNAL | `uint8` | 104 | +\| FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL | `uint8` | 105 | +\| FAILURE_UNIT_SYSTEM_ESC | `uint8` | 106 | +\| FAILURE_UNIT_SYSTEM_TRAFFIC_AVOIDANCE | `uint8` | 107 | +\| FAILURE_UNIT_DATALINK_LTE | `uint8` | 150 | +\| FAILURE_UNIT_DATALINK_WIFI | `uint8` | 151 | +\| FAILURE_UNIT_DATALINK_TELEM_RADIO | `uint8` | 152 | +\| FAILURE_UNIT_BUS_CAN | `uint8` | 200 | +\| FAILURE_UNIT_BUS_I2C | `uint8` | 201 | +\| FAILURE_TYPE_OK | `uint8` | 0 | +\| FAILURE_TYPE_OFF | `uint8` | 1 | +\| FAILURE_TYPE_STUCK | `uint8` | 2 | +\| FAILURE_TYPE_GARBAGE | `uint8` | 3 | +\| FAILURE_TYPE_WRONG | `uint8` | 4 | +\| FAILURE_TYPE_SLOW | `uint8` | 5 | +\| FAILURE_TYPE_DELAYED | `uint8` | 6 | +\| FAILURE_TYPE_INTERMITTENT | `uint8` | 7 | +\| FAILURE_TYPE_DRIFT | `uint8` | 8 | +\| SPEED_TYPE_AIRSPEED | `uint8` | 0 | +\| SPEED_TYPE_GROUNDSPEED | `uint8` | 1 | +\| SPEED_TYPE_CLIMB_SPEED | `uint8` | 2 | +\| SPEED_TYPE_DESCEND_SPEED | `uint8` | 3 | +\| ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER | `uint8` | 0 | +\| ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING | `uint8` | 1 | +\| ORBIT_YAW_BEHAVIOUR_UNCONTROLLED | `uint8` | 2 | +\| ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE | `uint8` | 3 | +\| ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED | `uint8` | 4 | +\| ORBIT_YAW_BEHAVIOUR_UNCHANGED | `uint8` | 5 | +\| RC_TYPE_SPEKTRUM | `uint8` | 0 | +\| RC_TYPE_CRSF | `uint8` | 1 | +\| RC_SUB_TYPE_SPEKTRUM_DSM2 | `uint8` | 0 | +\| RC_SUB_TYPE_SPEKTRUM_DSMX | `uint8` | 1 | +\| RC_SUB_TYPE_SPEKTRUM_DSMX8 | `uint8` | 2 | +\| ARMING_ACTION_DISARM | `int8` | 0 | +\| ARMING_ACTION_ARM | `int8` | 1 | +\| GRIPPER_ACTION_RELEASE | `uint8` | 0 | +\| GRIPPER_ACTION_GRAB | `uint8` | 1 | +\| SAFETY_SAFE | `uint8` | 0 | Activate safety (MAVLink SAFETY_SWITCH_STATE_SAFE) | +\| SAFETY_DANGEROUS | `uint8` | 1 | Deactivate safety (MAVLink SAFETY_SWITCH_STATE_DANGEROUS) | +\| ACTUATOR_TEST_GROUP_ROLL_TORQUE | `uint8` | 0 | +\| ACTUATOR_TEST_GROUP_PITCH_TORQUE | `uint8` | 1 | +\| ACTUATOR_TEST_GROUP_YAW_TORQUE | `uint8` | 2 | +\| ACTUATOR_TEST_GROUP_COLLECTIVE_TILT | `uint8` | 3 | +\| ACTUATOR_TEST_GROUP_X_THRUST | `uint8` | 4 | +\| ACTUATOR_TEST_GROUP_Y_THRUST | `uint8` | 5 | +\| ACTUATOR_TEST_GROUP_Z_THRUST | `uint8` | 6 | +\| ORB_QUEUE_LENGTH | `uint8` | 8 | +\| COMPONENT_MODE_EXECUTOR_START | `uint16` | 1000 | + +## Source Message + +[Source file (GitHub)](https://github.com/PX4/PX4-Autopilot/blob/main/msg/px4_msgs_old/msg/VehicleCommandV0.msg) + +:::details +Click here to see original file + +```c +# Vehicle Command uORB message. Used for commanding a mission / action / etc. +# Follows the MAVLink COMMAND_INT / COMMAND_LONG definition + +uint32 MESSAGE_VERSION = 0 + +uint64 timestamp # [us] Time since system start. + +uint16 VEHICLE_CMD_CUSTOM_0 = 0 # Test command. +uint16 VEHICLE_CMD_CUSTOM_1 = 1 # Test command. +uint16 VEHICLE_CMD_CUSTOM_2 = 2 # Test command. +uint16 VEHICLE_CMD_NAV_WAYPOINT = 16 # Navigate to MISSION. |[s] (decimal) Hold time. (ignored by fixed wing, time to stay at MISSION for rotary wing)|[m] Acceptance radius (if the sphere with this radius is hit, the MISSION counts as reached)|0 to pass through the WP, if > 0 radius [m] to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.|Desired yaw angle at MISSION (rotary wing)|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_NAV_LOITER_UNLIM = 17 # Loiter around this MISSION an unlimited amount of time. |Unused|Unused|[m] Radius around MISSION. If positive loiter clockwise, else counter-clockwise|Desired yaw angle.|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_NAV_LOITER_TURNS = 18 # Loiter around this MISSION for X turns. |Turns|Unused|Radius around MISSION [m]. If positive loiter clockwise, else counter-clockwise|Desired yaw angle.|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_NAV_LOITER_TIME = 19 # Loiter around this MISSION for time. |[s] Seconds (decimal)|Unused|Radius around MISSION [m]. If positive loiter clockwise, else counter-clockwise|Desired yaw angle.|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_NAV_RETURN_TO_LAUNCH = 20 # Return to launch location. |Unused|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_NAV_LAND = 21 # Land at location. |Unused|Unused|Unused|Desired yaw angle.|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_NAV_TAKEOFF = 22 # Takeoff from ground / hand. |Unused (FW pitch from FW_TKO_PITCH_MIN)|Unused|Unused|[deg] [@range 0,360] Yaw angle in NED if yaw source available, ignored otherwise|Latitude (WGS-84)|Longitude (WGS-84)|[m] Altitude AMSL| +uint16 VEHICLE_CMD_NAV_PRECLAND = 23 # Attempt a precision landing. +uint16 VEHICLE_CMD_DO_ORBIT = 34 # Start orbiting on the circumference of a circle defined by the parameters. |[m] Radius|[m/s] Velocity|[@enum ORBIT_YAW_BEHAVIOUR] Yaw behaviour|Unused|Latitude/X|Longitude/Y|Altitude/Z| +uint16 VEHICLE_CMD_DO_FIGUREEIGHT = 35 # Start flying on the outline of a figure eight defined by the parameters. |[m] Major radius|[m] Minor radius|[m/s] Velocity|Orientation|Latitude/X|Longitude/Y|Altitude/Z| +uint16 VEHICLE_CMD_NAV_ROI = 80 # Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |[@enum VEHICLE_ROI] Region of interest mode.|MISSION index/ target ID.|ROI index (allows a vehicle to manage multiple ROI's)|Unused|x the location of the fixed ROI (see MAV_FRAME)|y|z| +uint16 VEHICLE_CMD_NAV_PATHPLANNING = 81 # Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning|0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid|Unused|[deg] [@range 0, 360] Yaw angle at goal, in compass degrees|Latitude/X of goal|Longitude/Y of goal|Altitude/Z of goal| +uint16 VEHICLE_CMD_NAV_VTOL_TAKEOFF = 84 # Takeoff from ground / hand and transition to fixed wing. |Minimum pitch (if airspeed sensor present), desired pitch without sensor|Transition heading, 0: Default, 3: Use specified transition heading|Unused|Yaw angle (if magnetometer present), ignored without magnetometer|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_NAV_VTOL_LAND = 85 # Transition to MC and land at location. |Unused|Unused|Unused|Desired yaw angle.|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_NAV_GUIDED_LIMITS = 90 # Set limits for external control. |[s] Timeout - maximum time that external controller will be allowed to control vehicle. 0 means no timeout|[m] Absolute altitude min AMSL - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit|[m] Absolute altitude max - if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit|[m] Horizontal move limit (AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit|Unused|Unused|Unused| +uint16 VEHICLE_CMD_NAV_GUIDED_MASTER = 91 # Set id of master controller. |System ID|Component ID|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_NAV_DELAY = 93 # Delay the next navigation command a number of seconds or until a specified time. |[s] Delay (decimal, -1 to enable time-of-day fields)|[h] hour (24h format, UTC, -1 to ignore)|minute (24h format, UTC, -1 to ignore)|second (24h format, UTC)|Unused|Unused|Unused| +uint16 VEHICLE_CMD_NAV_LAST = 95 # NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration.|Unused|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_CONDITION_DELAY = 112 # Delay mission state machine. |[s] Delay (decimal seconds)|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_CONDITION_CHANGE_ALT = 113 # Ascend/descend at rate. Delay mission state machine until desired altitude reached.|Descent / Ascend rate (m/s)|Unused|Unused|Unused|Unused|Unused|Finish Altitude| +uint16 VEHICLE_CMD_CONDITION_DISTANCE = 114 # Delay mission state machine until within desired distance of next NAV point. |Distance [m]|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_CONDITION_YAW = 115 # Reach a certain target angle. |[deg] [@range 0,360] Target angle. 0 is north|[deg/s] Speed during yaw change|[@range -1,1] Direction: negative: counter clockwise, positive: clockwise |[ 1,0] Relative offset or absolute angle|Unused|Unused|Unused| +uint16 VEHICLE_CMD_CONDITION_LAST = 159 # NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration. |Unused|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_CONDITION_GATE = 4501 # Wait until passing a threshold. |2D coord mode: 0: Orthogonal to planned route|Altitude mode: 0: Ignore altitude|Unused|Unused|Lat|Lon|Alt| +uint16 VEHICLE_CMD_DO_SET_MODE = 176 # Set system mode. |Mode, as defined by ENUM MAV_MODE|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_JUMP = 177 # Jump to the desired command in the mission list. Repeat this action only the specified number of times. |Sequence number|Repeat count|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_CHANGE_SPEED = 178 # Change speed and/or throttle set points. |[@enum SPEED_TYPE] Speed type (0=Airspeed, 1=Ground Speed)|Speed (m/s, -1 indicates no change)|[%] Throttle ( Percent, -1 indicates no change)|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_SET_HOME = 179 # Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)|Unused|Unused|Unused|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_DO_SET_PARAMETER = 180 # Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number|Parameter value|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_SET_RELAY = 181 # Set a relay to a condition. |Relay number|Setting (1=on, 0=off, others possible depending on system hardware)|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_REPEAT_RELAY = 182 # Cycle a relay on and off for a desired number of cycles with a desired period. |Relay number|Cycle count|[s] Cycle time (decimal seconds)|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_REPEAT_SERVO = 184 # Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number|[us] PWM rate (1000 to 2000 typical)|Cycle count|[s] Cycle time|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_FLIGHTTERMINATION = 185 # Terminate flight immediately. |Flight termination activated if > 0.5|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_CHANGE_ALTITUDE = 186 # Set the vehicle to Loiter mode and change the altitude to specified value. |Altitude|Frame of new altitude|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_SET_ACTUATOR = 187 # Sets actuators (e.g. servos) to a desired value. |Actuator 1|Actuator 2|Actuator 3|Actuator 4|Actuator 5|Actuator 6|Index| +uint16 VEHICLE_CMD_DO_LAND_START = 189 # Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. |Unused|Unused|Unused|Unused|Latitude|Longitude|Unused| +uint16 VEHICLE_CMD_DO_GO_AROUND = 191 # Mission command to safely abort an autonomous landing. |[m] Altitude|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_REPOSITION = 192 # Reposition to specific WGS84 GPS position. |[m/s] Ground speed|Bitmask|[m] Loiter radius for planes|[deg] Yaw|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_DO_PAUSE_CONTINUE = 193 +uint16 VEHICLE_CMD_DO_SET_ROI_LOCATION = 195 # Sets the region of interest (ROI) to a location. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Unused|Unused|Unused|Unused|Latitude|Longitude|Altitude| +uint16 VEHICLE_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196 # Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Unused|Unused|Unused|Unused|Pitch offset from next waypoint|Roll offset from next waypoint|Yaw offset from next waypoint| +uint16 VEHICLE_CMD_DO_SET_ROI_NONE = 197 # Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Unused|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_CONTROL_VIDEO = 200 # Control onboard camera system. |Camera ID (-1 for all)|Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw|Transmission mode: 0: video stream, >0: single images every n seconds (decimal seconds)|Recording: 0: disabled, 1: enabled compressed, 2: enabled raw|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_SET_ROI = 201 # Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |[@enum VEHICLE_ROI] Region of interest mode.|MISSION index/ target ID.|ROI index (allows a vehicle to manage multiple ROI's)|Unused|x the location of the fixed ROI (see MAV_FRAME)|y|z| +uint16 VEHICLE_CMD_DO_DIGICAM_CONTROL=203 +uint16 VEHICLE_CMD_DO_MOUNT_CONFIGURE=204 # Mission command to configure a camera or antenna mount. |[@enum MAV_MOUNT_MODE] Mount operation mode|Stabilize roll? (1 = yes, 0 = no)|Stabilize pitch? (1 = yes, 0 = no)|stabilize yaw? (1 = yes, 0 = no)|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_MOUNT_CONTROL=205 # Mission command to control a camera or antenna mount. |[deg] Pitch or lat, depending on mount mode.|[deg] Roll or lon depending on mount mode|[deg]/[m] Yaw or alt depending on mount mode|Unused|Unused|Unused|[@enum MAV_MOUNT_MODE]| +uint16 VEHICLE_CMD_DO_SET_CAM_TRIGG_DIST=206 # Mission command to set TRIG_DIST for this flight. |[m] Camera trigger distance|[ms] Shutter integration time|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_FENCE_ENABLE=207 # Mission command to enable the geofence. |enable? (0=disable, 1=enable)|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_PARACHUTE=208 # Mission command to trigger a parachute. |action [@enum PARACHUTE_ACTION] (0=disable, 1=enable, 2=release, for some systems see [@enum PARACHUTE_ACTION], not in general message set.)|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_MOTOR_TEST=209 # Motor test command. |Instance (@range 1, )|throttle type|throttle|timeout [s]|Motor count|Test order|Unused| +uint16 VEHICLE_CMD_DO_INVERTED_FLIGHT=210 # Change to/from inverted flight. |inverted (0=normal, 1=inverted)|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_GRIPPER = 211 # Command to operate a gripper. +uint16 VEHICLE_CMD_DO_AUTOTUNE_ENABLE = 212 # Enable autotune module. |1 to enable|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_SET_CAM_TRIGG_INTERVAL=214 # Mission command to set TRIG_INTERVAL for this flight. |[m] Camera trigger distance|Shutter integration time (ms)|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_MOUNT_CONTROL_QUAT=220 # Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)|q2 - quaternion param #2, x (0 in null-rotation)|q3 - quaternion param #3, y (0 in null-rotation)|q4 - quaternion param #4, z (0 in null-rotation)|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_GUIDED_MASTER=221 # Set id of master controller. |System ID|Component ID|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_GUIDED_LIMITS=222 # Set limits for external control. |[s] Timeout - maximum time that external controller will be allowed to control vehicle. 0 means no timeout|[m] Absolute altitude min(AMSL) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit|[m] Absolute altitude max - if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit|[m] Horizontal move limit (AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_SET_MISSION_CURRENT = 224 # Set the mission item with sequence number seq as current item and emit MISSION_CURRENT (whether or not the mission mode is active). ACKs FAILED if seq is out of range or there is no current mission item. |Mission sequence value to set, -1 for the current mission item (use to reset jump counters without changing the current item)|Reset repeat/jump counters and clear mission complete flag (1=true,0=false; default:0)|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_DO_LAST = 240 # NOP - This command is only used to mark the upper limit of the DO commands in the enumeration. |Unused|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_PREFLIGHT_CALIBRATION = 241 # Trigger calibration. This command will be only accepted if in pre-flight mode. See MAVLink spec MAV_CMD_PREFLIGHT_CALIBRATION. +uint16 PREFLIGHT_CALIBRATION_TEMPERATURE_CALIBRATION = 3# Param value for VEHICLE_CMD_PREFLIGHT_CALIBRATION to start temperature calibration. +uint16 VEHICLE_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242 # Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow|X axis offset (or generic dimension 1), in the sensor's raw units|Y axis offset (or generic dimension 2), in the sensor's raw units|Z axis offset (or generic dimension 3), in the sensor's raw units|Generic dimension 4, in the sensor's raw units|Generic dimension 5, in the sensor's raw units|Generic dimension 6, in the sensor's raw units| +uint16 VEHICLE_CMD_PREFLIGHT_UAVCAN = 243 # UAVCAN configuration. If param 1 == 1 actuator mapping and direction assignment should be started. +uint16 VEHICLE_CMD_PREFLIGHT_STORAGE = 245 # Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM|Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246 # Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot.|0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer.|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_OBLIQUE_SURVEY=260 # Mission command to set a Camera Auto Mount Pivoting Oblique Survey for this flight. |[m] Camera trigger distance|[ms] Shutter integration time|Camera minimum trigger interval|Number of positions|Roll|Pitch|Unused| +uint16 VEHICLE_CMD_DO_SET_STANDARD_MODE=262 # Enable the specified standard MAVLink mode. |MAV_STANDARD_MODE| +uint16 VEHICLE_CMD_GIMBAL_DEVICE_INFORMATION = 283 # Command to ask information about a low level gimbal. + +uint16 VEHICLE_CMD_MISSION_START = 300 # Start running a mission. |first_item: the first mission item to run|last_item: the last mission item to run (after this item is run, the mission ends)| +uint16 VEHICLE_CMD_ACTUATOR_GROUP_TEST = 309 # Test groups of related actuators (e.g. all actuators contributing to roll torque). |[@enum ACTUATOR_TEST_GROUP] Group|[@range -1,1] Value|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_ACTUATOR_TEST = 310 # Actuator testing command. |[@range -1,1] value|[s] timeout|Unused|Unused|output function| +uint16 VEHICLE_CMD_CONFIGURE_ACTUATOR = 311 # Actuator configuration command. |configuration|Unused|Unused|Unused|output function| +uint16 VEHICLE_CMD_ESC_REQUEST_EEPROM = 312 # Request EEPROM data from an ESC. |ESC Index|Firmware Type|Unused|Unused|Unused| +uint16 VEHICLE_CMD_COMPONENT_ARM_DISARM = 400 # Arms / Disarms a component. |1 to arm, 0 to disarm. +uint16 VEHICLE_CMD_RUN_PREARM_CHECKS = 401 # Instructs a target system to run pre-arm checks. +uint16 VEHICLE_CMD_INJECT_FAILURE = 420 # Inject artificial failure for testing purposes. +uint16 VEHICLE_CMD_START_RX_PAIR = 500 # Starts receiver pairing. |0:Spektrum|0:Spektrum DSM2, 1:Spektrum DSMX| +uint16 VEHICLE_CMD_REQUEST_MESSAGE = 512 # Request to send a single instance of the specified message. +uint16 VEHICLE_CMD_REQUEST_CAMERA_INFORMATION = 521 # Request camera information (CAMERA_INFORMATION). |0: No action 1: Request camera capabilities|Reserved (all remaining params)|Reserved (default:0)|Reserved (default:0)|Reserved (default:0)|Reserved (default:0)|Reserved (default:0)| +uint16 VEHICLE_CMD_SET_CAMERA_MODE = 530 # Set camera capture mode (photo, video, etc.). +uint16 VEHICLE_CMD_SET_CAMERA_ZOOM = 531 # Set camera zoom. +uint16 VEHICLE_CMD_SET_CAMERA_FOCUS = 532 +uint16 VEHICLE_CMD_EXTERNAL_ATTITUDE_ESTIMATE = 620 # Set an external estimate of vehicle attitude in degrees. +uint16 VEHICLE_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000 # Setpoint to be sent to a gimbal manager to set a gimbal pitch and yaw. +uint16 VEHICLE_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001 # Gimbal configuration to set which sysid/compid is in primary and secondary control. +uint16 VEHICLE_CMD_IMAGE_START_CAPTURE = 2000 # Start image capture sequence. +uint16 VEHICLE_CMD_DO_TRIGGER_CONTROL = 2003 # Enable or disable on-board camera triggering system. +uint16 VEHICLE_CMD_VIDEO_START_CAPTURE = 2500 # Start a video capture. +uint16 VEHICLE_CMD_VIDEO_STOP_CAPTURE = 2501 # Stop the current video capture. +uint16 VEHICLE_CMD_LOGGING_START = 2510 # Start streaming ULog data. +uint16 VEHICLE_CMD_LOGGING_STOP = 2511 # Stop streaming ULog data. +uint16 VEHICLE_CMD_CONTROL_HIGH_LATENCY = 2600 # Control starting/stopping transmitting data over the high latency link. +uint16 VEHICLE_CMD_DO_VTOL_TRANSITION = 3000 # Command VTOL transition. +uint16 VEHICLE_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300 # Command safety on/off. |SAFETY_SAFE (0) to activate safety, SAFETY_DANGEROUS (1) to deactivate safety and allow non-throttling actuator movement|Unused|Unused|Unused|Unused|Unused|Unused| +uint16 VEHICLE_CMD_ARM_AUTHORIZATION_REQUEST = 3001 # Request arm authorization. +uint16 VEHICLE_CMD_PAYLOAD_PREPARE_DEPLOY = 30001 # Prepare a payload deployment in the flight plan. +uint16 VEHICLE_CMD_PAYLOAD_CONTROL_DEPLOY = 30002 # Control a pre-programmed payload deployment. +uint16 VEHICLE_CMD_FIXED_MAG_CAL_YAW = 42006 # Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location. +uint16 VEHICLE_CMD_DO_WINCH = 42600 # Command to operate winch. + +uint16 VEHICLE_CMD_EXTERNAL_POSITION_ESTIMATE = 43003 # External reset of estimator global position when dead reckoning. +uint16 VEHICLE_CMD_EXTERNAL_WIND_ESTIMATE = 43004 +uint16 VEHICLE_CMD_ESTIMATOR_SENSOR_ENABLE = 43006 # Enable/disable estimator sensor fusion. |Source (FUSION_SOURCE_*)|Sensor instance (0-based)|Enable (1) or Disable (0)|Estimator Instance (NaN: not used)|Empty|Empty|Empty| +# Sensor fusion source types for VEHICLE_CMD_ESTIMATOR_SENSOR_ENABLE +uint8 FUSION_SOURCE_GPS = 0 # GNSS (EKF2_GPS{i}_CTRL, use instance param) +uint8 FUSION_SOURCE_OF = 1 # Optical Flow (EKF2_OF_CTRL) +uint8 FUSION_SOURCE_EV = 2 # External Vision (EKF2_EV_CTRL) +uint8 FUSION_SOURCE_AGP = 3 # Auxiliary Global Position (EKF2_AGP{i}_CTRL, use instance param) +uint8 FUSION_SOURCE_BARO = 4 # Barometer (EKF2_BARO_CTRL) +uint8 FUSION_SOURCE_RNG = 5 # Range Finder (EKF2_RNG_CTRL) +uint8 FUSION_SOURCE_MAG = 6 # Magnetometer (EKF2_MAG_TYPE) +uint8 FUSION_SOURCE_ASPD = 7 # Airspeed (EKF2_ARSP_THR) +uint8 FUSION_SOURCE_RNGBCN = 8 # Ranging Beacon + +# PX4 vehicle commands (beyond 16 bit MAVLink commands). +uint32 VEHICLE_CMD_PX4_INTERNAL_START = 65537 # Start of PX4 internal only vehicle commands (> UINT16_MAX). +uint32 VEHICLE_CMD_SET_GPS_GLOBAL_ORIGIN = 100000 # Sets the GPS coordinates of the vehicle local origin (0,0,0) position. |Unused|Unused|Unused|Unused|Latitude (WGS-84)|Longitude (WGS-84)|[m] Altitude (AMSL from GNSS, positive above ground)| +uint32 VEHICLE_CMD_SET_NAV_STATE = 100001 # Change mode by specifying nav_state directly. |nav_state|Unused|Unused|Unused|Unused|Unused|Unused| + +uint16 VEHICLE_CMD_DO_SET_GLOBAL_ORIGIN = 611 # Sets GNSS coordinates of the vehicle local origin (0,0,0) position. Send as COMMAND_INT with MAV_FRAME_GLOBAL_INT. |Unused|Unused|Unused|Unused|Latitude (WGS-84)|Longitude (WGS-84)|[m] Altitude (AMSL)| +uint16 VEHICLE_CMD_GUIDED_CHANGE_HEADING = 43002 # Change heading/course. param1: heading type (0=course-over-ground, 1=heading). param2: target [deg]. param3: max rate [deg/s]. |Heading type (HEADING_TYPE enum)|[deg] Target bearing [0..360]|[deg/s] Max rate of change|Unused|Unused|Unused|Unused| + +uint8 VEHICLE_MOUNT_MODE_RETRACT = 0 # Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization. +uint8 VEHICLE_MOUNT_MODE_NEUTRAL = 1 # Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. +uint8 VEHICLE_MOUNT_MODE_MAVLINK_TARGETING = 2 # Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization. +uint8 VEHICLE_MOUNT_MODE_RC_TARGETING = 3 # Load neutral position and start RC Roll,Pitch,Yaw control with stabilization. +uint8 VEHICLE_MOUNT_MODE_GPS_POINT = 4 # Load neutral position and start to point to Lat,Lon,Alt. +uint8 VEHICLE_MOUNT_MODE_ENUM_END = 5 # + +uint8 VEHICLE_ROI_NONE = 0 # No region of interest. +uint8 VEHICLE_ROI_WPNEXT = 1 # Point toward next MISSION. +uint8 VEHICLE_ROI_WPINDEX = 2 # Point toward given MISSION. +uint8 VEHICLE_ROI_LOCATION = 3 # Point toward fixed location. +uint8 VEHICLE_ROI_TARGET = 4 # Point toward target. +uint8 VEHICLE_ROI_ENUM_END = 5 + +uint8 ACTUATOR_CONFIGURATION_NONE = 0 # Do nothing. +uint8 ACTUATOR_CONFIGURATION_BEEP = 1 # Command the actuator to beep now. +uint8 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2 # Permanently set the actuator (ESC) to 3D mode (reversible thrust). +uint8 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3 # Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust). +uint8 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4 # Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise). +uint8 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5 # Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1). + +uint8 PARACHUTE_ACTION_DISABLE = 0 +uint8 PARACHUTE_ACTION_ENABLE = 1 +uint8 PARACHUTE_ACTION_RELEASE = 2 + +uint8 FAILURE_UNIT_SENSOR_GYRO = 0 +uint8 FAILURE_UNIT_SENSOR_ACCEL = 1 +uint8 FAILURE_UNIT_SENSOR_MAG = 2 +uint8 FAILURE_UNIT_SENSOR_BARO = 3 +uint8 FAILURE_UNIT_SENSOR_GPS = 4 +uint8 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5 +uint8 FAILURE_UNIT_SENSOR_VIO = 6 +uint8 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7 +uint8 FAILURE_UNIT_SENSOR_AIRSPEED = 8 +uint8 FAILURE_UNIT_SYSTEM_BATTERY = 100 +uint8 FAILURE_UNIT_SYSTEM_MOTOR = 101 +uint8 FAILURE_UNIT_SYSTEM_SERVO = 102 +uint8 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103 +uint8 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104 +uint8 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105 +uint8 FAILURE_UNIT_SYSTEM_ESC = 106 +uint8 FAILURE_UNIT_SYSTEM_TRAFFIC_AVOIDANCE = 107 +uint8 FAILURE_UNIT_DATALINK_LTE = 150 +uint8 FAILURE_UNIT_DATALINK_WIFI = 151 +uint8 FAILURE_UNIT_DATALINK_TELEM_RADIO = 152 +uint8 FAILURE_UNIT_BUS_CAN = 200 +uint8 FAILURE_UNIT_BUS_I2C = 201 + +uint8 FAILURE_TYPE_OK = 0 +uint8 FAILURE_TYPE_OFF = 1 +uint8 FAILURE_TYPE_STUCK = 2 +uint8 FAILURE_TYPE_GARBAGE = 3 +uint8 FAILURE_TYPE_WRONG = 4 +uint8 FAILURE_TYPE_SLOW = 5 +uint8 FAILURE_TYPE_DELAYED = 6 +uint8 FAILURE_TYPE_INTERMITTENT = 7 +uint8 FAILURE_TYPE_DRIFT = 8 + +# Used as param1 in DO_CHANGE_SPEED command. +uint8 SPEED_TYPE_AIRSPEED = 0 +uint8 SPEED_TYPE_GROUNDSPEED = 1 +uint8 SPEED_TYPE_CLIMB_SPEED = 2 +uint8 SPEED_TYPE_DESCEND_SPEED = 3 + +# Used as param3 in CMD_DO_ORBIT. +uint8 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0 +uint8 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1 +uint8 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2 +uint8 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3 +uint8 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4 +uint8 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5 + +# Used as param1&2 in CMD_START_RX_PAIR. +uint8 RC_TYPE_SPEKTRUM = 0 +uint8 RC_TYPE_CRSF = 1 +uint8 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0 +uint8 RC_SUB_TYPE_SPEKTRUM_DSMX = 1 +uint8 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2 + +# Used as param1 in ARM_DISARM command. +int8 ARMING_ACTION_DISARM = 0 +int8 ARMING_ACTION_ARM = 1 + +# param2 in VEHICLE_CMD_DO_GRIPPER. +uint8 GRIPPER_ACTION_RELEASE = 0 +uint8 GRIPPER_ACTION_GRAB = 1 + +# Used as param1 in DO_SET_SAFETY_SWITCH_STATE command (matches MAVLink SAFETY_SWITCH_STATE enum). +uint8 SAFETY_SAFE = 0 # Activate safety (MAVLink SAFETY_SWITCH_STATE_SAFE) +uint8 SAFETY_DANGEROUS = 1 # Deactivate safety (MAVLink SAFETY_SWITCH_STATE_DANGEROUS) + +# param1 in VEHICLE_CMD_ACTUATOR_GROUP_TEST (matches MAVLink ACTUATOR_TEST_GROUP enum) +uint8 ACTUATOR_TEST_GROUP_ROLL_TORQUE = 0 +uint8 ACTUATOR_TEST_GROUP_PITCH_TORQUE = 1 +uint8 ACTUATOR_TEST_GROUP_YAW_TORQUE = 2 +uint8 ACTUATOR_TEST_GROUP_COLLECTIVE_TILT = 3 +uint8 ACTUATOR_TEST_GROUP_X_THRUST = 4 +uint8 ACTUATOR_TEST_GROUP_Y_THRUST = 5 +uint8 ACTUATOR_TEST_GROUP_Z_THRUST = 6 + +uint8 ORB_QUEUE_LENGTH = 8 + +float32 param1 # Parameter 1, as defined by MAVLink uint16 VEHICLE_CMD enum. +float32 param2 # Parameter 2, as defined by MAVLink uint16 VEHICLE_CMD enum. +float32 param3 # Parameter 3, as defined by MAVLink uint16 VEHICLE_CMD enum. +float32 param4 # Parameter 4, as defined by MAVLink uint16 VEHICLE_CMD enum. +float64 param5 # Parameter 5, as defined by MAVLink uint16 VEHICLE_CMD enum. +float64 param6 # Parameter 6, as defined by MAVLink uint16 VEHICLE_CMD enum. +float32 param7 # Parameter 7, as defined by MAVLink uint16 VEHICLE_CMD enum. +uint32 command # Command ID. +uint8 target_system # System which should execute the command. +uint8 target_component # Component which should execute the command, 0 for all components. +uint8 source_system # System sending the command. +uint16 source_component # Component / mode executor sending the command. +uint8 confirmation # 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command). +bool from_external + +uint16 COMPONENT_MODE_EXECUTOR_START = 1000 + +# TOPICS vehicle_command gimbal_v1_command vehicle_command_mode_executor +``` + +::: diff --git a/docs/uk/msg_docs/VehicleGnss.md b/docs/uk/msg_docs/VehicleGnss.md index bb97c2eb638..625bd43d067 100644 --- a/docs/uk/msg_docs/VehicleGnss.md +++ b/docs/uk/msg_docs/VehicleGnss.md @@ -13,22 +13,39 @@ Heading is on vehicle_gnss_heading. ## Fields -| Назва | Тип | Unit [Frame] | Range/Enum | Опис | -| ------------------------------------------------------------------------ | ------------ | ---------------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| timestamp | `uint64` | us | | Time since system start | -| timestamp_sample | `uint64` | us | | Measurement time, delay corrected. Use this rather than receiver.timestamp_sample, which holds the same value | -| receiver | `SensorGnss` | | | The selected receiver's sensor_gnss sample with the corrected timestamp_sample | -| antenna_offset | `float32[3]` | m [FRD] | | Antenna position of the selected receiver | -| selected_instance | `uint8` | | | sensor_gnss instance of the selected receiver | -| selection_count | `uint8` | | | Increments when the selected receiver changes | -| usable | `bool` | | | Sample may be used: the receiver has passed its checks for long enough | -| failed_checks | `uint16` | | [CHECK](#CHECK) | Bitmask of the enabled checks that failed | +| Назва | Тип | Unit [Frame] | Range/Enum | Опис | +| ----------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| timestamp | `uint64` | us | | Time since system start | +| timestamp_sample | `uint64` | us | | Measurement time, delay corrected. Use this rather than receiver.timestamp_sample, which holds the same value | +| receiver | `SensorGnss` | | | The selected receiver's sensor_gnss sample with the corrected timestamp_sample | +| antenna_offset | `float32[3]` | m [FRD] | | Antenna position of the selected receiver | +| selected_instance | `uint8` | | | sensor_gnss instance of the selected receiver | +| selection_count | `uint8` | | | Increments when the selected receiver changes | +| selection_reason | `uint8` | | [SELECTION](#SELECTION) | Why this receiver is selected | +| usable | `bool` | | | Sample may be used: the checks that decide it have passed without a failure for long enough | +| strict | `bool` | | | The strict checks decide usable: they haven't passed since the vehicle was disarmed on the ground, or they pass. Otherwise the relaxed checks decide | +| failed_strict_checks | `uint16` | | [CHECK](#CHECK) | Enabled checks this sample fails at the strict thresholds, evaluated on every sample | +| failed_relaxed_checks | `uint16` | | [CHECK](#CHECK) | Enabled checks this sample fails at the relaxed thresholds, evaluated on every sample | ## Enums +### SELECTION {#SELECTION} + +Used in field(s): [selection_reason](#fld_selection_reason) + +| Назва | Тип | Значення | Опис | +| ----------------------------------------------------------------------------------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------- | +| SELECTION_PREFERRED | `uint8` | 0 | The preferred receiver | +| SELECTION_ONLY | `uint8` | 1 | No other receiver has published | +| SELECTION_RANKED | `uint8` | 2 | No receiver is preferred, and no other one ranks higher | +| SELECTION_TIMEOUT | `uint8` | 3 | The previously selected or the preferred receiver stopped publishing | +| SELECTION_UNHEALTHY | `uint8` | 4 | The previously selected or the preferred receiver failed its checks or delivered samples late, continuously or often | +| SELECTION_STRICT | `uint8` | 5 | Passes the strict checks, which the previously selected receiver didn't | +| SELECTION_RTK_FIXED | `uint8` | 6 | Passes the strict checks with an RTK fixed solution, and the previously selected receiver ranked lower | + ### CHECK {#CHECK} -Used in field(s): [failed_checks](#fld_failed_checks) +Used in field(s): [failed_strict_checks](#fld_failed_strict_checks), [failed_relaxed_checks](#fld_failed_relaxed_checks) | Назва | Тип | Значення | Опис | | -------------------------------------------------------------- | -------- | -------- | ------------------------------------------ | @@ -66,12 +83,22 @@ SensorGnss receiver # The selected receiver's sensor_gnss sample with the correc float32[3] antenna_offset # [m] [@frame FRD] Antenna position of the selected receiver # Selection state -uint8 selected_instance # [-] sensor_gnss instance of the selected receiver -uint8 selection_count # [-] Increments when the selected receiver changes +uint8 selected_instance # [-] sensor_gnss instance of the selected receiver +uint8 selection_count # [-] Increments when the selected receiver changes +uint8 selection_reason # [@enum SELECTION] Why this receiver is selected +uint8 SELECTION_PREFERRED = 0 # The preferred receiver +uint8 SELECTION_ONLY = 1 # No other receiver has published +uint8 SELECTION_RANKED = 2 # No receiver is preferred, and no other one ranks higher +uint8 SELECTION_TIMEOUT = 3 # The previously selected or the preferred receiver stopped publishing +uint8 SELECTION_UNHEALTHY = 4 # The previously selected or the preferred receiver failed its checks or delivered samples late, continuously or often +uint8 SELECTION_STRICT = 5 # Passes the strict checks, which the previously selected receiver didn't +uint8 SELECTION_RTK_FIXED = 6 # Passes the strict checks with an RTK fixed solution, and the previously selected receiver ranked lower -# Check result for this sample -bool usable # Sample may be used: the receiver has passed its checks for long enough -uint16 failed_checks # [@enum CHECK] Bitmask of the enabled checks that failed +# Check result for this sample. The strict checks are the GNSS_REQ_* thresholds, satellite count, PDOP and drift at rest on the ground; the relaxed checks are fixed, looser limits on fix type, accuracy, spoofing and jamming. +bool usable # Sample may be used: the checks that decide it have passed without a failure for long enough +bool strict # The strict checks decide usable: they haven't passed since the vehicle was disarmed on the ground, or they pass. Otherwise the relaxed checks decide +uint16 failed_strict_checks # [@enum CHECK] Enabled checks this sample fails at the strict thresholds, evaluated on every sample +uint16 failed_relaxed_checks # [@enum CHECK] Enabled checks this sample fails at the relaxed thresholds, evaluated on every sample uint16 CHECK_NSATS = 1 # Too few satellites uint16 CHECK_PDOP = 2 # Position dilution of precision too high uint16 CHECK_EPH = 4 # Horizontal position accuracy too low diff --git a/docs/uk/msg_docs/VehicleStatus.md b/docs/uk/msg_docs/VehicleStatus.md index c7d25f50bb8..34a753559b1 100644 --- a/docs/uk/msg_docs/VehicleStatus.md +++ b/docs/uk/msg_docs/VehicleStatus.md @@ -39,7 +39,7 @@ Encodes the system state of the vehicle published by commander. | in_transition_mode | `bool` | | | True if VTOL is doing a transition | | in_transition_to_fw | `bool` | | | True if VTOL is doing a transition from MC to FW | | system_type | `uint8` | | | system type, contains mavlink MAV_TYPE | -| system_id | `uint8` | | | system id, contains MAVLink's system ID field | +| system_id | `uint32` | | | system id, contains MAVLink's system ID field | | component_id | `uint8` | | | subsystem / component id, contains MAVLink's component ID field | | safety_button_available | `bool` | | | Set to true if a safety button is connected | | safety_off | `bool` | | | Set to true if safety is off | @@ -58,7 +58,7 @@ Encodes the system state of the vehicle published by commander. | Назва | Тип | Значення | Опис | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------------- | -| MESSAGE_VERSION | `uint32` | 4 | | +| MESSAGE_VERSION | `uint32` | 5 | | | ARMING_STATE_DISARMED | `uint8` | 1 | | | ARMING_STATE_ARMED | `uint8` | 2 | | | ARM_DISARM_REASON_STICK_GESTURE | `uint8` | 1 | | @@ -123,7 +123,7 @@ Click here to see original file ```c # Encodes the system state of the vehicle published by commander -uint32 MESSAGE_VERSION = 4 +uint32 MESSAGE_VERSION = 5 uint64 timestamp # time since system start (microseconds) @@ -225,7 +225,7 @@ bool in_transition_to_fw # True if VTOL is doing a transition from MC to FW # MAVLink identification uint8 system_type # system type, contains mavlink MAV_TYPE -uint8 system_id # system id, contains MAVLink's system ID field +uint32 system_id # system id, contains MAVLink's system ID field uint8 component_id # subsystem / component id, contains MAVLink's component ID field bool safety_button_available # Set to true if a safety button is connected diff --git a/docs/uk/msg_docs/VehicleStatusV4.md b/docs/uk/msg_docs/VehicleStatusV4.md new file mode 100644 index 00000000000..a77f80969d1 --- /dev/null +++ b/docs/uk/msg_docs/VehicleStatusV4.md @@ -0,0 +1,251 @@ +--- +pageClass: is-wide-page +--- + +# VehicleStatusV4 (UORB message) + +Encodes the system state of the vehicle published by commander. + +**TOPICS:** vehicle_status_v4 + +## Fields + +| Назва | Тип | Unit [Frame] | Range/Enum | Опис | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| timestamp | `uint64` | | | time since system start (microseconds) | +| armed_time | `uint64` | | | Arming timestamp (microseconds) | +| takeoff_time | `uint64` | | | Takeoff timestamp (microseconds) | +| arming_state | `uint8` | | | | +| latest_arming_reason | `uint8` | | | | +| latest_disarming_reason | `uint8` | | | | +| nav_state_timestamp | `uint64` | | | time when current nav_state activated | +| nav_state_user_intention | `uint8` | | | Mode that the user selected (might be different from nav_state in a failsafe situation) | +| nav_state | `uint8` | | | Currently active mode | +| executor_in_charge | `uint8` | | | Current mode executor in charge (0=Autopilot) | +| nav_state_display | `uint8` | | | User-visible nav state sent via MAVLink (executor state if active, otherwise nav_state) | +| accepts_offboard_setpoints | `bool` | | | True if the current mode accepts offboard trajectory setpoints via MAVLink | +| valid_nav_states_mask | `uint32` | | | Bitmask for all valid nav_state values | +| can_set_nav_states_mask | `uint32` | | | Bitmask for all modes that a user can select | +| hil_state | `uint8` | | | | +| vehicle_type | `uint8` | | | | +| failsafe | `bool` | | | true if system is in failsafe state (e.g. Return, Hover, Terminate, ...) | +| failsafe_and_user_took_over | `bool` | | | true if system is in failsafe state but the user took over control | +| failsafe_defer_state | `uint8` | | | one of FAILSAFE_DEFER_STATE_\* | +| gcs_connection_lost | `bool` | | | datalink to GCS lost | +| gcs_connection_lost_counter | `uint8` | | | counts unique GCS connection lost events | +| high_latency_data_link_lost | `bool` | | | Set to true if the high latency data link (eg. RockBlock Iridium 9603 telemetry module) is lost | +| is_vtol | `bool` | | | True if the system is VTOL capable | +| is_vtol_tailsitter | `bool` | | | True if the system performs a 90° pitch down rotation during transition from MC to FW | +| in_transition_mode | `bool` | | | True if VTOL is doing a transition | +| in_transition_to_fw | `bool` | | | True if VTOL is doing a transition from MC to FW | +| system_type | `uint8` | | | system type, contains mavlink MAV_TYPE | +| system_id | `uint8` | | | system id, contains MAVLink's system ID field | +| component_id | `uint8` | | | subsystem / component id, contains MAVLink's component ID field | +| safety_button_available | `bool` | | | Set to true if a safety button is connected | +| safety_off | `bool` | | | Set to true if safety is off | +| power_input_valid | `bool` | | | set if input power is valid | +| usb_connected | `bool` | | | set to true (never cleared) once telemetry received from usb link | +| open_drone_id_system_present | `bool` | | | | +| open_drone_id_system_healthy | `bool` | | | | +| parachute_system_present | `bool` | | | | +| parachute_system_healthy | `bool` | | | | +| traffic_avoidance_system_present | `bool` | | | | +| rc_calibration_in_progress | `bool` | | | | +| calibration_enabled | `bool` | | | | +| pre_flight_checks_pass | `bool` | | | true if all checks necessary to arm pass | + +## Constants + +| Назва | Тип | Значення | Опис | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------------- | +| MESSAGE_VERSION | `uint32` | 4 | | +| ARMING_STATE_DISARMED | `uint8` | 1 | | +| ARMING_STATE_ARMED | `uint8` | 2 | | +| ARM_DISARM_REASON_STICK_GESTURE | `uint8` | 1 | | +| ARM_DISARM_REASON_RC_SWITCH | `uint8` | 2 | | +| ARM_DISARM_REASON_COMMAND_INTERNAL | `uint8` | 3 | | +| ARM_DISARM_REASON_COMMAND_EXTERNAL | `uint8` | 4 | | +| ARM_DISARM_REASON_MISSION_START | `uint8` | 5 | | +| ARM_DISARM_REASON_LANDING | `uint8` | 6 | | +| ARM_DISARM_REASON_PREFLIGHT_INACTION | `uint8` | 7 | | +| ARM_DISARM_REASON_KILL_SWITCH | `uint8` | 8 | | +| ARM_DISARM_REASON_RC_BUTTON | `uint8` | 13 | | +| ARM_DISARM_REASON_FAILSAFE | `uint8` | 14 | | +| NAVIGATION_STATE_MANUAL | `uint8` | 0 | Manual mode | +| NAVIGATION_STATE_ALTCTL | `uint8` | 1 | Altitude control mode | +| NAVIGATION_STATE_POSCTL | `uint8` | 2 | Position control mode | +| NAVIGATION_STATE_AUTO_MISSION | `uint8` | 3 | Auto mission mode | +| NAVIGATION_STATE_AUTO_LOITER | `uint8` | 4 | Auto loiter mode | +| NAVIGATION_STATE_AUTO_RTL | `uint8` | 5 | Return mode | +| NAVIGATION_STATE_POSITION_SLOW | `uint8` | 6 | | +| NAVIGATION_STATE_GUIDED_COURSE | `uint8` | 7 | Guided Course mode (FW: maintain course/alt/speed) | +| NAVIGATION_STATE_ALTITUDE_CRUISE | `uint8` | 8 | Altitude with Cruise mode | +| NAVIGATION_STATE_MANUAL_PARKING | `uint8` | 9 | Manual Parking mode | +| NAVIGATION_STATE_ACRO | `uint8` | 10 | Acro mode | +| NAVIGATION_STATE_FREE2 | `uint8` | 11 | | +| NAVIGATION_STATE_DESCEND | `uint8` | 12 | Descend mode (no position control) | +| NAVIGATION_STATE_TERMINATION | `uint8` | 13 | Termination mode | +| NAVIGATION_STATE_OFFBOARD | `uint8` | 14 | | +| NAVIGATION_STATE_STAB | `uint8` | 15 | Stabilized mode | +| NAVIGATION_STATE_FREE1 | `uint8` | 16 | | +| NAVIGATION_STATE_AUTO_TAKEOFF | `uint8` | 17 | Takeoff | +| NAVIGATION_STATE_AUTO_LAND | `uint8` | 18 | Land | +| NAVIGATION_STATE_AUTO_FOLLOW_TARGET | `uint8` | 19 | Auto Follow | +| NAVIGATION_STATE_AUTO_PRECLAND | `uint8` | 20 | Precision land with landing target | +| NAVIGATION_STATE_ORBIT | `uint8` | 21 | Orbit in a circle | +| NAVIGATION_STATE_AUTO_VTOL_TAKEOFF | `uint8` | 22 | Takeoff, transition, establish loiter | +| NAVIGATION_STATE_EXTERNAL1 | `uint8` | 23 | | +| NAVIGATION_STATE_EXTERNAL2 | `uint8` | 24 | | +| NAVIGATION_STATE_EXTERNAL3 | `uint8` | 25 | | +| NAVIGATION_STATE_EXTERNAL4 | `uint8` | 26 | | +| NAVIGATION_STATE_EXTERNAL5 | `uint8` | 27 | | +| NAVIGATION_STATE_EXTERNAL6 | `uint8` | 28 | | +| NAVIGATION_STATE_EXTERNAL7 | `uint8` | 29 | | +| NAVIGATION_STATE_EXTERNAL8 | `uint8` | 30 | | +| NAVIGATION_STATE_MAX | `uint8` | 31 | | +| HIL_STATE_OFF | `uint8` | 0 | | +| HIL_STATE_ON | `uint8` | 1 | | +| VEHICLE_TYPE_UNSPECIFIED | `uint8` | 0 | | +| VEHICLE_TYPE_ROTARY_WING | `uint8` | 1 | | +| VEHICLE_TYPE_FIXED_WING | `uint8` | 2 | | +| VEHICLE_TYPE_ROVER | `uint8` | 3 | | +| FAILSAFE_DEFER_STATE_DISABLED | `uint8` | 0 | | +| FAILSAFE_DEFER_STATE_ENABLED | `uint8` | 1 | | +| FAILSAFE_DEFER_STATE_WOULD_FAILSAFE | `uint8` | 2 | Failsafes deferred, but would trigger a failsafe | + +## Source Message + +[Source file (GitHub)](https://github.com/PX4/PX4-Autopilot/blob/main/msg/px4_msgs_old/msg/VehicleStatusV4.msg) + +:::details +Click here to see original file + +```c +# Encodes the system state of the vehicle published by commander + +uint32 MESSAGE_VERSION = 4 + +uint64 timestamp # time since system start (microseconds) + +uint64 armed_time # Arming timestamp (microseconds) +uint64 takeoff_time # Takeoff timestamp (microseconds) + +uint8 arming_state +uint8 ARMING_STATE_DISARMED = 1 +uint8 ARMING_STATE_ARMED = 2 + +uint8 latest_arming_reason +uint8 latest_disarming_reason +uint8 ARM_DISARM_REASON_STICK_GESTURE = 1 +uint8 ARM_DISARM_REASON_RC_SWITCH = 2 +uint8 ARM_DISARM_REASON_COMMAND_INTERNAL = 3 +uint8 ARM_DISARM_REASON_COMMAND_EXTERNAL = 4 +uint8 ARM_DISARM_REASON_MISSION_START = 5 +uint8 ARM_DISARM_REASON_LANDING = 6 +uint8 ARM_DISARM_REASON_PREFLIGHT_INACTION = 7 +uint8 ARM_DISARM_REASON_KILL_SWITCH = 8 +uint8 ARM_DISARM_REASON_RC_BUTTON = 13 +uint8 ARM_DISARM_REASON_FAILSAFE = 14 + +uint64 nav_state_timestamp # time when current nav_state activated + +uint8 nav_state_user_intention # Mode that the user selected (might be different from nav_state in a failsafe situation) + +uint8 nav_state # Currently active mode +uint8 NAVIGATION_STATE_MANUAL = 0 # Manual mode +uint8 NAVIGATION_STATE_ALTCTL = 1 # Altitude control mode +uint8 NAVIGATION_STATE_POSCTL = 2 # Position control mode +uint8 NAVIGATION_STATE_AUTO_MISSION = 3 # Auto mission mode +uint8 NAVIGATION_STATE_AUTO_LOITER = 4 # Auto loiter mode +uint8 NAVIGATION_STATE_AUTO_RTL = 5 # Return mode +uint8 NAVIGATION_STATE_POSITION_SLOW = 6 +uint8 NAVIGATION_STATE_GUIDED_COURSE = 7 # Guided Course mode (FW: maintain course/alt/speed) +uint8 NAVIGATION_STATE_ALTITUDE_CRUISE = 8 # Altitude with Cruise mode +uint8 NAVIGATION_STATE_MANUAL_PARKING = 9 # Manual Parking mode +uint8 NAVIGATION_STATE_ACRO = 10 # Acro mode +uint8 NAVIGATION_STATE_FREE2 = 11 +uint8 NAVIGATION_STATE_DESCEND = 12 # Descend mode (no position control) +uint8 NAVIGATION_STATE_TERMINATION = 13 # Termination mode +uint8 NAVIGATION_STATE_OFFBOARD = 14 +uint8 NAVIGATION_STATE_STAB = 15 # Stabilized mode +uint8 NAVIGATION_STATE_FREE1 = 16 +uint8 NAVIGATION_STATE_AUTO_TAKEOFF = 17 # Takeoff +uint8 NAVIGATION_STATE_AUTO_LAND = 18 # Land +uint8 NAVIGATION_STATE_AUTO_FOLLOW_TARGET = 19 # Auto Follow +uint8 NAVIGATION_STATE_AUTO_PRECLAND = 20 # Precision land with landing target +uint8 NAVIGATION_STATE_ORBIT = 21 # Orbit in a circle +uint8 NAVIGATION_STATE_AUTO_VTOL_TAKEOFF = 22 # Takeoff, transition, establish loiter +uint8 NAVIGATION_STATE_EXTERNAL1 = 23 +uint8 NAVIGATION_STATE_EXTERNAL2 = 24 +uint8 NAVIGATION_STATE_EXTERNAL3 = 25 +uint8 NAVIGATION_STATE_EXTERNAL4 = 26 +uint8 NAVIGATION_STATE_EXTERNAL5 = 27 +uint8 NAVIGATION_STATE_EXTERNAL6 = 28 +uint8 NAVIGATION_STATE_EXTERNAL7 = 29 +uint8 NAVIGATION_STATE_EXTERNAL8 = 30 +uint8 NAVIGATION_STATE_MAX = 31 + +uint8 executor_in_charge # Current mode executor in charge (0=Autopilot) +uint8 nav_state_display # User-visible nav state sent via MAVLink (executor state if active, otherwise nav_state) + +bool accepts_offboard_setpoints # True if the current mode accepts offboard trajectory setpoints via MAVLink + +uint32 valid_nav_states_mask # Bitmask for all valid nav_state values +uint32 can_set_nav_states_mask # Bitmask for all modes that a user can select + +uint8 hil_state +uint8 HIL_STATE_OFF = 0 +uint8 HIL_STATE_ON = 1 + +# Current vehicle locomotion method. A vehicle can have different methods (e.g. VTOL transitions from RW to FW method) +uint8 vehicle_type +uint8 VEHICLE_TYPE_UNSPECIFIED = 0 +uint8 VEHICLE_TYPE_ROTARY_WING = 1 +uint8 VEHICLE_TYPE_FIXED_WING = 2 +uint8 VEHICLE_TYPE_ROVER = 3 + +uint8 FAILSAFE_DEFER_STATE_DISABLED = 0 +uint8 FAILSAFE_DEFER_STATE_ENABLED = 1 +uint8 FAILSAFE_DEFER_STATE_WOULD_FAILSAFE = 2 # Failsafes deferred, but would trigger a failsafe + +bool failsafe # true if system is in failsafe state (e.g. Return, Hover, Terminate, ...) +bool failsafe_and_user_took_over # true if system is in failsafe state but the user took over control +uint8 failsafe_defer_state # one of FAILSAFE_DEFER_STATE_* + +# Link loss +bool gcs_connection_lost # datalink to GCS lost +uint8 gcs_connection_lost_counter # counts unique GCS connection lost events +bool high_latency_data_link_lost # Set to true if the high latency data link (eg. RockBlock Iridium 9603 telemetry module) is lost + +# VTOL flags +bool is_vtol # True if the system is VTOL capable +bool is_vtol_tailsitter # True if the system performs a 90° pitch down rotation during transition from MC to FW +bool in_transition_mode # True if VTOL is doing a transition +bool in_transition_to_fw # True if VTOL is doing a transition from MC to FW + +# MAVLink identification +uint8 system_type # system type, contains mavlink MAV_TYPE +uint8 system_id # system id, contains MAVLink's system ID field +uint8 component_id # subsystem / component id, contains MAVLink's component ID field + +bool safety_button_available # Set to true if a safety button is connected +bool safety_off # Set to true if safety is off + +bool power_input_valid # set if input power is valid +bool usb_connected # set to true (never cleared) once telemetry received from usb link + +bool open_drone_id_system_present +bool open_drone_id_system_healthy + +bool parachute_system_present +bool parachute_system_healthy + +bool traffic_avoidance_system_present + +bool rc_calibration_in_progress +bool calibration_enabled + +bool pre_flight_checks_pass # true if all checks necessary to arm pass +``` + +::: diff --git a/docs/uk/msg_docs/VteAidSource1d.md b/docs/uk/msg_docs/VteAidSource1d.md index 229a1219d66..bf5e3f49c53 100644 --- a/docs/uk/msg_docs/VteAidSource1d.md +++ b/docs/uk/msg_docs/VteAidSource1d.md @@ -13,19 +13,22 @@ Subscribed by: logger only. Inspect observation, innovation, test_ratio, and fus ## Fields -| Назва | Тип | Unit [Frame] | Range/Enum | Опис | -| -------------------------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| timestamp | `uint64` | us | | Time since system start | -| timestamp_sample | `uint64` | us | | Timestamp of the raw observation | -| time_last_predict | `uint64` | us | | Timestamp of last filter prediction | -| observation | `float32` | | | Observation attempted to be fused | -| observation_variance | `float32` | | | Variance of observation attempted to be fused | -| innovation | `float32` | | | Kalman Filter innovation (y = z - Hx) | -| innovation_variance | `float32` | | | Kalman Filter variance of the innovation | -| test_ratio | `float32` | | | Normalized innovation squared (NIS) | -| fusion_status | `uint8` | | [VTE_FUSION_STATUS](#VTE_FUSION_STATUS) | Fusion status code | -| time_since_meas_ms | `float32` | ms | | (now - timestamp_sample) | -| history_steps | `uint8` | | | Number of steps replayed in OOSM (0 if current or failed) | +| Назва | Тип | Unit [Frame] | Range/Enum | Опис | +| -------------------------------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| timestamp | `uint64` | us | | Time since system start | +| timestamp_sample | `uint64` | us | | Timestamp of the raw observation | +| time_last_predict | `uint64` | us | | Timestamp of last filter prediction | +| observation | `float32` | | | Observation attempted to be fused | +| observation_variance | `float32` | | | Variance of observation attempted to be fused | +| innovation | `float32` | | | Kalman Filter innovation (y = z - Hx) | +| innovation_variance | `float32` | | | Kalman Filter variance of the innovation | +| test_ratio | `float32` | | | NIS divided by the gate threshold, so above 1 means rejected | +| fusion_status | `uint8` | | [VTE_FUSION_STATUS](#VTE_FUSION_STATUS) | Fusion status code | +| time_since_meas_ms | `float32` | ms | | (now - timestamp_sample) | +| history_steps | `uint8` | | | Number of steps replayed in OOSM (0 if current or failed) | +| replayed_count | `uint8` | | | Stored observations gated again after this one (0 if none) | +| replay_revised_count | `uint8` | | | Those whose gate decision changed (0 if none) | +| replay_test_ratio_max | `float32` | | | Highest test_ratio among those accepted before the replay (-1 if none) | ## Enums @@ -38,17 +41,18 @@ Used in field(s): [fusion_status](#fld_fusion_status) ## Constants -| Назва | Тип | Значення | Опис | -| ------------------------------------------------------------------------------------------------------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------ | -| STATUS_IDLE | `uint8` | 0 | No fusion attempted yet | -| STATUS_FUSED_CURRENT | `uint8` | 1 | Fused immediately (low latency) | -| STATUS_FUSED_OOSM | `uint8` | 2 | Fused via history buffer | -| STATUS_REJECT_NIS | `uint8` | 3 | Rejected by Normalized Innovation Squared check | -| STATUS_REJECT_COV | `uint8` | 4 | Rejected due to invalid/infinite covariance or numerical error | -| STATUS_REJECT_TOO_OLD | `uint8` | 5 | Rejected: older than buffer limit (kOosmMaxTimeUs) or oldest sample | -| STATUS_REJECT_TOO_NEW | `uint8` | 6 | Rejected: timestamp in the future (beyond tolerance) | -| STATUS_REJECT_STALE | `uint8` | 7 | Rejected: history was reset due to staleness/discontinuity | -| STATUS_REJECT_EMPTY | `uint8` | 8 | Rejected: history buffer not yet populated | +| Назва | Тип | Значення | Опис | +| ------------------------------------------------------------------------------------------------------------------------ | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- | +| STATUS_IDLE | `uint8` | 0 | No fusion attempted yet | +| STATUS_FUSED_CURRENT | `uint8` | 1 | Fused immediately (low latency) | +| STATUS_FUSED_OOSM | `uint8` | 2 | Fused via history buffer | +| STATUS_REJECT_NIS | `uint8` | 3 | Rejected by Normalized Innovation Squared check | +| STATUS_REJECT_COV | `uint8` | 4 | Rejected due to invalid/infinite covariance or numerical error; clears history if a replayed observation failed | +| STATUS_REJECT_TOO_OLD | `uint8` | 5 | Rejected: older than buffer limit (kOosmMaxTimeUs) or the oldest snapshot a replay can use | +| STATUS_REJECT_TOO_NEW | `uint8` | 6 | Rejected: timestamp in the future (beyond tolerance) | +| STATUS_REJECT_STALE | `uint8` | 7 | Rejected: history was reset due to staleness/discontinuity | +| STATUS_REJECT_EMPTY | `uint8` | 8 | Rejected: history buffer not yet populated | +| STATUS_INITIALIZED | `uint8` | 9 | Accepted as initial state; no prior innovation or repeated fusion | ## Source Message @@ -74,22 +78,26 @@ float32 observation_variance # [-] Variance of observation attempted to be fused float32 innovation # [-] Kalman Filter innovation (y = z - Hx) float32 innovation_variance # [-] Kalman Filter variance of the innovation -float32 test_ratio # [-] Normalized innovation squared (NIS) +float32 test_ratio # [-] NIS divided by the gate threshold, so above 1 means rejected uint8 fusion_status # [@enum VTE_FUSION_STATUS] Fusion status code uint8 STATUS_IDLE = 0 # No fusion attempted yet uint8 STATUS_FUSED_CURRENT = 1 # Fused immediately (low latency) uint8 STATUS_FUSED_OOSM = 2 # Fused via history buffer uint8 STATUS_REJECT_NIS = 3 # Rejected by Normalized Innovation Squared check -uint8 STATUS_REJECT_COV = 4 # Rejected due to invalid/infinite covariance or numerical error -uint8 STATUS_REJECT_TOO_OLD = 5 # Rejected: older than buffer limit (kOosmMaxTimeUs) or oldest sample +uint8 STATUS_REJECT_COV = 4 # Rejected due to invalid/infinite covariance or numerical error; clears history if a replayed observation failed +uint8 STATUS_REJECT_TOO_OLD = 5 # Rejected: older than buffer limit (kOosmMaxTimeUs) or the oldest snapshot a replay can use uint8 STATUS_REJECT_TOO_NEW = 6 # Rejected: timestamp in the future (beyond tolerance) uint8 STATUS_REJECT_STALE = 7 # Rejected: history was reset due to staleness/discontinuity uint8 STATUS_REJECT_EMPTY = 8 # Rejected: history buffer not yet populated +uint8 STATUS_INITIALIZED = 9 # Accepted as initial state; no prior innovation or repeated fusion # OOSM Diagnostics float32 time_since_meas_ms # [ms] (now - timestamp_sample) uint8 history_steps # [-] Number of steps replayed in OOSM (0 if current or failed) +uint8 replayed_count # [-] Stored observations gated again after this one (0 if none) +uint8 replay_revised_count # [-] Those whose gate decision changed (0 if none) +float32 replay_test_ratio_max # [-] Highest test_ratio among those accepted before the replay (-1 if none) # TOPICS vte_aid_ev_yaw ``` diff --git a/docs/uk/msg_docs/VteAidSource3d.md b/docs/uk/msg_docs/VteAidSource3d.md index 70846ecfb8b..0e15381e356 100644 --- a/docs/uk/msg_docs/VteAidSource3d.md +++ b/docs/uk/msg_docs/VteAidSource3d.md @@ -13,19 +13,22 @@ Subscribed by: logger only. Inspect observation, innovation, test_ratio, and per ## Fields -| Назва | Тип | Unit [Frame] | Range/Enum | Опис | -| -------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| timestamp | `uint64` | us | | Time since system start | -| timestamp_sample | `uint64` | us | | Timestamp of the raw observation | -| time_last_predict | `uint64` | us | | Timestamp of last filter prediction | -| observation | `float32[3]` | [NED] | | Sensor observation attempted to be fused | -| observation_variance | `float32[3]` | [NED] | | Variance of the observation attempted to be fused | -| innovation | `float32[3]` | [NED] | | Kalman Filter innovation (y = z - Hx) | -| innovation_variance | `float32[3]` | [NED] | | Kalman Filter variance of the innovation | -| test_ratio | `float32[3]` | | | Normalized innovation squared (NIS) | -| fusion_status | `uint8[3]` | | [VTE_FUSION_STATUS](#VTE_FUSION_STATUS) | Fusion status code per axis | -| time_since_meas_ms | `float32` | ms | | (now - timestamp_sample) | -| history_steps | `uint8` | | | Number of steps replayed in OOSM (0 if current or failed) | +| Назва | Тип | Unit [Frame] | Range/Enum | Опис | +| -------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| timestamp | `uint64` | us | | Time since system start | +| timestamp_sample | `uint64` | us | | Timestamp of the raw observation | +| time_last_predict | `uint64` | us | | Timestamp of last filter prediction | +| observation | `float32[3]` | [NED] | | Sensor observation attempted to be fused | +| observation_variance | `float32[3]` | [NED] | | Variance of the observation attempted to be fused | +| innovation | `float32[3]` | [NED] | | Kalman Filter innovation (y = z - Hx) | +| innovation_variance | `float32[3]` | [NED] | | Kalman Filter variance of the innovation | +| test_ratio | `float32[3]` | | | NIS divided by the gate threshold, so above 1 means rejected | +| fusion_status | `uint8[3]` | | [VTE_FUSION_STATUS](#VTE_FUSION_STATUS) | Fusion status code per axis | +| time_since_meas_ms | `float32` | ms | | (now - timestamp_sample) | +| history_steps | `uint8` | | | Number of steps replayed in OOSM (0 if current or failed) | +| replayed_count | `uint8` | | | Stored observations gated again after this one, most on any axis (0 if none) | +| replay_revised_count | `uint8` | | | Those whose gate decision changed, most on any axis (0 if none) | +| replay_test_ratio_max | `float32[3]` | | | Highest test_ratio among those accepted before the replay (-1 if none) | ## Enums @@ -38,17 +41,18 @@ Used in field(s): [fusion_status](#fld_fusion_status) ## Constants -| Назва | Тип | Значення | Опис | -| ------------------------------------------------------------------------------------------------------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------ | -| STATUS_IDLE | `uint8` | 0 | No fusion attempted yet | -| STATUS_FUSED_CURRENT | `uint8` | 1 | Fused immediately (low latency) | -| STATUS_FUSED_OOSM | `uint8` | 2 | Fused via history buffer | -| STATUS_REJECT_NIS | `uint8` | 3 | Rejected by Normalized Innovation Squared check | -| STATUS_REJECT_COV | `uint8` | 4 | Rejected due to invalid/infinite covariance or numerical error | -| STATUS_REJECT_TOO_OLD | `uint8` | 5 | Rejected: older than buffer limit (kOosmMaxTimeUs) or oldest sample | -| STATUS_REJECT_TOO_NEW | `uint8` | 6 | Rejected: timestamp in the future (beyond tolerance) | -| STATUS_REJECT_STALE | `uint8` | 7 | Rejected: history was reset due to staleness/discontinuity | -| STATUS_REJECT_EMPTY | `uint8` | 8 | Rejected: history buffer not yet populated | +| Назва | Тип | Значення | Опис | +| ------------------------------------------------------------------------------------------------------------------------ | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- | +| STATUS_IDLE | `uint8` | 0 | No fusion attempted yet | +| STATUS_FUSED_CURRENT | `uint8` | 1 | Fused immediately (low latency) | +| STATUS_FUSED_OOSM | `uint8` | 2 | Fused via history buffer | +| STATUS_REJECT_NIS | `uint8` | 3 | Rejected by Normalized Innovation Squared check | +| STATUS_REJECT_COV | `uint8` | 4 | Rejected due to invalid/infinite covariance or numerical error; clears history if a replayed observation failed | +| STATUS_REJECT_TOO_OLD | `uint8` | 5 | Rejected: older than buffer limit (kOosmMaxTimeUs) or the oldest snapshot a replay can use | +| STATUS_REJECT_TOO_NEW | `uint8` | 6 | Rejected: timestamp in the future (beyond tolerance) | +| STATUS_REJECT_STALE | `uint8` | 7 | Rejected: history was reset due to staleness/discontinuity | +| STATUS_REJECT_EMPTY | `uint8` | 8 | Rejected: history buffer not yet populated | +| STATUS_INITIALIZED | `uint8` | 9 | Accepted as initial state; no prior innovation or repeated fusion | ## Source Message @@ -74,22 +78,26 @@ float32[3] observation_variance # [-] [@frame NED] Variance of the observation a float32[3] innovation # [-] [@frame NED] Kalman Filter innovation (y = z - Hx) float32[3] innovation_variance # [-] [@frame NED] Kalman Filter variance of the innovation -float32[3] test_ratio # [-] Normalized innovation squared (NIS) +float32[3] test_ratio # [-] NIS divided by the gate threshold, so above 1 means rejected uint8[3] fusion_status # [@enum VTE_FUSION_STATUS] Fusion status code per axis uint8 STATUS_IDLE = 0 # No fusion attempted yet uint8 STATUS_FUSED_CURRENT = 1 # Fused immediately (low latency) uint8 STATUS_FUSED_OOSM = 2 # Fused via history buffer uint8 STATUS_REJECT_NIS = 3 # Rejected by Normalized Innovation Squared check -uint8 STATUS_REJECT_COV = 4 # Rejected due to invalid/infinite covariance or numerical error -uint8 STATUS_REJECT_TOO_OLD = 5 # Rejected: older than buffer limit (kOosmMaxTimeUs) or oldest sample +uint8 STATUS_REJECT_COV = 4 # Rejected due to invalid/infinite covariance or numerical error; clears history if a replayed observation failed +uint8 STATUS_REJECT_TOO_OLD = 5 # Rejected: older than buffer limit (kOosmMaxTimeUs) or the oldest snapshot a replay can use uint8 STATUS_REJECT_TOO_NEW = 6 # Rejected: timestamp in the future (beyond tolerance) uint8 STATUS_REJECT_STALE = 7 # Rejected: history was reset due to staleness/discontinuity uint8 STATUS_REJECT_EMPTY = 8 # Rejected: history buffer not yet populated +uint8 STATUS_INITIALIZED = 9 # Accepted as initial state; no prior innovation or repeated fusion -# OOSM Diagnostics (Shared across axes) +# OOSM Diagnostics (scalars are shared across axes) float32 time_since_meas_ms # [ms] (now - timestamp_sample) uint8 history_steps # [-] Number of steps replayed in OOSM (0 if current or failed) +uint8 replayed_count # [-] Stored observations gated again after this one, most on any axis (0 if none) +uint8 replay_revised_count # [-] Those whose gate decision changed, most on any axis (0 if none) +float32[3] replay_test_ratio_max # [-] Highest test_ratio among those accepted before the replay (-1 if none) # TOPICS vte_aid_gps_pos_target vte_aid_gps_pos_mission vte_aid_gps_vel_target vte_aid_gps_vel_uav # TOPICS vte_aid_fiducial_marker diff --git a/docs/uk/msg_docs/VteOrientation.md b/docs/uk/msg_docs/VteOrientation.md index 28a1a1ede40..d658688504a 100644 --- a/docs/uk/msg_docs/VteOrientation.md +++ b/docs/uk/msg_docs/VteOrientation.md @@ -7,7 +7,7 @@ pageClass: is-wide-page Vision Target Estimator orientation state, exposing the full yaw filter output with covariances for logging and tuning. Published by: vision_target_estimator (VTEOrientation). -Subscribed by: logger only. The orientation-related fields consumed elsewhere (precision landing) are exposed on landing_target_pose. +Subscribed by: precision landing (navigator) and the logger. **TOPICS:** vte_orientation @@ -33,7 +33,7 @@ Click here to see original file # Vision Target Estimator orientation state, exposing the full yaw filter output with covariances for logging and tuning. # # Published by: vision_target_estimator (VTEOrientation). -# Subscribed by: logger only. The orientation-related fields consumed elsewhere (precision landing) are exposed on landing_target_pose. +# Subscribed by: precision landing (navigator) and the logger. uint64 timestamp # [us] Time since system start diff --git a/docs/uk/msg_docs/index.md b/docs/uk/msg_docs/index.md index 67e2a916413..8ca7c062c5d 100644 --- a/docs/uk/msg_docs/index.md +++ b/docs/uk/msg_docs/index.md @@ -66,17 +66,21 @@ Graphs showing how these are used [can be found here](../middleware/uorb_graph.m - [HomePositionV0](HomePositionV0.md) — GPS home position in WGS84 coordinates. - [HomePositionV1](HomePositionV1.md) — GPS home position in WGS84 coordinates. - [ManualControlSetpointV0](ManualControlSetpointV0.md) +- [ManualControlSetpointV1](ManualControlSetpointV1.md) — Manual control input. - [RegisterExtComponentReplyV0](RegisterExtComponentReplyV0.md) - [RegisterExtComponentRequestV0](RegisterExtComponentRequestV0.md) — Request to register an external component. - [RegisterExtComponentRequestV1](RegisterExtComponentRequestV1.md) — Request to register an external component. - [VehicleAttitudeSetpointV0](VehicleAttitudeSetpointV0.md) - [VehicleCommandAckV0](VehicleCommandAckV0.md) — Vehicle Command Ackonwledgement uORB message. Used for acknowledging the vehicle command being received. Follows the MAVLink COMMAND_ACK message definition. +- [VehicleCommandAckV1](VehicleCommandAckV1.md) — Vehicle Command Acknowledgement uORB message. +- [VehicleCommandV0](VehicleCommandV0.md) — Vehicle Command uORB message. Використовується для управління місією / дією / тощо. Follows the MAVLink COMMAND_INT / COMMAND_LONG definition. - [VehicleGlobalPositionV0](VehicleGlobalPositionV0.md) — Fused global position in WGS84. This struct contains global position estimation. It is not the raw GPS. measurement (@see vehicle_gps_position). This topic is usually published by the position. estimator, which will take more sources of information into account than just GPS,. e.g. control inputs of the vehicle in a Kalman-filter implementation. - [VehicleLocalPositionV0](VehicleLocalPositionV0.md) — Fused local position in NED. The coordinate system origin is the vehicle position at the time when the EKF2-module was started. - [VehicleStatusV0](VehicleStatusV0.md) — Encodes the system state of the vehicle published by commander. - [VehicleStatusV1](VehicleStatusV1.md) — Encodes the system state of the vehicle published by commander. - [VehicleStatusV2](VehicleStatusV2.md) — Encodes the system state of the vehicle published by commander. - [VehicleStatusV3](VehicleStatusV3.md) — Encodes the system state of the vehicle published by commander. +- [VehicleStatusV4](VehicleStatusV4.md) — Encodes the system state of the vehicle published by commander. ## Unversioned Messages diff --git a/docs/uk/releases/1.18.md b/docs/uk/releases/1.18.md index 6bfc0133fa3..8857cd9065f 100644 --- a/docs/uk/releases/1.18.md +++ b/docs/uk/releases/1.18.md @@ -198,10 +198,11 @@ For users upgrading from v1.17, please take a moment to review the following bef - Rejected missions now report the reason to the GCS (e.g. empty mission, dataman read failure) instead of failing silently. ([PX4-Autopilot#27254](https://github.com/PX4/PX4-Autopilot/pull/27254)) - Arming with [RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) set to `5` (safe points only) no longer requires a rally point to be uploaded: the vehicle falls back to returning to the home position when no rally point is defined. ([PX4-Autopilot#27773](https://github.com/PX4/PX4-Autopilot/pull/27773)) - GCS connection-loss failsafe no longer triggers flight termination while the vehicle is disarmed, preventing a termination state from latching before or at arming after a ground station link loss. ([PX4-Autopilot#26820](https://github.com/PX4/PX4-Autopilot/pull/26820)) -- New [NAV_RCL_ACT](../advanced_config/parameter_reference.md#NAV_RCL_ACT) option `7` (Hold without failsafe): on manual control (RC) loss the vehicle holds position but does not enter a failsafe state, so an external mode or offboard controller can keep commanding it. ([PX4-Autopilot#27792](https://github.com/PX4/PX4-Autopilot/pull/27792)) +- New [NAV_RCL_ACT](../advanced_config/parameter_reference.md#NAV_RCL_ACT) option `7` (Hold without failsafe): on manual control (RC) loss the vehicle holds position but does not enter a failsafe state, so an external mode or offboard controller can keep commanding it. If [COM_OBL_RC_ACT](../advanced_config/parameter_reference.md#COM_OBL_RC_ACT) is a manual mode (the default, Position), a vehicle in Offboard mode without manual control now goes to Hold when its companion computer stops, instead of staying in Offboard. ([PX4-Autopilot#27792](https://github.com/PX4/PX4-Autopilot/pull/27792), [PX4-Autopilot#28961](https://github.com/PX4/PX4-Autopilot/pull/28961)) - Control allocator now stops the motors when it receives a NaN thrust setpoint, instead of forwarding invalid values to the ESCs. ([PX4-Autopilot#26494](https://github.com/PX4/PX4-Autopilot/pull/26494)) - The home position altitude filter receives its barometer time delta in seconds instead of microseconds. ([PX4-Autopilot#28415](https://github.com/PX4/PX4-Autopilot/pull/28415)) - A mission that ends on an exhausted DO_JUMP no longer reports "Waypoint could not be read" at critical severity. ([PX4-Autopilot#28464](https://github.com/PX4/PX4-Autopilot/pull/28464)) +- With more than one battery, a battery that disconnects in flight no longer holds the [battery level failsafe](../config/safety.md#battery-level-failsafe) at the critical level when another battery reaches the emergency level, so with [COM_LOW_BAT_ACT](../advanced_config/parameter_reference.md#COM_LOW_BAT_ACT) set to `3` the vehicle now lands at the emergency level instead of continuing to return. ([PX4-Autopilot#29028](https://github.com/PX4/PX4-Autopilot/pull/29028)) ## Оцінки @@ -217,7 +218,12 @@ For users upgrading from v1.17, please take a moment to review the following bef - EKF2 can now use GNSS height as the height reference when GNSS is in dead-reckoning mode, provided it can start without requiring a reset. ([PX4-Autopilot#27766](https://github.com/PX4/PX4-Autopilot/pull/27766)) - EKF2 now counts NED-frame external vision velocity fusion as a horizontal (NE) aiding source (and only counts vision position when it is in the NED frame), so vehicles aided only by vision velocity are no longer treated as dead-reckoning. ([PX4-Autopilot#27538](https://github.com/PX4/PX4-Autopilot/pull/27538)) - The EKF2 selector no longer falls back to an instance whose vertical test ratio is already failing, which stepped the published altitude on every switch after a brief fault on the selected instance. ([PX4-Autopilot#28418](https://github.com/PX4/PX4-Autopilot/pull/28418)) +- EKF2 now caps the GNSS height observation noise at [EKF2_NOAID_NOISE](../advanced_config/parameter_reference.md#EKF2_NOAID_NOISE) only when no other height source is fused. With a barometer or another height source, a GNSS height with a poor reported vertical accuracy is no longer fused as more accurate than the receiver reports. ([PX4-Autopilot#29058](https://github.com/PX4/PX4-Autopilot/pull/29058)) + +## Датчики + - Disabling the selected magnetometer at runtime (setting its [CAL_MAGn_PRIO](../advanced_config/parameter_reference.md#CAL_MAG0_PRIO) to `0`) now hands over to the next magnetometer without a sensor failure report, and a magnetometer disabled at boot no longer prevents those after it from being selected. ([PX4-Autopilot#28750](https://github.com/PX4/PX4-Autopilot/pull/28750)) +- [Thermal compensation](../advanced_config/sensor_thermal_calibration.md) for a magnetometer that reports no temperature now reads the barometer sample. Previously it read the accelerometer sample, which overran a stack buffer once a second and published the accelerometer y-axis value as the magnetometer temperature. ([PX4-Autopilot#28997](https://github.com/PX4/PX4-Autopilot/pull/28997)) ## RC diff --git a/docs/uk/releases/main.md b/docs/uk/releases/main.md index 52ca3a3ddc5..b69d50d87b9 100644 --- a/docs/uk/releases/main.md +++ b/docs/uk/releases/main.md @@ -43,30 +43,49 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ROS 2 applications must subscribe to `/fmu/out/vehicle_gnss` (`px4_msgs/msg/VehicleGnss`) instead of `/fmu/out/vehicle_gps_position` (`px4_msgs/msg/SensorGps`). Read the timestamps from the top level of `VehicleGnss`: only `timestamp` and `timestamp_sample` are converted to ROS time, while `receiver.timestamp` and `receiver.timestamp_sample` stay on the PX4 boot clock. `timestamp` is now when the sensors module published the sample; use `timestamp_sample` for the measurement time. - `SENS_GPS_MASK`, `SENS_GPS_TAU`, `SENS_GPS_PRIME` and `SENS_GPSn_ID/OFFX/OFFY/OFFZ/DELAY` are now `SENS_GNSS_*` and `SENS_GNSSn_*` (the driver `GPS_*` and `EKF2_*` parameters are unchanged). + `SENS_GPS_MASK`, `SENS_GPS_TAU`, `SENS_GPS_PRIME` and `SENS_GPSn_ID/OFFX/OFFY/OFFZ/DELAY` are now `SENS_GNSS_*` and `SENS_GNSSn_*` (the driver `GPS_*` parameters are unchanged). Saved parameters are migrated automatically, but loading a QGC parameter file with the old names does not restore them. The log analysis scripts in the tree read both the old and the new names. The uORB-over-Cyphal registers are renamed from `uorb.sensor_gps` to `uorb.sensor_gnss` (`uavcan.sub.uorb.sensor_gnss.0.id`, `uavcan.pub.uorb.sensor_gnss.0.id`); `UCAN1_UORB_GPS` and `UCAN1_UORB_GPS_P` are unchanged. ([PX4-Autopilot#24399](https://github.com/PX4/PX4-Autopilot/pull/24399)) +- **The GNSS check parameters moved from EKF2 to the sensors module.** + `EKF2_GPS_CHECK` is now [GNSS_CHECK](../advanced_config/parameter_reference.md#GNSS_CHECK), `EKF2_REQ_EPH`, `EKF2_REQ_EPV`, `EKF2_REQ_NSATS`, `EKF2_REQ_PDOP`, `EKF2_REQ_HDRIFT`, `EKF2_REQ_VDRIFT`, `EKF2_REQ_FIX` and `EKF2_REQ_SACC` are now `GNSS_REQ_*`, and `EKF2_REQ_GPS_H` is now [GNSS_REQ_TIME](../advanced_config/parameter_reference.md#GNSS_REQ_TIME). + Saved parameters are migrated automatically, but loading a QGC parameter file with the old names does not restore them. ([PX4-Autopilot#28520](https://github.com/PX4/PX4-Autopilot/pull/28520), [PX4-Autopilot#28798](https://github.com/PX4/PX4-Autopilot/pull/28798)) - **`DO_JUMP` can only loop back and its repeat count must fit.** A mission is now rejected if a `DO_JUMP` targets itself or a later mission item, even if its repeat count is 0, and if its repeat count is negative, above 65535 or not a number (it is no longer narrowed to a different count). Missions stored on the vehicle with such jumps must be edited and uploaded again. +- **`MAV_CMD_MISSION_START` no longer arms the vehicle.** + The command switches to [Mission mode](../flight_modes_mc/mission.md) at the requested item, and the mission starts once the vehicle is armed. + This also applies to `MAV_CMD_DO_LAND_START`, which uses it internally. + Ground stations and scripts that relied on the command to arm must send `MAV_CMD_COMPONENT_ARM_DISARM` separately (QGroundControl, MAVSDK and the PX4 ROS 2 Interface Library already do). + See the [MAVLink spec clarification](https://github.com/mavlink/mavlink/pull/2648). +- **The primary GNSS receiver defaults to Auto.** + [SENS_GNSS_PRIME](../advanced_config/parameter_reference.md#SENS_GNSS_PRIME) now defaults to `-1` (Auto) instead of `0`, and saved values are not changed: with Auto the moving base of a moving base pair is the primary receiver, and without one, a receiver that passes the strict checks ([GNSS_REQ_EPH](../advanced_config/parameter_reference.md#GNSS_REQ_EPH) and the other `GNSS_REQ_*` parameters) is used, then one with an RTK fixed solution. + To keep preferring the receiver on the main serial port, set `SENS_GNSS_PRIME` to `0`. + In flight the primary receiver is now also left when it has failed the strict checks for 10 s while the other receiver passed them. ([PX4-Autopilot#28798](https://github.com/PX4/PX4-Autopilot/pull/28798)) +- **Re-check the motor failure trigger thresholds.** + `MOTFAIL_OFF` and `MOTFAIL_TIME` are replaced by a separate band and trigger time per direction ([MOTFAIL_OVER](../advanced_config/parameter_reference.md#MOTFAIL_OVER)/[MOTFAIL_OVR_TIME](../advanced_config/parameter_reference.md#MOTFAIL_OVR_TIME) and [MOTFAIL_UNDER](../advanced_config/parameter_reference.md#MOTFAIL_UNDER)/[MOTFAIL_UND_TIME](../advanced_config/parameter_reference.md#MOTFAIL_UND_TIME)), and are not migrated: the new parameters start at their defaults. The check now compares a low-pass filtered current residual instead of the instantaneous value, so the thresholds are worth re-deriving: see [Motor Failure Detection > Upgrading from PX4 v1.18](../config/motor_failure_detection.md#upgrading-from-px4-v1-18). ([PX4-Autopilot#27917](https://github.com/PX4/PX4-Autopilot/pull/27917)) ## Інші зміни - Fast mission Return modes ([RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) = 2 and 4) now skip `DO_JUMP` commands (loops) while following the mission path. ([PX4-Autopilot#26993: fix(navigator): goToNextPositionItem skip loops when required](https://github.com/PX4/PX4-Autopilot/pull/26993)) +- A mission Return mode ([RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) = 1, 2, 3 or 4) now reads the current mission on the cycle that activates it, so a mission uploaded or changed right as Return starts is used for the return type, the geofence avoidance destination and the starting item. The fast variants also discard the item index they recorded from an earlier mission when a different one is current. ([PX4-Autopilot#28748](https://github.com/PX4/PX4-Autopilot/pull/28748)) +- A `DO_JUMP` whose counter cannot be written to storage, for example on a failing SD card, is now skipped with a message to the operator. Previously the jump was taken again on every pass, repeating the same mission segment until a failsafe stopped the mission. ([PX4-Autopilot#28752](https://github.com/PX4/PX4-Autopilot/pull/28752)) ### Підтримка обладнання +- [AIFoundry Erbium](../flight_controller/aifoundry_erbium.md): new experimental target for the AIFoundry Erbium RISC-V (ET-Minion) chip, which runs the SIH quadcopter on the `erbium_emu` emulator until silicon is available. ([PX4-Autopilot#29094](https://github.com/PX4/PX4-Autopilot/pull/29094)) - [DroneCAN ESCs](../dronecan/escs.md) no longer need to set `UAVCAN_PUB_ARM` as `ArmingStatus` is published automatically whenever `UAVCAN_ENABLE` is `3` (ESC output enabled). ([PX4-Autopilot#28364](https://github.com/PX4/PX4-Autopilot/pull/28364)) - [DroneCAN ESC](../dronecan/escs.md) channels assigned a non-motor function (e.g. _Peripheral via Actuator Set_) can be driven bidirectionally via `UAVCAN_EC_SIGNED` (signed RawCommand, 0 = neutral). Motors continue to use `CA_R_REV`. ([PX4-Autopilot#26903](https://github.com/PX4/PX4-Autopilot/pull/26903)) - [DroneCAN](../dronecan/index.md) batteries that set the charging flag in `BatteryInfo` now report a charging state (shown in MAVLink `BATTERY_STATUS.charge_state`) as long as the pack has no low, critical or emergency warning. Charging does not count as a battery warning, so it does not affect the [battery level failsafe](../config/safety.md#battery-level-failsafe) or the arming checks. ([PX4-Autopilot#28422](https://github.com/PX4/PX4-Autopilot/pull/28422), [PX4-Autopilot#29012](https://github.com/PX4/PX4-Autopilot/pull/29012)) - [Serial Passthrough](../uart/serial_passthrough.md): new reference [bridge application](../uart/serial_passthrough.md#bridge-application), `Tools/mavlink_serial_bridge.py`, exposes a flight controller serial port or ESC signal pin as a virtual serial port on a Linux/macOS host, so ESC configuration and GPS tools can connect to it over MAVLink. ([PX4-Autopilot#28782: feat(tools): add mavlink_serial_bridge.py reference bridge application](https://github.com/PX4/PX4-Autopilot/pull/28782)) +- [Agam FloRange](../dronecan/agam_florange.md): new DroneCAN optical flow, distance sensor and IMU module (PAA3905, AFBR-S50LV85D, ICM-42688-P). ([PX4-Autopilot#28901](https://github.com/PX4/PX4-Autopilot/pull/28901)) ### Загальні - The unit and functional test suite builds, links and runs on macOS (`make tests`), and `px4_poll()` timeouts on macOS wait for their full duration instead of returning at once. The blended GPS timestamp is accumulated in double and rounded once instead of truncating each weighted term. ([PX4-Autopilot#28516](https://github.com/PX4/PX4-Autopilot/pull/28516)) - The AlphaFilter library takes its sample interval and time constant in microseconds, and the float seconds overloads are removed, so a value in the wrong unit no longer compiles. Out-of-tree code that constructs the filter with seconds needs updating. ([PX4-Autopilot#28421](https://github.com/PX4/PX4-Autopilot/pull/28421)) +- The dataman module now hands out 16-bit client IDs instead of 8-bit ones. Each switch between mission-based return types and each MAVLink instance started in flight used up IDs, and once 254 had been handed out, every new client failed its requests with "Max Dataman clients reached". ([PX4-Autopilot#28944](https://github.com/PX4/PX4-Autopilot/pull/28944)) ### Управління @@ -86,12 +105,13 @@ Please continue reading for [upgrade instructions](#upgrade-guide). - Added `RTL_TYPE=6` for battery-aware home priority return ([PX4-Autopilot#26968](https://github.com/PX4/PX4-Autopilot/pull/26968)). Returns to home if the estimated flight time to home is within the remaining battery time; otherwise returns to the closest rally point. Falls back to the closest safe point (home or rally) if battery time remaining is unavailable. +- [Secure boot](../advanced_config/bootloader_secure_boot.md#multi-part-signed-images) now supports applications that can boot securely from SD card or eMMC. ([PX4-Autopilot#28228](https://github.com/PX4/PX4-Autopilot/pull/28228)) +- [Motor failure detection](../config/motor_failure_detection.md) now compares a low-pass filtered current residual against a separate trip band and trigger time for the undercurrent and overcurrent directions, instead of one symmetric band on the instantaneous current, and the current model gains an offset term. See [Upgrading from PX4 v1.18](../config/motor_failure_detection.md#upgrading-from-px4-v1-18). ([PX4-Autopilot#27711](https://github.com/PX4/PX4-Autopilot/pull/27711), [PX4-Autopilot#27917](https://github.com/PX4/PX4-Autopilot/pull/27917)) ### Оцінки - EKF2 fuses dual-antenna GNSS heading from its own topic, `vehicle_gnss_heading`, at the heading's rate and measurement time instead of with each position sample. GNSS yaw fusion is gated on the heading itself (its baseline checks, and the spoofing and jamming state of the receiver providing it under [GNSS_CHECK](../advanced_config/parameter_reference.md#GNSS_CHECK), which stop it like position fusion), not on the position checks, and it keeps running when position and velocity fusion stop. `GPS_RAW_INT` and `GPS2_RAW` report the body-frame heading of the receiver that provides it. ([PX4-Autopilot#27102](https://github.com/PX4/PX4-Autopilot/pull/27102)) - When the local position estimate is lost in flight because of GNSS, commander now reports the reason as an event: either the receiver checks that failed, or that the receiver stopped sending data. The ground station and the log show the cause ahead of the "GNSS data fusion stopped" message. ([PX4-Autopilot#28873](https://github.com/PX4/PX4-Autopilot/pull/28873)) -- EKF2 now caps the GNSS height observation noise at [EKF2_NOAID_NOISE](../advanced_config/parameter_reference.md#EKF2_NOAID_NOISE) only when no other height source is fused. With a barometer or another height source, a GNSS height with a poor reported vertical accuracy is no longer fused as more accurate than the receiver reports. ([PX4-Autopilot#29058](https://github.com/PX4/PX4-Autopilot/pull/29058)) ### Датчики @@ -105,7 +125,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ### Debug & Logging -- Уточнюється +- [Offline motor failure replay](../debug/motor_failure_replay.md): a host tool that runs the real motor failure detector over a recorded `.ulg`, for calibrating and verifying the [motor failure detection](../config/motor_failure_detection.md) thresholds against a vehicle's own flights. ([PX4-Autopilot#27917](https://github.com/PX4/PX4-Autopilot/pull/27917)) ### Ethernet @@ -117,7 +137,9 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ### MAVLink -- Уточнюється +- ESC/motor health is now reported in [SYS_STATUS](https://mavlink.io/en/messages/common.html#SYS_STATUS) using the [MAV_SYS_STATUS_SENSOR_PROPULSION](https://mavlink.io/en/messages/common.html#MAV_SYS_STATUS_SENSOR_PROPULSION) bit instead of [MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS](https://mavlink.io/en/messages/common.html#MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS). + ([PX4-Autopilot#29192](https://github.com/PX4/PX4-Autopilot/pull/29192)). +- [SYS_STATUS](https://mavlink.io/en/messages/common.html#SYS_STATUS) now sets the [MAV_SYS_STATUS_EXTENSION_USED](https://mavlink.io/en/messages/common.html#MAV_SYS_STATUS_EXTENSION_USED) flag in `onboard_control_sensors_present` when extended sensor fields are used. ### RC @@ -125,7 +147,9 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ### Мульти-Ротор -- Уточнюється +- The neural network controller (`mc_nn_control`) now maps its actions to motor commands over the real motor range, so action -1 idles a motor instead of stopping it and the top of the range no longer runs past full scale. The two RPM limits and the thrust coefficient (`MC_NN_MIN_RPM`, `MC_NN_MAX_RPM`, `MC_NN_THRST_COEF`) are now checked against each other, and the module has its first unit tests. ([PX4-Autopilot#28433](https://github.com/PX4/PX4-Autopilot/pull/28433)) +- The neural network controller (`mc_nn_control`) now rejects at load a model whose input or output shape does not match what the controller expects, checks the position, attitude and angular velocity observations each cycle for validity, age and finiteness, and reports a fault on a bad observation or a non-finite output instead of stopping one motor. ([PX4-Autopilot#28504](https://github.com/PX4/PX4-Autopilot/pull/28504)) +- The multicopter position controller now moves its stored fallback setpoint along with the current setpoint when the estimator resets its position, velocity or heading, so when the setpoint is unusable at the moment of a reset the controller no longer flies a fallback setpoint that is offset by the amount of the reset. ([PX4-Autopilot#28810](https://github.com/PX4/PX4-Autopilot/pull/28810)) ### VTOL diff --git a/docs/uk/sensor/barometer.md b/docs/uk/sensor/barometer.md index bb4b2c778be..55c4adb18c3 100644 --- a/docs/uk/sensor/barometer.md +++ b/docs/uk/sensor/barometer.md @@ -55,7 +55,7 @@ This calibration: ### GNSS-Baro Calibration :::info -GNSS-baro calibration requires an operational GNSS receiver with vertical accuracy (EPV) ≤ 8 meters. +GNSS-baro calibration requires an operational GNSS receiver passing all enabled checks in [GNSS_CHECK](../advanced_config/parameter_reference.md#GNSS_CHECK). Relative calibration must already have completed. ::: diff --git a/docs/uk/sensor/optical_flow.md b/docs/uk/sensor/optical_flow.md index 292d09ac215..ff62411524e 100644 --- a/docs/uk/sensor/optical_flow.md +++ b/docs/uk/sensor/optical_flow.md @@ -55,6 +55,11 @@ Reducing the optical flow scale factor can improve the situation. ## Датчики потоку/Камери +### Agam FloRange + +[Agam FloRange](../dronecan/agam_florange.md) is a [DroneCAN](../dronecan/index.md) optical flow sensor, [distance sensor](../sensor/rangefinders.md), and IMU. +It has a PixArt PAA3905 optical flow sensor, Broadcom AFBR-S50LV85D 30-metre distance sensor, and InvenSense ICM-42688-P 6-Axis IMU. + ### ARK Flow & ARK Flow MR [ARK Flow](../dronecan/ark_flow.md) is a [DroneCAN](../dronecan/index.md) optical flow sensor, [distance sensor](../sensor/rangefinders.md), and IMU. diff --git a/docs/uk/sensor/rangefinders.md b/docs/uk/sensor/rangefinders.md index 570dbc63554..d86c0301bcf 100644 --- a/docs/uk/sensor/rangefinders.md +++ b/docs/uk/sensor/rangefinders.md @@ -17,10 +17,11 @@ There may also be other DroneCAN rangefinders than those listed here. | Rangefinder | Technology | Range (min – max) | З'єднання | NDAA | Примітки | | ------------------------------------------- | ---------------------------------- | ------------------------------------------------------------- | ---------------- | ----------------- | ------------------------------------------------------ | -| [Ainstein US-D1 Standard Radar Altimeter] | Microwave radar | ~50 m | UART | ✔️ | | +| [Ainstein US-D1 Standard Radar Altimeter] | Microwave radar | 0.5 m – 50 m | UART | ✔️ | All-weather, works over water | | [ARK DIST SR] | ToF (850 nm IR) | 8 cm to ~30 m | DroneCAN, UART | ✔️ | | | [ARK DIST MR] | ToF (IR) | 8 cm to ~50 m | DroneCAN, UART | ✔️ | | -| [Benewake TFmini] | ToF (IR laser) | ~12 m | UART | ~ | | +| [Benewake TFmini Plus] | ToF (IR LED) | 0.1 m – 12 m | UART | ~ | PX4 minimum 0.4 m | +| [Benewake TFmini-S] | ToF (IR laser) | 0.1 m – 12 m | UART | ~ | PX4 minimum 0.4 m | | [Garmin LIDAR-Lite v3] | ToF (IR laser) | up to 40 m | I2C, PWM | ~ | PX4 caps range to 35 m or less | | [Holybro ST VL53L1X Lidar] | ToF (IR) | up to ~4 m | I2C | ~ | | | [LeddarOne] | ToF (IR) | 1 cm – 40 m | UART | ~ | | @@ -44,7 +45,8 @@ There may also be other DroneCAN rangefinders than those listed here. [Ainstein US-D1 Standard Radar Altimeter]: ../sensor/ulanding_radar.md [ARK DIST SR]: ../dronecan/ark_dist.md [ARK DIST MR]: ../dronecan/ark_dist_mr.md -[Benewake TFmini]: ../sensor/tfmini.md +[Benewake TFmini Plus]: ../sensor/tfmini.md +[Benewake TFmini-S]: ../sensor/tfmini.md [Garmin LIDAR-Lite v3]: ../sensor/lidar_lite.md [Holybro ST VL53L1X Lidar]: #holybro-st-vl53l1x-lidar [Lanbao PSK-CM8JL65-CC5]: ../sensor/cm8jl65_ir_distance_sensor.md @@ -130,18 +132,18 @@ PX4 supports the following models connected via the I2C bus: TeraRanger Evo 60m, ### Стандартний радарний висотомір Ainstein US-D1 -The _Ainstein_ [US-D1 Standard Radar Altimeter](../sensor/ulanding_radar.md) is compact microwave rangefinder that has been optimised for use on UAVs. -Він має діапазон виявлення близько 50м. -Особливі переваги цього продукту полягають в тому, що він може ефективно працювати в усіх погодних умовах і на всіх типах місцевості (включаючи воду). +The [Ainstein US-D1 Standard Radar Altimeter](../sensor/ulanding_radar.md) is a compact microwave radar rangefinder with a range of 0.5 m to 50 m and a 100 Hz update rate. +It can operate effectively in all weather conditions and over all terrain types (including water). +Це повинно бути підключено до шини UART/серійного порту. ### LeddarOne [LeddarOne](../sensor/leddar_one.md) is small Lidar module with a narrow, yet diffuse beam that offers excellent overall detection range and performance, in a robust, reliable, cost-effective package. Він має діапазон сенсора від (5см - 40м) і може бути підключений до портів PWM або I2C. -### TFmini +### Benewake TFmini Lidar -The [Benewake TFmini Lidar](../sensor/tfmini.md) is a tiny, low cost, and low power LIDAR with 12m range. +The [Benewake TFmini](../sensor/tfmini.md) LiDAR rangefinders (TFmini-S and TFmini Plus) have a range of 0.1–12 m and connect to a serial port (UART). ### PSK-CM8JL65-CC5 diff --git a/docs/uk/sensor/tfmini.md b/docs/uk/sensor/tfmini.md index 47ab22e5ca2..f98fed486c2 100644 --- a/docs/uk/sensor/tfmini.md +++ b/docs/uk/sensor/tfmini.md @@ -1,32 +1,144 @@ # Benewake TFmini Lidar -The _Benewake TFmini LiDAR_ is a tiny, low cost, and low power LIDAR with 12m range. + -PX4 підтримує всі три варіанти серії: TFmini-s, TFmini-i, TFmini Plus. -Ці повинні бути підключені до шини UART/серійного порту. +The Benewake [TFmini-S](https://en.benewake.com/TFminiS/index_proid_325.html) and [TFmini Plus](https://en.benewake.com/TFminiPlus/index_proid_323.html) are small, low-power time-of-flight LiDAR [rangefinders](../sensor/rangefinders.md) with a range of 0.1–12 m (PX4 uses 0.4–12 m) and a 100 Hz default update rate. +They connect to the flight controller using a serial port (UART). ![TFmini LiDAR](../../assets/hardware/sensors/tfmini/tfmini_hero.jpg) -## Де купити +## Supported Models {#supported_models} -- [TFmini-s](https://en.benewake.com/TFminiS/index_proid_325.html) -- [TFmini-i](https://en.benewake.com/TFminii/index_proid_324.html) (industrial) -- [TFmini Plus](https://en.benewake.com/TFminiPlus/index_proid_323.html) +| Модель | Діапазон | Підключення | `SENS_TFMINI_HW` value | +| ---------------------------------------------------------------------- | ------------------------ | ----------- | -------------------------------- | +| [TFmini-S](https://en.benewake.com/TFminiS/index_proid_325.html) | 0.1–12 m | UART | `1` (default) | +| [TFmini Plus](https://en.benewake.com/TFminiPlus/index_proid_323.html) | 0.1–12 m | UART | `1` (default) | -## Налаштування програмного забезпечення +PX4 reports distances from 0.4 m to 12 m for both models. -TFmini can be connected to any unused _serial port_ (UART), such as: `TELEM2`, `TELEM3`, `GPS2` etc. +## Specifications {#specifications} -## Налаштування параметрів +- **Technology:** Time-of-flight, 850 nm infrared (VCSEL on the TFmini-S, LED on the TFmini Plus) +- **Range:** 0.1–12 m at 90% reflectivity; 0.1–7 m (TFmini-S) or 0.1–4 m (TFmini Plus) at 10% reflectivity (PX4 uses 0.4–12 m) +- **Update rate:** 100 Hz by default, adjustable 1–1000 Hz +- **Field of view:** 2° (TFmini-S), 3.6° (TFmini Plus) +- **Accuracy:** ±6 cm below 6 m and ±1% from 6–12 m (TFmini-S); ±5 cm below 5 m and ±1% from 5–12 m (TFmini Plus) +- **Resolution:** 1 cm +- **Interface:** UART at 115200 baud, 8N1, 3.3 V (LVTTL); the sensors also support I2C, which the PX4 driver does not use +- **Input voltage:** 5 V ±0.1 V (TFmini-S), 5 V ±0.5 V (TFmini Plus) +- **Current draw:** ≤140 mA average, 200 mA peak (TFmini-S); ≤110 mA average, 140 mA peak (TFmini Plus) +- **Dimensions:** 42 x 15 x 16 mm (TFmini-S), 35 x 18.5 x 21 mm (TFmini Plus) +- **Weight:** 5 g (TFmini-S), 12 g (TFmini Plus) +- **Operating temperature:** 0–60 °C (TFmini-S), -20 °C to 60 °C (TFmini Plus) +- **Ingress protection:** IP65 (TFmini Plus) +- **Laser class:** Class 1 (TFmini-S) -[Configure the serial port](../peripherals/serial_configuration.md) on which the lidar will run using [SENS_TFMINI_CFG](../advanced_config/parameter_reference.md#SENS_TFMINI_CFG). -Не потрібно встановлювати швидкість передачі (вона зашита в програму драйвера сенсора, оскільки підтримується лише одна швидкість). +## Where to Buy {#store} -:::info -If the configuration parameter is not available in _QGroundControl_ then the [tfmini](../modules/modules_driver_distance_sensor.md#tfmini) driver may not be in firmware. -Для отримання інформації про те, як її додати, див. : +- TFmini-S: [Benewake](https://en.benewake.com/TFminiS/index_proid_325.html), [Mouser](https://www.mouser.com/en/ProductDetail/Benewake/TFmini-S-Uart?qs=DPoM0jnrROXBvfO6mWli6w%3D%3D) +- TFmini Plus: [Benewake](https://en.benewake.com/TFminiPlus/index_proid_323.html), [Mouser](https://www.mouser.com/en/ProductDetail/Benewake/TFmini-Plus-Uart?qs=DPoM0jnrROWctNsxLIii7A%3D%3D) -- [Serial port Configuration: Configuration Parameter Missing from QGroundControl](../peripherals/serial_configuration.md#parameter_not_in_firmware) -- [PX4 Board Configuration (Kconfig)](../hardware/porting_guide_config.md#px4-menuconfig-setup). +## Hardware Setup {#hardware_setup} -::: +### Mounting {#mounting} + +Mount the sensor facing down: PX4 assumes a downward-facing sensor, and the orientation cannot be configured. + +Readings below 0.4 m are reported as out of range. + +### Pinouts {#pinouts} + +The TFmini-S and TFmini Plus have a cable ending in a JST 1.25 mm 4-pin connector (Molex 51021-0400). +This is not the JST-GH connector used by flight controllers that follow the [Pixhawk Connector Standard](https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-009%20Pixhawk%20Connector%20Standard.pdf), so you will need an adapter cable to connect to those ports. +The cable can be extended, but Benewake recommends keeping it shorter than 1 m. + +The wire colours are the same on both models, but the pin numbering differs. + +TFmini-S: + +| Pin | Wire colour | Сигнал | +| --- | ----------- | ------------------------------------------------------------ | +| 1 | Black | GND | +| 2 | Red | +5 V | +| 3 | White | RX (UART receive, 3.3 V) | +| 4 | Зелений | TX (UART transmit, 3.3 V) | + +TFmini Plus: + +| Pin | Wire colour | Сигнал | +| --- | ----------- | ------------------------------------------------------------ | +| 1 | Red | +5 V | +| 2 | White | RX (UART receive, 3.3 V) | +| 3 | Зелений | TX (UART transmit, 3.3 V) | +| 4 | Black | GND | + +### Wiring {#wiring} + +The TFmini can be connected to any unused serial port (UART), such as `TELEM2`, `TELEM3` or `GPS2`. + +| TFmini wire | Connect to | +| ------------------------------ | ------------------------------------------------------- | +| Green (TX) | Flight controller UART RX | +| White (RX) | Flight controller UART TX (optional) | +| Red (+5 V) | 5 V supply | +| Black (GND) | Flight controller GND | + +The driver only reads from the sensor, so the sensor's RX wire does not need to be connected. + +The TFmini-S needs 5 V ±0.1 V and up to 140 mA (200 mA peak); the TFmini Plus needs 5 V ±0.5 V and up to 110 mA (140 mA peak). +Neither has over-voltage or reverse-polarity protection. + +## Firmware Support {#firmware_support} + +The rangefinder is supported by the [tfmini](../modules/modules_driver_distance_sensor.md#tfmini) driver, which is built into firmware by either of the following [board configuration](../hardware/porting_guide_config.md) keys: + +- `CONFIG_COMMON_DISTANCE_SENSOR=y`: the common set of rangefinder drivers, which includes this one. +- `CONFIG_DRIVERS_DISTANCE_SENSOR_TFMINI=y`: this driver on its own. + +Most boards set `CONFIG_COMMON_DISTANCE_SENSOR`, so the driver is present in most firmware. +To check your board, look for either key in its configuration file, `boards///default.px4board`, or check whether [SENS_TFMINI_CFG](../advanced_config/parameter_reference.md#SENS_TFMINI_CFG) is listed in _QGroundControl_ (parameters are only shown for drivers that are in the firmware). + +If the driver is missing, add either key to the board's `default.px4board` file, or enable it in [`boardconfig`](../hardware/porting_guide_config.md#px4-menuconfig-setup) under **Drivers > Distance sensors**, and then [build and upload the firmware](../dev_setup/building_px4.md). + +The driver does not start until it is enabled using the parameters in [PX4 Configuration](#px4_configuration). + +## PX4 Configuration {#px4_configuration} + +[Configure the serial port](../peripherals/serial_configuration.md) on which the rangefinder will run using [SENS_TFMINI_CFG](../advanced_config/parameter_reference.md#SENS_TFMINI_CFG), and then reboot. +Немає потреби встановлювати швидкість передачі для порту, оскільки це налаштовано драйвером. +If the port is already used by another function, see [Deconflicting Ports](../peripherals/serial_configuration.md#deconflicting-ports) in _Serial Port Configuration_. + +If the parameter is not available in _QGroundControl_ then the driver is not in the firmware: see [Firmware Support](#firmware_support). + +The driver does not configure the sensor, so the sensor must be at its factory settings: UART interface, 115200 baud, and the `Standard 9 bytes (cm)` output format (not `Pixhawk` or `Standard 9 bytes (mm)`). +If these have been changed, reset the sensor to its defaults as described in the Benewake user manual. + +[SENS_TFMINI_HW](../advanced_config/parameter_reference.md#SENS_TFMINI_HW) selects the model and sets the range limits PX4 reports. +Leave it at its default `1` (`TFMINI`) for the TFmini-S and TFmini Plus. + +The configuration that is common to all rangefinders, such as the sensor position offsets used by the estimator, is covered in [Rangefinders > Configuration/Setup](../sensor/rangefinders.md#configuration). + +## Testing {#testing} + +You can check that the driver is running, and see its error counters, using the _QGroundControl MAVLink Console_: + +```sh +tfmini status +``` + +You can observe the published measurements with: + +```sh +listener distance_sensor +``` + +The sensor type is reported as laser, with minimum and maximum distances of 0.4 m and 12 m. + +The measurements can also be viewed in the `DISTANCE_SENSOR` message in the _QGroundControl MAVLink Inspector_. +For more information see [Rangefinders > Testing](../sensor/rangefinders.md#testing). + +## Further Information {#further_information} + +- [Modules Reference: Distance Sensor (Driver): tfmini](../modules/modules_driver_distance_sensor.md#tfmini) +- [TFmini-S Datasheet](https://en.benewake.com/uploadfiles/2025/04/20250430175121856.pdf) and [User Manual](https://en.benewake.com/uploadfiles/2025/04/20250430175136263.pdf) (Benewake) +- [TFmini Plus Datasheet](https://en.benewake.com/uploadfiles/2025/04/20250430175207216.pdf) and [User Manual](https://en.benewake.com/uploadfiles/2025/04/20250430175221028.pdf) (Benewake) diff --git a/docs/uk/sensor/ulanding_radar.md b/docs/uk/sensor/ulanding_radar.md index fc5de2c992f..15c8238c034 100644 --- a/docs/uk/sensor/ulanding_radar.md +++ b/docs/uk/sensor/ulanding_radar.md @@ -1,38 +1,121 @@ # Стандартний радарний висотомір Ainstein US-D1 -:::tip -This supersedes the _Aerotenna uLanding Radar_ (discontinued) but uses the same driver/setup. + + +The [Ainstein US-D1 Standard Radar Altimeter](https://ainstein.ai/us-d1-all-weather-radar-altimeter/) is a compact microwave radar [rangefinder](../sensor/rangefinders.md) with a range of 0.5–50 m and a 100 Hz update rate. +It connects to the flight controller using a serial port (UART). +It is useful for applications including terrain following and precision hovering (e.g. for photography), and can operate effectively in all weather conditions and over all terrain types (including water). + +![Ainstein US-D1](../../assets/hardware/sensors/ainstein/us_d1_hero.jpg) + +:::info +The US-D1 supersedes the _Aerotenna uLanding Radar_ (discontinued), and uses the same driver and setup. ::: -The _Ainstein_ [US-D1 Standard Radar Altimeter](https://ainstein.ai/us-d1-all-weather-radar-altimeter/) is a compact microwave rangefinder that has been optimised for use on UAVs. -З діапазоном відчуття близько 50 метрів, він корисний для застосувань, включаючи слідування за місцевістю, точне зависання (наприклад, для фотографії), датчик запобігання зіткненням тощо. -Особливі переваги цього продукту полягають в тому, що він може ефективно працювати в усіх погодних умовах і на всіх типах місцевості (включаючи воду). -The user manual can be found [here](https://ainstein.ai/wp-content/uploads/US-D1-Technical-User-Manual-D00.02.05.docx.pdf). +## Specifications {#specifications} -![Ainstein US-DA](../../assets/hardware/sensors/ainstein/us_d1_hero.jpg) +- **Technology:** Microwave radar (24 GHz) +- **Range:** 0.5–50 m (PX4 reports measurements from 0.315 m) +- **Update rate:** 100 Hz +- **Field of view:** 43° x 30° +- **Accuracy:** 6 cm below 1 m, 4 cm above 1 m +- **Interface:** UART, CAN (the PX4 driver uses UART at 115200 baud) +- **Input voltage:** 5–13 V DC (5.5 V recommended) +- **Power consumption:** 2 W at 5 V +- **Dimensions:** 108 x 79 x 20 mm +- **Weight:** 110 g +- **Operating temperature:** -20 °C to 65 °C +- **Ingress protection:** IP67 (with sealant) -The rangefinder is not automatically included in most firmware, and hence cannot be used just by setting a parameter through _QGroundControl_ (as is possible with some other rangefinders). -Для використання його вам потрібно додати драйвер до вбудованого програмного забезпечення та оновити файл конфігурації, щоб запустити драйвер при завантаженні. -Нижче пояснюється, як. +## Where to Buy {#store} -## Налаштування програмного забезпечення +- [US-D1: All-Weather Radar Altimeter](https://sensing.ai/collections/ainstein-radar-products/products/us-d1radar-altimeter) (Ainstein store) -Дальномер підтримується будь-яким обладнанням, яке працює під управлінням операційної системи NuttX або Posix і яке може пропонувати послідовний порт для інтерфейсу. -Minimally this will include most, if not all, [Pixhawk Series](../flight_controller/pixhawk_series.md) controllers. +## Hardware Setup {#hardware_setup} -US-D1 can be connected to any unused _serial port_ (UART), e.g.: TELEM2, TELEM3, GPS2 etc. +### Mounting {#mounting} -## Налаштування параметрів +Mount the US-D1 rigidly on the underside of the vehicle, with its front face (the radome) parallel to the ground and facing directly down. +Keep it well away from the landing gear and any other structure that could fall within its field of view, and do not cover or coat the radome. -[Configure the serial port](../peripherals/serial_configuration.md) on which the lidar will run using [SENS_ULAND_CFG](../advanced_config/parameter_reference.md#SENS_ULAND_CFG). +PX4 assumes that the sensor is facing down (the orientation cannot be configured). + +### Pinouts {#pinouts} + +The US-D1 has a short cable terminated with a 4-pin Molex connector. + +| Wire colour | Сигнал | Опис | +| ----------- | ------ | -------------------------------------------------------- | +| Black | GND | Ground | +| White | RX | UART receive (3.3 V) | +| Зелений | TX | UART transmit (3.3 V) | +| Red | VCC | Power input, 5–13 V DC | + +:::info +The US-D1 is shipped configured for either UART, CAN, or DroneCAN output. +The wiring above, and the setup on this page, are for the UART version. +::: + +### Wiring {#wiring} + +The US-D1 can be connected to any unused serial port (UART), such as `TELEM2`, `TELEM3` or `GPS2`. + +| US-D1 wire | Connect to | +| ------------------------------ | ----------------------------------------------------------------------- | +| Black (GND) | Flight controller GND | +| Green (TX) | Flight controller UART RX | +| White (RX) | Flight controller UART TX (optional) | +| Red (VCC) | 5–13 V DC supply (5.5 V recommended) | + +The driver only reads from the sensor, so the sensor RX wire does not need to be connected. + +The sensor consumes about 2 W (around 400 mA at 5 V). +Check that the flight controller port can supply this, or power the sensor from a separate supply that shares a ground with the flight controller. + +## Firmware Support {#firmware_support} + +The rangefinder is supported by the [ulanding_radar](../modules/modules_driver_distance_sensor.md#ulanding-radar) driver, which is built into firmware by either of the following [board configuration](../hardware/porting_guide_config.md) keys: + +- `CONFIG_COMMON_DISTANCE_SENSOR=y`: the common set of rangefinder drivers, which includes this one. +- `CONFIG_DRIVERS_DISTANCE_SENSOR_ULANDING_RADAR=y`: this driver on its own. + +Most boards set `CONFIG_COMMON_DISTANCE_SENSOR`, so the driver is present in most firmware. +To check your board, look for either key in its configuration file, `boards///default.px4board`, or check whether [SENS_ULAND_CFG](../advanced_config/parameter_reference.md#SENS_ULAND_CFG) is listed in _QGroundControl_ (parameters are only shown for drivers that are in the firmware). + +If the driver is missing, add either key to the board's `default.px4board` file, or enable it in [boardconfig](../hardware/porting_guide_config.md#px4-menuconfig-setup) under **Drivers > Distance sensors**, and then [build and upload the firmware](../dev_setup/building_px4.md). + +The driver does not start until it is enabled using the parameters in [PX4 Configuration](#px4_configuration). + +## PX4 Configuration {#px4_configuration} + +[Configure the serial port](../peripherals/serial_configuration.md) on which the rangefinder will run using [SENS_ULAND_CFG](../advanced_config/parameter_reference.md#SENS_ULAND_CFG), and then reboot. Немає потреби встановлювати швидкість передачі для порту, оскільки це налаштовано драйвером. -::: info +If the parameter is not available in _QGroundControl_ then the driver is not in the firmware: see [Firmware Support](#firmware_support). -If the configuration parameter is not available in _QGroundControl_ then you may need to [add the driver to the firmware](../peripherals/serial_configuration.md#parameter_not_in_firmware): +The configuration that is common to all rangefinders, such as the sensor position offsets used by the estimator, is covered in [Rangefinders > Configuration/Setup](../sensor/rangefinders.md#configuration). -```plain -CONFIG_DRIVERS_DISTANCE_SENSOR_ULANDING_RADAR=y +## Testing {#testing} + +You can check that the driver is running, and see its error counters, using the _QGroundControl MAVLink Console_: + +```sh +ulanding_radar status ``` -::: +You can observe the published measurements with: + +```sh +listener distance_sensor +``` + +The sensor type is reported as radar, with minimum and maximum distances of 0.315 m and 50 m. + +The measurements can also be viewed in the `DISTANCE_SENSOR` message in the _QGroundControl MAVLink Inspector_. +For more information see [Rangefinders > Testing](../sensor/rangefinders.md#testing). + +## Further Information {#further_information} + +- [Modules Reference: Distance Sensor (Driver): ulanding_radar](../modules/modules_driver_distance_sensor.md#ulanding-radar) +- [US-D1 Technical User Manual](https://ainstein.ai/wp-content/uploads/US-D1-Technical-User-Manual-3.pdf) (Ainstein) +- [US-D1 Data Sheet](https://ainstein.ai/wp-content/uploads/US-D1-Data-Sheet-2.pdf) (Ainstein) diff --git a/docs/uk/sim_gazebo_gz/index.md b/docs/uk/sim_gazebo_gz/index.md index 4a2ee8404e3..0d88529b8ee 100644 --- a/docs/uk/sim_gazebo_gz/index.md +++ b/docs/uk/sim_gazebo_gz/index.md @@ -263,6 +263,19 @@ gst-launch-1.0 -v udpsrc port=5600 \ ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false ``` +#### Multi-Sensor Simulation + +Gazebo can simulate multple sensor instancs for GNSS, IMU, barometer and magnetometer, which is useful for testing failover and multi-EKF. + +To support additional sensors they must first be added in the model sdf file following the same convention as primary sensors, but with `_1`, `_2` added at the end of their name. + +Then use the appropriate parameter below to specify the number of sensors to enable: + +- [SIM_GZ_EN_GPS](../advanced_config/parameter_reference.md#SIM_GZ_EN_GPS) +- [SIM_GZ_EN_IMU](../advanced_config/parameter_reference.md#SIM_GZ_EN_IMU) +- [SIM_GZ_EN_MAG](../advanced_config/parameter_reference.md#SIM_GZ_EN_MAG) +- [SIM_GZ_EN_BARO](../advanced_config/parameter_reference.md#SIM_GZ_EN_BARO) + #### Симуляція кількох рухомих засобів In a multi-vehicle simulation, each vehicle instance streams to a separate port starting from `5600` — i.e. `5600`, `5601`, `5602`, and so on. If an instance (other than the first, which acts as the Gazebo world host) is restarted, it resumes streaming on its originally assigned port. diff --git a/docs/uk/simulation/px4_simulation_quickstart.md b/docs/uk/simulation/px4_simulation_quickstart.md index 33f2f4197de..25bfa28b4f7 100644 --- a/docs/uk/simulation/px4_simulation_quickstart.md +++ b/docs/uk/simulation/px4_simulation_quickstart.md @@ -2,45 +2,40 @@ First install [Docker](https://docs.docker.com/get-started/get-docker/) (a free tool that runs containers). -The following command will then run a PX4 quadrotor simulation that you can connect to [QGroundControl](https://qgroundcontrol.com), [MAVSDK](https://mavsdk.mavlink.io/) or [ROS 2](../ros2/user_guide.md) (on Linux, macOS, and Windows): +The following command will then run a PX4 quadrotor simulation that you can connect to [QGroundControl](https://qgroundcontrol.com), [MAVSDK](https://mavsdk.mavlink.io/) or [ROS 2](../ros2/user_guide.md). ```sh -docker run --rm -it -p 14550:14550/udp px4io/px4-sitl:latest +docker run --rm -it px4io/px4-sitl:latest ``` -That's it — open [QGroundControl](https://qgroundcontrol.com) and fly! - -:::details -Trouble connecting to QGC? -This command is recommended for Linux and can also be used on Windows (with recent docker/WSL2). -It uses a different mechanism for connecting to the host ports, and will often work in rare cases where the other command does not. +On Linux (or WSL2 without _Docker Desktop_): ```sh docker run --rm -it --network host px4io/px4-sitl:latest ``` -::: +That's it — open [QGroundControl](https://qgroundcontrol.com) and fly! ::: tip -To try [other vehicle types](../sim_sih/#supported-vehicle-types), use the `-e` flag to pass the `PX4_SIM_MODEL` environment variable to the `docker run` command: +To try [other vehicle types](../sim_sih/#supported-vehicle-types), use the `-e` flag to pass the `PX4_SIM_MODEL` environment variable to the `docker run` command (on Linux, or WSL2 without _Docker Desktop_, also add `--network host`): Plane ```sh -docker run --rm -it -p 14550:14550/udp -e PX4_SIM_MODEL=sihsim_airplane px4io/px4-sitl:latest +docker run --rm -it -e PX4_SIM_MODEL=sihsim_airplane px4io/px4-sitl:latest ``` Standard VTOL ```sh -docker run --rm -it -p 14550:14550/udp -e PX4_SIM_MODEL=sihsim_standard_vtol px4io/px4-sitl:latest +docker run --rm -it -e PX4_SIM_MODEL=sihsim_standard_vtol px4io/px4-sitl:latest ``` Ackermann rover ```sh -docker run --rm -it -p 14550:14550/udp -e PX4_SIM_MODEL=sihsim_rover_ackermann px4io/px4-sitl:latest +docker run --rm -it -e PX4_SIM_MODEL=sihsim_rover_ackermann px4io/px4-sitl:latest ``` For more information and options see [Container Images](../simulation/px4_sitl_prebuilt_packages.md#container-images) (in _Pre-built SITL Packages_) and [SIH Simulation](../sim_sih/index.md). diff --git a/docs/uk/telemetry/sik_radio.md b/docs/uk/telemetry/sik_radio.md index f41a0b5eac4..21d924036d8 100644 --- a/docs/uk/telemetry/sik_radio.md +++ b/docs/uk/telemetry/sik_radio.md @@ -26,6 +26,22 @@ SiK Radios often come with appropriate connectors/cables allowing them to be dir The vehicle-based radio is connected to the flight-controller's `TELEM1` port, and typically requires no further configuration. +## Link Throughput + +The serial baudrate says little about what a SiK link carries over the air. +At 57600 baud with the common 64 kbps air rate, a radio carries roughly 2000 B/s with error +correction enabled and about twice that without. + +[MAV_0_RATE](../advanced_config/parameter_reference.md#MAV_0_RATE) caps what PX4 sends on +`TELEM1`. Setting it above what the link carries does not make telemetry faster: the radio +drops packets instead, which shows up as MAVLink loss and makes parameter and log downloads +slow or unreliable. Lower it if you see loss. + +Two AT commands report the radio's own limits: `ATI5` lists the settings, including +`S2:AIR_SPEED` and `S5:ECC`, and `ATI6` reports `max_data_packet_length` - the largest +MAVLink packet the radio sends in one piece. Error correction roughly halves both the +throughput and that packet size. + ## Оновлення прошивки Hardware sourced from most [vendors](#vendors) should come pre-configured with the latest firmware. diff --git a/docs/uk/test_and_ci/integration_testing_mavsdk.md b/docs/uk/test_and_ci/integration_testing_mavsdk.md index 01388edc8eb..c75b84df553 100644 --- a/docs/uk/test_and_ci/integration_testing_mavsdk.md +++ b/docs/uk/test_and_ci/integration_testing_mavsdk.md @@ -1,11 +1,12 @@ # Інтеграційне тестування за допомогою MAVSDK -PX4 can be tested end to end to using integration tests based on [MAVSDK](https://mavsdk.mavlink.io). +PX4 can be tested end to end using integration tests based on [MAVSDK](https://mavsdk.mavlink.io). -Тести в основному розробляються для SITL і запускаються в режимі безперервної інтеграції (CI). +The tests are written in Python using the [MAVSDK Python package](https://pypi.org/project/mavsdk/) and [pytest](https://pytest.org). +They are primarily developed against SITL and run in continuous integration (CI). В майбутньому ми плануємо зробити їх універсальними для будь-якої платформи/обладнання. -Інструкції нижче пояснюють, як налаштувати та запустити тести локально. +The instructions below explain how to set up and run the tests locally, and how to write new ones. :::info This is the recommended integration test framework for PX4. @@ -18,7 +19,6 @@ This is the recommended integration test framework for PX4. Якщо ви цього ще не зробили: - Install the development toolchain for [Linux](../dev_setup/dev_env_linux_ubuntu.md) or [macOS](../dev_setup/dev_env_mac.md) (Windows not supported). - [Gazebo Classic](../sim_gazebo_classic/index.md) is required, and should be installed by default. - [Get the PX4 source code](../dev_setup/building_px4.md#download-the-px4-source-code): ```sh @@ -28,20 +28,23 @@ This is the recommended integration test framework for PX4. ### Збірка PX4 для тестування -Щоб зібрати вихідний код PX4 для тестування на симуляторі, скористайтеся: +The tests run in the [SIH](../sim_sih/index.md) simulator, which is built into PX4. +To build PX4 for SITL, use: ```sh -DONT_RUN=1 make px4_sitl gazebo-classic mavsdk_tests +make px4_sitl_default ``` -### Встановлення бібліотеки C++ MAVSDK +### Install the Test Dependencies -The tests need the MAVSDK C++ library installed system-wide (e.g. in `/usr/lib` or `/usr/local/lib`). +The tests need the `mavsdk` and `pytest` Python packages, in the versions given in `Tools/setup/test-requirements.txt`. +They are installed by the [setup scripts](../dev_setup/dev_env.md), or manually with: -Встановлюйте або з бінарних файлів, або з джерела: +```sh +pip install -r Tools/setup/test-requirements.txt +``` -- [MAVSDK > C++ > C++ QuickStart](https://mavsdk.mavlink.io/main/en/cpp/quickstart.html): Install as a prebuilt library on supported platforms (recommended) -- [MAVSDK > C++ Guide > Building from Source](https://mavsdk.mavlink.io/main/en/cpp/guide/build.html): Build C++ library from source. +The `mavsdk` package is a native binding of the MAVSDK C++ library, so no separate MAVSDK installation is needed. ## Запуск усіх PX4 тестів @@ -52,6 +55,7 @@ test/mavsdk_tests/mavsdk_test_runner.py test/mavsdk_tests/configs/sih-sitl.json ``` This will list all the tests and then run them sequentially. +Each test case is run against a freshly started PX4 instance. To see all possible command line arguments use the `-h` argument: @@ -87,79 +91,93 @@ options: ## Запуск одного тесту Run a single test by specifying the `model` and test `case` as command line options. +A test case is a pytest test ID, and wildcards are supported. For example, to test a multicopter mission using the SIH simulator: ```sh -test/mavsdk_tests/mavsdk_test_runner.py test/mavsdk_tests/configs/sih-sitl.json --speed-factor 10 --model quadx --case 'Fly square Multicopter Missions including Return' +test/mavsdk_tests/mavsdk_test_runner.py test/mavsdk_tests/configs/sih-sitl.json --speed-factor 10 --model quadx --case 'test_multicopter_mission.py::test_square_mission_with_return' ``` -The easiest way to find out the current set of models and their associated test cases is to run all PX4 tests [as shown above](#run-all-px4-tests) (note, you can then cancel the build if you wish to test just one). - -На момент написання статті список, згенерований в результаті запуску всіх тестів, є таким: +Or to run all the failsafe tests: ```sh -About to run 39 test cases for 3 selected models (1 iteration): - - iris: - - 'Land on GPS lost during mission (baro height mode)' - - 'Land on GPS lost during mission (GPS height mode)' - - 'Continue on mag lost during mission' - - 'Continue on baro lost during mission (baro height mode)' - - 'Continue on baro lost during mission (GPS height mode)' - - 'Continue on baro stuck during mission (baro height mode)' - - 'Continue on baro stuck during mission (GPS height mode)' - - 'Takeoff and Land' - - 'Fly square Multicopter Missions including Return' - - 'Fly square Multicopter Missions with manual Return' - - 'Fly straight Multicopter Mission' - - 'Offboard takeoff and land' - - 'Offboard position control' - - 'Fly forward in position control' - - 'Fly forward in altitude control' - - standard_vtol: - - 'Land on GPS lost during mission (baro height mode)' - - 'Land on GPS lost during mission (GPS height mode)' - - 'Continue on mag lost during mission' - - 'Continue on baro lost during mission (baro height mode)' - - 'Continue on baro lost during mission (GPS height mode)' - - 'Continue on baro stuck during mission (baro height mode)' - - 'Continue on baro stuck during mission (GPS height mode)' - - 'Takeoff and Land' - - 'Fly square Multicopter Missions including Return' - - 'Fly square Multicopter Missions with manual Return' - - 'Fly forward in position control' - - 'Fly forward in altitude control' - - tailsitter: - - 'Land on GPS lost during mission (baro height mode)' - - 'Land on GPS lost during mission (GPS height mode)' - - 'Continue on mag lost during mission' - - 'Continue on baro lost during mission (baro height mode)' - - 'Continue on baro lost during mission (GPS height mode)' - - 'Continue on baro stuck during mission (baro height mode)' - - 'Continue on baro stuck during mission (GPS height mode)' - - 'Takeoff and Land' - - 'Fly square Multicopter Missions including Return' - - 'Fly square Multicopter Missions with manual Return' - - 'Fly forward in position control' - - 'Fly forward in altitude control' +test/mavsdk_tests/mavsdk_test_runner.py test/mavsdk_tests/configs/sih-sitl.json --speed-factor 10 --model quadx --case 'test_multicopter_failsafe.py::*' ``` +To list all test cases, use pytest from the test directory: + +```sh +cd test/mavsdk_tests +pytest --collect-only -q +``` + +## Run a Test Against a Running PX4 + +While developing a test, it can be quicker to start PX4 yourself and run the test directly with pytest. +Start PX4 with SIH in one terminal: + +```sh +make px4_sitl sihsim_quadx +``` + +And run a test in another terminal: + +```sh +cd test/mavsdk_tests +pytest -v -s 'test_multicopter_mission.py::test_takeoff_and_land' +``` + +The `-s` option shows the test output while it runs. +Most tests expect a vehicle that is freshly started and on the ground, so restart PX4 between tests. + +## Write a Test + +Tests are plain pytest functions in `test/mavsdk_tests/test_*.py`. +A test gets a tester that is connected to the vehicle through a fixture, and is selected for vehicles by markers: + +```py +import pytest + +from autopilot_tester import AutopilotTester, MissionOptions + + +@pytest.mark.multicopter +def test_square_mission_with_return(tester: AutopilotTester) -> None: + tester.wait_until_ready() + tester.prepare_square_mission(MissionOptions(rtl_at_end=True)) + tester.arm() + tester.execute_mission() + tester.wait_until_disarmed(180) +``` + +The testers wrap MAVSDK with the building blocks the tests need, such as missions, offboard control, failure injection and trajectory checks: + +- `tester`: [autopilot_tester.py](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/autopilot_tester.py) with the common functionality. +- `tester_rtl`: [autopilot_tester_rtl.py](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/autopilot_tester_rtl.py) adds rally points and geofences. +- `tester_loiter`: [autopilot_tester_loiter.py](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/autopilot_tester_loiter.py) adds fixed-wing loiter, reposition and figure eight. +- `tester_follow_me`: [autopilot_tester_follow_me.py](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/autopilot_tester_follow_me.py) adds follow-me. +- `tester_vision_target`: [autopilot_tester_vision_target.py](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/autopilot_tester_vision_target.py) simulates landing target sensors for precision landing. + +Things to keep in mind: + +- Timeouts and sleeps of the testers are in simulation time, so a test behaves the same at any speed factor. +- A failing `assert` in a MAVSDK callback is not reported by MAVSDK. + Use `check_in_callback()` in callbacks instead, which fails the test once it finishes. +- MAVLink messages that MAVSDK has no plugin for can be sent and received with MAVSDK's `MavlinkDirect` plugin, see for example `send_command_int()`. +- Markers have to be listed in `pytest.ini`. + The `test_filter` of each entry in the config files is a pytest marker expression, such as `multicopter or offboard`. + +The tests are checked in CI with `mypy --strict` and `flake8`. + ## Примітки щодо реалізацій: -- The tests are invoked from the test runner script [mavsdk_test_runner.py](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/mavsdk_test_runner.py), which is written in Python. +- The tests are invoked from the test runner script [mavsdk_test_runner.py](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/mavsdk_test_runner.py). - In addition to MAVSDK, this runner starts `px4` as well as Gazebo for SITL tests, and collects the logs of these processes. + For each test case, the runner starts `px4` (and Gazebo Classic if configured) with a fresh root filesystem, runs the test with pytest, and collects the logs of these processes. -- Модуль виконання тесту - це бінарний файл на мові C++, який містить: - - The [main](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/test_main.cpp) function to parse the arguments. - - An abstraction around MAVSDK called [autopilot_tester](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/autopilot_tester.h). - - The actual tests using the abstraction around MAVSDK as e.g. [test_multicopter_mission.cpp](https://github.com/PX4/PX4-Autopilot/blob/main/test/mavsdk_tests/test_multicopter_mission.cpp). - - The tests use the [catch2](https://github.com/catchorg/Catch2) unit testing framework. - Причини використання цього фреймворку наступні: - - Asserts (`REQUIRE`) which are needed to abort a test can be inside of functions (and not just in the top level test as is [the case with gtest](https://github.com/google/googletest/blob/main/docs/advanced.md#assertion-placement)). - - Dependency management is easier because _catch2_ can just be included as a header-only library. - - _Catch2_ supports [tags](https://github.com/catchorg/Catch2/blob/devel/docs/test-cases-and-sections.md#tags), which allows for flexible composition of tests. +- The config files in `test/mavsdk_tests/configs/` define which models are tested with which tests, and per model settings such as the timeout, environment variables or the Gazebo world. Терміни: -- "model": This is the selected Gazebo model, e.g. `iris`. -- "test case": This is a [catch2 test case](https://github.com/catchorg/Catch2/blob/devel/docs/test-cases-and-sections.md). +- "model": This is the selected simulation model, e.g. `quadx`. +- "test case": This is a pytest test, identified by its test ID, e.g. `test_multicopter_mission.py::test_takeoff_and_land`.