Compare commits

..

10 Commits

Author SHA1 Message Date
Pedro-Roque bbd6d9794f fix: add whitelist on dds em 2026-03-12 22:50:46 -07:00
Pedro-Roque 695e2c7caa Merge branch 'feat/safe_dds' of github.com:PX4/PX4-Autopilot into feat/safe_dds 2026-03-12 15:25:42 -07:00
Pedro-Roque 627072b811 feat: added module name 2026-03-12 15:25:31 -07:00
Pedro Roque d651d9e8e2 Merge branch 'main' into feat/safe_dds 2026-03-12 15:08:41 -07:00
Pedro-Roque 574295998b Merge branch 'feat/safe_dds' of github.com:PX4/PX4-Autopilot into feat/safe_dds 2026-03-12 15:07:21 -07:00
Pedro-Roque 71807c93d8 fix: schema failure 2026-03-12 15:07:09 -07:00
Pedro Roque b0d061b0b7 Merge branch 'main' into feat/safe_dds 2026-03-12 11:15:05 -07:00
Pedro-Roque 23613e7e4a rft(dds): reduce the number of conditional checks 2026-03-12 11:13:59 -07:00
Pedro-Roque 71ac74827a feat: add whitelisting 2026-03-12 10:00:05 -07:00
Pedro-Roque 41e1ee6023 feat: ensure safe DDS interface by default 2026-03-11 15:58:47 -07:00
173 changed files with 3488 additions and 1926 deletions
+2
View File
@@ -141,6 +141,8 @@ Checks: '*,
-cppcoreguidelines-avoid-goto,
-hicpp-avoid-goto,
-bugprone-branch-clone,
-bugprone-unhandled-self-assignment,
-cert-oop54-cpp,
-performance-enum-size,
-readability-avoid-nested-conditional-operator,
-cppcoreguidelines-prefer-member-initializer,
+2 -2
View File
@@ -130,8 +130,8 @@ jobs:
load: false
push: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_registry) }}
provenance: false
cache-from: type=gha,scope=${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}
cache-from: type=gha,version=1,scope=${{ matrix.arch }}
cache-to: type=gha,version=1,mode=max,scope=${{ matrix.arch }}
deploy:
name: Deploy To Registry
-27
View File
@@ -1,27 +0,0 @@
cff-version: 1.2.0
title: "PX4 Autopilot"
message: "If you use PX4 in your research, please cite it using this metadata."
type: software
authors:
- family-names: Meier
given-names: Lorenz
- name: "The PX4 Contributors"
repository-code: "https://github.com/PX4/PX4-Autopilot"
url: "https://px4.io"
abstract: >-
PX4 is an open-source autopilot stack for drones and
unmanned vehicles. It supports multirotors, fixed-wing,
VTOL, rovers, and many more platforms. PX4 runs on both
RTOS and POSIX-compatible operating systems.
keywords:
- autopilot
- drone
- uav
- flight-controller
- robotics
- ros2
license: BSD-3-Clause
identifiers:
- type: doi
value: "10.5281/zenodo.595432"
description: "Zenodo concept DOI (resolves to latest version)"
-1
View File
@@ -10,7 +10,6 @@
<p align="center">
<a href="https://github.com/PX4/PX4-Autopilot/releases"><img src="https://img.shields.io/github/release/PX4/PX4-Autopilot.svg" alt="Releases"></a>
<a href="https://www.bestpractices.dev/projects/6520"><img src="https://www.bestpractices.dev/projects/6520/badge" alt="OpenSSF Best Practices"></a>
<a href="https://zenodo.org/badge/latestdoi/22634/PX4/PX4-Autopilot"><img src="https://zenodo.org/badge/22634/PX4/PX4-Autopilot.svg" alt="DOI"></a>
<a href="https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml"><img src="https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml/badge.svg?branch=main" alt="Build Targets"></a>
<a href="https://discord.gg/dronecode"><img src="https://discordapp.com/api/guilds/1022170275984457759/widget.png?style=shield" alt="Discord"></a>
+3 -4
View File
@@ -119,11 +119,10 @@ else
param set SYS_AUTOCONFIG 1
fi
# To trigger a parameter reset during boot SYS_AUTCONFIG was set to 1 before
if param greater SYS_AUTOCONFIG 0
if param compare SYS_AUTOCONFIG 1
then
# Reset parameters except airframe, parameter version, RC calibration, sensor calibration, total flight time, flight UUID
param reset_all SYS_AUTOSTART SYS_PARAM_VER RC* CAL_* LND_FLIGHT* TC_* COM_FLIGHT*
# Reset params except Airframe, RC calibration, sensor calibration, flight modes, total flight time, and next flight UUID.
param reset_all SYS_AUTOSTART RC* CAL_* COM_FLTMODE* LND_FLIGHT* TC_* COM_FLIGHT*
set AUTOCNF yes
fi
+2 -2
View File
@@ -191,8 +191,8 @@ else
# To trigger a parameter reset during boot SYS_AUTCONFIG was set to 1 before
if param greater SYS_AUTOCONFIG 0
then
# Reset parameters except airframe, parameter version, RC calibration, sensor calibration, total flight time, flight UUID
param reset_all SYS_AUTOSTART SYS_PARAM_VER RC* CAL_* LND_FLIGHT* TC_* COM_FLIGHT*
# Reset parameters except airframe, parameter version, RC calibration, sensor calibration, flight modes, total flight time, flight UUID
param reset_all SYS_AUTOSTART SYS_PARAM_VER RC* CAL_* COM_FLTMODE* LND_FLIGHT* TC_* COM_FLIGHT*
fi
#
+20 -32
View File
@@ -6,42 +6,32 @@ cp **/**/*.elf artifacts/ 2>/dev/null || true
for build_dir_path in build/*/ ; do
build_dir_path=${build_dir_path::${#build_dir_path}-1}
build_dir=${build_dir_path#*/}
mkdir -p artifacts/$build_dir
mkdir artifacts/$build_dir
find artifacts/ -maxdepth 1 -type f -name "*$build_dir*"
# Airframe (NuttX: build root, SITL: docs/ subdirectory)
airframes_src=""
if [ -f "$build_dir_path/airframes.xml" ]; then
airframes_src="$build_dir_path/airframes.xml"
elif [ -f "$build_dir_path/docs/airframes.xml" ]; then
airframes_src="$build_dir_path/docs/airframes.xml"
fi
if [ -n "$airframes_src" ]; then
cp "$airframes_src" "artifacts/$build_dir/"
fi
# Airframe
cp $build_dir_path/airframes.xml artifacts/$build_dir/
# Parameters
cp $build_dir_path/parameters.xml artifacts/$build_dir/ 2>/dev/null || true
cp $build_dir_path/parameters.json artifacts/$build_dir/ 2>/dev/null || true
cp $build_dir_path/parameters.json.xz artifacts/$build_dir/ 2>/dev/null || true
cp $build_dir_path/parameters.xml artifacts/$build_dir/
cp $build_dir_path/parameters.json artifacts/$build_dir/
cp $build_dir_path/parameters.json.xz artifacts/$build_dir/
# Actuators
cp $build_dir_path/actuators.json artifacts/$build_dir/ 2>/dev/null || true
cp $build_dir_path/actuators.json.xz artifacts/$build_dir/ 2>/dev/null || true
cp $build_dir_path/actuators.json artifacts/$build_dir/
cp $build_dir_path/actuators.json.xz artifacts/$build_dir/
# Events
mkdir -p artifacts/$build_dir/events/
cp $build_dir_path/events/all_events.json.xz artifacts/$build_dir/events/ 2>/dev/null || true
cp $build_dir_path/events/all_events.json.xz artifacts/$build_dir/
# ROS 2 msgs
cp $build_dir_path/events/all_events.json.xz artifacts/$build_dir/
# Module Docs
ls -la artifacts/$build_dir
echo "----------"
done
if [ -d artifacts/px4_sitl_default ]; then
# general metadata (used by Flight Review and other downstream consumers)
mkdir -p artifacts/_general/
# general metadata
mkdir artifacts/_general/
cp artifacts/px4_sitl_default/airframes.xml artifacts/_general/
# Airframe
if [ -f artifacts/px4_sitl_default/airframes.xml ]; then
cp artifacts/px4_sitl_default/airframes.xml artifacts/_general/
else
echo "Error: expected 'artifacts/px4_sitl_default/airframes.xml' not found." >&2
exit 1
fi
cp artifacts/px4_sitl_default/airframes.xml artifacts/_general/
# Parameters
cp artifacts/px4_sitl_default/parameters.xml artifacts/_general/
cp artifacts/px4_sitl_default/parameters.json artifacts/_general/
@@ -50,11 +40,9 @@ if [ -d artifacts/px4_sitl_default ]; then
cp artifacts/px4_sitl_default/actuators.json artifacts/_general/
cp artifacts/px4_sitl_default/actuators.json.xz artifacts/_general/
# Events
if [ -f artifacts/px4_sitl_default/events/all_events.json.xz ]; then
cp artifacts/px4_sitl_default/events/all_events.json.xz artifacts/_general/
else
echo "Error: expected 'artifacts/px4_sitl_default/events/all_events.json.xz' not found." >&2
exit 1
fi
cp artifacts/px4_sitl_default/events/all_events.json.xz artifacts/_general/
# ROS 2 msgs
cp artifacts/px4_sitl_default/events/all_events.json.xz artifacts/_general/
# Module Docs
ls -la artifacts/_general/
fi
+3 -3
View File
@@ -259,7 +259,7 @@
#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15)
#define GPIO_VDD_5V_HIPOWER_nEN /* PG10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN10)
#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13)
#define GPIO_VDD_3V3_SENSORS_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2)
#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13)
@@ -286,7 +286,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true))
#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN)
#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true))
@@ -452,7 +452,7 @@
GPIO_VDD_5V_PERIPH_nOC, \
GPIO_VDD_5V_HIPOWER_nEN, \
GPIO_VDD_5V_HIPOWER_nOC, \
GPIO_VDD_3V3_SENSORS_EN, \
GPIO_VDD_3V3_SENSORS4_EN, \
GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_PD15, \
+3 -3
View File
@@ -107,7 +107,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_5V_PERIPH_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS_EN(false);
VDD_3V3_SENSORS4_EN(false);
bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN();
/* Keep Spektum on to discharge rail*/
@@ -122,7 +122,7 @@ __EXPORT void board_peripheral_reset(int ms)
/* switch the peripheral rail back on */
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_5V_PERIPH_EN(true);
}
@@ -219,7 +219,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_3V3_SD_CARD_EN(true);
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
/* Need hrt running before using the ADC */
+1 -1
View File
@@ -48,7 +48,7 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
+3 -3
View File
@@ -273,7 +273,7 @@
#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15)
#define GPIO_VDD_5V_HIPOWER_nEN /* PG10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN10)
#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13)
#define GPIO_VDD_3V3_SENSORS_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2)
#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13)
@@ -295,7 +295,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true))
#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN)
#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true))
@@ -455,7 +455,7 @@
GPIO_VDD_5V_PERIPH_nOC, \
GPIO_VDD_5V_HIPOWER_nEN, \
GPIO_VDD_5V_HIPOWER_nOC, \
GPIO_VDD_3V3_SENSORS_EN, \
GPIO_VDD_3V3_SENSORS4_EN, \
GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_PD15, \
+3 -3
View File
@@ -108,7 +108,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_5V_HIPOWER_EN(false);
VDD_5V_PERIPH_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS_EN(false);
VDD_3V3_SENSORS4_EN(false);
SPI6_RESET(true);
bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN();
@@ -124,7 +124,7 @@ __EXPORT void board_peripheral_reset(int ms)
/* switch the peripheral rail back on */
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_5V_PERIPH_EN(true);
@@ -221,7 +221,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
/* Power on Interfaces */
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
SPI6_RESET(false);
+2 -2
View File
@@ -48,7 +48,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -71,7 +71,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
+2 -2
View File
@@ -48,7 +48,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
// initSPIBus(SPI::Bus::SPI5, {
// initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -69,7 +69,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
// initSPIBus(SPI::Bus::SPI5, {
// initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
+3 -3
View File
@@ -262,7 +262,7 @@
#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15)
#define GPIO_VDD_5V_HIPOWER_nEN /* PG10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN10)
#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13)
#define GPIO_VDD_3V3_SENSORS_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2)
#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13)
@@ -289,7 +289,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true))
#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN)
#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true))
@@ -453,7 +453,7 @@
GPIO_VDD_5V_PERIPH_nOC, \
GPIO_VDD_5V_HIPOWER_nEN, \
GPIO_VDD_5V_HIPOWER_nOC, \
GPIO_VDD_3V3_SENSORS_EN, \
GPIO_VDD_3V3_SENSORS4_EN, \
GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_PD15, \
+3 -3
View File
@@ -107,7 +107,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_5V_PERIPH_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS_EN(false);
VDD_3V3_SENSORS4_EN(false);
bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN();
/* Keep Spektum on to discharge rail*/
@@ -122,7 +122,7 @@ __EXPORT void board_peripheral_reset(int ms)
/* switch the peripheral rail back on */
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_5V_PERIPH_EN(true);
}
@@ -215,7 +215,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_3V3_SD_CARD_EN(true);
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
/* Need hrt running before using the ADC */
+1 -1
View File
@@ -48,7 +48,7 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
+3 -3
View File
@@ -271,7 +271,7 @@
#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15)
#define GPIO_VDD_5V_HIPOWER_nEN /* PG10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN10)
#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13)
#define GPIO_VDD_3V3_SENSORS_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2)
#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13)
@@ -297,7 +297,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true))
#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN)
#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true))
@@ -463,7 +463,7 @@
GPIO_VDD_5V_PERIPH_nOC, \
GPIO_VDD_5V_HIPOWER_nEN, \
GPIO_VDD_5V_HIPOWER_nOC, \
GPIO_VDD_3V3_SENSORS_EN, \
GPIO_VDD_3V3_SENSORS4_EN, \
GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_SYNC, \
+3 -3
View File
@@ -107,7 +107,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_5V_PERIPH_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS_EN(false);
VDD_3V3_SENSORS4_EN(false);
bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN();
/* Keep Spektum on to discharge rail*/
@@ -122,7 +122,7 @@ __EXPORT void board_peripheral_reset(int ms)
/* switch the peripheral rail back on */
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_5V_PERIPH_EN(true);
}
@@ -219,7 +219,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_3V3_SD_CARD_EN(true);
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
/* Need hrt running before using the ADC */
+1 -1
View File
@@ -49,7 +49,7 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -65,6 +65,7 @@ adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-logger"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-manual_control"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mavlink"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mavlink_bridge"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mavlink_tests"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mb12xx"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mc_att_control"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mc_pos_control"
+1 -1
View File
@@ -143,7 +143,7 @@ if [ "$GPS" != "NONE" ]; then
if [ "$PLATFORM" == "M0197" ]; then
gps start -d /dev/ttyHS7
else
qshell gps start -d 6
qshell gps start
fi
fi
@@ -202,7 +202,7 @@
*(.text._ZN21MavlinkStreamAltitude8get_sizeEv)
*(.text._ZN7Mavlink29check_requested_subscriptionsEv)
*(.text.imxrt_lpspi_setmode)
*(.text._ZN3Ekf36uncorrelateAndLimitHeadingCovarianceEv)
*(.text._ZN3Ekf34controlZeroInnovationHeadingUpdateEv)
*(.text.perf_begin)
*(.text.imxrt_lpspi_setfrequency)
*(.text._ZN17FlightModeManager9_initTaskE15FlightTaskIndex)
@@ -202,7 +202,7 @@
*(.text._ZN21MavlinkStreamAltitude8get_sizeEv)
*(.text._ZN7Mavlink29check_requested_subscriptionsEv)
*(.text.imxrt_lpspi_setmode)
*(.text._ZN3Ekf36uncorrelateAndLimitHeadingCovarianceEv)
*(.text._ZN3Ekf34controlZeroInnovationHeadingUpdateEv)
*(.text.perf_begin)
*(.text.imxrt_lpspi_setfrequency)
*(.text._ZN17FlightModeManager9_initTaskE15FlightTaskIndex)
+3 -3
View File
@@ -233,7 +233,7 @@
#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15)
#define GPIO_VDD_5V_HIPOWER_nEN /* PF12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTF|GPIO_PIN12)
#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13)
#define GPIO_VDD_3V3_SENSORS_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2)
#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13)
@@ -258,7 +258,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true))
#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN)
#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true))
@@ -409,7 +409,7 @@
GPIO_VDD_5V_PERIPH_nOC, \
GPIO_VDD_5V_HIPOWER_nEN, \
GPIO_VDD_5V_HIPOWER_nOC, \
GPIO_VDD_3V3_SENSORS_EN, \
GPIO_VDD_3V3_SENSORS4_EN, \
GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_PH11, \
+3 -3
View File
@@ -107,7 +107,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_5V_PERIPH_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS_EN(false);
VDD_3V3_SENSORS4_EN(false);
bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN();
/* Keep Spektum on to discharge rail*/
@@ -122,7 +122,7 @@ __EXPORT void board_peripheral_reset(int ms)
/* switch the peripheral rail back on */
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_5V_PERIPH_EN(true);
}
@@ -217,7 +217,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_3V3_SD_CARD_EN(true);
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
/* Need hrt running before using the ADC */
+3 -3
View File
@@ -49,7 +49,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -73,7 +73,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -96,7 +96,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
+1 -1
View File
@@ -185,7 +185,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
/* Tone alarm output */
+3 -3
View File
@@ -268,7 +268,7 @@
#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15)
#define GPIO_VDD_5V_HIPOWER_nEN /* PG10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN10)
#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13)
#define GPIO_VDD_3V3_SENSORS_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2)
#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13)
@@ -290,7 +290,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true))
#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN)
#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true))
@@ -454,7 +454,7 @@
GPIO_VDD_5V_PERIPH_nOC, \
GPIO_VDD_5V_HIPOWER_nEN, \
GPIO_VDD_5V_HIPOWER_nOC, \
GPIO_VDD_3V3_SENSORS_EN, \
GPIO_VDD_3V3_SENSORS4_EN, \
GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_PD15, \
+3 -3
View File
@@ -107,7 +107,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_5V_PERIPH_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS_EN(false);
VDD_3V3_SENSORS4_EN(false);
bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN();
/* Keep Spektum on to discharge rail*/
@@ -122,7 +122,7 @@ __EXPORT void board_peripheral_reset(int ms)
/* switch the peripheral rail back on */
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_5V_PERIPH_EN(true);
}
@@ -219,7 +219,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_3V3_SD_CARD_EN(true);
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
/* Need hrt running before using the ADC */
+7 -7
View File
@@ -49,7 +49,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -73,7 +73,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -97,7 +97,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -120,7 +120,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -143,7 +143,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -166,7 +166,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -190,7 +190,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS_EN from board_config.h
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
@@ -205,7 +205,7 @@
*(.text._ZN21MavlinkStreamAltitude8get_sizeEv)
*(.text._ZN7Mavlink29check_requested_subscriptionsEv)
*(.text.imxrt_lpspi_setmode)
*(.text._ZN3Ekf36uncorrelateAndLimitHeadingCovarianceEv)
*(.text._ZN3Ekf34controlZeroInnovationHeadingUpdateEv)
*(.text.perf_begin)
*(.text.imxrt_lpspi_setfrequency)
*(.text._ZN17FlightModeManager9_initTaskE15FlightTaskIndex)
+1 -1
View File
@@ -161,7 +161,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true))
#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN)
+3 -3
View File
@@ -108,7 +108,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_5V_PERIPH_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS_EN(false);
VDD_3V3_SENSORS4_EN(false);
bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN();
/* Keep Spektum on to discharge rail*/
@@ -123,7 +123,7 @@ __EXPORT void board_peripheral_reset(int ms)
/* switch the peripheral rail back on */
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_5V_PERIPH_EN(true);
}
@@ -212,7 +212,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
/* Need hrt running before using the ADC */
@@ -210,7 +210,7 @@
#define GPIO_VDD_3V5_LTE_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15)
#define GPIO_VDD_5V_HIPOWER_nEN /* PF12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTF|GPIO_PIN12)
#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13)
#define GPIO_VDD_3V3_SENSORS_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
/* Spare GPIO */
@@ -227,7 +227,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_3V5_LTE_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V5_LTE_nEN, on_true)
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, on_true)
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
/* Tone alarm output */
@@ -342,7 +342,7 @@
GPIO_VDD_3V5_LTE_nOC, \
GPIO_VDD_5V_HIPOWER_nEN, \
GPIO_VDD_5V_HIPOWER_nOC, \
GPIO_VDD_3V3_SENSORS_EN, \
GPIO_VDD_3V3_SENSORS4_EN, \
GPIO_PH11, \
GPIO_NFC_GPIO, \
GPIO_TONE_ALARM_IDLE, \
@@ -109,7 +109,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_3V5_LTE_EN(false);
VDD_5V_HIPOWER_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS_EN(false);
VDD_3V3_SENSORS4_EN(false);
/* wait for the peripheral rail to reach GND */
usleep(ms * 1000);
@@ -121,7 +121,7 @@ __EXPORT void board_peripheral_reset(int ms)
board_control_spi_sensors_power(true, 0xffff);
VDD_3V5_LTE_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
}
@@ -211,7 +211,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
/* Power on Interfaces */
VDD_3V5_LTE_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
/* Need hrt running before using the ADC */
+3 -3
View File
@@ -259,7 +259,7 @@
#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15)
#define GPIO_VDD_5V_HIPOWER_nEN /* PG10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN10)
#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13)
#define GPIO_VDD_3V3_SENSORS_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2)
#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13)
@@ -276,7 +276,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true))
#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN)
#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true))
@@ -420,7 +420,7 @@
GPIO_VDD_5V_PERIPH_nOC, \
GPIO_VDD_5V_HIPOWER_nEN, \
GPIO_VDD_5V_HIPOWER_nOC, \
GPIO_VDD_3V3_SENSORS_EN, \
GPIO_VDD_3V3_SENSORS4_EN, \
GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_ETH_POWER_EN, \
+1 -1
View File
@@ -212,7 +212,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_3V3_SD_CARD_EN(true);
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
/* Need hrt running before using the ADC */
+3 -3
View File
@@ -267,7 +267,7 @@
#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15)
#define GPIO_VDD_5V_HIPOWER_nEN /* PG10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN10)
#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13)
#define GPIO_VDD_3V3_SENSORS_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8)
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2)
#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13)
@@ -289,7 +289,7 @@
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true))
#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true))
#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true))
#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true))
#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true))
#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN)
#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true))
@@ -452,7 +452,7 @@
GPIO_VDD_5V_PERIPH_nOC, \
GPIO_VDD_5V_HIPOWER_nEN, \
GPIO_VDD_5V_HIPOWER_nOC, \
GPIO_VDD_3V3_SENSORS_EN, \
GPIO_VDD_3V3_SENSORS4_EN, \
GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_PD15, \
+3 -3
View File
@@ -107,7 +107,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_5V_PERIPH_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS_EN(false);
VDD_3V3_SENSORS4_EN(false);
bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN();
/* Keep Spektum on to discharge rail*/
@@ -122,7 +122,7 @@ __EXPORT void board_peripheral_reset(int ms)
/* switch the peripheral rail back on */
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_5V_PERIPH_EN(true);
}
@@ -219,7 +219,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_3V3_SD_CARD_EN(true);
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS_EN(true);
VDD_3V3_SENSORS4_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
/* Need hrt running before using the ADC */
@@ -301,6 +301,7 @@
1 1 COM_FLTMODE5 -1 6
1 1 COM_FLTMODE6 8 6
1 1 COM_FLTT_LOW_ACT 3 6
1 1 COM_FLT_PROFILE 0 6
1 1 COM_FLT_TIME_MAX -1 6
1 1 COM_FORCE_SAFETY 0 6
1 1 COM_HLDL_LOSS_T 120 6
@@ -308,8 +309,10 @@
1 1 COM_HOME_EN 1 6
1 1 COM_HOME_IN_AIR 0 6
1 1 COM_IMB_PROP_ACT 0 6
1 1 COM_KILL_DISARM 5.000000000000000000 9
1 1 COM_LKDOWN_TKO 3.000000000000000000 9
1 1 COM_LOW_BAT_ACT 0 6
1 1 COM_MOT_TEST_EN 1 6
1 1 COM_OBC_LOSS_T 5.000000000000000000 9
1 1 COM_OBL_RC_ACT 0 6
1 1 COM_OBS_AVOID 0 6
Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 22 KiB

+48 -8
View File
@@ -5499,7 +5499,7 @@ Note that non-motor outputs might already be active in prearm state if COM_PREAR
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | 127 | 127 | | 127 | |
| &nbsp; | 128 | 128 | | 128 | |
### RBCLW_DIS2 (`INT32`) {#RBCLW_DIS2}
@@ -5513,7 +5513,7 @@ Note that non-motor outputs might already be active in prearm state if COM_PREAR
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | 127 | 127 | | 127 | |
| &nbsp; | 128 | 128 | | 128 | |
### RBCLW_FAIL1 (`INT32`) {#RBCLW_FAIL1}
@@ -5701,7 +5701,7 @@ Maxmimum output value (when not disarmed).
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | 127 | 254 | | 254 | |
| &nbsp; | 128 | 256 | | 256 | |
### RBCLW_MAX2 (`INT32`) {#RBCLW_MAX2}
@@ -5713,7 +5713,7 @@ Maxmimum output value (when not disarmed).
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | 127 | 254 | | 254 | |
| &nbsp; | 128 | 256 | | 256 | |
### RBCLW_MIN1 (`INT32`) {#RBCLW_MIN1}
@@ -5725,7 +5725,7 @@ Minimum output value (when not disarmed).
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | 0 | 127 | | 0 | |
| &nbsp; | 1 | 128 | | 1 | |
### RBCLW_MIN2 (`INT32`) {#RBCLW_MIN2}
@@ -5737,7 +5737,7 @@ Minimum output value (when not disarmed).
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | 0 | 127 | | 0 | |
| &nbsp; | 1 | 128 | | 1 | |
### RBCLW_REV (`INT32`) {#RBCLW_REV}
@@ -18620,6 +18620,25 @@ the estimated time it takes to reach the RTL destination.
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | | | 1 | 0 | |
### COM_FLT_PROFILE (`INT32`) {#COM_FLT_PROFILE}
User Flight Profile.
Describes the intended use of the vehicle.
Can be used by ground control software or log post processing.
This param does not influence the behavior within the firmware. This means for example the control logic is independent of the setting of this param (but depends on other params).
**Values:**
- `0`: Default
- `100`: Pro User
- `200`: Flight Tester
- `300`: Developer
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | | | | 0 | |
### COM_FLT_TIME_MAX (`INT32`) {#COM_FLT_TIME_MAX}
Maximum allowed flight time.
@@ -18713,6 +18732,16 @@ See also FD_IMB_PROP_THR to set the failure threshold.
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | | | 1 | 0 | |
### COM_KILL_DISARM (`FLOAT`) {#COM_KILL_DISARM}
Timeout value for disarming when kill switch is engaged.
Use RC_MAP_KILL_SW to map a kill switch.
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ------- | ---- |
| &nbsp; | 0.0 | 30.0 | 0.1 | 5.0 | s |
### COM_LKDOWN_TKO (`FLOAT`) {#COM_LKDOWN_TKO}
Timeout for detecting a failure after takeoff.
@@ -18849,6 +18878,17 @@ By default disabled for safety reasons
| ------ | -------- | -------- | --------- | ------------ | ---- |
| &nbsp; | | | | Disabled (0) | |
### COM_MOT_TEST_EN (`INT32`) {#COM_MOT_TEST_EN}
Enable Actuator Testing.
If set, enables the actuator test interface via MAVLink (ACTUATOR_TEST), that
allows spinning the motors and moving the servos for testing purposes.
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ----------- | ---- |
| &nbsp; | | | | Enabled (1) | |
### COM_OBC_LOSS_T (`FLOAT`) {#COM_OBC_LOSS_T}
Time-out to wait when onboard computer connection is lost before warning about loss connection.
@@ -19094,7 +19134,7 @@ Note: Only has an effect on multicopters, and VTOLs in multicopter mode.
Stick override threshold.
If COM_RC_OVERRIDE is enabled and the joystick input is moved more than this threshold
the pilot takes over control.
the autopilot the pilot takes over control.
| Reboot | minValue | maxValue | increment | default | unit |
| ------ | -------- | -------- | --------- | ------- | ---- |
@@ -31943,7 +31983,7 @@ Emergency Kill switch channel.
This channel immediately sets all outputs to their disarmed values, parachutes are NOT deployed.
Unlike termination this can be undone. Quickly flipping the switch back restores control.
System auto-disarms after 5 seconds, preflight checks and re-arming are then required.
System auto-disarms after COM_KILL_DISARM seconds, preflight checks and re-arming are then required.
**Values:**
+1
View File
@@ -660,6 +660,7 @@ For each of the tilt servos:
- If a safety button is used, it must be pressed before actuator testing is allowed.
- The kill-switch can still be used to stop motors immediately.
- Servos do not actually move until the corresponding slider is changed.
- The parameter [COM_MOT_TEST_EN](../advanced_config/parameter_reference.md#COM_MOT_TEST_EN) can be used to completely disable actuator testing.
- On the shell, [actuator_test](../modules/modules_command.md#actuator-test) can be used as well for actuator testing.
- VTOLs will automatically turn off motors pointing upwards during **fixed-wing flight**:
- Standard VTOL : Motors defined as multicopter motors will be turned off
+6 -2
View File
@@ -364,7 +364,11 @@ This section lists the available emergency switches.
A kill switch immediately stops all motor outputs — if flying, the vehicle will start to fall!
The motors will restart if the switch is reverted within 5 seconds, after which the vehicle will automatically disarm, and you will need to arm it again in order to start the motors.
[By default](#COM_KILL_DISARM) the motors will restart if the switch is reverted within 5 seconds, after which the vehicle will automatically disarm, and you will need to arm it again in order to start the motors.
| Parameter | Description |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| <a id="COM_KILL_DISARM"></a>[COM_KILL_DISARM](../advanced_config/parameter_reference.md#COM_KILL_DISARM) | Timeout value for disarming after kill switch is engaged. Default: `5` seconds. |
::: info
There is also a [Kill Gesture](#kill-gesture), which cannot be reverted.
@@ -406,7 +410,7 @@ A return switch can be used to immediately engage [Return mode](../flight_modes/
A kill gesture immediately stops all motor outputs — if flying, the vehicle will start to fall!
The action cannot be reverted without a reboot (this differs from a [Kill Switch](#kill-switch), where the operation can be reverted within 5 seconds).
The action cannot be reverted without a reboot (this differs from a [Kill Switch](#kill-switch), where the operation can be reverted within the time period defined by [COM_KILL_DISARM](#COM_KILL_DISARM)).
| Parameter | Description |
| -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
-3
View File
@@ -84,7 +84,6 @@ You need to set necessary [DroneCAN](index.md) parameters and define offsets if
- Enable GPS yaw fusion by setting bit 3 of [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) to true.
- Enable GPS blending to ensure the heading is always published by setting [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) to 7 (all three bits checked).
- If using [Moving Baseline & GPS Heading](#setting-up-moving-baseline--gps-heading), set [SENS_GPS_PRIME](../advanced_config/parameter_reference.md#SENS_GPS_PRIME) to the CAN node ID of the _Moving Base_ module. The moving base is preferred because the rover receiver in a moving baseline configuration can experience degraded navigation rate and increased data latency when corrections are intermittent.
- Enable [UAVCAN_SUB_GPS](../advanced_config/parameter_reference.md#UAVCAN_SUB_GPS), [UAVCAN_SUB_MAG](../advanced_config/parameter_reference.md#UAVCAN_SUB_MAG), and [UAVCAN_SUB_BARO](../advanced_config/parameter_reference.md#UAVCAN_SUB_BARO).
- The parameters [EKF2_GPS_POS_X](../advanced_config/parameter_reference.md#EKF2_GPS_POS_X), [EKF2_GPS_POS_Y](../advanced_config/parameter_reference.md#EKF2_GPS_POS_Y) and [EKF2_GPS_POS_Z](../advanced_config/parameter_reference.md#EKF2_GPS_POS_Z) can be set to account for the offset of the ARK RTK GPS from the vehicles centre of gravity.
@@ -137,7 +136,6 @@ Setup via CAN:
- On the _Moving Base_, set the following:
- [GPS_UBX_MODE](../advanced_config/parameter_reference.md#GPS_UBX_MODE) to `4`.
- [CANNODE_PUB_MBD](../advanced_config/parameter_reference.md#CANNODE_PUB_MBD) to `1`.
- On the _Flight Controller_, set [SENS_GPS_PRIME](../advanced_config/parameter_reference.md#SENS_GPS_PRIME) to the CAN node ID of the _Moving Base_ (see [PX4 Configuration](#px4-configuration)).
Setup via UART:
@@ -156,7 +154,6 @@ Setup via UART:
- [GPS_YAW_OFFSET](../advanced_config/parameter_reference.md#GPS_YAW_OFFSET) to `0` if your _Rover_ is in front of your _Moving Base_, `90` if _Rover_ is right of _Moving Base_, `180` if _Rover_ is behind _Moving Base_, or `270` if _Rover_ is left of _Moving Base_.
- On the _Moving Base_, set the following:
- [GPS_UBX_MODE](../advanced_config/parameter_reference.md#GPS_UBX_MODE) to `2`.
- On the _Flight Controller_, set [SENS_GPS_PRIME](../advanced_config/parameter_reference.md#SENS_GPS_PRIME) to the CAN node ID of the _Moving Base_ (see [PX4 Configuration](#px4-configuration)).
For more information see [Rover and Moving Base](../dronecan/index.md#rover-and-moving-base) in the DroneCAN guide.
+23 -53
View File
@@ -4,11 +4,11 @@
The _Return_ flight mode is used to _fly a vehicle to safety_ on an unobstructed path to a safe destination, where it should land.
Each vehicle has a **default** return mode behavior which is described in the linked topics (read those first if you plan on using the defaults):
The following topics should be read first if you're using these vehicle types:
- [Multicopter](../flight_modes_mc/return.md) — Home/rally point return
- [Fixed-wing (Plane)](../flight_modes_fw/return.md) — Mission landing/Rally point return
- [VTOL](../flight_modes_vtol/return.md) — Mission landing/Rally point return
- [Multicopter](../flight_modes_mc/return.md)
- [Fixed-wing (Plane)](../flight_modes_fw/return.md)
- [VTOL](../flight_modes_vtol/return.md)
::: info
@@ -40,9 +40,11 @@ This topic covers all the possible return types that any vehicle _might_ be conf
The following sections explain how to configure the [return type](#return_types), [minimum return altitude](#minimum-return-altitude) and [landing/arrival behaviour](#loiter-landing-at-destination).
## Return Types (RTL_TYPE) {#return_types}
<a id="return_types"></a>
PX4 provides a number of alternative approaches for finding an unobstructed path to a safe destination and/or landing, which are set using the [RTL_TYPE](#RTL_TYPE) parameter.
## Return Types (RTL_TYPE)
PX4 provides four alternative approaches for finding an unobstructed path to a safe destination and/or landing, which are set using the [RTL_TYPE](#RTL_TYPE) parameter.
At high level these are:
@@ -54,16 +56,12 @@ At high level these are:
If no _mission_ defined, return direct to home (rally points are ignored).
- [Closest safe destination return](#closest-safe-destination-return-type-rtl-type-3) (`RTL_TYPE=3`): Ascend to a safe altitude and return via direct path to closest destination: home, start of mission landing pattern, or rally point.
If the destination is a mission landing pattern, follow the pattern to land.
- [Reverse mission return or mission landing](#mission-landing-or-reverse-mission-return-type-rtl-type-4) (`RTL_TYPE=4`): Return to the planned mission landing, or to home via the reverse mission path, whichever is closer (counted by waypoints).
Do not consider rally points.
If no mission is defined, return direct to home.
- [Safe point return](#safe-point-return-type-rtl-type-5) (`RTL_TYPE=5`): Return directly to the closest rally (safe) point.
Do not consider the home position or mission landing.
If no rally point is defined, descend and loiter at the current position.
More detailed explanations for each of the types are provided in the following sections.
### Home/Rally Point Return Type (RTL_TYPE=0) {#home_return}
<a id="home_return"></a>
### Home/Rally Point Return Type (RTL_TYPE=0)
This is the default return type for a [multicopter](../flight_modes_mc/return.md) (see topic for more information).
@@ -149,34 +147,6 @@ In this return type the vehicle:
By default an MC or VTOL in MC mode will land, and a fixed-wing vehicle circles at the descent altitude.
A VTOL in FW mode aligns its heading to the destination point, transitions to MC mode, and then lands.
### Mission Landing or Reverse Mission Return Type (RTL_TYPE=4)
This return type uses the mission (if defined) to provide a safe return path (either forward or in reverse), and the [mission landing pattern](#mission-landing-pattern) (if defined) to provide landing behaviour:
- If a mission landing pattern exists and it is closer (by waypoint count) than home via the reverse mission, the vehicle flies forward to the mission landing.
- Otherwise it flies the mission in reverse to return home.
- If no valid mission is defined, the vehicle returns directly to home.
- Rally points are ignored.
Note that this is similar to [RTL_TYPE=2](#mission-path-return-type-rtl-type-2), but the choice between fast-forward and fast-reverse is based on which destination is _closer by waypoint count_ rather than which flight mode is active when return mode is activated.
### Safe Point Return Type (RTL_TYPE=5)
In this return type the vehicle returns directly to the closest rally point (only).
Home position and mission landings are not considered.
The vehicle:
- Ascends to a safe [minimum return altitude](#minimum-return-altitude) (above any expected obstacles).
- Flies via a direct path to the closest rally point.
- On [arrival](#loiter-landing-at-destination) descends to the descent altitude and [lands or waits](#loiter-landing-at-destination) (depending on landing parameters).
If no rally point is defined, the vehicle will descend and loiter at its current position (it will not return to home).
::: info
This type is useful when the home position is not a safe return point.
:::
## Minimum Return Altitude
For most [return types](#return_types) a vehicle will ascend to a _minimum safe altitude_ before returning (unless already above that altitude), in order to avoid any obstacles between it and the destination.
@@ -235,15 +205,15 @@ For this reason fixed-wing vehicles are configured to use [Mission landing/reall
The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode) (and summarised below).
| Parameter | Description |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <a id="RTL_TYPE"></a>[RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) | Return mechanism (path and destination).<br>`0`: Return to a rally point or home (whichever is closest) via direct path.<br>`1`: Return to a rally point or the mission landing pattern start point (whichever is closest), via direct path. If neither mission landing or rally points are defined return home via a direct path. If the destination is a mission landing pattern, follow the pattern to land.<br>`2`: Use mission path fast-forward to landing if a landing pattern is defined, otherwise fast-reverse to home. Ignore rally points. Fly direct to home if no mission plan is defined.<br>`3`: Return via direct path to closest destination: home, start of mission landing pattern or safe point. If the destination is a mission landing pattern, follow the pattern to land.<br>`4`: Return home via the reverse mission path or to the planned mission landing, whichever is closer by waypoint count. Ignore rally points. Fly direct to home if no mission is defined.<br>`5`: Return directly to the closest rally point (safe point). Ignore home and mission landing. If no rally point is defined, descend at current position. |
| <a id="RTL_RETURN_ALT"></a>[RTL_RETURN_ALT](../advanced_config/parameter_reference.md#RTL_RETURN_ALT) | Return altitude in meters (default: 60m) when [RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) is 0. If already above this value the vehicle will return at its current altitude. |
| <a id="RTL_DESCEND_ALT"></a>[RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | Minimum return altitude and altitude at which the vehicle will slow or stop its initial descent from a higher return altitude (default: 30m) |
| <a id="RTL_LAND_DELAY"></a>[RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to wait at `RTL_DESCEND_ALT` before landing (default: 0.5s) -by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. The delay is provided to allow you to configure time for landing gear to be deployed (triggered automatically). |
| <a id="RTL_MIN_DIST"></a>[RTL_MIN_DIST](../advanced_config/parameter_reference.md#RTL_MIN_DIST) | Minimum horizontal distance from home position to trigger ascent to the return altitude specified by the "cone". If the vehicle is horizontally closer than this distance to home, it will return at its current altitude or `RTL_DESCEND_ALT` (whichever is higher) instead of first ascending to RTL_RETURN_ALT. |
| <a id="RTL_CONE_ANG"></a>[RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle RTL return altitude. Values (in degrees): 0, 25, 45, 65, 80, 90. Note that 0 is "no cone" (always return at `RTL_RETURN_ALT` or higher), while 90 indicates that the vehicle must return at the current altitude or `RTL_DESCEND_ALT` (whichever is higher). |
| <a id="COM_RC_OVERRIDE"></a>[COM_RC_OVERRIDE](../advanced_config/parameter_reference.md#COM_RC_OVERRIDE) | Controls whether stick movement on a multicopter (or VTOL in MC mode) causes a mode change to [Position mode](../flight_modes_mc/position.md) (except when vehicle is handling a critical battery failsafe). This can be separately enabled for auto modes and for offboard mode, and is enabled in auto modes by default. |
| <a id="COM_RC_STICK_OV"></a>[COM_RC_STICK_OV](../advanced_config/parameter_reference.md#COM_RC_STICK_OV) | The amount of stick movement that causes a transition to [Position mode](../flight_modes_mc/position.md) (if [COM_RC_OVERRIDE](#COM_RC_OVERRIDE) is enabled). |
| <a id="RTL_LOITER_RAD"></a>[RTL_LOITER_RAD](../advanced_config/parameter_reference.md#RTL_LOITER_RAD) | [Fixed-wing Only] The radius of the loiter circle (at [RTL_LAND_DELAY](#RTL_LAND_DELAY)). |
| <a id="MIS_TKO_LAND_REQ"></a>[MIS_TKO_LAND_REQ](../advanced_config/parameter_reference.md#MIS_TKO_LAND_REQ) | Specify whether a mission landing or takeoff pattern is _required_. Generally fixed-wing vehicles set this to require a landing pattern but VTOL do not. |
| Parameter | Description |
| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="RTL_TYPE"></a>[RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) | Return mechanism (path and destination).<br>`0`: Return to a rally point or home (whichever is closest) via direct path.<br>`1`: Return to a rally point or the mission landing pattern start point (whichever is closest), via direct path. If neither mission landing or rally points are defined return home via a direct path. If the destination is a mission landing pattern, follow the pattern to land.<br>`2`: Use mission path fast-forward to landing if a landing pattern is defined, otherwise fast-reverse to home. Ignore rally points. Fly direct to home if no mission plan is defined.<br>`3`: Return via direct path to closest destination: home, start of mission landing pattern or safe point. If the destination is a mission landing pattern, follow the pattern to land. |
| <a id="RTL_RETURN_ALT"></a>[RTL_RETURN_ALT](../advanced_config/parameter_reference.md#RTL_RETURN_ALT) | Return altitude in meters (default: 60m) when [RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) is 0. If already above this value the vehicle will return at its current altitude. |
| <a id="RTL_DESCEND_ALT"></a>[RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | Minimum return altitude and altitude at which the vehicle will slow or stop its initial descent from a higher return altitude (default: 30m) |
| <a id="RTL_LAND_DELAY"></a>[RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to wait at `RTL_DESCEND_ALT` before landing (default: 0.5s) -by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. The delay is provided to allow you to configure time for landing gear to be deployed (triggered automatically). |
| <a id="RTL_MIN_DIST"></a>[RTL_MIN_DIST](../advanced_config/parameter_reference.md#RTL_MIN_DIST) | Minimum horizontal distance from home position to trigger ascent to the return altitude specified by the "cone". If the vehicle is horizontally closer than this distance to home, it will return at its current altitude or `RTL_DESCEND_ALT` (whichever is higher) instead of first ascending to RTL_RETURN_ALT. |
| <a id="RTL_CONE_ANG"></a>[RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle RTL return altitude. Values (in degrees): 0, 25, 45, 65, 80, 90. Note that 0 is "no cone" (always return at `RTL_RETURN_ALT` or higher), while 90 indicates that the vehicle must return at the current altitude or `RTL_DESCEND_ALT` (whichever is higher). |
| <a id="COM_RC_OVERRIDE"></a>[COM_RC_OVERRIDE](../advanced_config/parameter_reference.md#COM_RC_OVERRIDE) | Controls whether stick movement on a multicopter (or VTOL in MC mode) causes a mode change to [Position mode](../flight_modes_mc/position.md) (except when vehicle is handling a critical battery failsafe). This can be separately enabled for auto modes and for offboard mode, and is enabled in auto modes by default. |
| <a id="COM_RC_STICK_OV"></a>[COM_RC_STICK_OV](../advanced_config/parameter_reference.md#COM_RC_STICK_OV) | The amount of stick movement that causes a transition to [Position mode](../flight_modes_mc/position.md) (if [COM_RC_OVERRIDE](#COM_RC_OVERRIDE) is enabled). |
| <a id="RTL_LOITER_RAD"></a>[RTL_LOITER_RAD](../advanced_config/parameter_reference.md#RTL_LOITER_RAD) | [Fixed-wing Only] The radius of the loiter circle (at [RTL_LAND_DELAY](#RTL_LAND_DELAY)). |
| <a id="MIS_TKO_LAND_REQ"></a>[MIS_TKO_LAND_REQ](../advanced_config/parameter_reference.md#MIS_TKO_LAND_REQ) | Specify whether a mission landing or takeoff pattern is _required_. Generally fixed-wing vehicles set this to require a landing pattern but VTOL do not. |
-5
View File
@@ -4,11 +4,6 @@
The _Return_ flight mode is used to _fly a vehicle to safety_ on an unobstructed path to a safe destination, where it can land.
This topic describes the [Mission Landing/Rally Point](../flight_modes/return.md#mission-landing-rally-point-return-type-rtl-type-1) return type that FW vehicles use by default.
See the [Return Mode (Generic Vehicle)](../flight_modes/return.md#return-types-rtl-type) for an overview of the other supported types.
## Overview
Fixed-wing vehicles use the [Mission Landing/Rally Point](../flight_modes/return.md#mission-landing-rally-point-return-type-rtl-type-1) return type by default, and are expected to always have a mission with a landing pattern.
With this configuration, return mode causes the vehicle to ascend to a minimum safe altitude above obstructions (if needed), fly to the start of the landing pattern defined in the mission plan, and then follow it to land.
-5
View File
@@ -4,11 +4,6 @@
The _Return_ flight mode is used to _fly a vehicle to safety_ on an unobstructed path to a safe destination, where it can land.
This topic describes the [home/rally point return type](../flight_modes/return.md#home-rally-point-return-type-rtl-type-0) return type that MC vehicles use by default.
See the [Return Mode (Generic Vehicle)](../flight_modes/return.md#return-types-rtl-type) for an overview of the other supported types.
## Overview
Multicopters use a [home/rally point return type](../flight_modes/return.md#home-rally-point-return-type-rtl-type-0) by default.
In this return type vehicles ascend to a safe altitude above obstructions if needed, fly directly to the closest safe landing point (a rally point or the home position), descend to the "descent altitude", wait briefly, and then land.
The return altitude, descent altitude, and landing delay are normally set to conservative "safe" values, but can be changed if needed.
-5
View File
@@ -4,11 +4,6 @@
The _Return_ flight mode is used to _fly a vehicle to safety_ on an unobstructed path to a safe destination, where it may either wait (hover or circle) or land.
This topic describes the [Mission Landing/Rally Point](../flight_modes/return.md#mission-landing-rally-point-return-type-rtl-type-1) return type that VTOL vehicles use by default.
See the [Return Mode (Generic Vehicle)](../flight_modes/return.md#return-types-rtl-type) for an overview of the other supported types.
## Overview
VTOL vehicles use the [Mission Landing/Rally Point](../flight_modes/return.md#mission-landing-rally-point-return-type-rtl-type-1) return type by default.
In this return type a vehicle ascends to a minimum safe altitude above obstructions (if needed), and then flies directly to a rally point or the start of a mission landing point (whichever is nearest), or the home position if neither rally points or mission landing pattern is defined.
If the destination is a mission landing pattern, the vehicle will then follow the pattern to land.
+4 -44
View File
@@ -163,42 +163,6 @@ $$\dot{B} = \gamma - \frac{\dot{V_T}}{g}$$
## Fixed-Wing Attitude Controller
### Setpoint modificaiton
Most fixed-wing aircraft cannot generate a sustained yaw rate using the rudder alone. As a result, the yaw component of the quaternion attitude error should be removed before computing the control action.
This is achieved by premultiplying the setpoint quaternion with a rotation about the global down axis. The additional rotation cancels the yaw component of the attitude error while preserving the roll and pitch components.
The yaw offset is
$$
\psi =-2\frac{\hat{q}_0 q_3 - \hat{q}_1 q_2 + \hat{q}_2 q_1 -\hat{q}_3 q_0}
{\hat{q}_0 q_0 - \hat{q}_1 q_1 - \hat{q}_2 q_2 + \hat{q}_3 q_3}
$$
The quaternion representing the yaw offset is
$$
_{\text{yaw}} =
\operatorname{normalize}
\left(
\begin{bmatrix}
1 \
0 \
0 \
\frac{\psi}{2}
\end{bmatrix}
\right)
$$
The corrected setpoint quaternion is then obtained by applying the rotation
$$
_{\text{sp, corrected}} = _{\text{yaw}} \otimes _{sp}
$$
### Quaternion based attitude controller
![FW Attitude Controller Diagram](../../assets/diagrams/px4_fw_attitude_controller_diagram.png)
<!-- The drawing is on draw.io: https://drive.google.com/file/d/1ibxekmtc6Ljq60DvNMplgnnU-JOvKYLQ/view?usp=sharing
@@ -221,16 +185,12 @@ In order to keep a constant rate, this damping can be compensated using feedforw
### Turn coordination
The yaw rate setpoint is generated using the turn coordination constraint in order to minimize lateral acceleration, generated when the aircraft is slipping.
The roll and pitch controllers have the same structure and the longitudinal and lateral dynamics are assumed to be uncoupled enough to work independently.
The yaw controller, however, generates its yaw rate setpoint using the turn coordination constraint in order to minimize lateral acceleration, generated when the aircraft is slipping. The turn coordination algorithm is based solely on coordinated turn geometry calculation.
$$r_{sp} = \frac{2g}{V_T}\left(q_0 q_1 + q_2 q_3\right)$$
$$\dot{\Psi}_{sp} = \frac{g}{V_T} \tan{\phi_{sp}} \cos{\theta_{sp}}$$
This also helps to counteract [adverse yaw effects](https://youtu.be/sNV_SDDxuWk) and to damp the [Dutch roll mode](https://en.wikipedia.org/wiki/Dutch_roll) by providing extra directional damping.
To compensate for the non-zero pitch rate that naturally occurs during coordinated turns, a geometry-based feedforward term is added to the pitch-rate command.
This feedforward term accounts for the aircraft's current attitude and airspeed so that the controller does not need to generate this motion purely through feedback.
$$q_{sp}^{ff} = \frac{4g(q_0 q_1 + q_2 q_3)^2}{V(1 - 2q_1^2 - 2q_2^2)}$$
The yaw rate controller also helps to counteract [adverse yaw effects](https://youtu.be/sNV_SDDxuWk) and to damp the [Dutch roll mode](https://en.wikipedia.org/wiki/Dutch_roll) by providing extra directional damping.
## VTOL Flight Controller
+187 -187
View File
@@ -95,202 +95,202 @@ They are not build into the module, and hence are neither published or subscribe
::: details See messages
- [InternalCombustionEngineStatus](../msg_docs/InternalCombustionEngineStatus.md)
- [TuneControl](../msg_docs/TuneControl.md)
- [LandingTargetPose](../msg_docs/LandingTargetPose.md)
- [DeviceInformation](../msg_docs/DeviceInformation.md)
- [ParameterSetUsedRequest](../msg_docs/ParameterSetUsedRequest.md)
- [Mission](../msg_docs/Mission.md)
- [VehicleMagnetometer](../msg_docs/VehicleMagnetometer.md)
- [InternalCombustionEngineControl](../msg_docs/InternalCombustionEngineControl.md)
- [VehicleLocalPositionSetpoint](../msg_docs/VehicleLocalPositionSetpoint.md)
- [LedControl](../msg_docs/LedControl.md)
- [GimbalDeviceInformation](../msg_docs/GimbalDeviceInformation.md)
- [LoggerStatus](../msg_docs/LoggerStatus.md)
- [VehicleAcceleration](../msg_docs/VehicleAcceleration.md)
- [DebugVect](../msg_docs/DebugVect.md)
- [PositionControllerLandingStatus](../msg_docs/PositionControllerLandingStatus.md)
- [EscReport](../msg_docs/EscReport.md)
- [AirspeedWind](../msg_docs/AirspeedWind.md)
- [GimbalManagerSetAttitude](../msg_docs/GimbalManagerSetAttitude.md)
- [EstimatorSensorBias](../msg_docs/EstimatorSensorBias.md)
- [EstimatorBias3d](../msg_docs/EstimatorBias3d.md)
- [EscStatus](../msg_docs/EscStatus.md)
- [TaskStackInfo](../msg_docs/TaskStackInfo.md)
- [MountOrientation](../msg_docs/MountOrientation.md)
- [Cpuload](../msg_docs/Cpuload.md)
- [RaptorStatus](../msg_docs/RaptorStatus.md)
- [ActuatorOutputs](../msg_docs/ActuatorOutputs.md)
- [MavlinkLog](../msg_docs/MavlinkLog.md)
- [DronecanNodeStatus](../msg_docs/DronecanNodeStatus.md)
- [GainCompression](../msg_docs/GainCompression.md)
- [ActuatorTest](../msg_docs/ActuatorTest.md)
- [ButtonEvent](../msg_docs/ButtonEvent.md)
- [MavlinkTunnel](../msg_docs/MavlinkTunnel.md)
- [VehicleStatusV1](../msg_docs/VehicleStatusV1.md)
- [GpsDump](../msg_docs/GpsDump.md)
- [LandingTargetInnovations](../msg_docs/LandingTargetInnovations.md)
- [DebugKeyValue](../msg_docs/DebugKeyValue.md)
- [SensorBaro](../msg_docs/SensorBaro.md)
- [HoverThrustEstimate](../msg_docs/HoverThrustEstimate.md)
- [TrajectorySetpoint6dof](../msg_docs/TrajectorySetpoint6dof.md)
- [HeaterStatus](../msg_docs/HeaterStatus.md)
- [CanInterfaceStatus](../msg_docs/CanInterfaceStatus.md)
- [NavigatorMissionItem](../msg_docs/NavigatorMissionItem.md)
- [GeneratorStatus](../msg_docs/GeneratorStatus.md)
- [OrbTest](../msg_docs/OrbTest.md)
- [NormalizedUnsignedSetpoint](../msg_docs/NormalizedUnsignedSetpoint.md)
- [FollowTarget](../msg_docs/FollowTarget.md)
- [ActuatorServosTrim](../msg_docs/ActuatorServosTrim.md)
- [QshellReq](../msg_docs/QshellReq.md)
- [UavcanParameterValue](../msg_docs/UavcanParameterValue.md)
- [TecsStatus](../msg_docs/TecsStatus.md)
- [Vtx](../msg_docs/Vtx.md)
- [SensorGyro](../msg_docs/SensorGyro.md)
- [VehicleAngularVelocity](../msg_docs/VehicleAngularVelocity.md)
- [FollowTargetStatus](../msg_docs/FollowTargetStatus.md)
- [GpioIn](../msg_docs/GpioIn.md)
- [DatamanResponse](../msg_docs/DatamanResponse.md)
- [FollowTargetEstimator](../msg_docs/FollowTargetEstimator.md)
- [GimbalControls](../msg_docs/GimbalControls.md)
- [TakeoffStatus](../msg_docs/TakeoffStatus.md)
- [OpenDroneIdSystem](../msg_docs/OpenDroneIdSystem.md)
- [RtlTimeEstimate](../msg_docs/RtlTimeEstimate.md)
- [SensorMag](../msg_docs/SensorMag.md)
- [VehicleImuStatus](../msg_docs/VehicleImuStatus.md)
- [VehicleCommandAckV0](../msg_docs/VehicleCommandAckV0.md)
- [QshellRetval](../msg_docs/QshellRetval.md)
- [SensorGnssStatus](../msg_docs/SensorGnssStatus.md)
- [RcChannels](../msg_docs/RcChannels.md)
- [InternalCombustionEngineStatus](../msg_docs/InternalCombustionEngineStatus.md)
- [RtlStatus](../msg_docs/RtlStatus.md)
- [OrbTestMedium](../msg_docs/OrbTestMedium.md)
- [Rpm](../msg_docs/Rpm.md)
- [PwmInput](../msg_docs/PwmInput.md)
- [OpenDroneIdSelfId](../msg_docs/OpenDroneIdSelfId.md)
- [SensorUwb](../msg_docs/SensorUwb.md)
- [AirspeedValidatedV0](../msg_docs/AirspeedValidatedV0.md)
- [SensorGnssRelative](../msg_docs/SensorGnssRelative.md)
- [ParameterSetValueRequest](../msg_docs/ParameterSetValueRequest.md)
- [ManualControlSwitches](../msg_docs/ManualControlSwitches.md)
- [RegisterExtComponentReplyV0](../msg_docs/RegisterExtComponentReplyV0.md)
- [OrbTestLarge](../msg_docs/OrbTestLarge.md)
- [EstimatorAidSource3d](../msg_docs/EstimatorAidSource3d.md)
- [ArmingCheckReplyV0](../msg_docs/ArmingCheckReplyV0.md)
- [GpioRequest](../msg_docs/GpioRequest.md)
- [DebugValue](../msg_docs/DebugValue.md)
- [FlightPhaseEstimation](../msg_docs/FlightPhaseEstimation.md)
- [VelocityLimits](../msg_docs/VelocityLimits.md)
- [SensorCorrection](../msg_docs/SensorCorrection.md)
- [IridiumsbdStatus](../msg_docs/IridiumsbdStatus.md)
- [BatteryInfo](../msg_docs/BatteryInfo.md)
- [FixedWingLateralGuidanceStatus](../msg_docs/FixedWingLateralGuidanceStatus.md)
- [GpioOut](../msg_docs/GpioOut.md)
- [TiltrotorExtraControls](../msg_docs/TiltrotorExtraControls.md)
- [GimbalManagerInformation](../msg_docs/GimbalManagerInformation.md)
- [EstimatorInnovations](../msg_docs/EstimatorInnovations.md)
- [YawEstimatorStatus](../msg_docs/YawEstimatorStatus.md)
- [VehicleLocalPositionV0](../msg_docs/VehicleLocalPositionV0.md)
- [GimbalManagerSetManualControl](../msg_docs/GimbalManagerSetManualControl.md)
- [MissionResult](../msg_docs/MissionResult.md)
- [TuneControl](../msg_docs/TuneControl.md)
- [WheelEncoders](../msg_docs/WheelEncoders.md)
- [FailureDetectorStatus](../msg_docs/FailureDetectorStatus.md)
- [RegisterExtComponentRequestV0](../msg_docs/RegisterExtComponentRequestV0.md)
- [EstimatorGpsStatus](../msg_docs/EstimatorGpsStatus.md)
- [HealthReport](../msg_docs/HealthReport.md)
- [NavigatorStatus](../msg_docs/NavigatorStatus.md)
- [DistanceSensorModeChangeRequest](../msg_docs/DistanceSensorModeChangeRequest.md)
- [CellularStatus](../msg_docs/CellularStatus.md)
- [LandingGearWheel](../msg_docs/LandingGearWheel.md)
- [ActuatorControlsStatus](../msg_docs/ActuatorControlsStatus.md)
- [SensorGyroFft](../msg_docs/SensorGyroFft.md)
- [VehicleRoi](../msg_docs/VehicleRoi.md)
- [OpenDroneIdOperatorId](../msg_docs/OpenDroneIdOperatorId.md)
- [PpsCapture](../msg_docs/PpsCapture.md)
- [GimbalManagerStatus](../msg_docs/GimbalManagerStatus.md)
- [VehicleStatusV0](../msg_docs/VehicleStatusV0.md)
- [ActuatorArmed](../msg_docs/ActuatorArmed.md)
- [DifferentialPressure](../msg_docs/DifferentialPressure.md)
- [ParameterUpdate](../msg_docs/ParameterUpdate.md)
- [ActionRequest](../msg_docs/ActionRequest.md)
- [LaunchDetectionStatus](../msg_docs/LaunchDetectionStatus.md)
- [AutotuneAttitudeControlStatus](../msg_docs/AutotuneAttitudeControlStatus.md)
- [DebugArray](../msg_docs/DebugArray.md)
- [ControlAllocatorStatus](../msg_docs/ControlAllocatorStatus.md)
- [RoverRateStatus](../msg_docs/RoverRateStatus.md)
- [SatelliteInfo](../msg_docs/SatelliteInfo.md)
- [CameraStatus](../msg_docs/CameraStatus.md)
- [LogMessage](../msg_docs/LogMessage.md)
- [PositionControllerStatus](../msg_docs/PositionControllerStatus.md)
- [SensorBaro](../msg_docs/SensorBaro.md)
- [SensorAccelFifo](../msg_docs/SensorAccelFifo.md)
- [SensorHygrometer](../msg_docs/SensorHygrometer.md)
- [PositionSetpoint](../msg_docs/PositionSetpoint.md)
- [VehicleAngularAccelerationSetpoint](../msg_docs/VehicleAngularAccelerationSetpoint.md)
- [GpsDump](../msg_docs/GpsDump.md)
- [GpioConfig](../msg_docs/GpioConfig.md)
- [GeofenceStatus](../msg_docs/GeofenceStatus.md)
- [EstimatorEventFlags](../msg_docs/EstimatorEventFlags.md)
- [SensorPreflightMag](../msg_docs/SensorPreflightMag.md)
- [VehicleOpticalFlow](../msg_docs/VehicleOpticalFlow.md)
- [PurePursuitStatus](../msg_docs/PurePursuitStatus.md)
- [GeofenceResult](../msg_docs/GeofenceResult.md)
- [EstimatorBias](../msg_docs/EstimatorBias.md)
- [SystemPower](../msg_docs/SystemPower.md)
- [EventV0](../msg_docs/EventV0.md)
- [CameraCapture](../msg_docs/CameraCapture.md)
- [RoverSpeedStatus](../msg_docs/RoverSpeedStatus.md)
- [HomePositionV0](../msg_docs/HomePositionV0.md)
- [VehicleGlobalPositionV0](../msg_docs/VehicleGlobalPositionV0.md)
- [Px4ioStatus](../msg_docs/Px4ioStatus.md)
- [EstimatorStates](../msg_docs/EstimatorStates.md)
- [FixedWingRunwayControl](../msg_docs/FixedWingRunwayControl.md)
- [FigureEightStatus](../msg_docs/FigureEightStatus.md)
- [InputRc](../msg_docs/InputRc.md)
- [Ekf2Timestamps](../msg_docs/Ekf2Timestamps.md)
- [LandingTargetInnovations](../msg_docs/LandingTargetInnovations.md)
- [UavcanParameterRequest](../msg_docs/UavcanParameterRequest.md)
- [DatamanRequest](../msg_docs/DatamanRequest.md)
- [ParameterResetRequest](../msg_docs/ParameterResetRequest.md)
- [VehicleConstraints](../msg_docs/VehicleConstraints.md)
- [VehicleAttitudeSetpointV0](../msg_docs/VehicleAttitudeSetpointV0.md)
- [FixedWingLateralStatus](../msg_docs/FixedWingLateralStatus.md)
- [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md)
- [NeuralControl](../msg_docs/NeuralControl.md)
- [DebugKeyValue](../msg_docs/DebugKeyValue.md)
- [GimbalDeviceSetAttitude](../msg_docs/GimbalDeviceSetAttitude.md)
- [EstimatorStatus](../msg_docs/EstimatorStatus.md)
- [ArmingCheckRequestV0](../msg_docs/ArmingCheckRequestV0.md)
- [TrajectorySetpoint6dof](../msg_docs/TrajectorySetpoint6dof.md)
- [ParameterSetValueResponse](../msg_docs/ParameterSetValueResponse.md)
- [MagnetometerBiasEstimate](../msg_docs/MagnetometerBiasEstimate.md)
- [CameraTrigger](../msg_docs/CameraTrigger.md)
- [PowerButtonState](../msg_docs/PowerButtonState.md)
- [ConfigOverridesV0](../msg_docs/ConfigOverridesV0.md)
- [VehicleStatusV1](../msg_docs/VehicleStatusV1.md)
- [AdcReport](../msg_docs/AdcReport.md)
- [SensorsStatus](../msg_docs/SensorsStatus.md)
- [UlogStreamAck](../msg_docs/UlogStreamAck.md)
- [UlogStream](../msg_docs/UlogStream.md)
- [SensorGyroFifo](../msg_docs/SensorGyroFifo.md)
- [BatteryStatusV0](../msg_docs/BatteryStatusV0.md)
- [SensorAccel](../msg_docs/SensorAccel.md)
- [PowerMonitor](../msg_docs/PowerMonitor.md)
- [EventV0](../msg_docs/EventV0.md)
- [ActionRequest](../msg_docs/ActionRequest.md)
- [DebugArray](../msg_docs/DebugArray.md)
- [PpsCapture](../msg_docs/PpsCapture.md)
- [Gripper](../msg_docs/Gripper.md)
- [EstimatorBias3d](../msg_docs/EstimatorBias3d.md)
- [GimbalManagerInformation](../msg_docs/GimbalManagerInformation.md)
- [PowerButtonState](../msg_docs/PowerButtonState.md)
- [PositionControllerStatus](../msg_docs/PositionControllerStatus.md)
- [EstimatorGpsStatus](../msg_docs/EstimatorGpsStatus.md)
- [ParameterSetValueResponse](../msg_docs/ParameterSetValueResponse.md)
- [SensorGyroFft](../msg_docs/SensorGyroFft.md)
- [RtlStatus](../msg_docs/RtlStatus.md)
- [VehicleGlobalPositionV0](../msg_docs/VehicleGlobalPositionV0.md)
- [FigureEightStatus](../msg_docs/FigureEightStatus.md)
- [VehicleOpticalFlow](../msg_docs/VehicleOpticalFlow.md)
- [AdcReport](../msg_docs/AdcReport.md)
- [VehicleImuStatus](../msg_docs/VehicleImuStatus.md)
- [ConfigOverridesV0](../msg_docs/ConfigOverridesV0.md)
- [GimbalDeviceInformation](../msg_docs/GimbalDeviceInformation.md)
- [GpioOut](../msg_docs/GpioOut.md)
- [GimbalControls](../msg_docs/GimbalControls.md)
- [ActuatorTest](../msg_docs/ActuatorTest.md)
- [ParameterResetRequest](../msg_docs/ParameterResetRequest.md)
- [MavlinkLog](../msg_docs/MavlinkLog.md)
- [VehicleAngularVelocity](../msg_docs/VehicleAngularVelocity.md)
- [CellularStatus](../msg_docs/CellularStatus.md)
- [LandingTargetPose](../msg_docs/LandingTargetPose.md)
- [HealthReport](../msg_docs/HealthReport.md)
- [Mission](../msg_docs/Mission.md)
- [GpsInjectData](../msg_docs/GpsInjectData.md)
- [OrbitStatus](../msg_docs/OrbitStatus.md)
- [FuelTankStatus](../msg_docs/FuelTankStatus.md)
- [PwmInput](../msg_docs/PwmInput.md)
- [SensorGyro](../msg_docs/SensorGyro.md)
- [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md)
- [CameraStatus](../msg_docs/CameraStatus.md)
- [GpioConfig](../msg_docs/GpioConfig.md)
- [RegisterExtComponentReplyV0](../msg_docs/RegisterExtComponentReplyV0.md)
- [DatamanResponse](../msg_docs/DatamanResponse.md)
- [VehicleImu](../msg_docs/VehicleImu.md)
- [GimbalManagerSetAttitude](../msg_docs/GimbalManagerSetAttitude.md)
- [EstimatorBias](../msg_docs/EstimatorBias.md)
- [Event](../msg_docs/Event.md)
- [EscReport](../msg_docs/EscReport.md)
- [Ping](../msg_docs/Ping.md)
- [EstimatorAidSource3d](../msg_docs/EstimatorAidSource3d.md)
- [VehicleLocalPositionSetpoint](../msg_docs/VehicleLocalPositionSetpoint.md)
- [FixedWingRunwayControl](../msg_docs/FixedWingRunwayControl.md)
- [EstimatorSelectorStatus](../msg_docs/EstimatorSelectorStatus.md)
- [GimbalManagerStatus](../msg_docs/GimbalManagerStatus.md)
- [GpioIn](../msg_docs/GpioIn.md)
- [InternalCombustionEngineControl](../msg_docs/InternalCombustionEngineControl.md)
- [EstimatorAidSource1d](../msg_docs/EstimatorAidSource1d.md)
- [EstimatorEventFlags](../msg_docs/EstimatorEventFlags.md)
- [AutotuneAttitudeControlStatus](../msg_docs/AutotuneAttitudeControlStatus.md)
- [UavcanParameterRequest](../msg_docs/UavcanParameterRequest.md)
- [UlogStreamAck](../msg_docs/UlogStreamAck.md)
- [VehicleLocalPositionV0](../msg_docs/VehicleLocalPositionV0.md)
- [EstimatorStatus](../msg_docs/EstimatorStatus.md)
- [PositionSetpoint](../msg_docs/PositionSetpoint.md)
- [SensorGyroFifo](../msg_docs/SensorGyroFifo.md)
- [FixedWingLateralGuidanceStatus](../msg_docs/FixedWingLateralGuidanceStatus.md)
- [VehicleCommandAckV0](../msg_docs/VehicleCommandAckV0.md)
- [FollowTarget](../msg_docs/FollowTarget.md)
- [VehicleOpticalFlowVel](../msg_docs/VehicleOpticalFlowVel.md)
- [OpenDroneIdSelfId](../msg_docs/OpenDroneIdSelfId.md)
- [Rpm](../msg_docs/Rpm.md)
- [GeofenceStatus](../msg_docs/GeofenceStatus.md)
- [OrbTest](../msg_docs/OrbTest.md)
- [FollowTargetEstimator](../msg_docs/FollowTargetEstimator.md)
- [PurePursuitStatus](../msg_docs/PurePursuitStatus.md)
- [BatteryStatusV0](../msg_docs/BatteryStatusV0.md)
- [ControlAllocatorStatus](../msg_docs/ControlAllocatorStatus.md)
- [RadioStatus](../msg_docs/RadioStatus.md)
- [MissionResult](../msg_docs/MissionResult.md)
- [HeaterStatus](../msg_docs/HeaterStatus.md)
- [GeneratorStatus](../msg_docs/GeneratorStatus.md)
- [AirspeedValidatedV0](../msg_docs/AirspeedValidatedV0.md)
- [VehicleMagnetometer](../msg_docs/VehicleMagnetometer.md)
- [LedControl](../msg_docs/LedControl.md)
- [ParameterSetUsedRequest](../msg_docs/ParameterSetUsedRequest.md)
- [ParameterUpdate](../msg_docs/ParameterUpdate.md)
- [CameraCapture](../msg_docs/CameraCapture.md)
- [EstimatorAidSource2d](../msg_docs/EstimatorAidSource2d.md)
- [GeofenceResult](../msg_docs/GeofenceResult.md)
- [OrbTestMedium](../msg_docs/OrbTestMedium.md)
- [VehicleRoi](../msg_docs/VehicleRoi.md)
- [VehicleAngularAccelerationSetpoint](../msg_docs/VehicleAngularAccelerationSetpoint.md)
- [RegisterExtComponentRequestV0](../msg_docs/RegisterExtComponentRequestV0.md)
- [SensorSelection](../msg_docs/SensorSelection.md)
- [RoverRateStatus](../msg_docs/RoverRateStatus.md)
- [ParameterSetValueRequest](../msg_docs/ParameterSetValueRequest.md)
- [Airspeed](../msg_docs/Airspeed.md)
- [SatelliteInfo](../msg_docs/SatelliteInfo.md)
- [MagnetometerBiasEstimate](../msg_docs/MagnetometerBiasEstimate.md)
- [VehicleAcceleration](../msg_docs/VehicleAcceleration.md)
- [SensorsStatus](../msg_docs/SensorsStatus.md)
- [SystemPower](../msg_docs/SystemPower.md)
- [SensorGnssStatus](../msg_docs/SensorGnssStatus.md)
- [Vtx](../msg_docs/Vtx.md)
- [LogMessage](../msg_docs/LogMessage.md)
- [MagWorkerData](../msg_docs/MagWorkerData.md)
- [RtlTimeEstimate](../msg_docs/RtlTimeEstimate.md)
- [LandingGearWheel](../msg_docs/LandingGearWheel.md)
- [Ekf2Timestamps](../msg_docs/Ekf2Timestamps.md)
- [NavigatorStatus](../msg_docs/NavigatorStatus.md)
- [EscStatus](../msg_docs/EscStatus.md)
- [DebugVect](../msg_docs/DebugVect.md)
- [RaptorStatus](../msg_docs/RaptorStatus.md)
- [DeviceInformation](../msg_docs/DeviceInformation.md)
- [UlogStream](../msg_docs/UlogStream.md)
- [FailureDetectorStatus](../msg_docs/FailureDetectorStatus.md)
- [VelocityLimits](../msg_docs/VelocityLimits.md)
- [LoggerStatus](../msg_docs/LoggerStatus.md)
- [SensorAirflow](../msg_docs/SensorAirflow.md)
- [VehicleConstraints](../msg_docs/VehicleConstraints.md)
- [SensorAccelFifo](../msg_docs/SensorAccelFifo.md)
- [FollowTargetStatus](../msg_docs/FollowTargetStatus.md)
- [OrbTestLarge](../msg_docs/OrbTestLarge.md)
- [DronecanNodeStatus](../msg_docs/DronecanNodeStatus.md)
- [EstimatorInnovations](../msg_docs/EstimatorInnovations.md)
- [ArmingCheckReplyV0](../msg_docs/ArmingCheckReplyV0.md)
- [IridiumsbdStatus](../msg_docs/IridiumsbdStatus.md)
- [QshellRetval](../msg_docs/QshellRetval.md)
- [GimbalDeviceSetAttitude](../msg_docs/GimbalDeviceSetAttitude.md)
- [ArmingCheckRequestV0](../msg_docs/ArmingCheckRequestV0.md)
- [CanInterfaceStatus](../msg_docs/CanInterfaceStatus.md)
- [UavcanParameterValue](../msg_docs/UavcanParameterValue.md)
- [RaptorInput](../msg_docs/RaptorInput.md)
- [SensorUwb](../msg_docs/SensorUwb.md)
- [TiltrotorExtraControls](../msg_docs/TiltrotorExtraControls.md)
- [VehicleAirData](../msg_docs/VehicleAirData.md)
- [SensorTemp](../msg_docs/SensorTemp.md)
- [VehicleStatusV0](../msg_docs/VehicleStatusV0.md)
- [AirspeedWind](../msg_docs/AirspeedWind.md)
- [BatteryInfo](../msg_docs/BatteryInfo.md)
- [Cpuload](../msg_docs/Cpuload.md)
- [OpenDroneIdArmStatus](../msg_docs/OpenDroneIdArmStatus.md)
- [DifferentialPressure](../msg_docs/DifferentialPressure.md)
- [YawEstimatorStatus](../msg_docs/YawEstimatorStatus.md)
- [CameraTrigger](../msg_docs/CameraTrigger.md)
- [GpioRequest](../msg_docs/GpioRequest.md)
- [SensorPreflightMag](../msg_docs/SensorPreflightMag.md)
- [LaunchDetectionStatus](../msg_docs/LaunchDetectionStatus.md)
- [VehicleAttitudeSetpointV0](../msg_docs/VehicleAttitudeSetpointV0.md)
- [PositionControllerLandingStatus](../msg_docs/PositionControllerLandingStatus.md)
- [RateCtrlStatus](../msg_docs/RateCtrlStatus.md)
- [SensorMag](../msg_docs/SensorMag.md)
- [SensorGnssRelative](../msg_docs/SensorGnssRelative.md)
- [ActuatorControlsStatus](../msg_docs/ActuatorControlsStatus.md)
- [NeuralControl](../msg_docs/NeuralControl.md)
- [TecsStatus](../msg_docs/TecsStatus.md)
- [NavigatorMissionItem](../msg_docs/NavigatorMissionItem.md)
- [RcChannels](../msg_docs/RcChannels.md)
- [NormalizedUnsignedSetpoint](../msg_docs/NormalizedUnsignedSetpoint.md)
- [ManualControlSwitches](../msg_docs/ManualControlSwitches.md)
- [ActuatorOutputs](../msg_docs/ActuatorOutputs.md)
- [SensorHygrometer](../msg_docs/SensorHygrometer.md)
- [FlightPhaseEstimation](../msg_docs/FlightPhaseEstimation.md)
- [EstimatorSensorBias](../msg_docs/EstimatorSensorBias.md)
- [MavlinkTunnel](../msg_docs/MavlinkTunnel.md)
- [Airspeed](../msg_docs/Airspeed.md)
- [EstimatorAidSource2d](../msg_docs/EstimatorAidSource2d.md)
- [EstimatorAidSource1d](../msg_docs/EstimatorAidSource1d.md)
- [RadioStatus](../msg_docs/RadioStatus.md)
- [VehicleOpticalFlowVel](../msg_docs/VehicleOpticalFlowVel.md)
- [VehicleAirData](../msg_docs/VehicleAirData.md)
- [SensorAirflow](../msg_docs/SensorAirflow.md)
- [Ping](../msg_docs/Ping.md)
- [MagWorkerData](../msg_docs/MagWorkerData.md)
- [FuelTankStatus](../msg_docs/FuelTankStatus.md)
- [GpsInjectData](../msg_docs/GpsInjectData.md)
- [Event](../msg_docs/Event.md)
- [OpenDroneIdArmStatus](../msg_docs/OpenDroneIdArmStatus.md)
- [HoverThrustEstimate](../msg_docs/HoverThrustEstimate.md)
- [RcParameterMap](../msg_docs/RcParameterMap.md)
- [MountOrientation](../msg_docs/MountOrientation.md)
- [OpenDroneIdSystem](../msg_docs/OpenDroneIdSystem.md)
- [FixedWingLateralStatus](../msg_docs/FixedWingLateralStatus.md)
- [OpenDroneIdOperatorId](../msg_docs/OpenDroneIdOperatorId.md)
- [TakeoffStatus](../msg_docs/TakeoffStatus.md)
- [Gripper](../msg_docs/Gripper.md)
- [SensorsStatusImu](../msg_docs/SensorsStatusImu.md)
- [DistanceSensorModeChangeRequest](../msg_docs/DistanceSensorModeChangeRequest.md)
- [DebugValue](../msg_docs/DebugValue.md)
- [GainCompression](../msg_docs/GainCompression.md)
- [GimbalManagerSetManualControl](../msg_docs/GimbalManagerSetManualControl.md)
- [SensorCorrection](../msg_docs/SensorCorrection.md)
- [TaskStackInfo](../msg_docs/TaskStackInfo.md)
- [EstimatorStates](../msg_docs/EstimatorStates.md)
- [InputRc](../msg_docs/InputRc.md)
- [QshellReq](../msg_docs/QshellReq.md)
- [ActuatorServosTrim](../msg_docs/ActuatorServosTrim.md)
- [HomePositionV0](../msg_docs/HomePositionV0.md)
- [ActuatorArmed](../msg_docs/ActuatorArmed.md)
- [VehicleImu](../msg_docs/VehicleImu.md)
- [SensorSelection](../msg_docs/SensorSelection.md)
- [EstimatorSelectorStatus](../msg_docs/EstimatorSelectorStatus.md)
- [IrlockReport](../msg_docs/IrlockReport.md)
- [RoverSpeedStatus](../msg_docs/RoverSpeedStatus.md)
- [SensorTemp](../msg_docs/SensorTemp.md)
- [RaptorInput](../msg_docs/RaptorInput.md)
:::
+4 -2
View File
@@ -1109,7 +1109,7 @@ px4io <command> [arguments...]
## rgbled
Source: [drivers/lights/rgbled](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/lights/rgbled)
Source: [drivers/lights/rgbled_ncp5623c](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/lights/rgbled_ncp5623c)
### Usage {#rgbled_usage}
@@ -1124,7 +1124,9 @@ rgbled <command> [arguments...]
[-f <val>] bus frequency in kHz
[-q] quiet startup (no message if no device found)
[-a <val>] I2C address
default: 85
default: 57
[-o <val>] RGB PWM Assignment
default: 123
stop
-4
View File
@@ -61,8 +61,6 @@ pageClass: is-wide-page
| cs_gnss_fault | `bool` | | | 45 - true if GNSS true if GNSS measurements (lat, lon, vel) have been declared faulty |
| cs_yaw_manual | `bool` | | | 46 - true if yaw has been set manually |
| cs_gnss_hgt_fault | `bool` | | | 47 - true if GNSS true if GNSS measurements (alt) have been declared faulty |
| cs_in_transition | `bool` | | | 48 - true if the vehicle is in vtol transition |
| cs_heading_observable | `bool` | | | 49 - true when heading is observable |
| fault_status_changes | `uint32` | | | number of filter fault status (fs) changes |
| fs_bad_mag_x | `bool` | | | 0 - true if the fusion of the magnetometer X-axis has encountered a numerical error |
| fs_bad_mag_y | `bool` | | | 1 - true if the fusion of the magnetometer Y-axis has encountered a numerical error |
@@ -137,8 +135,6 @@ bool cs_gnss_vel # 44 - true if GNSS velocity measurement fusion
bool cs_gnss_fault # 45 - true if GNSS true if GNSS measurements (lat, lon, vel) have been declared faulty
bool cs_yaw_manual # 46 - true if yaw has been set manually
bool cs_gnss_hgt_fault # 47 - true if GNSS true if GNSS measurements (alt) have been declared faulty
bool cs_in_transition # 48 - true if the vehicle is in vtol transition
bool cs_heading_observable # 49 - true when heading is observable
# fault status
uint32 fault_status_changes # number of filter fault status (fs) changes
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
-2
View File
@@ -52,8 +52,6 @@ bool cs_gnss_vel # 44 - true if GNSS velocity measurement fusion
bool cs_gnss_fault # 45 - true if GNSS true if GNSS measurements (lat, lon, vel) have been declared faulty
bool cs_yaw_manual # 46 - true if yaw has been set manually
bool cs_gnss_hgt_fault # 47 - true if GNSS true if GNSS measurements (alt) have been declared faulty
bool cs_in_transition # 48 - true if the vehicle is in vtol transition
bool cs_heading_observable # 49 - true when heading is observable
# fault status
uint32 fault_status_changes # number of filter fault status (fs) changes
-5
View File
@@ -92,11 +92,6 @@ public:
// copy assignment
Subscription &operator=(const Subscription &other)
{
// Check for self-assignment
if (this == &other) {
return *this;
}
unsubscribe();
_orb_id = other._orb_id;
_instance = other._instance;
+14
View File
@@ -72,6 +72,20 @@ endforeach()
# Mavlink test requires mavlink running
add_test(NAME sitl-mavlink
COMMAND $<TARGET_FILE:px4>
-s ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_mavlink
-t ${PX4_SOURCE_DIR}/test_data
${PX4_SOURCE_DIR}/ROMFS/px4fmu_test
WORKING_DIRECTORY ${SITL_WORKING_DIR}
)
set_tests_properties(sitl-mavlink PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
set_tests_properties(sitl-mavlink PROPERTIES PASS_REGULAR_EXPRESSION "ALL TESTS PASSED")
sanitizer_fail_test_on_error(sitl-mavlink)
# IMU filtering
add_test(NAME sitl-imu_filtering
COMMAND $<TARGET_FILE:px4>
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
# PX4 commands need the 'px4-' prefix in bash.
# (px4-alias.sh is expected to be in the PATH)
. px4-alias.sh
param load
param set CBRK_SUPPLY_CHK 894281
dataman start
battery_simulator start
simulator_mavlink start
tone_alarm start
pwm_out_sim start
ver all
mavlink start -x -u 14556 -r 2000000
mavlink boot_complete
mavlink_tests
shutdown
@@ -183,11 +183,11 @@ void VertiqIo::parameters_update()
}
}
void VertiqIo::OutputControls(float outputs[MAX_ACTUATORS])
void VertiqIo::OutputControls(uint16_t outputs[MAX_ACTUATORS])
{
//Put the mixer outputs into the output message
for (uint8_t i = 0; i < _transmission_message.num_cvs; i++) {
_transmission_message.commands[i] = static_cast<uint16_t>(lroundf(outputs[i]));
_transmission_message.commands[i] = outputs[i];
}
_operational_ifci.PackageIfciCommandsForTransmission(&_transmission_message, _output_message, &_output_len);
@@ -195,7 +195,8 @@ void VertiqIo::OutputControls(float outputs[MAX_ACTUATORS])
_serial_interface.ProcessSerialTx();
}
bool VertiqIo::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool VertiqIo::updateOutputs(uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs,
unsigned num_control_groups_updated)
{
#ifdef CONFIG_USE_IFCI_CONFIGURATION
@@ -94,13 +94,14 @@ public:
void print_info();
/** @see OutputModuleInterface */
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
/**
* @brief Used to package and transmit controls via IQUART
* @param outputs The output throttles calculated by the mixer
*/
void OutputControls(float outputs[MAX_ACTUATORS]);
void OutputControls(uint16_t outputs[MAX_ACTUATORS]);
private:
+10 -16
View File
@@ -957,7 +957,7 @@ int VoxlEsc::update_params()
return ret;
}
void VoxlEsc::update_leds(const vehicle_control_mode_s &mode, const led_control_s &control)
void VoxlEsc::update_leds(vehicle_control_mode_s mode, led_control_s control)
{
int i = 0;
uint8_t led_mask = _led_rsc.led_mask;
@@ -1237,7 +1237,8 @@ void VoxlEsc::mix_turtle_mode(uint16_t outputs[MAX_ACTUATORS])
}
/* OutputModuleInterface */
bool VoxlEsc::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool VoxlEsc::updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated)
{
//in Run() we call _mixing_output.update(), which calls MixingOutput::limitAndUpdateOutputs which calls _interface.updateOutputs (this function)
//So, if Run() is blocked by a custom command, this function will not be called until Run is running again
@@ -1246,16 +1247,9 @@ bool VoxlEsc::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs,
return false;
}
// Convert float outputs to uint16_t hardware values
uint16_t hw_outputs[VOXL_ESC_OUTPUT_CHANNELS] {};
for (int i = 0; i < VOXL_ESC_OUTPUT_CHANNELS; i++) {
hw_outputs[i] = static_cast<uint16_t>(lroundf(outputs[i]));
}
// don't use mixed values... recompute now.
if (_turtle_mode_en) {
mix_turtle_mode(hw_outputs);
mix_turtle_mode(outputs);
}
for (int i = 0; i < VOXL_ESC_OUTPUT_CHANNELS; i++) {
@@ -1265,24 +1259,24 @@ bool VoxlEsc::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs,
} else {
if ((_turtle_mode_en) || (_parameters.cmd_type == VOXL_ESC_RPM_CMDS)) {
if (_extended_rpm) {
if (hw_outputs[i] > VOXL_ESC_RPM_MAX_EXT) { hw_outputs[i] = VOXL_ESC_RPM_MAX_EXT; }
if (outputs[i] > VOXL_ESC_RPM_MAX_EXT) { outputs[i] = VOXL_ESC_RPM_MAX_EXT; }
} else {
if (hw_outputs[i] > VOXL_ESC_RPM_MAX) { hw_outputs[i] = VOXL_ESC_RPM_MAX; }
if (outputs[i] > VOXL_ESC_RPM_MAX) { outputs[i] = VOXL_ESC_RPM_MAX; }
}
} else if (_parameters.cmd_type == VOXL_ESC_PWM_CMDS) {
if (hw_outputs[i] > VOXL_ESC_PWM_MAX) { hw_outputs[i] = VOXL_ESC_PWM_MAX; }
if (outputs[i] > VOXL_ESC_PWM_MAX) { outputs[i] = VOXL_ESC_PWM_MAX; }
else if (hw_outputs[i] < _min_active_pwm) { hw_outputs[i] = _min_active_pwm; }
else if (outputs[i] < _min_active_pwm) { outputs[i] = _min_active_pwm; }
}
if (!_turtle_mode_en) {
_esc_chans[i].rate_req = hw_outputs[i] * _output_map[i].direction;
_esc_chans[i].rate_req = outputs[i] * _output_map[i].direction;
} else {
// mapping updated in mixTurtleMode, no remap needed here, but reverse direction
_esc_chans[i].rate_req = hw_outputs[i] * _output_map[i].direction * (-1);
_esc_chans[i].rate_req = outputs[i] * _output_map[i].direction * (-1);
}
}
}
+3 -2
View File
@@ -83,7 +83,8 @@ public:
void print_params();
/** @see OutputModuleInterface */
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
virtual int init();
int device_init(); // function where uart port is opened and ESC queried
@@ -271,7 +272,7 @@ private:
bool _device_initialized{false};
void update_leds(const vehicle_control_mode_s &mode, const led_control_s &control);
void update_leds(vehicle_control_mode_s mode, led_control_s control);
int read_response(Command *out_cmd);
int parse_response(uint8_t *buf, uint8_t len, bool print_feedback);
+3 -3
View File
@@ -169,7 +169,7 @@ public:
{
}
void update_outputs(float outputs[MAX_ACTUATORS], unsigned num_outputs)
void update_outputs(uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs)
{
if (_port_id == 0 || _port_id == CANARD_PORT_ID_UNSET) {
return;
@@ -178,7 +178,7 @@ public:
uint8_t max_num_outputs = MAX_ACTUATORS > num_outputs ? num_outputs : MAX_ACTUATORS;
for (int8_t i = max_num_outputs - 1; i >= _max_number_of_nonzero_outputs; i--) {
if (fabsf(outputs[i]) > FLT_EPSILON) {
if (outputs[i] != 0) {
_max_number_of_nonzero_outputs = i + 1;
break;
}
@@ -187,7 +187,7 @@ public:
uint16_t payload_buffer[reg_udral_service_actuator_common_sp_Vector31_0_1_value_ARRAY_CAPACITY_];
for (uint8_t i = 0; i < _max_number_of_nonzero_outputs; i++) {
payload_buffer[i] = nunavutFloat16Pack(outputs[i] / 8192.f); // Output is float16 so this would benefit rescaling to e.g. [-1,1]
payload_buffer[i] = nunavutFloat16Pack(outputs[i] / 8192.0);
}
const CanardTransferMetadata transfer_metadata = {
+2 -1
View File
@@ -435,7 +435,8 @@ void CyphalNode::sendPortList()
_uavcan_node_port_List_last = now;
}
bool UavcanMixingInterface::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool UavcanMixingInterface::updateOutputs(uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs,
unsigned num_control_groups_updated)
{
// Note: This gets called from MixingOutput from within its update() function
// Hence, the mutex lock in UavcanMixingInterface::Run() is in effect
+2 -1
View File
@@ -87,7 +87,8 @@ public:
_node_mutex(node_mutex),
_pub_manager(pub_manager) {}
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
void printInfo() { _mixing_output.printStatus(); }
+3 -2
View File
@@ -374,7 +374,8 @@ void DShot::mixerChanged()
update_num_motors();
}
bool DShot::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool DShot::updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated)
{
if (!_outputs_on) {
return false;
@@ -390,7 +391,7 @@ bool DShot::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, un
for (int i = 0; i < (int)num_outputs; i++) {
uint16_t output = static_cast<uint16_t>(lroundf(outputs[i]));
uint16_t output = outputs[i];
if (output == DSHOT_DISARM_VALUE) {
+2 -1
View File
@@ -92,7 +92,8 @@ public:
bool telemetry_enabled() const { return _telemetry != nullptr; }
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
private:
+3 -8
View File
@@ -97,15 +97,10 @@ int LinuxPWMOut::task_spawn(int argc, char *argv[])
return PX4_ERROR;
}
bool LinuxPWMOut::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool LinuxPWMOut::updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated)
{
uint16_t hw_outputs[MAX_ACTUATORS] {};
for (unsigned i = 0; i < num_outputs; i++) {
hw_outputs[i] = static_cast<uint16_t>(lroundf(outputs[i]));
}
_pwm_out->send_output_pwm(hw_outputs, num_outputs);
_pwm_out->send_output_pwm(outputs, num_outputs);
return true;
}
+2 -1
View File
@@ -73,7 +73,8 @@ public:
int init();
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
private:
static constexpr int MAX_ACTUATORS = 8;
+6 -6
View File
@@ -73,7 +73,8 @@ public:
static int custom_command(int argc, char *argv[]);
static int print_usage(const char *reason = nullptr);
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t *outputs, unsigned num_outputs,
unsigned num_control_groups_updated) override;
int print_status() override;
@@ -154,7 +155,8 @@ int PCA9685Wrapper::init()
return PX4_OK;
}
bool PCA9685Wrapper::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool PCA9685Wrapper::updateOutputs(uint16_t *outputs, unsigned num_outputs,
unsigned num_control_groups_updated)
{
if (_state != STATE::RUNNING) { return false; }
@@ -162,13 +164,11 @@ bool PCA9685Wrapper::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_ou
num_outputs = num_outputs > PCA9685_PWM_CHANNEL_COUNT ? PCA9685_PWM_CHANNEL_COUNT : num_outputs;
for (uint8_t i = 0; i < num_outputs; ++i) {
uint16_t output = static_cast<uint16_t>(lroundf(outputs[i]));
if (param_duty_mode & (1 << i)) {
low_level_outputs[i] = output;
low_level_outputs[i] = outputs[i];
} else {
low_level_outputs[i] = pca9685->calcRawFromPulse(output);
low_level_outputs[i] = pca9685->calcRawFromPulse(outputs[i]);
}
}
+4 -3
View File
@@ -127,18 +127,19 @@ bool PWMOut::update_pwm_out_state(bool on)
return true;
}
bool PWMOut::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool PWMOut::updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated)
{
/* output to the servos */
if (_pwm_initialized) {
for (size_t i = 0; i < num_outputs; i++) {
if (!_mixing_output.isFunctionSet(i)) {
// do not run any signal on disabled channels
outputs[i] = 0.f;
outputs[i] = 0;
}
if (_pwm_mask & (1 << i)) {
up_pwm_servo_set(i, static_cast<uint16_t>(lroundf(outputs[i])));
up_pwm_servo_set(i, outputs[i]);
}
}
}
+2 -1
View File
@@ -73,7 +73,8 @@ public:
/** @see ModuleBase::print_status() */
int print_status() override;
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
private:
void Run() override;
+6 -8
View File
@@ -155,7 +155,8 @@ public:
uint16_t system_status() const { return _status; }
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs,
unsigned num_control_groups_updated) override;
private:
void Run() override;
@@ -363,22 +364,19 @@ PX4IO::~PX4IO()
perf_free(_interface_write_perf);
}
bool PX4IO::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool PX4IO::updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated)
{
uint16_t hw_outputs[MAX_ACTUATORS] {};
for (size_t i = 0; i < num_outputs; i++) {
if (!_mixing_output.isFunctionSet(i)) {
// do not run any signal on disabled channels
outputs[i] = 0;
}
hw_outputs[i] = static_cast<uint16_t>(lroundf(outputs[i]));
}
if (!_test_fmu_fail) {
/* output to the servos */
io_reg_set(PX4IO_PAGE_DIRECT_PWM, 0, hw_outputs, num_outputs);
io_reg_set(PX4IO_PAGE_DIRECT_PWM, 0, outputs, num_outputs);
}
return true;
@@ -506,7 +504,7 @@ void PX4IO::updateFailsafe()
uint16_t values[PX4IO_MAX_ACTUATORS] {};
for (unsigned i = 0; i < _max_actuators; i++) {
values[i] = static_cast<uint16_t>(lroundf(_mixing_output.actualFailsafeValue(i)));
values[i] = _mixing_output.actualFailsafeValue(i);
}
io_reg_set(PX4IO_PAGE_FAILSAFE_PWM, 0, values, _max_actuators);
-9
View File
@@ -401,15 +401,6 @@ bool CrsfParser_TryParseCrsfPacket(CrsfPacket_t *const new_packet, CrsfParserSta
if (working_descriptor->packet_size == -1) {
working_segment_size = packet_size - PACKET_SIZE_TYPE_SIZE;
if (working_index + working_segment_size + CRC_SIZE > CRSF_MAX_PACKET_LEN) {
parser_statistics->invalid_known_packet_sizes++;
parser_state = PARSER_STATE_HEADER;
working_segment_size = HEADER_SIZE;
working_index = 0;
buffer_count = QueueBuffer_Count(&rx_queue);
continue;
}
} else {
if (packet_size != working_descriptor->packet_size + PACKET_SIZE_TYPE_SIZE) {
parser_statistics->invalid_known_packet_sizes++;
+18 -7
View File
@@ -156,10 +156,15 @@ int Roboclaw::initializeUART()
}
}
bool Roboclaw::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool Roboclaw::updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated)
{
setMotorSpeed(Motor::Right, (outputs[0] - 127.0f) / 127.f);
setMotorSpeed(Motor::Left, (outputs[1] - 127.0f) / 127.f);
float right_motor_output = ((float)outputs[0] - 128.0f) / 127.f;
float left_motor_output = ((float)outputs[1] - 128.0f) / 127.f;
setMotorSpeed(Motor::Right, right_motor_output);
setMotorSpeed(Motor::Left, left_motor_output);
return true;
}
@@ -241,7 +246,7 @@ void Roboclaw::setMotorSpeed(Motor motor, float value)
// send command
if (motor == Motor::Right) {
if (value > 0.f) {
if (value > 0) {
command = Command::DriveForwardMotor1;
} else {
@@ -249,7 +254,7 @@ void Roboclaw::setMotorSpeed(Motor motor, float value)
}
} else if (motor == Motor::Left) {
if (value > 0.f) {
if (value > 0) {
command = Command::DriveForwardMotor2;
} else {
@@ -286,9 +291,15 @@ void Roboclaw::resetEncoders()
sendTransaction(Command::ResetEncoders, nullptr, 0);
}
void Roboclaw::sendUnsigned7Bit(Command command, const float data)
void Roboclaw::sendUnsigned7Bit(Command command, float data)
{
uint8_t byte = static_cast<uint8_t>(lroundf(fabs(data) * INT8_MAX));
data = fabs(data);
if (data >= 1.0f) {
data = 0.99f;
}
auto byte = (uint8_t)(data * INT8_MAX);
sendTransaction(command, &byte, 1);
}
+2 -1
View File
@@ -79,7 +79,8 @@ public:
void Run() override;
/** @see OutputModuleInterface */
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
void setMotorSpeed(Motor motor, float value); ///< rev/sec
void setMotorDutyCycle(Motor motor, float value);
+3 -3
View File
@@ -10,9 +10,9 @@ actuator_output:
- param_prefix: RBCLW
channel_label: 'Channel'
standard_params:
disarmed: { min: 127, max: 127, default: 127 }
min: { min: 0, max: 127, default: 0 }
max: { min: 127, max: 254, default: 254 }
disarmed: { min: 128, max: 128, default: 128 }
min: { min: 1, max: 128, default: 1 }
max: { min: 128, max: 256, default: 256 }
failsafe: { min: 0, max: 257 }
num_channels: 2
+12 -12
View File
@@ -243,7 +243,7 @@ void TAP_ESC::send_tune_packet(EscbusTunePacket &tune_packet)
tap_esc_common::send_packet(_uart_fd, buzzer_packet, -1);
}
bool TAP_ESC::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs,
bool TAP_ESC::updateOutputs(uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs,
unsigned num_control_groups_updated)
{
if (_initialized) {
@@ -252,26 +252,26 @@ bool TAP_ESC::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs,
// We need to remap from the system default to what PX4's normal scheme is
switch (num_outputs) {
case 4:
motor_out[0] = static_cast<uint16_t>(lroundf(outputs[2]));
motor_out[1] = static_cast<uint16_t>(lroundf(outputs[1]));
motor_out[2] = static_cast<uint16_t>(lroundf(outputs[3]));
motor_out[3] = static_cast<uint16_t>(lroundf(outputs[0]));
motor_out[0] = outputs[2];
motor_out[1] = outputs[1];
motor_out[2] = outputs[3];
motor_out[3] = outputs[0];
break;
case 6:
motor_out[0] = static_cast<uint16_t>(lroundf(outputs[3]));
motor_out[1] = static_cast<uint16_t>(lroundf(outputs[0]));
motor_out[2] = static_cast<uint16_t>(lroundf(outputs[4]));
motor_out[3] = static_cast<uint16_t>(lroundf(outputs[2]));
motor_out[4] = static_cast<uint16_t>(lroundf(outputs[1]));
motor_out[5] = static_cast<uint16_t>(lroundf(outputs[5]));
motor_out[0] = outputs[3];
motor_out[1] = outputs[0];
motor_out[2] = outputs[4];
motor_out[3] = outputs[2];
motor_out[4] = outputs[1];
motor_out[5] = outputs[5];
break;
default:
// Use the system defaults
for (uint8_t i = 0; i < num_outputs; ++i) {
motor_out[i] = static_cast<uint16_t>(lroundf(outputs[i]));
motor_out[i] = outputs[i];
}
break;
+2 -1
View File
@@ -101,7 +101,8 @@ public:
int init();
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
private:
+2 -9
View File
@@ -98,16 +98,9 @@ void TattuCan::Run()
while (receive(&received_frame) > 0) {
if (received_frame.payload_size == 0) {
break;
}
size_t payload_size = received_frame.payload_size - 1;
if (offset + payload_size > sizeof(tattu_message)) {
break;
}
// TODO: add check to prevent buffer overflow from a corrupt 'payload_size' value
// TODO: AND look for TAIL_BYTE_START_OF_TRANSFER to indicate end of transfer. Untested...
memcpy(((char *)&tattu_message) + offset, received_frame.payload, payload_size);
offset += payload_size;
}
-10
View File
@@ -197,12 +197,6 @@ int BST::probe()
}
uint8_t *reply_raw = reinterpret_cast<uint8_t *>(&dev_info_reply);
if (dev_info_reply.length >= sizeof(dev_info_reply)) {
PX4_ERR("invalid reply length: %u", dev_info_reply.length);
return -EIO;
}
uint8_t crc_calc = crc8(reinterpret_cast<uint8_t *>(&dev_info_reply.type), dev_info_reply.length - 1);
uint8_t crc_recv = reply_raw[dev_info_reply.length];
@@ -211,10 +205,6 @@ int BST::probe()
return -EIO;
}
if (dev_info_reply.payload.dev_name_len >= sizeof(dev_info_reply.payload.dev_name)) {
dev_info_reply.payload.dev_name_len = sizeof(dev_info_reply.payload.dev_name) - 1;
}
dev_info_reply.payload.dev_name[dev_info_reply.payload.dev_name_len] = '\0';
PX4_DEBUG("device info: hardware ID: 0x%08X, firmware ID: 0x%04X, device name: %s",
(int)swap_uint32(dev_info_reply.payload.hw_id), (int)swap_uint16(dev_info_reply.payload.fw_id),
+2 -2
View File
@@ -85,7 +85,7 @@ int UavcanEscController::init()
return res;
}
void UavcanEscController::update_outputs(float outputs[MAX_ACTUATORS], uint8_t output_array_size)
void UavcanEscController::update_outputs(uint16_t outputs[MAX_ACTUATORS], uint8_t output_array_size)
{
// TODO: configurable rate limit
const auto timestamp = _node.getMonotonicTime();
@@ -99,7 +99,7 @@ void UavcanEscController::update_outputs(float outputs[MAX_ACTUATORS], uint8_t o
uavcan::equipment::esc::RawCommand msg{};
for (unsigned i = 0; i < output_array_size; i++) {
msg.cmd.push_back(static_cast<int>(lroundf(outputs[i])));
msg.cmd.push_back(static_cast<int>(outputs[i]));
}
_uavcan_pub_raw_cmd.broadcast(msg);
+1 -1
View File
@@ -73,7 +73,7 @@ public:
bool initialized() { return _initialized; };
void update_outputs(float outputs[MAX_ACTUATORS], uint8_t output_array_size);
void update_outputs(uint16_t outputs[MAX_ACTUATORS], uint8_t output_array_size);
/**
* Sets the number of rotors and enable timer
+3 -2
View File
@@ -44,7 +44,8 @@ UavcanServoController::UavcanServoController(uavcan::INode &node) :
_uavcan_pub_array_cmd.setPriority(UAVCAN_COMMAND_TRANSFER_PRIORITY);
}
void UavcanServoController::update_outputs(float outputs[MAX_ACTUATORS], unsigned num_outputs)
void
UavcanServoController::update_outputs(uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs)
{
uavcan::equipment::actuator::ArrayCommand msg;
@@ -52,7 +53,7 @@ void UavcanServoController::update_outputs(float outputs[MAX_ACTUATORS], unsigne
uavcan::equipment::actuator::Command cmd;
cmd.actuator_id = i;
cmd.command_type = uavcan::equipment::actuator::Command::COMMAND_TYPE_UNITLESS;
cmd.command_value = outputs[i] / 500.f - 1.f; // TODO would benefit from [-1, 1] parameters
cmd.command_value = (float)outputs[i] / 500.f - 1.f; // [-1, 1]
msg.commands.push_back(cmd);
}
+1 -1
View File
@@ -52,7 +52,7 @@ public:
UavcanServoController(uavcan::INode &node);
~UavcanServoController() = default;
void update_outputs(float outputs[MAX_ACTUATORS], unsigned num_outputs);
void update_outputs(uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs);
private:
uavcan::INode &_node;
@@ -21,10 +21,7 @@ endif ()
project(libuavcan)
if(NOT PYTHON_EXECUTABLE)
find_package(Python3 COMPONENTS Interpreter)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
endif()
find_package(PythonInterp)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(COMPILER_IS_GCC_COMPATIBLE 1)
@@ -278,7 +278,7 @@ def escape(s, format=HTML):
- `NONE`: nothing is replaced
- `HTML`: replace &<>'" by &...;
- `LATEX`: replace \\#$%&_{}~^
- `LATEX`: replace \#$%&_{}~^
- `MAIL_HEADER`: escape non-ASCII mail-header-contents
:Returns:
the escaped string in unicode
+4 -2
View File
@@ -1090,7 +1090,8 @@ void UavcanNode::publish_node_statuses()
}
#if defined(CONFIG_UAVCAN_OUTPUTS_CONTROLLER)
bool UavcanMixingInterfaceESC::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool UavcanMixingInterfaceESC::updateOutputs(uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs,
unsigned num_control_groups_updated)
{
if (_esc_controller.initialized()) {
// num_outputs is the maximum possible number of outputs (8)
@@ -1134,7 +1135,8 @@ void UavcanMixingInterfaceESC::mixerChanged()
_esc_controller.set_rotor_count(rotor_count);
}
bool UavcanMixingInterfaceServo::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool UavcanMixingInterfaceServo::updateOutputs(uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs,
unsigned num_control_groups_updated)
{
_servo_controller.update_outputs(outputs, num_outputs);
return true;
+4 -2
View File
@@ -129,7 +129,8 @@ public:
_node_mutex(node_mutex),
_esc_controller(esc_controller) {}
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
void mixerChanged() override;
@@ -161,7 +162,8 @@ public:
_node_mutex(node_mutex),
_servo_controller(servo_controller) {}
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
MixingOutput &mixingOutput() { return _mixing_output; }
+7 -6
View File
@@ -301,7 +301,8 @@ int Voxl2IO::handle_uart_passthru()
return num_writes;
}
bool Voxl2IO::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated)
bool Voxl2IO::updateOutputs(uint16_t outputs[input_rc_s::RC_INPUT_MAX_CHANNELS],
unsigned num_outputs, unsigned num_control_groups_updated)
{
// Stop Mixer while ESCs are being calibrated
if (_outputs_disabled) {
@@ -325,11 +326,11 @@ bool Voxl2IO::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs,
outputs[i] = 0;
}
if (outputs[i] > 0.5f) {
if (outputs[i]) {
_pwm_on = true;
}
output_cmds[i] = static_cast<uint32_t>(lroundf(outputs[i] * MIXER_OUTPUT_TO_CMD_SCALE)); //convert to ns
output_cmds[i] = ((uint32_t)outputs[i]) * MIXER_OUTPUT_TO_CMD_SCALE; //convert to ns
}
Command cmd;
@@ -346,9 +347,9 @@ bool Voxl2IO::updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs,
//if (_pwm_on && _debug){
if (_debug) {
PX4_INFO("Mixer outputs: [%.0f, %.0f, %.0f, %.0f, %.0f, %.0f, %.0f, %.0f]",
(double)outputs[0], (double)outputs[1], (double)outputs[2], (double)outputs[3],
(double)outputs[4], (double)outputs[5], (double)outputs[6], (double)outputs[7]);
PX4_INFO("Mixer outputs: [%u, %u, %u, %u, %u, %u, %u, %u]",
outputs[0], outputs[1], outputs[2], outputs[3],
outputs[4], outputs[5], outputs[6], outputs[7]);
}
perf_count(_output_update_perf);
+2 -1
View File
@@ -85,7 +85,8 @@ public:
int print_status() override;
/** @see OutputModuleInterface */
bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) override;
bool updateOutputs(uint16_t outputs[input_rc_s::RC_INPUT_MAX_CHANNELS],
unsigned num_outputs, unsigned num_control_groups_updated) override;
virtual int init();
-2
View File
@@ -721,8 +721,6 @@
"3": [67371008],
"4": [50593792],
"5": [84148224],
"6": [33751040],
"8": [720896],
"10": [327680],
"14": [393216],
"15": [458752],
-5
View File
@@ -87,11 +87,6 @@ public:
void operator=(const LatLonAlt &lla)
{
// Protect against self-assignment
if (this == &lla) {
return;
}
_latitude_rad = lla.latitude_rad();
_longitude_rad = lla.longitude_rad();
_altitude = lla.altitude();
+1 -21
View File
@@ -44,7 +44,7 @@
using namespace math::Utilities;
TEST(euler321YawTest, fromQuaternion)
TEST(euler312YawTest, fromQuaternion)
{
matrix::Quatf q1(3.5f, 2.4f, -0.5f, -3.f);
q1.normalize();
@@ -57,26 +57,6 @@ TEST(euler321YawTest, fromQuaternion)
EXPECT_FLOAT_EQ(euler2(2), getEuler321Yaw(q2));
}
TEST(euler312YawTest, fromQuaternion)
{
// Use orientations with more pitch than roll so 312 sequence is appropriate
matrix::Quatf q1(3.5f, 2.4f, -0.5f, -3.f);
q1.normalize();
const matrix::Dcmf R1(q1);
EXPECT_FLOAT_EQ(getEuler312Yaw(R1), getEuler312Yaw(q1));
matrix::Quatf q2(0.f, 0, -1.f, 0.f);
q2.normalize();
const matrix::Dcmf R2(q2);
EXPECT_FLOAT_EQ(getEuler312Yaw(R2), getEuler312Yaw(q2));
// Pure yaw rotation — 312 and 321 yaw should agree
matrix::Quatf q3(matrix::Eulerf(0.f, 0.f, 1.2f));
const matrix::Dcmf R3(q3);
EXPECT_FLOAT_EQ(getEuler312Yaw(R3), getEuler312Yaw(q3));
EXPECT_NEAR(getEuler312Yaw(q3), getEuler321Yaw(q3), 1e-5f);
}
TEST(shouldUse321RotationSequenceTest, pitch90)
{
matrix::Eulerf euler(0.f, math::radians(90), 0.f);
-5
View File
@@ -59,11 +59,6 @@ public:
// Separate function needed otherwise the default copy constructor matches before the deep copy implementation
Self &operator=(const Self &other)
{
// Protect against self-assignment
if (this == &other) {
return *this;
}
return this->operator=<M, N>(other);
}
+28 -15
View File
@@ -144,9 +144,9 @@ void MixingOutput::printStatus() const
PX4_INFO_RAW("Channel Configuration:\n");
for (unsigned i = 0; i < _max_num_outputs; i++) {
PX4_INFO_RAW("Channel %2d: func: %3d, value: %.2f, failsafe: %.2f, disarmed: %d, min: %d, max: %d, center: %d\n",
i, (int)_function_assignment[i], (double)_current_output_value[i], (double)actualFailsafeValue(i),
_disarmed_value[i], _min_value[i], _max_value[i], _center_value[i]);
PX4_INFO_RAW("Channel %i: func: %3i, value: %i, failsafe: %d, disarmed: %d, min: %d, max: %d, center: %d\n", i,
(int)_function_assignment[i], _current_output_value[i],
actualFailsafeValue(i), _disarmed_value[i], _min_value[i], _max_value[i], _center_value[i]);
}
}
@@ -509,15 +509,15 @@ MixingOutput::limitAndUpdateOutputs(float outputs[MAX_ACTUATORS], bool has_updat
// Doing so makes calibrations consistent among different configurations and hence PWM minimum and maximum have a consistent effect
// hence the defaults for these parameters also make most setups work out of the box
if (_armed.in_esc_calibration_mode) {
static constexpr float PWM_CALIBRATION_LOW = 1000.f;
static constexpr float PWM_CALIBRATION_HIGH = 2000.f;
static constexpr uint16_t PWM_CALIBRATION_LOW = 1000;
static constexpr uint16_t PWM_CALIBRATION_HIGH = 2000;
for (int i = 0; i < _max_num_outputs; i++) {
if (fabsf(_current_output_value[i] - (float)_min_value[i]) < 0.5f) {
if (_current_output_value[i] == _min_value[i]) {
_current_output_value[i] = PWM_CALIBRATION_LOW;
}
if (fabsf(_current_output_value[i] - (float)_max_value[i]) < 0.5f) {
if (_current_output_value[i] == _max_value[i]) {
_current_output_value[i] = PWM_CALIBRATION_HIGH;
}
}
@@ -532,7 +532,7 @@ MixingOutput::limitAndUpdateOutputs(float outputs[MAX_ACTUATORS], bool has_updat
}
}
float MixingOutput::output_limit_calc_single(int i, float value) const
uint16_t MixingOutput::output_limit_calc_single(int i, float value) const
{
// check for invalid / disabled channels
if (!PX4_ISFINITE(value)) {
@@ -552,15 +552,27 @@ float MixingOutput::output_limit_calc_single(int i, float value) const
&& _param_handles[i].center != PARAM_INVALID
&& _center_value[i] >= 800
&& _center_value[i] <= 2200) {
output = math::interpolateNXY(value, {-1.f, 0.f, 1.f}, {(float)_min_value[i], (float)_center_value[i], (float)_max_value[i]});
/* bi-linear interpolation */
if (value < 0.0f) {
output = math::interpolate(value, -1.f, 0.0f,
static_cast<float>(_min_value[i]), static_cast<float>(_center_value[i]));
} else {
output = math::interpolate(value, 0.0f, 1.0f,
static_cast<float>(_center_value[i]), static_cast<float>(_max_value[i]));
}
}
// Everything except servos, or if center is not set
else {
output = math::interpolate(value, -1.f, 1.f, static_cast<float>(_min_value[i]), static_cast<float>(_max_value[i]));
output = math::interpolate(value, -1.f, 1.f,
static_cast<float>(_min_value[i]), static_cast<float>(_max_value[i]));
}
return output;
return math::constrain(lroundf(output), 0L, static_cast<long>(UINT16_MAX));
}
void
@@ -635,7 +647,7 @@ MixingOutput::output_limit_calc(const bool armed, const int num_channels, const
for (int i = 0; i < num_channels; i++) {
// Ramp from disarmed value to currently desired output that would apply without ramp
float desired_output = output_limit_calc_single(i, output[i]);
uint16_t desired_output = output_limit_calc_single(i, output[i]);
_current_output_value[i] = _disarmed_value[i] + progress * (desired_output - _disarmed_value[i]);
}
}
@@ -676,9 +688,10 @@ MixingOutput::updateLatencyPerfCounter(const actuator_outputs_s &actuator_output
}
}
float MixingOutput::actualFailsafeValue(int index) const
uint16_t
MixingOutput::actualFailsafeValue(int index) const
{
float value = 0;
uint16_t value = 0;
if (_failsafe_value[index] == UINT16_MAX) { // if set to default, use the one provided by the function
float default_failsafe = NAN;
@@ -690,7 +703,7 @@ float MixingOutput::actualFailsafeValue(int index) const
value = output_limit_calc_single(index, default_failsafe);
} else {
value = static_cast<float>(_failsafe_value[index]);
value = _failsafe_value[index];
}
return value;
+5 -4
View File
@@ -84,7 +84,8 @@ public:
* @param num_control_groups_updated number of actuator_control groups updated
* @return if true, the update got handled, and actuator_outputs can be published
*/
virtual bool updateOutputs(float outputs[MAX_ACTUATORS], unsigned num_outputs, unsigned num_control_groups_updated) = 0;
virtual bool updateOutputs(uint16_t outputs[MAX_ACTUATORS],
unsigned num_outputs, unsigned num_control_groups_updated) = 0;
/** called whenever the mixer gets updated/reset */
virtual void mixerChanged() {}
@@ -185,7 +186,7 @@ public:
/**
* Returns the actual failsafe value taking into account the assigned function
*/
float actualFailsafeValue(int index) const;
uint16_t actualFailsafeValue(int index) const;
void setIgnoreLockdown(bool ignore_lockdown) { _ignore_lockdown = ignore_lockdown; }
@@ -206,7 +207,7 @@ public:
protected:
void updateParams() override;
float output_limit_calc_single(int i, float value) const;
uint16_t output_limit_calc_single(int i, float value) const;
private:
@@ -246,7 +247,7 @@ private:
uint16_t _min_value[MAX_ACTUATORS] {};
uint16_t _center_value[MAX_ACTUATORS] {};
uint16_t _max_value[MAX_ACTUATORS] {};
float _current_output_value[MAX_ACTUATORS] {}; ///< current output values (reordered)
uint16_t _current_output_value[MAX_ACTUATORS] {}; ///< current output values (reordered)
uint16_t _reverse_output_mask{0}; ///< reverses the interval [min, max] -> [max, min], NOT motor direction
enum class OutputLimitState {

Some files were not shown because too many files have changed in this diff Show More