mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-08-10 02:10:35 +08:00
Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d468ec4e1d | |||
| 59710b15ae | |||
| 0180ad3a63 | |||
| e0663cd6ad | |||
| a6863f0930 | |||
| 34d4eb7b9e | |||
| efc3e64c00 | |||
| 0369abd556 | |||
| 75e4047f2a | |||
| 310cbbedb1 | |||
| 6f81998e27 | |||
| edda54b26b | |||
| e29771cd97 | |||
| ac74a02d7c | |||
| d13692ca46 | |||
| 77d854b045 | |||
| fae563b35e | |||
| 4c130769bd | |||
| 599ea7545d | |||
| 9fd126194b | |||
| 6d15019717 | |||
| 6b2b20bd6e | |||
| e6e42fa043 | |||
| 3b35676afe | |||
| b0d48ce786 | |||
| f014bea723 | |||
| a9e67d4142 | |||
| 46f3e2ea71 | |||
| dd1b435460 | |||
| 9e07813005 | |||
| 80b1f5532b | |||
| 3de41e1847 | |||
| 828b6f5232 | |||
| 2cec05e44a | |||
| f56e6b0bda | |||
| bd17df8c29 | |||
| a19d6e4f6e | |||
| 71e553c67e | |||
| 359d58effd |
@@ -27,7 +27,7 @@ jobs:
|
||||
"failsafe_web",
|
||||
]
|
||||
container:
|
||||
image: px4io/px4-dev:v1.16.0-ondemand
|
||||
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
|
||||
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
|
||||
steps:
|
||||
- name: Install Node v20.18.0
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
name: Analyzing ${{ matrix.target }}
|
||||
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
|
||||
container:
|
||||
image: px4io/px4-dev:v1.16.0-ondemand
|
||||
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
|
||||
strategy:
|
||||
matrix:
|
||||
target: [px4_fmu-v5x, px4_fmu-v6x]
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
name: Checking ${{ matrix.target }}
|
||||
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
|
||||
container:
|
||||
image: px4io/px4-dev:v1.16.0-ondemand
|
||||
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
- name: Build PX4 and Run Test [${{ matrix.config }}]
|
||||
uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: px4io/px4-dev:v1.16.0-ondemand
|
||||
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
|
||||
options: -v ${{ github.workspace }}:/workspace
|
||||
run: |
|
||||
cd /workspace
|
||||
|
||||
@@ -11,13 +11,11 @@ on:
|
||||
- 'main'
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '.github/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
- '**'
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '.github/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -33,6 +31,12 @@ jobs:
|
||||
- name: Git Ownership Workaround
|
||||
run: git config --system --add safe.directory '*'
|
||||
|
||||
- name: Update ROS Keys
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/ros2.list && \
|
||||
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
|
||||
|
||||
- name: Install gazebo
|
||||
run: |
|
||||
apt update && apt install -y gazebo11 libgazebo11-dev gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly libgstreamer-plugins-base1.0-dev
|
||||
|
||||
Vendored
+10
@@ -6,6 +6,11 @@ CONFIG:
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_default
|
||||
px4_sitl_spacecraft:
|
||||
short: px4_sitl_spacecraft
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_spacecraft
|
||||
px4_sitl_nolockstep:
|
||||
short: px4_sitl_nolockstep
|
||||
buildType: RelWithDebInfo
|
||||
@@ -301,6 +306,11 @@ CONFIG:
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: holybro_durandal-v1_default
|
||||
holybro_kakuteh7-wing_default:
|
||||
short: holybro_kakuteh7-wing
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: holybro_kakuteh7-wing_default
|
||||
holybro_kakuteh7dualimu_default:
|
||||
short: holybro_kakuteh7dualimu
|
||||
buildType: MinSizeRel
|
||||
|
||||
+23
-2
@@ -216,12 +216,33 @@ foreach(board_extra_file ${OPTIONAL_BOARD_EXTRAS})
|
||||
if(CONFIG_SYSTEMCMDS_BL_UPDATE)
|
||||
# generate rc.board_bootloader_upgrade
|
||||
set(BOARD_FIRMWARE_BIN "${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_bootloader.bin")
|
||||
configure_file(${PX4_SOURCE_DIR}/platforms/nuttx/init/rc.board_bootloader_upgrade.in ${romfs_gen_root_dir}/init.d/rc.board_bootloader_upgrade @ONLY)
|
||||
message(STATUS "ROMFS: Adding platforms/nuttx/init/rc.board_bootloader_upgrade -> /etc/init.d/rc.board_bootloader_upgrade")
|
||||
|
||||
# Generate the file using configure_file at configure time to a temporary location
|
||||
set(bootloader_upgrade_tmp ${CMAKE_CURRENT_BINARY_DIR}/rc.board_bootloader_upgrade.tmp)
|
||||
configure_file(${PX4_SOURCE_DIR}/platforms/nuttx/init/rc.board_bootloader_upgrade.in ${bootloader_upgrade_tmp} @ONLY)
|
||||
|
||||
# Then copy it at build time with proper dependencies
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${romfs_gen_root_dir}/init.d/rc.board_bootloader_upgrade
|
||||
rc.board_bootloader_upgrade.stamp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${bootloader_upgrade_tmp} ${romfs_gen_root_dir}/init.d/rc.board_bootloader_upgrade
|
||||
COMMAND ${CMAKE_COMMAND} -E touch rc.board_bootloader_upgrade.stamp
|
||||
DEPENDS
|
||||
${bootloader_upgrade_tmp}
|
||||
${PX4_SOURCE_DIR}/platforms/nuttx/init/rc.board_bootloader_upgrade.in
|
||||
romfs_copy.stamp
|
||||
COMMENT "ROMFS: copying rc.board_bootloader_upgrade"
|
||||
)
|
||||
|
||||
list(APPEND extras_dependencies
|
||||
rc.board_bootloader_upgrade.stamp
|
||||
)
|
||||
else()
|
||||
# remove bootloader from extras
|
||||
list(REMOVE_ITEM OPTIONAL_BOARD_EXTRAS ${board_extra_file})
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name 6DoF Spacecraft Model
|
||||
#
|
||||
# @type Freeflyer with 8 thrusters
|
||||
#
|
||||
# @maintainer Pedro Roque <padr@kth.se>
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.sc_defaults
|
||||
|
||||
param set-default CA_AIRFRAME 15
|
||||
param set-default MAV_TYPE 99
|
||||
|
||||
param set-default CA_THRUSTER_CNT 12
|
||||
param set-default CA_R_REV 0
|
||||
|
||||
# param set-default FW_ARSP_MODE 1
|
||||
|
||||
# Auto to be provided by Custom Airframe
|
||||
param set-default CA_METHOD 0
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
|
||||
# Set proper failsafes
|
||||
param set-default COM_ACT_FAIL_ACT 0
|
||||
param set-default COM_LOW_BAT_ACT 0
|
||||
param set-default NAV_DLL_ACT 0
|
||||
param set-default GF_ACTION 1
|
||||
param set-default NAV_RCL_ACT 1
|
||||
param set-default COM_POSCTL_NAVL 2
|
||||
|
||||
# Set thrusters
|
||||
param set-default CA_THRUSTER0_PX -0.50
|
||||
param set-default CA_THRUSTER0_PY 0.50
|
||||
param set-default CA_THRUSTER0_PZ 0.0
|
||||
param set-default CA_THRUSTER0_CT 0.237
|
||||
param set-default CA_THRUSTER0_AX 0.0
|
||||
param set-default CA_THRUSTER0_AY -1.0
|
||||
param set-default CA_THRUSTER0_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER1_PX 0.50
|
||||
param set-default CA_THRUSTER1_PY 0.50
|
||||
param set-default CA_THRUSTER1_PZ 0.0
|
||||
param set-default CA_THRUSTER1_CT 0.237
|
||||
param set-default CA_THRUSTER1_AX 0.0
|
||||
param set-default CA_THRUSTER1_AY -1.0
|
||||
param set-default CA_THRUSTER1_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER2_PX 0.50
|
||||
param set-default CA_THRUSTER2_PY -0.50
|
||||
param set-default CA_THRUSTER2_PZ 0.0
|
||||
param set-default CA_THRUSTER2_CT 0.237
|
||||
param set-default CA_THRUSTER2_AX 0.0
|
||||
param set-default CA_THRUSTER2_AY 1.0
|
||||
param set-default CA_THRUSTER2_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER3_PX -0.50
|
||||
param set-default CA_THRUSTER3_PY -0.50
|
||||
param set-default CA_THRUSTER3_PZ 0.0
|
||||
param set-default CA_THRUSTER3_CT 0.237
|
||||
param set-default CA_THRUSTER3_AX 0.0
|
||||
param set-default CA_THRUSTER3_AY 1.0
|
||||
param set-default CA_THRUSTER3_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER4_PX -0.50
|
||||
param set-default CA_THRUSTER4_PY 0.0
|
||||
param set-default CA_THRUSTER4_PZ -0.50
|
||||
param set-default CA_THRUSTER4_CT 0.237
|
||||
param set-default CA_THRUSTER4_AX 1.0
|
||||
param set-default CA_THRUSTER4_AY 0.0
|
||||
param set-default CA_THRUSTER4_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER5_PX 0.50
|
||||
param set-default CA_THRUSTER5_PY 0.0
|
||||
param set-default CA_THRUSTER5_PZ -0.50
|
||||
param set-default CA_THRUSTER5_CT 0.237
|
||||
param set-default CA_THRUSTER5_AX -1.0
|
||||
param set-default CA_THRUSTER5_AY 0.0
|
||||
param set-default CA_THRUSTER5_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER6_PX 0.50
|
||||
param set-default CA_THRUSTER6_PY 0.0
|
||||
param set-default CA_THRUSTER6_PZ 0.50
|
||||
param set-default CA_THRUSTER6_CT 0.237
|
||||
param set-default CA_THRUSTER6_AX -1.0
|
||||
param set-default CA_THRUSTER6_AY 0.0
|
||||
param set-default CA_THRUSTER6_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER7_PX -0.50
|
||||
param set-default CA_THRUSTER7_PY 0.0
|
||||
param set-default CA_THRUSTER7_PZ 0.50
|
||||
param set-default CA_THRUSTER7_CT 0.237
|
||||
param set-default CA_THRUSTER7_AX 1.0
|
||||
param set-default CA_THRUSTER7_AY 0.0
|
||||
param set-default CA_THRUSTER7_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER8_PX 0.0
|
||||
param set-default CA_THRUSTER8_PY -0.50
|
||||
param set-default CA_THRUSTER8_PZ -0.50
|
||||
param set-default CA_THRUSTER8_CT 0.237
|
||||
param set-default CA_THRUSTER8_AX 0.0
|
||||
param set-default CA_THRUSTER8_AY 0.0
|
||||
param set-default CA_THRUSTER8_AZ 1.0
|
||||
|
||||
param set-default CA_THRUSTER9_PX 0.0
|
||||
param set-default CA_THRUSTER9_PY 0.50
|
||||
param set-default CA_THRUSTER9_PZ -0.50
|
||||
param set-default CA_THRUSTER9_CT 0.237
|
||||
param set-default CA_THRUSTER9_AX 0.0
|
||||
param set-default CA_THRUSTER9_AY 0.0
|
||||
param set-default CA_THRUSTER9_AZ 1.0
|
||||
|
||||
param set-default CA_THRUSTER10_PX 0.0
|
||||
param set-default CA_THRUSTER10_PY 0.50
|
||||
param set-default CA_THRUSTER10_PZ 0.50
|
||||
param set-default CA_THRUSTER10_CT 0.237
|
||||
param set-default CA_THRUSTER10_AX 0.0
|
||||
param set-default CA_THRUSTER10_AY 0.0
|
||||
param set-default CA_THRUSTER10_AZ -1.0
|
||||
|
||||
param set-default CA_THRUSTER11_PX 0.0
|
||||
param set-default CA_THRUSTER11_PY -0.50
|
||||
param set-default CA_THRUSTER11_PZ 0.50
|
||||
param set-default CA_THRUSTER11_CT 0.237
|
||||
param set-default CA_THRUSTER11_AX 0.0
|
||||
param set-default CA_THRUSTER11_AY 0.0
|
||||
param set-default CA_THRUSTER11_AZ -1.0
|
||||
|
||||
param set-default PWM_MAIN_FUNC1 101
|
||||
param set-default PWM_MAIN_FUNC2 102
|
||||
param set-default PWM_MAIN_FUNC3 103
|
||||
param set-default PWM_MAIN_FUNC4 104
|
||||
param set-default PWM_MAIN_FUNC5 105
|
||||
param set-default PWM_MAIN_FUNC6 106
|
||||
param set-default PWM_MAIN_FUNC7 107
|
||||
param set-default PWM_MAIN_FUNC8 108
|
||||
param set-default PWM_MAIN_FUNC9 109
|
||||
param set-default PWM_MAIN_FUNC10 110
|
||||
param set-default PWM_MAIN_FUNC11 111
|
||||
param set-default PWM_MAIN_FUNC12 112
|
||||
|
||||
# PWM Simulation
|
||||
param set PWM_SIM_PWM_MAX 10000
|
||||
param set PWM_SIM_PWM_MIN 0
|
||||
|
||||
# Controller Tunings
|
||||
param set-default SC_ROLLRATE_P 0.14
|
||||
param set-default SC_PITCHRATE_P 0.14
|
||||
param set-default SC_ROLLRATE_I 0.3
|
||||
param set-default SC_PITCHRATE_I 0.3
|
||||
param set-default SC_ROLLRATE_D 0.004
|
||||
param set-default SC_PITCHRATE_D 0.004
|
||||
@@ -20,7 +20,7 @@ param set-default COM_ARM_CHK_ESCS 0 # We don't have ESCs
|
||||
param set-default FD_ESCS_EN 0 # We don't have ESCs - but maybe we need this later?
|
||||
|
||||
param set-default CA_AIRFRAME 14
|
||||
param set-default MAV_TYPE 99
|
||||
param set-default MAV_TYPE 45
|
||||
|
||||
param set-default CA_THRUSTER_CNT 8
|
||||
param set-default CA_R_REV 0
|
||||
|
||||
@@ -114,7 +114,6 @@ px4_add_romfs_files(
|
||||
17001_flightgear_tf-g1
|
||||
17002_flightgear_tf-g2
|
||||
|
||||
71001_gazebo-classic_spacecraft_dart
|
||||
71002_gz_spacecraft_2d
|
||||
|
||||
# [22000, 22999] Reserve for custom models
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
. ${R}etc/init.d/rc.sc_defaults
|
||||
|
||||
param set-default CA_AIRFRAME 14
|
||||
param set-default MAV_TYPE 99
|
||||
param set-default MAV_TYPE 45
|
||||
|
||||
param set-default CA_THRUSTER_CNT 8
|
||||
param set-default CA_R_REV 0
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
||||
#
|
||||
|
||||
set VEHICLE_TYPE sc
|
||||
set VEHICLE_TYPE spacecraft
|
||||
|
||||
# MAV_TYPE_QUADROTOR 2
|
||||
#param set-default MAV_TYPE 12
|
||||
# MAV_TYPE_SPACECRAFT_ORBITTER
|
||||
param set-default MAV_TYPE 45
|
||||
|
||||
# Set micro-dds-client to use ethernet and IP-address 192.168.0.1
|
||||
param set-default UXRCE_DDS_AG_IP -1062731775
|
||||
|
||||
@@ -68,6 +68,15 @@ then
|
||||
. ${R}etc/init.d/rc.vtol_apps
|
||||
fi
|
||||
|
||||
#
|
||||
# Spapcecraft setup.
|
||||
#
|
||||
if [ $VEHICLE_TYPE = spacecraft ]
|
||||
then
|
||||
# Start standard multicopter apps.
|
||||
. ${R}etc/init.d/rc.sc_apps
|
||||
fi
|
||||
|
||||
#
|
||||
# Airship setup.
|
||||
#
|
||||
|
||||
@@ -280,6 +280,14 @@ else
|
||||
#
|
||||
send_event start
|
||||
|
||||
#
|
||||
# Start the hardfault streamer.
|
||||
#
|
||||
if param compare -s SYS_HF_MAV 1
|
||||
then
|
||||
hardfault_stream start
|
||||
fi
|
||||
|
||||
#
|
||||
# Start the resource load monitor.
|
||||
#
|
||||
|
||||
@@ -35,6 +35,7 @@ if args.filter:
|
||||
for board in args.filter.split(','):
|
||||
board_filter.append(board)
|
||||
|
||||
default_container = 'ghcr.io/px4/px4-dev:v1.16.0-rc1-258-g0369abd556'
|
||||
build_configs = []
|
||||
grouped_targets = {}
|
||||
excluded_boards = ['modalai_voxl2', 'px4_ros2'] # TODO: fix and enable
|
||||
@@ -86,7 +87,7 @@ def process_target(px4board_file, target_name):
|
||||
assert platform, f"PLATFORM not found in {px4board_file}"
|
||||
|
||||
if platform not in excluded_platforms:
|
||||
container = 'ghcr.io/px4/px4-dev:v1.16.0-ondemand'
|
||||
container = default_container
|
||||
if platform == 'posix':
|
||||
group = 'base'
|
||||
if toolchain:
|
||||
@@ -120,7 +121,7 @@ if(verbose):
|
||||
# - Events
|
||||
metadata_targets = ['airframe_metadata', 'parameters_metadata', 'extract_events']
|
||||
grouped_targets['base'] = {}
|
||||
grouped_targets['base']['container'] = 'ghcr.io/px4/px4-dev:v1.16.0-ondemand'
|
||||
grouped_targets['base']['container'] = default_container
|
||||
grouped_targets['base']['manufacturers'] = {}
|
||||
grouped_targets['base']['manufacturers']['px4'] = []
|
||||
grouped_targets['base']['manufacturers']['px4'] += metadata_targets
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ fi
|
||||
|
||||
# otherwise default to nuttx
|
||||
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||
PX4_DOCKER_REPO="px4io/px4-dev:v1.16.0-ondemand"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev:v1.16.0-rc1-258-g0369abd556"
|
||||
fi
|
||||
|
||||
echo "PX4_DOCKER_REPO: $PX4_DOCKER_REPO";
|
||||
|
||||
@@ -27,3 +27,4 @@ six>=1.12.0
|
||||
toml>=0.9
|
||||
sympy>=1.10.1
|
||||
pycryptodome
|
||||
lark
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -43,6 +43,7 @@ CONFIG_FIGURE_OF_EIGHT=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -5,6 +5,7 @@ CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS1"
|
||||
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2"
|
||||
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3"
|
||||
CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS5"
|
||||
CONFIG_BOARD_SERIAL_RC="/dev/ttyS4"
|
||||
CONFIG_DRIVERS_ADC_BOARD_ADC=y
|
||||
CONFIG_DRIVERS_BAROMETER_BMP280=y
|
||||
CONFIG_DRIVERS_BAROMETER_GOERTEK_SPA06=y
|
||||
|
||||
Binary file not shown.
@@ -74,7 +74,7 @@
|
||||
#define BOARD_TYPE 1105
|
||||
#define BOARD_FLASH_SECTORS (14)
|
||||
#define BOARD_FLASH_SIZE (16 * 128 * 1024)
|
||||
#define APP_RESERVATION_SIZE (1 * 128 * 1024)
|
||||
#define APP_RESERVATION_SIZE (2 * 128 * 1024)
|
||||
|
||||
#define OSC_FREQ 16
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ CONFIG_MODULES_FW_LATERAL_LONGITUDINAL_CONTROL=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_MODULES_FW_LATERAL_LONGITUDINAL_CONTROL=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -63,6 +63,7 @@ CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -733,6 +733,7 @@
|
||||
- [Protocols/Microservices](mavlink/protocols.md)
|
||||
- [Standard Modes Protocol](mavlink/standard_modes.md)
|
||||
- [uXRCE-DDS (PX4-ROS 2/DDS Bridge)](middleware/uxrce_dds.md)
|
||||
- [UORB Bridged to ROS 2](middleware/dds_topics.md)
|
||||
- [모듈과 명령어](modules/modules_main.md)
|
||||
- [자동 튜닝](modules/modules_autotune.md)
|
||||
- [명령어](modules/modules_command.md)
|
||||
|
||||
@@ -128,21 +128,21 @@ You add some "boilerplate" code to regularly listen for changes in the [uORB Top
|
||||
|
||||
- **px4_platform_common/module_params.h** to get the `DEFINE_PARAMETERS` macro:
|
||||
|
||||
```cpp
|
||||
#include <px4_platform_common/module_params.h>
|
||||
```
|
||||
```cpp
|
||||
#include <px4_platform_common/module_params.h>
|
||||
```
|
||||
|
||||
- **parameter_update.h** to access the uORB `parameter_update` message:
|
||||
|
||||
```cpp
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
```
|
||||
```cpp
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
```
|
||||
|
||||
- **Subscription.hpp** for the uORB C++ subscription API:
|
||||
|
||||
```cpp
|
||||
#include <uORB/Subscription.hpp>
|
||||
```
|
||||
```cpp
|
||||
#include <uORB/Subscription.hpp>
|
||||
```
|
||||
|
||||
Derive your class from `ModuleParams`, and use `DEFINE_PARAMETERS` to specify a list of parameters and their associated parameter attributes.
|
||||
매개변수의 이름은 매개변수 메타데이터 정의와 동일하여야 합니다.
|
||||
@@ -194,7 +194,7 @@ void Module::parameters_update()
|
||||
- `_parameter_update_sub.updated()` tells us if there is _any_ update to the `param_update` uORB message (but not what parameter is affected).
|
||||
- If there has been "some" parameter updated, we copy the update into a `parameter_update_s` (`param_update`), to clear the pending update.
|
||||
- Then we call `ModuleParams::updateParams()`.
|
||||
This "under the hood" updates all parameter attributes listed in our `DEFINE_PARAMETERS` list.
|
||||
This "under the hood" updates all parameter attributes listed in our `DEFINE_PARAMETERS` list.
|
||||
|
||||
The parameter attributes (`_sys_autostart` and `_att_bias_max` in this case) can then be used to represent the parameters, and will be updated whenever the parameter value changes.
|
||||
|
||||
@@ -267,12 +267,12 @@ YAML meta data is intended as a full replacement for the **.c** definitions.
|
||||
- An example of YAML definitions being used can be found in the MAVLink parameter definitions: [/src/modules/mavlink/module.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/mavlink/module.yaml).
|
||||
- YAML 파일은 다음을 추가하여 cmake 빌드 시스템에 등록됩니다.
|
||||
|
||||
```cmake
|
||||
MODULE_CONFIG
|
||||
module.yaml
|
||||
```
|
||||
```cmake
|
||||
MODULE_CONFIG
|
||||
module.yaml
|
||||
```
|
||||
|
||||
to the `px4_add_module` section of the `CMakeLists.txt` file of that module.
|
||||
to the `px4_add_module` section of the `CMakeLists.txt` file of that module.
|
||||
|
||||
#### 다중 인스턴스(템플릿) YAML 메타 데이터
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ This guide walks through the process of setting up the board and connecting to P
|
||||
You will temporarily need the following hardware in order to log into your Jetson and get its IP address, after which you will be able to log in via SSH:
|
||||
|
||||
- External display.
|
||||
If your display doesn't have a mini HDMI connector you will also need a [Mini HDMI to HDMI converter](https://a.co/d/6N815N9) if your external display has HDMI input
|
||||
If your display doesn't have a mini HDMI connector you will also need a [Mini HDMI to HDMI converter](https://a.co/d/6N815N9) if your external display has HDMI input
|
||||
- Ethernet cable
|
||||
- Mouse and keyboard (the baseboard has 4 USB ports exposed from Jetson, two of which are USB 3.0)
|
||||
|
||||
@@ -45,11 +45,11 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- 크기
|
||||
|
||||
- 126 x 80 x 45mm (with Jetson Orin NX + Heatsink/Fan & FC Module)
|
||||
- 126 x 80 x 22.9mm (without Jetson and FC Module)
|
||||
- 126 x 80 x 45mm (with Jetson Orin NX + Heatsink/Fan & FC Module)
|
||||
- 126 x 80 x 22.9mm (without Jetson and FC Module)
|
||||
|
||||
- 중량
|
||||
- 190g (with Jetson, Heatsink, Flight Controller, M.2 SSD, M.2 Wi-Fi Module)
|
||||
- 190g (with Jetson, Heatsink, Flight Controller, M.2 SSD, M.2 Wi-Fi Module)
|
||||
|
||||
:::
|
||||
|
||||
@@ -57,67 +57,67 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- 2x Gigabit Ethernet Port
|
||||
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- Ethernet Switch powered by the same circuit as the Pixhawk
|
||||
- 8-pin JST-GH
|
||||
- RJ45
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- Ethernet Switch powered by the same circuit as the Pixhawk
|
||||
- 8-pin JST-GH
|
||||
- RJ45
|
||||
|
||||
- 2x MIPI CSI Camera Inputs
|
||||
|
||||
- 4 Lanes each
|
||||
- 22-Pin Raspberry Pi Cam FFC
|
||||
- 4 Lanes each
|
||||
- 22-Pin Raspberry Pi Cam FFC
|
||||
|
||||
- 2x USB 3.0 Host Port
|
||||
|
||||
- USB A
|
||||
- 5A Current Limit
|
||||
- USB A
|
||||
- 5A Current Limit
|
||||
|
||||
- 2x USB 2.0 Host Port
|
||||
|
||||
- 5-Pin JST-GH
|
||||
- 0A Current Limit
|
||||
- 5-Pin JST-GH
|
||||
- 0A Current Limit
|
||||
|
||||
- USB 2.0 for Programming/Debugging
|
||||
|
||||
- USB-C
|
||||
- USB-C
|
||||
|
||||
- 2 Key M 2242/2280 for NVMe SSD
|
||||
|
||||
- PCIEx4
|
||||
- PCIEx4
|
||||
|
||||
- 2 Key E 2230 for WiFi/BT
|
||||
|
||||
- PCIEx2
|
||||
- USB
|
||||
- UART
|
||||
- I2S
|
||||
- PCIEx2
|
||||
- USB
|
||||
- UART
|
||||
- I2S
|
||||
|
||||
- Mini HDMI Out
|
||||
|
||||
- 4x GPIO
|
||||
|
||||
- 6-pin JST-GH
|
||||
- 6-pin JST-GH
|
||||
|
||||
- CAN Port
|
||||
|
||||
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
||||
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
||||
|
||||
- SPI Port
|
||||
|
||||
- 7-Pin JST-GH
|
||||
- 7-Pin JST-GH
|
||||
|
||||
- I2C Port
|
||||
|
||||
- 4-Pin JST-GH
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- I2S Port
|
||||
|
||||
- 7-Pin JST-GH
|
||||
- 7-Pin JST-GH
|
||||
|
||||
- 2x UART Port
|
||||
|
||||
- 1 for debug
|
||||
- 1 connected to Autopilot's telem2
|
||||
- 1 for debug
|
||||
- 1 connected to Autopilot's telem2
|
||||
|
||||
- Fan Power Port
|
||||
|
||||
@@ -129,13 +129,13 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- Pixhawk Autopilot Bus Interface
|
||||
|
||||
- 100 Pin Hirose DF40
|
||||
- 50 Pin Hirose DF40
|
||||
- 100 Pin Hirose DF40
|
||||
- 50 Pin Hirose DF40
|
||||
|
||||
- Redundant Digital Power Module Inputs
|
||||
|
||||
- I2C Power Monitor Support
|
||||
- 2x 6-Pin Molex CLIK-Mate
|
||||
- I2C Power Monitor Support
|
||||
- 2x 6-Pin Molex CLIK-Mate
|
||||
|
||||
- Power Path Selector
|
||||
|
||||
@@ -143,68 +143,68 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- 정격 전압
|
||||
|
||||
- 최대 입력 전압: 6V
|
||||
- USB 전원 입력: 4.75~5.25V
|
||||
- 최대 입력 전압: 6V
|
||||
- USB 전원 입력: 4.75~5.25V
|
||||
|
||||
- Full GPS Plus Safety Switch Port
|
||||
|
||||
- 10-Pin JST-GH
|
||||
- 10-Pin JST-GH
|
||||
|
||||
- Secondary (GPS2) Port
|
||||
|
||||
- 6-Pin JST-GH
|
||||
- 6-Pin JST-GH
|
||||
|
||||
- 2x CAN Ports
|
||||
|
||||
- 4-Pin JST-GH
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- 3x Telemetry Ports with Flow Control
|
||||
|
||||
- 2x 6-Pin JST-GH
|
||||
- 1 is connected to Jetson's `UART1` Port
|
||||
- 2x 6-Pin JST-GH
|
||||
- 1 is connected to Jetson's `UART1` Port
|
||||
|
||||
- 16 PWM Outputs
|
||||
|
||||
- 2x 10-Pin JST-GH
|
||||
- 2x 10-Pin JST-GH
|
||||
|
||||
- UART4 & I2C Port
|
||||
|
||||
- 6-Pin JST-GH
|
||||
- 6-Pin JST-GH
|
||||
|
||||
- 2x Gigabit Ethernet Port
|
||||
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- 8-Pin JST-GH
|
||||
- RJ45
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- 8-Pin JST-GH
|
||||
- RJ45
|
||||
|
||||
- AD & IO
|
||||
|
||||
- 8-Pin JST-GH
|
||||
- 8-Pin JST-GH
|
||||
|
||||
- USB 2.0
|
||||
|
||||
- USB-C
|
||||
- 4-Pin JST-GH
|
||||
- USB-C
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- DSM Input
|
||||
|
||||
- 3-Pin JST-ZH 1.5mm Pitch
|
||||
- 3-Pin JST-ZH 1.5mm Pitch
|
||||
|
||||
- RC In
|
||||
|
||||
- PPM/SBUS
|
||||
- 5-Pin JST-GH
|
||||
- PPM/SBUS
|
||||
- 5-Pin JST-GH
|
||||
|
||||
- SPI Port
|
||||
|
||||
- External Sensor Bus (SPI5)
|
||||
- 11-Pin JST-GH
|
||||
- External Sensor Bus (SPI5)
|
||||
- 11-Pin JST-GH
|
||||
|
||||
- 2x Debug Port
|
||||
|
||||
- 1 for FMU
|
||||
- 1 for IO
|
||||
- 10-Pin JST-SH
|
||||
- 1 for FMU
|
||||
- 1 for IO
|
||||
- 10-Pin JST-SH
|
||||
|
||||
:::
|
||||
|
||||
@@ -218,7 +218,7 @@ The Jetson has separate input power circuitry from the Pixhawk autopilot:
|
||||
- 8V/3A Minimum (Depends on Usage and Peripherals)
|
||||
- Voltage Rating: 7-21V (3S-4S)
|
||||
- Jetson Baseboard onboard BEC is rated for 7-21V (3S-4S).
|
||||
Note that the external UBEC-12A can be used for applications above 4S
|
||||
Note that the external UBEC-12A can be used for applications above 4S
|
||||
|
||||
During development using the following wired power supply is recommended:
|
||||
|
||||
@@ -698,7 +698,7 @@ On the following screen, confirm your selected device:
|
||||
|
||||
- Choose `Pre-config` for the OEM Configuration (this will skip Ubuntu first time setup screens after reboot).
|
||||
- Choose your preferred username and password (and write them down).
|
||||
These will be used as your login credentials to Jetpack.
|
||||
These will be used as your login credentials to Jetpack.
|
||||
- Choose `NVMe` as the storage device because the board has separate SSD for storage.
|
||||
|
||||

|
||||
@@ -922,95 +922,95 @@ These instructions approximately mirror the [PX4 Ethernet setup](../advanced_con
|
||||
Next we modify the Jetson IP address to be on the same network as the Pixhawk:
|
||||
|
||||
1. Make sure `netplan` is installed.
|
||||
You can check by running the following command:
|
||||
You can check by running the following command:
|
||||
|
||||
```sh
|
||||
netplan -h
|
||||
```
|
||||
```sh
|
||||
netplan -h
|
||||
```
|
||||
|
||||
If not, install it using the commands:
|
||||
If not, install it using the commands:
|
||||
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install netplan.io
|
||||
```
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install netplan.io
|
||||
```
|
||||
|
||||
2. Check `system_networkd` is running:
|
||||
|
||||
```sh
|
||||
sudo systemctl status systemd-networkd
|
||||
```
|
||||
```sh
|
||||
sudo systemctl status systemd-networkd
|
||||
```
|
||||
|
||||
You should see output like below if it is active:
|
||||
You should see output like below if it is active:
|
||||
|
||||
```sh
|
||||
● systemd-networkd.service - Network Configuration
|
||||
Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
|
||||
Active: active (running) since Wed 2024-09-11 23:32:44 EDT; 23min ago
|
||||
TriggeredBy: ● systemd-networkd.socket
|
||||
Docs: man:systemd-networkd.service(8)
|
||||
Main PID: 2452 (systemd-network)
|
||||
Status: "Processing requests..."
|
||||
Tasks: 1 (limit: 18457)
|
||||
Memory: 2.7M
|
||||
CPU: 157ms
|
||||
CGroup: /system.slice/systemd-networkd.service
|
||||
└─2452 /lib/systemd/systemd-networkd
|
||||
```sh
|
||||
● systemd-networkd.service - Network Configuration
|
||||
Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
|
||||
Active: active (running) since Wed 2024-09-11 23:32:44 EDT; 23min ago
|
||||
TriggeredBy: ● systemd-networkd.socket
|
||||
Docs: man:systemd-networkd.service(8)
|
||||
Main PID: 2452 (systemd-network)
|
||||
Status: "Processing requests..."
|
||||
Tasks: 1 (limit: 18457)
|
||||
Memory: 2.7M
|
||||
CPU: 157ms
|
||||
CGroup: /system.slice/systemd-networkd.service
|
||||
└─2452 /lib/systemd/systemd-networkd
|
||||
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: lo: Gained carrier
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: eth0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: Enumeration completed
|
||||
Sep 11 23:32:44 ubuntu systemd[1]: Started Network Configuration.
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Connected WiFi access point: Verizon_7YLWWD (78:67:0e:ea:a6:0>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
```
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: lo: Gained carrier
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: eth0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: Enumeration completed
|
||||
Sep 11 23:32:44 ubuntu systemd[1]: Started Network Configuration.
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Connected WiFi access point: Verizon_7YLWWD (78:67:0e:ea:a6:0>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
```
|
||||
|
||||
If `system_networkd` is not running, it can be enabled using:
|
||||
If `system_networkd` is not running, it can be enabled using:
|
||||
|
||||
```sh
|
||||
sudo systemctl start systemd-networkd
|
||||
sudo systemctl enable systemd-networkd
|
||||
```
|
||||
```sh
|
||||
sudo systemctl start systemd-networkd
|
||||
sudo systemctl enable systemd-networkd
|
||||
```
|
||||
|
||||
3. Open the Netplan configuration file (so we can set up a static IP for the Jetson).
|
||||
|
||||
The Netplan configuration file is usually located in the `/etc/netplan/` directory and named something like `01-netcfg.yaml` (the name can vary).
|
||||
Below we use `nano` to open the file, but you can use your preferred text editor:
|
||||
The Netplan configuration file is usually located in the `/etc/netplan/` directory and named something like `01-netcfg.yaml` (the name can vary).
|
||||
Below we use `nano` to open the file, but you can use your preferred text editor:
|
||||
|
||||
```sh
|
||||
sudo nano /etc/netplan/01-netcfg.yaml
|
||||
```
|
||||
```sh
|
||||
sudo nano /etc/netplan/01-netcfg.yaml
|
||||
```
|
||||
|
||||
4. Modify the yaml configuration, by overwriting the contents with the following information and then saving:
|
||||
|
||||
```sh
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses:
|
||||
- 10.41.10.1/24
|
||||
routes:
|
||||
- to: 0.0.0.0/0
|
||||
via: 10.41.10.254
|
||||
nameservers:
|
||||
addresses:
|
||||
- 10.41.10.254
|
||||
```
|
||||
```sh
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses:
|
||||
- 10.41.10.1/24
|
||||
routes:
|
||||
- to: 0.0.0.0/0
|
||||
via: 10.41.10.254
|
||||
nameservers:
|
||||
addresses:
|
||||
- 10.41.10.254
|
||||
```
|
||||
|
||||
This gives the Jetson a static IP address on the Ethernet interface of `10.41.10.1` .
|
||||
This gives the Jetson a static IP address on the Ethernet interface of `10.41.10.1` .
|
||||
|
||||
5. Apply the changes using the following command:
|
||||
|
||||
```sh
|
||||
sudo netplan apply
|
||||
```
|
||||
```sh
|
||||
sudo netplan apply
|
||||
```
|
||||
|
||||
The Pixhawk Ethernet address is set to `10.41.10.2` by default, which is on the same subnet.
|
||||
We can test our changes above by pinging the Pixhawk from within the Jetson terminal:
|
||||
@@ -1221,15 +1221,15 @@ Assuming the client is set up as defined above:
|
||||
|
||||
- (Serial connection) Start the agent on `/dev/ttyTHS1`:
|
||||
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
||||
```
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
||||
```
|
||||
|
||||
- (Ethernet) Start the agent on UDP port `8888`:
|
||||
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
|
||||
If your agent and client are connected and no nodes are running, you should see output similar to this in the Agent terminal:
|
||||
|
||||
|
||||
@@ -71,42 +71,42 @@ Explanations and requirements:
|
||||
- `/* EVENT`: This tag indicates that a comment defines metadata for the following event.
|
||||
|
||||
- **event_name**: the event name (`events::ID(event_name)`).
|
||||
- must be unique within the whole source code of PX4.
|
||||
As a general convention, prefix it with the module name, or the source file for larger modules.
|
||||
- must be a valid variable name, i.e. must not contain spaces, colons, etc.
|
||||
- from that name, a 24 bit event ID is derived using a hash function.
|
||||
This means as long as the event name stays the same, so will the ID.
|
||||
- must be unique within the whole source code of PX4.
|
||||
As a general convention, prefix it with the module name, or the source file for larger modules.
|
||||
- must be a valid variable name, i.e. must not contain spaces, colons, etc.
|
||||
- from that name, a 24 bit event ID is derived using a hash function.
|
||||
This means as long as the event name stays the same, so will the ID.
|
||||
|
||||
- **Log Level**:
|
||||
|
||||
- valid log levels are the same as used in the MAVLink [MAV_SEVERITY](https://mavlink.io/en/messages/common.html#MAV_SEVERITY) enum.
|
||||
In order of descending importance these are:
|
||||
- valid log levels are the same as used in the MAVLink [MAV_SEVERITY](https://mavlink.io/en/messages/common.html#MAV_SEVERITY) enum.
|
||||
In order of descending importance these are:
|
||||
|
||||
```plain
|
||||
Emergency,
|
||||
Alert,
|
||||
Critical,
|
||||
Error,
|
||||
Warning,
|
||||
Notice,
|
||||
Info,
|
||||
Debug,
|
||||
Disabled,
|
||||
```
|
||||
```plain
|
||||
Emergency,
|
||||
Alert,
|
||||
Critical,
|
||||
Error,
|
||||
Warning,
|
||||
Notice,
|
||||
Info,
|
||||
Debug,
|
||||
Disabled,
|
||||
```
|
||||
|
||||
- Above we specify a separate external and internal log level, which are the levels displayed to GCS users and in the log file, respectively: `{events::Log::Error, events::LogInternal::Info}`.
|
||||
For the majority of cases you can pass a single log level, and this will be used for both exernal and internal cases.
|
||||
There are cases it makes sense to have two different log levels.
|
||||
For example an RTL failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`.
|
||||
- Above we specify a separate external and internal log level, which are the levels displayed to GCS users and in the log file, respectively: `{events::Log::Error, events::LogInternal::Info}`.
|
||||
For the majority of cases you can pass a single log level, and this will be used for both exernal and internal cases.
|
||||
There are cases it makes sense to have two different log levels.
|
||||
For example an RTL failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`.
|
||||
|
||||
- **Event Message**:
|
||||
- Single-line, short message of the event.
|
||||
It may contain template placeholders for arguments (e.g. `{1}`). For more information see below.
|
||||
- Single-line, short message of the event.
|
||||
It may contain template placeholders for arguments (e.g. `{1}`). For more information see below.
|
||||
|
||||
- **Event Description**:
|
||||
- Detailed, optional event description.
|
||||
- Can be multiple lines/paragraphs.
|
||||
- It may contain template placeholders for arguments (e.g. `{2}`) and supported tags (see below)
|
||||
- Detailed, optional event description.
|
||||
- Can be multiple lines/paragraphs.
|
||||
- It may contain template placeholders for arguments (e.g. `{2}`) and supported tags (see below)
|
||||
|
||||
#### Arguments and Enums
|
||||
|
||||
@@ -125,35 +125,35 @@ Text format for event message description:
|
||||
|
||||
- characters can be escaped with \\
|
||||
|
||||
These have to be escaped: '\\\\', '\\<', '\\{'.
|
||||
These have to be escaped: '\\\\', '\\<', '\\{'.
|
||||
|
||||
- supported tags:
|
||||
|
||||
- Profiles: `<profile name="[!]NAME">CONTENT</profile>`
|
||||
- Profiles: `<profile name="[!]NAME">CONTENT</profile>`
|
||||
|
||||
`CONTENT` will only be shown if the name matches the configured profile.
|
||||
This can be used for example to hide developer information from end-users.
|
||||
`CONTENT` will only be shown if the name matches the configured profile.
|
||||
This can be used for example to hide developer information from end-users.
|
||||
|
||||
- URLs: `<a [href="URL"]>CONTENT</a>`.
|
||||
If `href` is not set, use `CONTENT` as `URL` (i.e.`<a>https://docs.px4.io</a>` is interpreted as `<a href="https://docs.px4.io">https://docs.px4.io</a>`)
|
||||
- URLs: `<a [href="URL"]>CONTENT</a>`.
|
||||
If `href` is not set, use `CONTENT` as `URL` (i.e.`<a>https://docs.px4.io</a>` is interpreted as `<a href="https://docs.px4.io">https://docs.px4.io</a>`)
|
||||
|
||||
- Parameters: `<param>PARAM_NAME</param>`
|
||||
- Parameters: `<param>PARAM_NAME</param>`
|
||||
|
||||
- no nested tags of the same type are allowed
|
||||
- no nested tags of the same type are allowed
|
||||
|
||||
- arguments: template placeholders that follow python syntax, with 1-based indexing (instead of 0)
|
||||
|
||||
- general form: `{ARG_IDX[:.NUM_DECIMAL_DIGITS][UNIT]}`
|
||||
- general form: `{ARG_IDX[:.NUM_DECIMAL_DIGITS][UNIT]}`
|
||||
|
||||
UNIT:
|
||||
UNIT:
|
||||
|
||||
- m: horizontal distance in meters
|
||||
- m_v: vertical distance in meters
|
||||
- m^2: area in m^2
|
||||
- m/s: speed in m/s
|
||||
- C: temperature in degrees celsius
|
||||
- m: horizontal distance in meters
|
||||
- m_v: vertical distance in meters
|
||||
- m^2: area in m^2
|
||||
- m/s: speed in m/s
|
||||
- C: temperature in degrees celsius
|
||||
|
||||
- `NUM_DECIMAL_DIGITS` only makes sense for real number arguments.
|
||||
- `NUM_DECIMAL_DIGITS` only makes sense for real number arguments.
|
||||
|
||||
## 로깅
|
||||
|
||||
|
||||
+14
-14
@@ -38,9 +38,9 @@ A frame configuration can define everything about a vehicle, from it's geometry
|
||||
When you're bringing up a new vehicle though, the frame will usually contain a fairly minimal configuration:
|
||||
|
||||
- Frames named with "Generic" define the vehicle type, number of rotors, and "placeholder" rotor positions.
|
||||
After selecting the airframe you define the actual geometry and then configure outputs.
|
||||
After selecting the airframe you define the actual geometry and then configure outputs.
|
||||
- Frames named with model/brand will define the vehicle type, number of rotors, actual rotor positions, and motor directions.
|
||||
After selecting the airframe you usually still have to configure outputs.
|
||||
After selecting the airframe you usually still have to configure outputs.
|
||||
|
||||
:::
|
||||
|
||||
@@ -52,7 +52,7 @@ This ensures that all ESC provide exactly the same output for a given input (ide
|
||||
The final step is [Motor Configuration](../config/actuators.md#motor-configuration):
|
||||
|
||||
- [Reverse any motors](../config/actuators.md#reversing-motors) that don't match the spin direction configured in the Geometry.
|
||||
For DShot ESC you can do this through the Acuator Testing UI.
|
||||
For DShot ESC you can do this through the Acuator Testing UI.
|
||||
- PWM, OneShot, and CAN ESC, set the motor input limits for disarmed, low and high speed (not needed for DShot ESC)
|
||||
|
||||
Relevant topics:
|
||||
@@ -123,14 +123,14 @@ Tuning is the final step, carried out only after most other setup and configurat
|
||||
|
||||
- [Autotune](../config/autotune_mc.md) — Automates tuning PX4 rate and attitude controllers (recommended).
|
||||
|
||||
::: info
|
||||
Automatic tuning works on frames that have reasonable authority and dynamics around all the body axes.
|
||||
It has primarily been tested on racing quads and X500, and is expected to be less effective on tricopters with a tiltable rotor.
|
||||
::: info
|
||||
Automatic tuning works on frames that have reasonable authority and dynamics around all the body axes.
|
||||
It has primarily been tested on racing quads and X500, and is expected to be less effective on tricopters with a tiltable rotor.
|
||||
|
||||
Manual tuning using these guides are only needed if there is a problem with autotune:
|
||||
Manual tuning using these guides are only needed if there is a problem with autotune:
|
||||
|
||||
- [MC PID Tuning (Manual/Basic)](../config_mc/pid_tuning_guide_multicopter_basic.md) — Manual tuning basic how to.
|
||||
- [MC PID Tuning Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
|
||||
- [MC PID Tuning (Manual/Basic)](../config_mc/pid_tuning_guide_multicopter_basic.md) — Manual tuning basic how to.
|
||||
- [MC PID Tuning Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
|
||||
|
||||
|
||||
:::
|
||||
@@ -138,7 +138,7 @@ Tuning is the final step, carried out only after most other setup and configurat
|
||||
- [MC Filter/Control Latency Tuning](../config_mc/filter_tuning.md) — Trade off control latency and noise filtering.
|
||||
|
||||
- [MC Setpoint Tuning (Trajectory Generator)](../config_mc/mc_trajectory_tuning.md)
|
||||
- [MC Jerk-limited Type Trajectory](../config_mc/mc_jerk_limited_type_trajectory.md)
|
||||
- [MC Jerk-limited Type Trajectory](../config_mc/mc_jerk_limited_type_trajectory.md)
|
||||
|
||||
- [Multicopter Racer Setup](../config_mc/racer_setup.md)
|
||||
|
||||
@@ -167,7 +167,7 @@ Yes but it must be physically feasible. E.g. if you make a quadrotor where all m
|
||||
- [Flight Controller Peripherals](../peripherals/index.md) - Setup specific sensors, optional sensors, actuators, and so on.
|
||||
- [Advanced Configuration](../advanced_config/index.md) - Factory/OEM calibration, configuring advanced features, less-common configuration.
|
||||
- Vehicle-Centric Config/Tuning:
|
||||
- **Multicopter Config/Tuning**
|
||||
- [Helicopter Config/Tuning](../config_heli/index.md)
|
||||
- [Fixed Wing Config/Tuning](../config_fw/index.md)
|
||||
- [VTOL Config/Tuning](../config_vtol/index.md)
|
||||
- **Multicopter Config/Tuning**
|
||||
- [Helicopter Config/Tuning](../config_heli/index.md)
|
||||
- [Fixed Wing Config/Tuning](../config_fw/index.md)
|
||||
- [VTOL Config/Tuning](../config_vtol/index.md)
|
||||
|
||||
@@ -26,13 +26,13 @@ ARF 키트는 PX4와 호환되는 대부분의 비행 콘트롤러를 지원합
|
||||
The Holybro [X500 V2 Kit](https://holybro.com/collections/x500-kits) includes almost all the required components:
|
||||
|
||||
- X500V2 프레임 키트
|
||||
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
||||
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
||||
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
||||
- Platform board - With mounting holes for GPS & popular companion computer
|
||||
- 이중 10mm Ø 로드 x 250mm 롱 레일 마운팅 시스템
|
||||
- 2개의 배터리 스트랩이 있는 배터리 마운트
|
||||
- 설치용 수공구
|
||||
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
||||
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
||||
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
||||
- Platform board - With mounting holes for GPS & popular companion computer
|
||||
- 이중 10mm Ø 로드 x 250mm 롱 레일 마운팅 시스템
|
||||
- 2개의 배터리 스트랩이 있는 배터리 마운트
|
||||
- 설치용 수공구
|
||||
- Holybro Motors - 2216 KV880 x6 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||
- Holybro BLHeli S ESC 20A x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||
- Propellers - 1045 x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||
@@ -93,92 +93,92 @@ Tools are included to do the assembly, however you may need:
|
||||
Estimate time to assemble is 55 min (25 minutes for frame, 30 minutes for autopilot installation/configuration)
|
||||
|
||||
1. Start by assembling the payload & battery holder.
|
||||
Push the rubbers into grippers (Do not use sharp items to push them in!).
|
||||
Next, pass the holders through the holder bars with the battery holder bases as Figure 3.
|
||||
Push the rubbers into grippers (Do not use sharp items to push them in!).
|
||||
Next, pass the holders through the holder bars with the battery holder bases as Figure 3.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 2_: Payload holder components
|
||||
_Figure 2_: Payload holder components
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 3_: Payload holder assembled
|
||||
_Figure 3_: Payload holder assembled
|
||||
|
||||
2. The next is to go for attaching the bottom plate to the payload holder.
|
||||
|
||||
You will need the parts as shown in Figure 4.
|
||||
Then mount the base for power distribution board using nylon nuts as Figure 5.
|
||||
Finally using 8 hex screws you can join the bottom plate to the payload holder (Figure 7)
|
||||
You will need the parts as shown in Figure 4.
|
||||
Then mount the base for power distribution board using nylon nuts as Figure 5.
|
||||
Finally using 8 hex screws you can join the bottom plate to the payload holder (Figure 7)
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 4_: Needed Materials
|
||||
_Figure 4_: Needed Materials
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 5_: PDB mount base
|
||||
_Figure 5_: PDB mount base
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 6_: Mounted pdb with nylon nuts
|
||||
_Figure 6_: Mounted pdb with nylon nuts
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 7_: Mounted Plate on payload holder
|
||||
_Figure 7_: Mounted Plate on payload holder
|
||||
|
||||
3. Let's gather the stuff needed for mounting landing gear as Figure 8.
|
||||
Use the hex screws to join landing gears to the bottom plate.
|
||||
You also need to open three hex screws on each of the leg stands so you can push them into carbon fiber pipes.
|
||||
Do not forget to tighten them back again.
|
||||
Use the hex screws to join landing gears to the bottom plate.
|
||||
You also need to open three hex screws on each of the leg stands so you can push them into carbon fiber pipes.
|
||||
Do not forget to tighten them back again.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 8_: Required parts for landing gear attachment
|
||||
_Figure 8_: Required parts for landing gear attachment
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 9_: Landing gear attachment to the body
|
||||
_Figure 9_: Landing gear attachment to the body
|
||||
|
||||
4. We will gather all the arms now to mount the top plate.
|
||||
Please pay attention that the motor numbers on arms are a match with the ones mentioned on the top plate.
|
||||
Fortunately, motors are mounted and ESCs have been connected in advance.
|
||||
Start by passing through all the screws as you have the arms fixed in their own places (They have a guide as shown in Figure 11 to ensure they are in place) and tighten all nylon nuts a bit.
|
||||
Then you can connect XT30 power connectors to the power board.
|
||||
Please keep in mind that the signal wires have to be passed through the top plate such that we can connect them later to Pixhawk.
|
||||
Please pay attention that the motor numbers on arms are a match with the ones mentioned on the top plate.
|
||||
Fortunately, motors are mounted and ESCs have been connected in advance.
|
||||
Start by passing through all the screws as you have the arms fixed in their own places (They have a guide as shown in Figure 11 to ensure they are in place) and tighten all nylon nuts a bit.
|
||||
Then you can connect XT30 power connectors to the power board.
|
||||
Please keep in mind that the signal wires have to be passed through the top plate such that we can connect them later to Pixhawk.
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/needed_stuff_top_plate.png" width="700" title="Arms and top plate materials">
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/needed_stuff_top_plate.png" width="700" title="Arms and top plate materials">
|
||||
|
||||
_Figure 10_: Connecting arms needed materials.
|
||||
_Figure 10_: Connecting arms needed materials.
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/guide_for_arm_mount.png" width="700" title="Guide for the arms mount">
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/guide_for_arm_mount.png" width="700" title="Guide for the arms mount">
|
||||
|
||||
_Figure 11_: Guide for the arms mount
|
||||
_Figure 11_: Guide for the arms mount
|
||||
|
||||
5. Tighten all 16 screws and nuts by using both hex wrench and nut driver.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 12_: Mounted top plate
|
||||
_Figure 12_: Mounted top plate
|
||||
|
||||
6. Next you can mount your pixhawk on the top plate by using the stickers.
|
||||
It is recommended to have the direction of your Pixhawk's arrow the same as the one mentioned on the top plate.
|
||||
It is recommended to have the direction of your Pixhawk's arrow the same as the one mentioned on the top plate.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 13_: Sticker tapes on Pixhawk
|
||||
_Figure 13_: Sticker tapes on Pixhawk
|
||||
|
||||
7. If you want to mount the GPS on the companion computer plate, you can now secure the GPS mount onto it using 4 screws and nuts.
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/gps_mount_plate.png" width="400" title="Secure GPS mount onto companion plate">
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/gps_mount_plate.png" width="400" title="Secure GPS mount onto companion plate">
|
||||
|
||||
_Figure 14_: Secure GPS mount onto companion plate
|
||||
_Figure 14_: Secure GPS mount onto companion plate
|
||||
|
||||
8. 테이프를 사용하여 GPS를 GPS 마스트 상단에 붙이고 GPS 마스트를 장착합니다.
|
||||
Make sure the arrow on the gps is pointing forward (Figure 15).
|
||||
Make sure the arrow on the gps is pointing forward (Figure 15).
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_holybro_pixhawk4/gps2.jpg" width="400" title="Figure 16: GPS and mast">
|
||||
<img src="../../assets/airframes/multicopter/x500_holybro_pixhawk4/gps2.jpg" width="400" title="Figure 16: GPS and mast">
|
||||
|
||||
_Figure 15_: GPS and mast
|
||||
_Figure 15_: GPS and mast
|
||||
|
||||
9. Finally, you can connect the Pixhawk interfaces such as telemetry radio to 'TELEM1' and motors signal cables accordingly.
|
||||
|
||||
@@ -204,14 +204,14 @@ First update the firmware, airframe, and actuator mappings:
|
||||
|
||||
- [Airframe](../config/airframe.md)
|
||||
|
||||
You will need to select the _Holybro X500 V2_ airframe (**Quadrotor x > Holybro 500 V2**)
|
||||
You will need to select the _Holybro X500 V2_ airframe (**Quadrotor x > Holybro 500 V2**)
|
||||
|
||||

|
||||

|
||||
|
||||
- [Actuators](../config/actuators.md)
|
||||
- You should not need to update the vehicle geometry (as this is a preconfigured airframe).
|
||||
- Assign actuator functions to outputs to match your wiring.
|
||||
- Test the configuration using the sliders.
|
||||
- You should not need to update the vehicle geometry (as this is a preconfigured airframe).
|
||||
- Assign actuator functions to outputs to match your wiring.
|
||||
- Test the configuration using the sliders.
|
||||
|
||||
그리고, 설치후에 필수적인 설정 작업과 보정 작업을 진행하여야 합니다.
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ Key airframe features:
|
||||
- Removable V tail or conventional tail options included
|
||||
- Threaded inserts in the wings and fuselage top for external mounting
|
||||
- Numerous mounting features
|
||||
- Top antenna hole
|
||||
- Top GPS cover
|
||||
- Side "T" antenna mounts
|
||||
- Rear electronics tray
|
||||
- Front facing "action cam" cutout
|
||||
- Front facing FPV camera cutout
|
||||
- Top antenna hole
|
||||
- Top GPS cover
|
||||
- Side "T" antenna mounts
|
||||
- Rear electronics tray
|
||||
- Front facing "action cam" cutout
|
||||
- Front facing FPV camera cutout
|
||||
- Removable wings
|
||||
- Low stall speed
|
||||
- Gentle handling
|
||||
@@ -69,10 +69,10 @@ Key build features
|
||||
- [6s2p 18650 LiIon flight battery](https://www.upgradeenergytech.com/product-page/6s-22-2v-5600mah-30c-dark-lithium-liion-drone-battery) (select XT60 connector)
|
||||
|
||||
- [Custom designed 3D printed parts](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/rd2_3d_printed_parts.zip)
|
||||
- ARK6X carrier mount
|
||||
- Holybro Pixhawk 5x carrier mount
|
||||
- FPV pod and camera mount
|
||||
- Pitot static probe "plug" adapter
|
||||
- ARK6X carrier mount
|
||||
- Holybro Pixhawk 5x carrier mount
|
||||
- FPV pod and camera mount
|
||||
- Pitot static probe "plug" adapter
|
||||
|
||||
- [Custom designed power distribution PCB](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/xt30_power_distro_pcb.zip)
|
||||
|
||||
@@ -426,15 +426,15 @@ Prior to the first flight, a comprehensive preflight must be conducted.
|
||||
I recommend checking the following items:
|
||||
|
||||
- Sensor calibration (QGC)
|
||||
- Mag calibration
|
||||
- Accelerometer calibration
|
||||
- 대기속도 보정
|
||||
- Level horizon calibration
|
||||
- Mag calibration
|
||||
- Accelerometer calibration
|
||||
- 대기속도 보정
|
||||
- Level horizon calibration
|
||||
- Check control surface deflection
|
||||
- Right stick -> Right aileron goes up, left aileron goes down
|
||||
- Left stick -> Left aileron goes up, right aileron goes down
|
||||
- Stick back -> elevator goes up
|
||||
-Stick forward -> elevator goes down
|
||||
-Stick forward -> elevator goes down
|
||||
- Left rudder -> Rudder goes left
|
||||
- Right rudder -> Rudder goes right
|
||||
- Check Px4 inputs (in `stabilized mode`)
|
||||
|
||||
@@ -98,11 +98,11 @@ The mapping between flight controller outputs and specific controls/motors depen
|
||||
Assembly information is covered in several sections:
|
||||
|
||||
- [Basic Assembly](../assembly/index.md) contains topics shows the setup of core components for a number of popular [flight controllers](../flight_controller/index.md).
|
||||
가이드가 없는 비행 컨트롤러는 일반적으로 거의 같은 방법으로 설정됩니다(거의 항상 유사한 설정 가이드가 포함됨).
|
||||
가이드가 없는 비행 컨트롤러는 일반적으로 거의 같은 방법으로 설정됩니다(거의 항상 유사한 설정 가이드가 포함됨).
|
||||
- [Peripherals](../peripherals/index.md) contains information about other peripherals, including [Airspeed Sensors](../sensor/airspeed.md).
|
||||
- [Airframes Reference > VTOL](../airframes/airframe_reference.md#vtol) explains which flight controller outputs must be connected to different flight controls for each airframe configuration:
|
||||
- 정의된 기체의 구성을 선택하십시오. 이는 비행을 위하여 사전 튜닝이 충분하기 때문입니다(미세 조정만 필요할 수 있음).
|
||||
- 그렇지 않으면, 기체와 일치하는 "일반 기체"를 선택하십시오.
|
||||
- 정의된 기체의 구성을 선택하십시오. 이는 비행을 위하여 사전 튜닝이 충분하기 때문입니다(미세 조정만 필요할 수 있음).
|
||||
- 그렇지 않으면, 기체와 일치하는 "일반 기체"를 선택하십시오.
|
||||
|
||||
In addition, build logs showing how others have set up different types of vehicles are provided as sub topics.
|
||||
For example see [FunCub QuadPlane](../frames_vtol/vtol_quadplane_fun_cub_vtol_pixhawk.md).
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
# dds_topics.yaml — PX4 Topics Exposed to ROS 2
|
||||
|
||||
:::info
|
||||
This document is [auto-generated](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/msg/generate_msg_docs.py) from the source code.
|
||||
:::
|
||||
|
||||
The [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) file specifies which uORB message definitions are compiled into the [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) module when [PX4 is built](../middleware/uxrce_dds.md#code-generation), and hence which topics are available for ROS 2 applications to subscribe or publish (by default).
|
||||
|
||||
This document shows a markdown-rendered version of [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml), listing the publications, subscriptions, and so on.
|
||||
|
||||
## Publications
|
||||
|
||||
| Topic | 형식 | Rate Limit |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
|
||||
| `/fmu/out/register_ext_component_reply` | [px4_msgs::msg::RegisterExtComponentReply](../msg_docs/RegisterExtComponentReply.md) | |
|
||||
| `/fmu/out/arming_check_request` | [px4_msgs::msg::ArmingCheckRequest](../msg_docs/ArmingCheckRequest.md) | 5.0 |
|
||||
| `/fmu/out/mode_completed` | [px4_msgs::msg::ModeCompleted](../msg_docs/ModeCompleted.md) | 50.0 |
|
||||
| `/fmu/out/battery_status` | [px4_msgs::msg::BatteryStatus](../msg_docs/BatteryStatus.md) | 1.0 |
|
||||
| `/fmu/out/collision_constraints` | [px4_msgs::msg::CollisionConstraints](../msg_docs/CollisionConstraints.md) | 50.0 |
|
||||
| `/fmu/out/estimator_status_flags` | [px4_msgs::msg::EstimatorStatusFlags](../msg_docs/EstimatorStatusFlags.md) | 5.0 |
|
||||
| `/fmu/out/failsafe_flags` | [px4_msgs::msg::FailsafeFlags](../msg_docs/FailsafeFlags.md) | 5.0 |
|
||||
| `/fmu/out/manual_control_setpoint` | [px4_msgs::msg::ManualControlSetpoint](../msg_docs/ManualControlSetpoint.md) | 25.0 |
|
||||
| `/fmu/out/message_format_response` | [px4_msgs::msg::MessageFormatResponse](../msg_docs/MessageFormatResponse.md) | |
|
||||
| `/fmu/out/position_setpoint_triplet` | [px4_msgs::msg::PositionSetpointTriplet](../msg_docs/PositionSetpointTriplet.md) | 5.0 |
|
||||
| `/fmu/out/sensor_combined` | [px4_msgs::msg::SensorCombined](../msg_docs/SensorCombined.md) | |
|
||||
| `/fmu/out/timesync_status` | [px4_msgs::msg::TimesyncStatus](../msg_docs/TimesyncStatus.md) | 10.0 |
|
||||
| `/fmu/out/vehicle_land_detected` | [px4_msgs::msg::VehicleLandDetected](../msg_docs/VehicleLandDetected.md) | 5.0 |
|
||||
| `/fmu/out/vehicle_attitude` | [px4_msgs::msg::VehicleAttitude](../msg_docs/VehicleAttitude.md) | |
|
||||
| `/fmu/out/vehicle_control_mode` | [px4_msgs::msg::VehicleControlMode](../msg_docs/VehicleControlMode.md) | 50.0 |
|
||||
| `/fmu/out/vehicle_command_ack` | [px4_msgs::msg::VehicleCommandAck](../msg_docs/VehicleCommandAck.md) | |
|
||||
| `/fmu/out/vehicle_global_position` | [px4_msgs::msg::VehicleGlobalPosition](../msg_docs/VehicleGlobalPosition.md) | 50.0 |
|
||||
| `/fmu/out/vehicle_gps_position` | [px4_msgs::msg::SensorGps](../msg_docs/SensorGps.md) | 50.0 |
|
||||
| `/fmu/out/vehicle_local_position` | [px4_msgs::msg::VehicleLocalPosition](../msg_docs/VehicleLocalPosition.md) | 50.0 |
|
||||
| `/fmu/out/vehicle_odometry` | [px4_msgs::msg::VehicleOdometry](../msg_docs/VehicleOdometry.md) | |
|
||||
| `/fmu/out/vehicle_status` | [px4_msgs::msg::VehicleStatus](../msg_docs/VehicleStatus.md) | 5.0 |
|
||||
| `/fmu/out/airspeed_validated` | [px4_msgs::msg::AirspeedValidated](../msg_docs/AirspeedValidated.md) | 50.0 |
|
||||
| `/fmu/out/vtol_vehicle_status` | [px4_msgs::msg::VtolVehicleStatus](../msg_docs/VtolVehicleStatus.md) | |
|
||||
| `/fmu/out/home_position` | [px4_msgs::msg::HomePosition](../msg_docs/HomePosition.md) | 5.0 |
|
||||
|
||||
## Subscriptions
|
||||
|
||||
| Topic | 형식 |
|
||||
| ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| /fmu/in/register_ext_component_request | [px4_msgs::msg::RegisterExtComponentRequest](../msg_docs/RegisterExtComponentRequest.md) |
|
||||
| /fmu/in/unregister_ext_component | [px4_msgs::msg::UnregisterExtComponent](../msg_docs/UnregisterExtComponent.md) |
|
||||
| /fmu/in/config_overrides_request | [px4_msgs::msg::ConfigOverrides](../msg_docs/ConfigOverrides.md) |
|
||||
| /fmu/in/arming_check_reply | [px4_msgs::msg::ArmingCheckReply](../msg_docs/ArmingCheckReply.md) |
|
||||
| /fmu/in/message_format_request | [px4_msgs::msg::MessageFormatRequest](../msg_docs/MessageFormatRequest.md) |
|
||||
| /fmu/in/mode_completed | [px4_msgs::msg::ModeCompleted](../msg_docs/ModeCompleted.md) |
|
||||
| /fmu/in/config_control_setpoints | [px4_msgs::msg::VehicleControlMode](../msg_docs/VehicleControlMode.md) |
|
||||
| /fmu/in/distance_sensor | [px4_msgs::msg::DistanceSensor](../msg_docs/DistanceSensor.md) |
|
||||
| /fmu/in/manual_control_input | [px4_msgs::msg::ManualControlSetpoint](../msg_docs/ManualControlSetpoint.md) |
|
||||
| /fmu/in/offboard_control_mode | [px4_msgs::msg::OffboardControlMode](../msg_docs/OffboardControlMode.md) |
|
||||
| /fmu/in/onboard_computer_status | [px4_msgs::msg::OnboardComputerStatus](../msg_docs/OnboardComputerStatus.md) |
|
||||
| /fmu/in/obstacle_distance | [px4_msgs::msg::ObstacleDistance](../msg_docs/ObstacleDistance.md) |
|
||||
| /fmu/in/sensor_optical_flow | [px4_msgs::msg::SensorOpticalFlow](../msg_docs/SensorOpticalFlow.md) |
|
||||
| /fmu/in/goto_setpoint | [px4_msgs::msg::GotoSetpoint](../msg_docs/GotoSetpoint.md) |
|
||||
| /fmu/in/telemetry_status | [px4_msgs::msg::TelemetryStatus](../msg_docs/TelemetryStatus.md) |
|
||||
| /fmu/in/trajectory_setpoint | [px4_msgs::msg::TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) |
|
||||
| /fmu/in/vehicle_attitude_setpoint | [px4_msgs::msg::VehicleAttitudeSetpoint](../msg_docs/VehicleAttitudeSetpoint.md) |
|
||||
| /fmu/in/vehicle_mocap_odometry | [px4_msgs::msg::VehicleOdometry](../msg_docs/VehicleOdometry.md) |
|
||||
| /fmu/in/vehicle_rates_setpoint | [px4_msgs::msg::VehicleRatesSetpoint](../msg_docs/VehicleRatesSetpoint.md) |
|
||||
| /fmu/in/vehicle_visual_odometry | [px4_msgs::msg::VehicleOdometry](../msg_docs/VehicleOdometry.md) |
|
||||
| /fmu/in/vehicle_command | [px4_msgs::msg::VehicleCommand](../msg_docs/VehicleCommand.md) |
|
||||
| /fmu/in/vehicle_command_mode_executor | [px4_msgs::msg::VehicleCommand](../msg_docs/VehicleCommand.md) |
|
||||
| /fmu/in/vehicle_thrust_setpoint | [px4_msgs::msg::VehicleThrustSetpoint](../msg_docs/VehicleThrustSetpoint.md) |
|
||||
| /fmu/in/vehicle_torque_setpoint | [px4_msgs::msg::VehicleTorqueSetpoint](../msg_docs/VehicleTorqueSetpoint.md) |
|
||||
| /fmu/in/actuator_motors | [px4_msgs::msg::ActuatorMotors](../msg_docs/ActuatorMotors.md) |
|
||||
| /fmu/in/actuator_servos | [px4_msgs::msg::ActuatorServos](../msg_docs/ActuatorServos.md) |
|
||||
| /fmu/in/aux_global_position | [px4_msgs::msg::VehicleGlobalPosition](../msg_docs/VehicleGlobalPosition.md) |
|
||||
| /fmu/in/fixed_wing_longitudinal_setpoint | [px4_msgs::msg::FixedWingLongitudinalSetpoint](../msg_docs/FixedWingLongitudinalSetpoint.md) |
|
||||
| /fmu/in/fixed_wing_lateral_setpoint | [px4_msgs::msg::FixedWingLateralSetpoint](../msg_docs/FixedWingLateralSetpoint.md) |
|
||||
| /fmu/in/longitudinal_control_configuration | [px4_msgs::msg::LongitudinalControlConfiguration](../msg_docs/LongitudinalControlConfiguration.md) |
|
||||
| /fmu/in/lateral_control_configuration | [px4_msgs::msg::LateralControlConfiguration](../msg_docs/LateralControlConfiguration.md) |
|
||||
|
||||
## Subscriptions Multi
|
||||
|
||||
None
|
||||
|
||||
## Not Exported
|
||||
|
||||
These messages are not listed in the yaml file.
|
||||
They are not build into the module, and hence are neither published or subscribed.
|
||||
|
||||
:::details
|
||||
See messages
|
||||
|
||||
- [SensorCorrection](../msg_docs/SensorCorrection.md)
|
||||
- [ActuatorOutputs](../msg_docs/ActuatorOutputs.md)
|
||||
- [FixedWingRunwayControl](../msg_docs/FixedWingRunwayControl.md)
|
||||
- [EstimatorInnovations](../msg_docs/EstimatorInnovations.md)
|
||||
- [FlightPhaseEstimation](../msg_docs/FlightPhaseEstimation.md)
|
||||
- [PurePursuitStatus](../msg_docs/PurePursuitStatus.md)
|
||||
- [Px4ioStatus](../msg_docs/Px4ioStatus.md)
|
||||
- [SatelliteInfo](../msg_docs/SatelliteInfo.md)
|
||||
- [GeofenceResult](../msg_docs/GeofenceResult.md)
|
||||
- [GimbalManagerStatus](../msg_docs/GimbalManagerStatus.md)
|
||||
- [ManualControlSwitches](../msg_docs/ManualControlSwitches.md)
|
||||
- [OpenDroneIdSelfId](../msg_docs/OpenDroneIdSelfId.md)
|
||||
- [OpenDroneIdSystem](../msg_docs/OpenDroneIdSystem.md)
|
||||
- [EventV0](../msg_docs/EventV0.md)
|
||||
- [QshellRetval](../msg_docs/QshellRetval.md)
|
||||
- [RoverThrottleSetpoint](../msg_docs/RoverThrottleSetpoint.md)
|
||||
- [AirspeedValidatedV0](../msg_docs/AirspeedValidatedV0.md)
|
||||
- [RcChannels](../msg_docs/RcChannels.md)
|
||||
- [SensorAccel](../msg_docs/SensorAccel.md)
|
||||
- [GimbalDeviceAttitudeStatus](../msg_docs/GimbalDeviceAttitudeStatus.md)
|
||||
- [EscStatus](../msg_docs/EscStatus.md)
|
||||
- [RoverAttitudeSetpoint](../msg_docs/RoverAttitudeSetpoint.md)
|
||||
- [RateCtrlStatus](../msg_docs/RateCtrlStatus.md)
|
||||
- [AirspeedWind](../msg_docs/AirspeedWind.md)
|
||||
- [InputRc](../msg_docs/InputRc.md)
|
||||
- [GpioIn](../msg_docs/GpioIn.md)
|
||||
- [LaunchDetectionStatus](../msg_docs/LaunchDetectionStatus.md)
|
||||
- [VehicleImu](../msg_docs/VehicleImu.md)
|
||||
- [Event](../msg_docs/Event.md)
|
||||
- [SensorUwb](../msg_docs/SensorUwb.md)
|
||||
- [ActuatorServosTrim](../msg_docs/ActuatorServosTrim.md)
|
||||
- [DatamanResponse](../msg_docs/DatamanResponse.md)
|
||||
- [OrbTest](../msg_docs/OrbTest.md)
|
||||
- [VehicleLocalPositionSetpoint](../msg_docs/VehicleLocalPositionSetpoint.md)
|
||||
- [VehicleAngularVelocity](../msg_docs/VehicleAngularVelocity.md)
|
||||
- [FollowTargetStatus](../msg_docs/FollowTargetStatus.md)
|
||||
- [NormalizedUnsignedSetpoint](../msg_docs/NormalizedUnsignedSetpoint.md)
|
||||
- [YawEstimatorStatus](../msg_docs/YawEstimatorStatus.md)
|
||||
- [TakeoffStatus](../msg_docs/TakeoffStatus.md)
|
||||
- [UlogStreamAck](../msg_docs/UlogStreamAck.md)
|
||||
- [OrbTestLarge](../msg_docs/OrbTestLarge.md)
|
||||
- [RoverSteeringSetpoint](../msg_docs/RoverSteeringSetpoint.md)
|
||||
- [CameraCapture](../msg_docs/CameraCapture.md)
|
||||
- [VehicleRoi](../msg_docs/VehicleRoi.md)
|
||||
- [ActuatorArmed](../msg_docs/ActuatorArmed.md)
|
||||
- [FixedWingLateralGuidanceStatus](../msg_docs/FixedWingLateralGuidanceStatus.md)
|
||||
- [ParameterSetValueResponse](../msg_docs/ParameterSetValueResponse.md)
|
||||
- [GeofenceStatus](../msg_docs/GeofenceStatus.md)
|
||||
- [VehicleAngularAccelerationSetpoint](../msg_docs/VehicleAngularAccelerationSetpoint.md)
|
||||
- [SensorGnssRelative](../msg_docs/SensorGnssRelative.md)
|
||||
- [PowerMonitor](../msg_docs/PowerMonitor.md)
|
||||
- [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md)
|
||||
- [ParameterResetRequest](../msg_docs/ParameterResetRequest.md)
|
||||
- [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md)
|
||||
- [TecsStatus](../msg_docs/TecsStatus.md)
|
||||
- [EstimatorSelectorStatus](../msg_docs/EstimatorSelectorStatus.md)
|
||||
- [CanInterfaceStatus](../msg_docs/CanInterfaceStatus.md)
|
||||
- [Ping](../msg_docs/Ping.md)
|
||||
- [LedControl](../msg_docs/LedControl.md)
|
||||
- [Wind](../msg_docs/Wind.md)
|
||||
- [VehicleStatusV0](../msg_docs/VehicleStatusV0.md)
|
||||
- [ActuatorTest](../msg_docs/ActuatorTest.md)
|
||||
- [IridiumsbdStatus](../msg_docs/IridiumsbdStatus.md)
|
||||
- [FailureDetectorStatus](../msg_docs/FailureDetectorStatus.md)
|
||||
- [GimbalManagerSetAttitude](../msg_docs/GimbalManagerSetAttitude.md)
|
||||
- [Gripper](../msg_docs/Gripper.md)
|
||||
- [SensorMag](../msg_docs/SensorMag.md)
|
||||
- [DebugValue](../msg_docs/DebugValue.md)
|
||||
- [SensorPreflightMag](../msg_docs/SensorPreflightMag.md)
|
||||
- [RcParameterMap](../msg_docs/RcParameterMap.md)
|
||||
- [LandingGear](../msg_docs/LandingGear.md)
|
||||
- [GimbalDeviceInformation](../msg_docs/GimbalDeviceInformation.md)
|
||||
- [VehicleOpticalFlow](../msg_docs/VehicleOpticalFlow.md)
|
||||
- [UlogStream](../msg_docs/UlogStream.md)
|
||||
- [GimbalControls](../msg_docs/GimbalControls.md)
|
||||
- [RoverRateSetpoint](../msg_docs/RoverRateSetpoint.md)
|
||||
- [LogMessage](../msg_docs/LogMessage.md)
|
||||
- [RoverVelocitySetpoint](../msg_docs/RoverVelocitySetpoint.md)
|
||||
- [GpioOut](../msg_docs/GpioOut.md)
|
||||
- [TaskStackInfo](../msg_docs/TaskStackInfo.md)
|
||||
- [VelocityLimits](../msg_docs/VelocityLimits.md)
|
||||
- [MagWorkerData](../msg_docs/MagWorkerData.md)
|
||||
- [ParameterUpdate](../msg_docs/ParameterUpdate.md)
|
||||
- [TrajectorySetpoint6dof](../msg_docs/TrajectorySetpoint6dof.md)
|
||||
- [SensorBaro](../msg_docs/SensorBaro.md)
|
||||
- [VehicleImuStatus](../msg_docs/VehicleImuStatus.md)
|
||||
- [InternalCombustionEngineStatus](../msg_docs/InternalCombustionEngineStatus.md)
|
||||
- [VehicleOpticalFlowVel](../msg_docs/VehicleOpticalFlowVel.md)
|
||||
- [GimbalManagerSetManualControl](../msg_docs/GimbalManagerSetManualControl.md)
|
||||
- [Rpm](../msg_docs/Rpm.md)
|
||||
- [MagnetometerBiasEstimate](../msg_docs/MagnetometerBiasEstimate.md)
|
||||
- [MountOrientation](../msg_docs/MountOrientation.md)
|
||||
- [ActionRequest](../msg_docs/ActionRequest.md)
|
||||
- [OpenDroneIdArmStatus](../msg_docs/OpenDroneIdArmStatus.md)
|
||||
- [SensorAccelFifo](../msg_docs/SensorAccelFifo.md)
|
||||
- [LoggerStatus](../msg_docs/LoggerStatus.md)
|
||||
- [GeneratorStatus](../msg_docs/GeneratorStatus.md)
|
||||
- [InternalCombustionEngineControl](../msg_docs/InternalCombustionEngineControl.md)
|
||||
- [Ekf2Timestamps](../msg_docs/Ekf2Timestamps.md)
|
||||
- [LandingTargetPose](../msg_docs/LandingTargetPose.md)
|
||||
- [PositionControllerLandingStatus](../msg_docs/PositionControllerLandingStatus.md)
|
||||
- [UavcanParameterValue](../msg_docs/UavcanParameterValue.md)
|
||||
- [OrbitStatus](../msg_docs/OrbitStatus.md)
|
||||
- [PositionControllerStatus](../msg_docs/PositionControllerStatus.md)
|
||||
- [EstimatorStatus](../msg_docs/EstimatorStatus.md)
|
||||
- [DatamanRequest](../msg_docs/DatamanRequest.md)
|
||||
- [HoverThrustEstimate](../msg_docs/HoverThrustEstimate.md)
|
||||
- [FixedWingLateralStatus](../msg_docs/FixedWingLateralStatus.md)
|
||||
- [NavigatorMissionItem](../msg_docs/NavigatorMissionItem.md)
|
||||
- [Cpuload](../msg_docs/Cpuload.md)
|
||||
- [EstimatorAidSource3d](../msg_docs/EstimatorAidSource3d.md)
|
||||
- [RoverRateStatus](../msg_docs/RoverRateStatus.md)
|
||||
- [EscReport](../msg_docs/EscReport.md)
|
||||
- [DebugArray](../msg_docs/DebugArray.md)
|
||||
- [ControlAllocatorStatus](../msg_docs/ControlAllocatorStatus.md)
|
||||
- [SensorHygrometer](../msg_docs/SensorHygrometer.md)
|
||||
- [EstimatorSensorBias](../msg_docs/EstimatorSensorBias.md)
|
||||
- [EstimatorBias3d](../msg_docs/EstimatorBias3d.md)
|
||||
- [GimbalManagerInformation](../msg_docs/GimbalManagerInformation.md)
|
||||
- [QshellReq](../msg_docs/QshellReq.md)
|
||||
- [CameraStatus](../msg_docs/CameraStatus.md)
|
||||
- [GpsInjectData](../msg_docs/GpsInjectData.md)
|
||||
- [FigureEightStatus](../msg_docs/FigureEightStatus.md)
|
||||
- [TransponderReport](../msg_docs/TransponderReport.md)
|
||||
- [UavcanParameterRequest](../msg_docs/UavcanParameterRequest.md)
|
||||
- [MavlinkLog](../msg_docs/MavlinkLog.md)
|
||||
- [EstimatorGpsStatus](../msg_docs/EstimatorGpsStatus.md)
|
||||
- [FuelTankStatus](../msg_docs/FuelTankStatus.md)
|
||||
- [Mission](../msg_docs/Mission.md)
|
||||
- [PositionSetpoint](../msg_docs/PositionSetpoint.md)
|
||||
- [MissionResult](../msg_docs/MissionResult.md)
|
||||
- [EstimatorEventFlags](../msg_docs/EstimatorEventFlags.md)
|
||||
- [VehicleMagnetometer](../msg_docs/VehicleMagnetometer.md)
|
||||
- [MavlinkTunnel](../msg_docs/MavlinkTunnel.md)
|
||||
- [DifferentialPressure](../msg_docs/DifferentialPressure.md)
|
||||
- [CellularStatus](../msg_docs/CellularStatus.md)
|
||||
- [GpsDump](../msg_docs/GpsDump.md)
|
||||
- [GimbalDeviceSetAttitude](../msg_docs/GimbalDeviceSetAttitude.md)
|
||||
- [ArmingCheckReplyV0](../msg_docs/ArmingCheckReplyV0.md)
|
||||
- [NavigatorStatus](../msg_docs/NavigatorStatus.md)
|
||||
- [RoverPositionSetpoint](../msg_docs/RoverPositionSetpoint.md)
|
||||
- [FollowTarget](../msg_docs/FollowTarget.md)
|
||||
- [SensorsStatusImu](../msg_docs/SensorsStatusImu.md)
|
||||
- [EstimatorStates](../msg_docs/EstimatorStates.md)
|
||||
- [SensorGyro](../msg_docs/SensorGyro.md)
|
||||
- [SensorAirflow](../msg_docs/SensorAirflow.md)
|
||||
- [ButtonEvent](../msg_docs/ButtonEvent.md)
|
||||
- [DebugKeyValue](../msg_docs/DebugKeyValue.md)
|
||||
- [GpioConfig](../msg_docs/GpioConfig.md)
|
||||
- [CameraTrigger](../msg_docs/CameraTrigger.md)
|
||||
- [LandingGearWheel](../msg_docs/LandingGearWheel.md)
|
||||
- [VehicleConstraints](../msg_docs/VehicleConstraints.md)
|
||||
- [HealthReport](../msg_docs/HealthReport.md)
|
||||
- [PowerButtonState](../msg_docs/PowerButtonState.md)
|
||||
- [RadioStatus](../msg_docs/RadioStatus.md)
|
||||
- [SensorGyroFifo](../msg_docs/SensorGyroFifo.md)
|
||||
- [EstimatorBias](../msg_docs/EstimatorBias.md)
|
||||
- [DebugVect](../msg_docs/DebugVect.md)
|
||||
- [DistanceSensorModeChangeRequest](../msg_docs/DistanceSensorModeChangeRequest.md)
|
||||
- [RtlTimeEstimate](../msg_docs/RtlTimeEstimate.md)
|
||||
- [PpsCapture](../msg_docs/PpsCapture.md)
|
||||
- [SensorSelection](../msg_docs/SensorSelection.md)
|
||||
- [SystemPower](../msg_docs/SystemPower.md)
|
||||
- [ActuatorControlsStatus](../msg_docs/ActuatorControlsStatus.md)
|
||||
- [SensorGyroFft](../msg_docs/SensorGyroFft.md)
|
||||
- [VehicleAirData](../msg_docs/VehicleAirData.md)
|
||||
- [FollowTargetEstimator](../msg_docs/FollowTargetEstimator.md)
|
||||
- [ParameterSetUsedRequest](../msg_docs/ParameterSetUsedRequest.md)
|
||||
- [GpioRequest](../msg_docs/GpioRequest.md)
|
||||
- [OpenDroneIdOperatorId](../msg_docs/OpenDroneIdOperatorId.md)
|
||||
- [RtlStatus](../msg_docs/RtlStatus.md)
|
||||
- [Airspeed](../msg_docs/Airspeed.md)
|
||||
- [VehicleAcceleration](../msg_docs/VehicleAcceleration.md)
|
||||
- [ParameterSetValueRequest](../msg_docs/ParameterSetValueRequest.md)
|
||||
- [IrlockReport](../msg_docs/IrlockReport.md)
|
||||
- [HeaterStatus](../msg_docs/HeaterStatus.md)
|
||||
- [AdcReport](../msg_docs/AdcReport.md)
|
||||
- [PwmInput](../msg_docs/PwmInput.md)
|
||||
- [TiltrotorExtraControls](../msg_docs/TiltrotorExtraControls.md)
|
||||
- [EstimatorAidSource1d](../msg_docs/EstimatorAidSource1d.md)
|
||||
- [OrbTestMedium](../msg_docs/OrbTestMedium.md)
|
||||
- [VehicleAttitudeSetpointV0](../msg_docs/VehicleAttitudeSetpointV0.md)
|
||||
- [EstimatorAidSource2d](../msg_docs/EstimatorAidSource2d.md)
|
||||
- [TuneControl](../msg_docs/TuneControl.md)
|
||||
- [WheelEncoders](../msg_docs/WheelEncoders.md)
|
||||
- [AutotuneAttitudeControlStatus](../msg_docs/AutotuneAttitudeControlStatus.md)
|
||||
- [LandingTargetInnovations](../msg_docs/LandingTargetInnovations.md)
|
||||
- [SensorsStatus](../msg_docs/SensorsStatus.md)
|
||||
|
||||
:::
|
||||
@@ -38,7 +38,7 @@ The PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) is gen
|
||||
The agent has no dependency on client code.
|
||||
It can be built standalone or in a ROS 2 workspace, or installed as a snap package on Ubuntu.
|
||||
|
||||
When PX4 is built, a code generator uses the uORB message definitions in the source tree ([PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg)) to compile support for the subset of uORB topics in [PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) into [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client).
|
||||
When PX4 is built, a code generator uses the uORB message definitions in the source tree ([PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg)) to compile support for the subset of uORB topics in [/src/modules/uxrce_dds_client/dds_topics.yaml](../middleware/dds_topics.md) into [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client).
|
||||
|
||||
PX4 main or release builds automatically export the set of uORB messages definitions in the build to an associated branch in [PX4/px4_msgs](https://github.com/PX4/px4_msgs).
|
||||
|
||||
@@ -326,13 +326,11 @@ ROS_DOMAIN_ID=3 PX4_UXRCE_DDS_PORT=9999 PX4_UXRCE_DDS_NS=drone make px4_sitl gz_
|
||||
|
||||
## Supported uORB Messages
|
||||
|
||||
The set of [PX4 uORB topics](../msg_docs/index.md) that are exposed through the client are set in [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml).
|
||||
The set of [PX4 uORB topics](../msg_docs/index.md) that are exposed through the client are set in [dds_topics.yaml](../middleware/dds_topics.md).
|
||||
|
||||
The topics are release specific (support is compiled into [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) at build time).
|
||||
While most releases should support a very similar set of messages, to be certain you would need to check the yaml file for your particular release.
|
||||
|
||||
<!-- Jublish the set we use?: https://github.com/PX4/px4_msgs/issues/22 -->
|
||||
|
||||
Note that ROS 2/DDS needs to have the _same_ message definitions that were used to create the uXRCE-DDS client module in the PX4 Firmware in order to interpret the messages.
|
||||
The message definitions are stored in the ROS 2 interface package [PX4/px4_msgs](https://github.com/PX4/px4_msgs), and they are automatically synchronized by CI on the `main` and release branches.
|
||||
Note that all the messages from PX4 source code are present in the repository, but only those listed in `dds_topics.yaml` will be available as ROS 2 topics.
|
||||
@@ -349,21 +347,21 @@ Therefore,
|
||||
```
|
||||
|
||||
::: info
|
||||
Technically, [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) completely defines the relationship between PX4 uORB topics and ROS 2 messages.
|
||||
Technically, [dds_topics.yaml](../middleware/dds_topics.md) completely defines the relationship between PX4 uORB topics and ROS 2 messages.
|
||||
For more information see [DDS Topics YAML](#dds-topics-yaml) below.
|
||||
|
||||
:::
|
||||
|
||||
## Customizing the Namespace
|
||||
|
||||
Custom topic and service namespaces can be applied at build time (changing [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml)) or at runtime (which is useful for multi vehicle operations):
|
||||
Custom topic and service namespaces can be applied at build time (changing [dds_topics.yaml](../middleware/dds_topics.md)) or at runtime (which is useful for multi vehicle operations):
|
||||
|
||||
- One possibility is to use the `-n` option when starting the [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) from command line.
|
||||
This technique can be used both in simulation and real vehicles.
|
||||
- A custom namespace can be provided for simulations (only) by setting the environment variable `PX4_UXRCE_DDS_NS` before starting the simulation.
|
||||
|
||||
:::info
|
||||
Changing the namespace at runtime will append the desired namespace as a prefix to all `topic` fields in [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) and all [service servers](#dds-ros-2-services).
|
||||
Changing the namespace at runtime will append the desired namespace as a prefix to all `topic` fields in [dds_topics.yaml](../middleware/dds_topics.md) and all [service servers](#dds-ros-2-services).
|
||||
Therefore, commands like:
|
||||
|
||||
```sh
|
||||
@@ -420,7 +418,7 @@ Deadline, lifespan, and lease durations are also all set to "default".
|
||||
|
||||
## DDS Topics YAML
|
||||
|
||||
The PX4 yaml file [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) defines the set of PX4 uORB topics that are built into firmware and published.
|
||||
The PX4 [dds_topics.yaml](../middleware/dds_topics.md) file defines the set of PX4 uORB topics that are built into firmware and published.
|
||||
More precisely, it completely defines the relationship/pairing between PX4 uORB and ROS 2 messages.
|
||||
|
||||
The file is structured as follows:
|
||||
@@ -549,7 +547,7 @@ Take a look at the [client startup section](#starting-the-client) to learn how t
|
||||
|
||||
#### New file for setting which topics are published
|
||||
|
||||
The list of topics that are published and subscribed for a particular firmware is now managed by the [dds_topic.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) configuration file, which replaces [urtps_bridge_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/release/1.13/msg/tools/urtps_bridge_topics.yaml)
|
||||
The list of topics that are published and subscribed for a particular firmware is now managed by the [dds_topics.yaml](../middleware/dds_topics.md) configuration file, which replaces [urtps_bridge_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/release/1.13/msg/tools/urtps_bridge_topics.yaml)
|
||||
|
||||
See [Supported uORB Messages](#supported-uorb-messages) and [DDS Topics YAML](#dds-topics-yaml) sections for more information.
|
||||
|
||||
|
||||
+119
-119
@@ -29,151 +29,151 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too
|
||||
|
||||
2. Create a new C file in that directory named **px4_simple_app.c**:
|
||||
|
||||
- 기본 헤더를 페이지 상단에 복사합니다.
|
||||
이것은 기여한 모든 파일에 첨부하여야 합니다.
|
||||
- 기본 헤더를 페이지 상단에 복사합니다.
|
||||
이것은 기여한 모든 파일에 첨부하여야 합니다.
|
||||
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
```
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
```
|
||||
|
||||
- 기본 헤더 아래에 다음 코드를 복사합니다.
|
||||
이것은 기여한 모든 파일에 첨부하여야 합니다.
|
||||
- 기본 헤더 아래에 다음 코드를 복사합니다.
|
||||
이것은 기여한 모든 파일에 첨부하여야 합니다.
|
||||
|
||||
```c
|
||||
/**
|
||||
* @file px4_simple_app.c
|
||||
* Minimal application example for PX4 autopilot
|
||||
*
|
||||
* @author Example User <mail@example.com>
|
||||
*/
|
||||
```c
|
||||
/**
|
||||
* @file px4_simple_app.c
|
||||
* Minimal application example for PX4 autopilot
|
||||
*
|
||||
* @author Example User <mail@example.com>
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/log.h>
|
||||
#include <px4_platform_common/log.h>
|
||||
|
||||
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
|
||||
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
|
||||
|
||||
int px4_simple_app_main(int argc, char *argv[])
|
||||
{
|
||||
PX4_INFO("Hello Sky!");
|
||||
return OK;
|
||||
}
|
||||
```
|
||||
int px4_simple_app_main(int argc, char *argv[])
|
||||
{
|
||||
PX4_INFO("Hello Sky!");
|
||||
return OK;
|
||||
}
|
||||
```
|
||||
|
||||
:::tip
|
||||
The main function must be named `<module_name>_main` and exported from the module as shown.
|
||||
:::tip
|
||||
The main function must be named `<module_name>_main` and exported from the module as shown.
|
||||
|
||||
:::
|
||||
|
||||
:::tip
|
||||
`PX4_INFO` is the equivalent of `printf` for the PX4 shell (included from **px4_platform_common/log.h**).
|
||||
There are different log levels: `PX4_INFO`, `PX4_WARN`, `PX4_ERR`, `PX4_DEBUG`.
|
||||
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
|
||||
:::tip
|
||||
`PX4_INFO` is the equivalent of `printf` for the PX4 shell (included from **px4_platform_common/log.h**).
|
||||
There are different log levels: `PX4_INFO`, `PX4_WARN`, `PX4_ERR`, `PX4_DEBUG`.
|
||||
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
|
||||
|
||||
:::
|
||||
|
||||
3. Create and open a new _cmake_ definition file named **CMakeLists.txt**.
|
||||
아래 텍스트를 복사하십시오.
|
||||
아래 텍스트를 복사하십시오.
|
||||
|
||||
```cmake
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE examples__px4_simple_app
|
||||
MAIN px4_simple_app
|
||||
STACK_MAIN 2000
|
||||
SRCS
|
||||
px4_simple_app.c
|
||||
DEPENDS
|
||||
)
|
||||
```
|
||||
```cmake
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE examples__px4_simple_app
|
||||
MAIN px4_simple_app
|
||||
STACK_MAIN 2000
|
||||
SRCS
|
||||
px4_simple_app.c
|
||||
DEPENDS
|
||||
)
|
||||
```
|
||||
|
||||
The `px4_add_module()` method builds a static library from a module description.
|
||||
The `px4_add_module()` method builds a static library from a module description.
|
||||
|
||||
- The `MODULE` block is the Firmware-unique name of the module (by convention the module name is prefixed by parent directories back to `src`).
|
||||
- The `MAIN` block lists the entry point of the module, which registers the command with NuttX so that it can be called from the PX4 shell or SITL console.
|
||||
- The `MODULE` block is the Firmware-unique name of the module (by convention the module name is prefixed by parent directories back to `src`).
|
||||
- The `MAIN` block lists the entry point of the module, which registers the command with NuttX so that it can be called from the PX4 shell or SITL console.
|
||||
|
||||
:::tip
|
||||
The `px4_add_module()` format is documented in [PX4-Autopilot/cmake/px4_add_module.cmake](https://github.com/PX4/PX4-Autopilot/blob/main/cmake/px4_add_module.cmake). <!-- NEED px4_version -->
|
||||
:::tip
|
||||
The `px4_add_module()` format is documented in [PX4-Autopilot/cmake/px4_add_module.cmake](https://github.com/PX4/PX4-Autopilot/blob/main/cmake/px4_add_module.cmake). <!-- NEED px4_version -->
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
If you specify `DYNAMIC` as an option to `px4_add_module`, a _shared library_ is created instead of a static library on POSIX platforms (these can be loaded without having to recompile PX4, and shared to others as binaries rather than source code).
|
||||
Your app will not become a builtin command, but ends up in a separate file called `examples__px4_simple_app.px4mod`.
|
||||
You can then run your command by loading the file at runtime using the `dyn` command: `dyn ./examples__px4_simple_app.px4mod`
|
||||
::: info
|
||||
If you specify `DYNAMIC` as an option to `px4_add_module`, a _shared library_ is created instead of a static library on POSIX platforms (these can be loaded without having to recompile PX4, and shared to others as binaries rather than source code).
|
||||
Your app will not become a builtin command, but ends up in a separate file called `examples__px4_simple_app.px4mod`.
|
||||
You can then run your command by loading the file at runtime using the `dyn` command: `dyn ./examples__px4_simple_app.px4mod`
|
||||
|
||||
:::
|
||||
|
||||
4. Create and open a new _Kconfig_ definition file named **Kconfig** and define your symbol for naming (see [Kconfig naming convention](../hardware/porting_guide_config.md#px4-kconfig-symbol-naming-convention)).
|
||||
아래 텍스트를 복사하십시오.
|
||||
아래 텍스트를 복사하십시오.
|
||||
|
||||
```
|
||||
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
||||
bool "px4_simple_app"
|
||||
default n
|
||||
---help---
|
||||
Enable support for px4_simple_app
|
||||
```
|
||||
```
|
||||
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
||||
bool "px4_simple_app"
|
||||
default n
|
||||
---help---
|
||||
Enable support for px4_simple_app
|
||||
```
|
||||
|
||||
## 애플리케이션/펌웨어 빌드
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ CONFIG_DRIVERS_RPM_CAPTURE=y
|
||||
Additionally, to enable the module:
|
||||
|
||||
- Set [ICE_EN](../advanced_config/parameter_reference.md#ICE_EN)
|
||||
to true and adjust the other `ICE_` module parameters according to your needs.
|
||||
to true and adjust the other `ICE_` module parameters according to your needs.
|
||||
- Set [RPM_CAP_ENABLE](../advanced_config/parameter_reference.md#RPM_CAP_ENABLE) to true.
|
||||
|
||||
The module outputs control signals for ignition, throttle, and choke,
|
||||
@@ -367,8 +367,8 @@ The state machine:
|
||||
|
||||
- Checks if [Rpm.msg](../msg_docs/Rpm.md) is updated to know if the engine is running
|
||||
- Allows for user inputs from:
|
||||
- AUX{N}
|
||||
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md)
|
||||
- AUX{N}
|
||||
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md)
|
||||
|
||||
The module publishes [InternalCombustionEngineControl.msg](../msg_docs/InternalCombustionEngineControl.md).
|
||||
|
||||
@@ -484,7 +484,7 @@ The normal log is always a superset of the mission log.
|
||||
The implementation uses two threads:
|
||||
|
||||
- The main thread, running at a fixed rate (or polling on a topic if started with -p) and checking for
|
||||
data updates
|
||||
data updates
|
||||
- The writer thread, writing data to the file
|
||||
|
||||
In between there is a write buffer with configurable size (and another fixed-size buffer for
|
||||
@@ -688,9 +688,9 @@ There are 2 environment variables used for configuration: `replay`, which must b
|
||||
the log file to be replayed. The second is the mode, specified via `replay_mode`:
|
||||
|
||||
- `replay_mode=ekf2`: specific EKF2 replay mode. It can only be used with the ekf2 module, but allows the replay
|
||||
to run as fast as possible.
|
||||
to run as fast as possible.
|
||||
- Generic otherwise: this can be used to replay any module(s), but the replay will be done with the same speed as the
|
||||
log was recorded.
|
||||
log was recorded.
|
||||
|
||||
The module is typically used together with uORB publisher rules, to specify which messages should be replayed.
|
||||
The replay module will just publish all messages that are found in the log. It also applies the parameters from
|
||||
@@ -842,12 +842,12 @@ it into a more usable form, and publishes it for the rest of the system.
|
||||
The provided functionality includes:
|
||||
|
||||
- Read the output from the sensor drivers (`SensorGyro`, etc.).
|
||||
If there are multiple of the same type, do voting and failover handling.
|
||||
Then apply the board rotation and temperature calibration (if enabled). And finally publish the data; one of the
|
||||
topics is `SensorCombined`, used by many parts of the system.
|
||||
If there are multiple of the same type, do voting and failover handling.
|
||||
Then apply the board rotation and temperature calibration (if enabled). And finally publish the data; one of the
|
||||
topics is `SensorCombined`, used by many parts of the system.
|
||||
- Make sure the sensor drivers get the updated calibration parameters (scale & offset) when the parameters change or
|
||||
on startup. The sensor drivers use the ioctl interface for parameter updates. For this to work properly, the
|
||||
sensor drivers must already be running when `sensors` is started.
|
||||
on startup. The sensor drivers use the ioctl interface for parameter updates. For this to work properly, the
|
||||
sensor drivers must already be running when `sensors` is started.
|
||||
- Do sensor consistency checks and publish the `SensorsStatusImu` topic.
|
||||
|
||||
### 구현
|
||||
|
||||
@@ -25,38 +25,38 @@ Other examples in Python can be found here: [integrationtests/python_src/px4_it/
|
||||
|
||||
1. Open the terminal and go to `~/catkin_ws/src` directory
|
||||
|
||||
```sh
|
||||
roscd # Should cd into ~/catkin_ws/devel
|
||||
cd ..
|
||||
cd src
|
||||
```
|
||||
```sh
|
||||
roscd # Should cd into ~/catkin_ws/devel
|
||||
cd ..
|
||||
cd src
|
||||
```
|
||||
|
||||
2. In the `~/catkin_ws/src` directory create a new package named `offboard_py` (in this case) with the `rospy` dependency:
|
||||
|
||||
```sh
|
||||
catkin_create_pkg offboard_py rospy
|
||||
```
|
||||
```sh
|
||||
catkin_create_pkg offboard_py rospy
|
||||
```
|
||||
|
||||
3. Build the new package in the `~/catkin_ws/` directory:
|
||||
|
||||
```sh
|
||||
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
||||
catkin build
|
||||
source devel/setup.bash
|
||||
```
|
||||
```sh
|
||||
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
||||
catkin build
|
||||
source devel/setup.bash
|
||||
```
|
||||
|
||||
4. You should now be able to cd into the package by using:
|
||||
|
||||
```sh
|
||||
roscd offboard_py
|
||||
```
|
||||
```sh
|
||||
roscd offboard_py
|
||||
```
|
||||
|
||||
5. To store your Python files, create a new folder called `/scripts` on the package:
|
||||
|
||||
```sh
|
||||
mkdir scripts
|
||||
cd scripts
|
||||
```
|
||||
```sh
|
||||
mkdir scripts
|
||||
cd scripts
|
||||
```
|
||||
|
||||
## 코드
|
||||
|
||||
|
||||
@@ -37,63 +37,63 @@ To build and run the example:
|
||||
|
||||
2. Create and navigate into a new colcon workspace directory using:
|
||||
|
||||
```sh
|
||||
mkdir -p ~/ws_offboard_control/src/
|
||||
cd ~/ws_offboard_control/src/
|
||||
```
|
||||
```sh
|
||||
mkdir -p ~/ws_offboard_control/src/
|
||||
cd ~/ws_offboard_control/src/
|
||||
```
|
||||
|
||||
3. Clone the [px4_msgs](https://github.com/PX4/px4_msgs) repo to the `/src` directory (this repo is needed in every ROS 2 PX4 workspace!):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
# checkout the matching release branch if not using PX4 main.
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
# checkout the matching release branch if not using PX4 main.
|
||||
```
|
||||
|
||||
4. Clone the example repository [px4_ros_com](https://github.com/PX4/px4_ros_com) to the `/src` directory:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
|
||||
5. Source the ROS 2 development environment into the current terminal and compile the workspace using `colcon`:
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
6. Source the `local_setup.bash`:
|
||||
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
|
||||
7. Launch the example.
|
||||
|
||||
```
|
||||
ros2 run px4_ros_com offboard_control
|
||||
```
|
||||
```
|
||||
ros2 run px4_ros_com offboard_control
|
||||
```
|
||||
|
||||
The vehicle should arm, ascend 5 metres, and then wait (perpetually).
|
||||
|
||||
|
||||
+140
-140
@@ -28,7 +28,7 @@ The agent acts as a proxy for the client to publish and subscribe to topics in t
|
||||
|
||||
The PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) is generated at build time and included in PX4 firmware by default.
|
||||
It includes both the "generic" micro XRCE-DDS client code, and PX4-specific translation code that it uses to publish to/from uORB topics.
|
||||
The subset of uORB messages that are generated into the client are listed in [PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml).
|
||||
The subset of uORB messages that are generated into the client are specified in [dds_topics.yaml](../middleware/dds_topics.md).
|
||||
The generator uses the uORB message definitions in the source tree: [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) to create the code for sending ROS 2 messages.
|
||||
|
||||
ROS 2 applications need to be built in a workspace that has the _same_ message definitions that were used to create the uXRCE-DDS client module in the PX4 Firmware.
|
||||
@@ -97,48 +97,48 @@ To install ROS 2 and its dependencies:
|
||||
|
||||
1. Install ROS 2.
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
To install ROS 2 "Humble" on Ubuntu 22.04:
|
||||
::: tab humble
|
||||
To install ROS 2 "Humble" on Ubuntu 22.04:
|
||||
|
||||
```sh
|
||||
sudo apt update && sudo apt install locales
|
||||
sudo locale-gen en_US en_US.UTF-8
|
||||
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
sudo apt install software-properties-common
|
||||
sudo add-apt-repository universe
|
||||
sudo apt update && sudo apt install curl -y
|
||||
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
sudo apt install ros-humble-desktop
|
||||
sudo apt install ros-dev-tools
|
||||
source /opt/ros/humble/setup.bash && echo "source /opt/ros/humble/setup.bash" >> .bashrc
|
||||
```
|
||||
```sh
|
||||
sudo apt update && sudo apt install locales
|
||||
sudo locale-gen en_US en_US.UTF-8
|
||||
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
sudo apt install software-properties-common
|
||||
sudo add-apt-repository universe
|
||||
sudo apt update && sudo apt install curl -y
|
||||
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
sudo apt install ros-humble-desktop
|
||||
sudo apt install ros-dev-tools
|
||||
source /opt/ros/humble/setup.bash && echo "source /opt/ros/humble/setup.bash" >> .bashrc
|
||||
```
|
||||
|
||||
The instructions above are reproduced from the official installation guide: [Install ROS 2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html).
|
||||
You can install _either_ the desktop (`ros-humble-desktop`) _or_ bare-bones versions (`ros-humble-ros-base`), _and_ the development tools (`ros-dev-tools`).
|
||||
The instructions above are reproduced from the official installation guide: [Install ROS 2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html).
|
||||
You can install _either_ the desktop (`ros-humble-desktop`) _or_ bare-bones versions (`ros-humble-ros-base`), _and_ the development tools (`ros-dev-tools`).
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
To install ROS 2 "Foxy" on Ubuntu 20.04:
|
||||
::: tab foxy
|
||||
To install ROS 2 "Foxy" on Ubuntu 20.04:
|
||||
|
||||
- Follow the official installation guide: [Install ROS 2 Foxy](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html).
|
||||
- Follow the official installation guide: [Install ROS 2 Foxy](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html).
|
||||
|
||||
You can install _either_ the desktop (`ros-foxy-desktop`) _or_ bare-bones versions (`ros-foxy-ros-base`), _and_ the development tools (`ros-dev-tools`).
|
||||
You can install _either_ the desktop (`ros-foxy-desktop`) _or_ bare-bones versions (`ros-foxy-ros-base`), _and_ the development tools (`ros-dev-tools`).
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
2. Some Python dependencies must also be installed (using **`pip`** or **`apt`**):
|
||||
|
||||
```sh
|
||||
pip install --user -U empy==3.3.4 pyros-genmsg setuptools
|
||||
```
|
||||
```sh
|
||||
pip install --user -U empy==3.3.4 pyros-genmsg setuptools
|
||||
```
|
||||
|
||||
### Setup Micro XRCE-DDS Agent & Client
|
||||
|
||||
@@ -155,22 +155,22 @@ To setup and start the agent:
|
||||
|
||||
2. Enter the following commands to fetch and build the agent from source:
|
||||
|
||||
```sh
|
||||
git clone -b v2.4.2 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
|
||||
cd Micro-XRCE-DDS-Agent
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig /usr/local/lib/
|
||||
```
|
||||
```sh
|
||||
git clone -b v2.4.2 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
|
||||
cd Micro-XRCE-DDS-Agent
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig /usr/local/lib/
|
||||
```
|
||||
|
||||
3. Start the agent with settings for connecting to the uXRCE-DDS client running on the simulator:
|
||||
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
|
||||
The agent is now running, but you won't see much until we start PX4 (in the next step).
|
||||
|
||||
@@ -187,31 +187,31 @@ To start the simulator (and client):
|
||||
|
||||
1. Open a new terminal in the root of the **PX4 Autopilot** repo that was installed above.
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
- Start a PX4 [Gazebo](../sim_gazebo_gz/index.md) simulation using:
|
||||
- Start a PX4 [Gazebo](../sim_gazebo_gz/index.md) simulation using:
|
||||
|
||||
```sh
|
||||
make px4_sitl gz_x500
|
||||
```
|
||||
```sh
|
||||
make px4_sitl gz_x500
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
- Start a PX4 [Gazebo Classic](../sim_gazebo_classic/index.md) simulation using:
|
||||
- Start a PX4 [Gazebo Classic](../sim_gazebo_classic/index.md) simulation using:
|
||||
|
||||
```sh
|
||||
make px4_sitl gazebo-classic
|
||||
```
|
||||
```sh
|
||||
make px4_sitl gazebo-classic
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
The agent and client are now running they should connect.
|
||||
|
||||
@@ -261,52 +261,52 @@ To create and build the workspace:
|
||||
|
||||
2. Create and navigate into a new workspace directory using:
|
||||
|
||||
```sh
|
||||
mkdir -p ~/ws_sensor_combined/src/
|
||||
cd ~/ws_sensor_combined/src/
|
||||
```
|
||||
```sh
|
||||
mkdir -p ~/ws_sensor_combined/src/
|
||||
cd ~/ws_sensor_combined/src/
|
||||
```
|
||||
|
||||
::: info
|
||||
A naming convention for workspace folders can make it easier to manage workspaces.
|
||||
::: info
|
||||
A naming convention for workspace folders can make it easier to manage workspaces.
|
||||
|
||||
:::
|
||||
|
||||
3. Clone the example repository and [px4_msgs](https://github.com/PX4/px4_msgs) to the `/src` directory (the `main` branch is cloned by default, which corresponds to the version of PX4 we are running):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
|
||||
4. Source the ROS 2 development environment into the current terminal and compile the workspace using `colcon`:
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
This builds all the folders under `/src` using the sourced toolchain.
|
||||
This builds all the folders under `/src` using the sourced toolchain.
|
||||
|
||||
#### Running the Example
|
||||
|
||||
@@ -322,42 +322,42 @@ In a new terminal:
|
||||
|
||||
1. Navigate into the top level of your workspace directory and source the ROS 2 environment (in this case "Humble"):
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
cd ~/ws_sensor_combined/
|
||||
source /opt/ros/humble/setup.bash
|
||||
```
|
||||
```sh
|
||||
cd ~/ws_sensor_combined/
|
||||
source /opt/ros/humble/setup.bash
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
cd ~/ws_sensor_combined/
|
||||
source /opt/ros/foxy/setup.bash
|
||||
```
|
||||
```sh
|
||||
cd ~/ws_sensor_combined/
|
||||
source /opt/ros/foxy/setup.bash
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
2. Source the `local_setup.bash`.
|
||||
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
|
||||
3. Now launch the example.
|
||||
Note here that we use `ros2 launch`, which is described below.
|
||||
Note here that we use `ros2 launch`, which is described below.
|
||||
|
||||
```sh
|
||||
ros2 launch px4_ros_com sensor_combined_listener.launch.py
|
||||
```
|
||||
```sh
|
||||
ros2 launch px4_ros_com sensor_combined_listener.launch.py
|
||||
```
|
||||
|
||||
If this is working you should see data being printed on the terminal/console where you launched the ROS listener:
|
||||
|
||||
@@ -385,18 +385,18 @@ If you were to use incompatible [message versions](../middleware/uorb.md#message
|
||||
|
||||
1. Include the [Message Translation Node](../ros2/px4_ros2_msg_translation_node.md) into the example workspace or a separate workspace by running the following script:
|
||||
|
||||
```sh
|
||||
cd /path/to/ros_ws
|
||||
/path/to/PX4-Autopilot/Tools/copy_to_ros_ws.sh .
|
||||
```
|
||||
```sh
|
||||
cd /path/to/ros_ws
|
||||
/path/to/PX4-Autopilot/Tools/copy_to_ros_ws.sh .
|
||||
```
|
||||
|
||||
2. Build and run the translation node:
|
||||
|
||||
```sh
|
||||
colcon build
|
||||
source install/local_setup.bash
|
||||
ros2 run translation_node translation_node_bin
|
||||
```
|
||||
```sh
|
||||
colcon build
|
||||
source install/local_setup.bash
|
||||
ros2 run translation_node translation_node_bin
|
||||
```
|
||||
|
||||
## Controlling a Vehicle
|
||||
|
||||
@@ -405,7 +405,7 @@ To control applications, ROS 2 applications:
|
||||
- subscribe to (listen to) telemetry topics published by PX4
|
||||
- publish to topics that cause PX4 to perform some action.
|
||||
|
||||
The topics that you can use are defined in [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml), and you can get more information about their data in the [uORB Message Reference](../msg_docs/index.md).
|
||||
The topics that you can use are defined in [dds_topics.yaml](../middleware/dds_topics.md), and you can get more information about their data in the [uORB Message Reference](../msg_docs/index.md).
|
||||
For example, [VehicleGlobalPosition](../msg_docs/VehicleGlobalPosition.md) can be used to get the vehicle global position, while [VehicleCommand](../msg_docs/VehicleCommand.md) can be used to command actions such as takeoff and land.
|
||||
|
||||
The [ROS 2 Example applications](#ros-2-example-applications) examples below provide concrete examples of how to use these topics.
|
||||
@@ -456,13 +456,13 @@ Therefore, ROS 2 nodes that want to interface with PX4 must take care of the fra
|
||||
|
||||
- To rotate a vector from ENU to NED two basic rotations must be performed:
|
||||
|
||||
- first a pi/2 rotation around the `Z`-axis (up),
|
||||
- then a pi rotation around the `X`-axis (old East/new North).
|
||||
- first a pi/2 rotation around the `Z`-axis (up),
|
||||
- then a pi rotation around the `X`-axis (old East/new North).
|
||||
|
||||
- To rotate a vector from NED to ENU two basic rotations must be performed:
|
||||
|
||||
- - first a pi/2 rotation around the `Z`-axis (down),
|
||||
- then a pi rotation around the `X`-axis (old North/new East). Note that the two resulting operations are mathematically equivalent.
|
||||
- then a pi rotation around the `X`-axis (old North/new East). Note that the two resulting operations are mathematically equivalent.
|
||||
|
||||
- To rotate a vector from FLU to FRD a pi rotation around the `X`-axis (front) is sufficient.
|
||||
|
||||
@@ -720,17 +720,17 @@ Therefore,
|
||||
|
||||
- If you're using a main or release version of PX4 you can get the message definitions by cloning the interface package [PX4/px4_msgs](https://github.com/PX4/px4_msgs) into your workspace.
|
||||
- If you're creating or modifying uORB messages you must manually update the messages in your workspace from your PX4 source tree.
|
||||
Generally this means that you would update [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml), clone the interface package, and then manually synchronize it by copying the new/modified message definitions from [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) to its `msg` folders.
|
||||
Assuming that PX4-Autopilot is in your home directory `~`, while `px4_msgs` is in `~/ros2_ws/src/`, then the command might be:
|
||||
Generally this means that you would update [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml), clone the interface package, and then manually synchronize it by copying the new/modified message definitions from [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) to its `msg` folders.
|
||||
Assuming that PX4-Autopilot is in your home directory `~`, while `px4_msgs` is in `~/ros2_ws/src/`, then the command might be:
|
||||
|
||||
```sh
|
||||
rm ~/ros2_ws/src/px4_msgs/msg/*.msg
|
||||
cp ~/PX4-Autopilot/mgs/*.msg ~/ros2_ws/src/px4_msgs/msg/
|
||||
```
|
||||
```sh
|
||||
rm ~/ros2_ws/src/px4_msgs/msg/*.msg
|
||||
cp ~/PX4-Autopilot/mgs/*.msg ~/ros2_ws/src/px4_msgs/msg/
|
||||
```
|
||||
|
||||
::: info
|
||||
Technically, [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) completely defines the relationship between PX4 uORB topics and ROS 2 messages.
|
||||
For more information see [uXRCE-DDS > DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml).
|
||||
::: info
|
||||
Technically, [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) completely defines the relationship between PX4 uORB topics and ROS 2 messages.
|
||||
For more information see [uXRCE-DDS > DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml).
|
||||
|
||||
:::
|
||||
|
||||
@@ -739,11 +739,11 @@ Therefore,
|
||||
Custom topic and service namespaces can be applied at build time (changing [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml)) or at runtime (useful for multi vehicle operations):
|
||||
|
||||
- One possibility is to use the `-n` option when starting the [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) from command line.
|
||||
This technique can be used both in simulation and real vehicles.
|
||||
This technique can be used both in simulation and real vehicles.
|
||||
- A custom namespace can be provided for simulations (only) by setting the environment variable `PX4_UXRCE_DDS_NS` before starting the simulation.
|
||||
|
||||
:::info
|
||||
Changing the namespace at runtime will append the desired namespace as a prefix to all `topic` fields in [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) and all [service servers](#px4-ros-2-service-servers).
|
||||
Changing the namespace at runtime will append the desired namespace as a prefix to all `topic` fields in [dds_topics.yaml](../middleware/dds_topics.md) and all [service servers](#px4-ros-2-service-servers).
|
||||
Therefore, commands like:
|
||||
|
||||
```sh
|
||||
@@ -780,7 +780,7 @@ The service servers that are built into the PX4 [uxrce_dds_client](../modules/mo
|
||||
|
||||
- `/fmu/vehicle_command` (definition: [`px4_msgs::srv::VehicleCommand`](https://github.com/PX4/px4_msgs/blob/main/srv/VehicleCommand.srv).)
|
||||
|
||||
This service can be called by ROS 2 applications to send PX4 [VehicleCommand](../msg_docs/VehicleCommand.md) uORB messages and receive PX4 [VehicleCommandAck](../msg_docs/VehicleCommandAck.md) uORB messages in response.
|
||||
This service can be called by ROS 2 applications to send PX4 [VehicleCommand](../msg_docs/VehicleCommand.md) uORB messages and receive PX4 [VehicleCommandAck](../msg_docs/VehicleCommandAck.md) uORB messages in response.
|
||||
|
||||
All PX4 service names follow the convention `{extra_namespace}/fmu/{server_specific_name}` where `{extra_namespace}` is the same [custom namespace](#customizing-the-namespace) that can be given to the PX4 topics.
|
||||
|
||||
@@ -973,38 +973,38 @@ The standard installation should include all the tools needed by ROS 2.
|
||||
If any are missing, they can be added separately:
|
||||
|
||||
- **`colcon`** build tools should be in the development tools.
|
||||
It can be installed using:
|
||||
It can be installed using:
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/PX4/px4_ros_com.git ~/px4_ros_com_ros2/src/px4_ros_com
|
||||
$ git clone https://github.com/PX4/px4_msgs.git ~/px4_ros_com_ros2/src/px4_msgs
|
||||
```
|
||||
```sh
|
||||
$ git clone https://github.com/PX4/px4_ros_com.git ~/px4_ros_com_ros2/src/px4_ros_com
|
||||
$ git clone https://github.com/PX4/px4_msgs.git ~/px4_ros_com_ros2/src/px4_msgs
|
||||
```
|
||||
|
||||
- The Eigen3 library used by the transforms library should be in the both the desktop and base packages.
|
||||
It should be installed as shown:
|
||||
It should be installed as shown:
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
sudo apt install ros-humble-eigen3-cmake-module
|
||||
```
|
||||
```sh
|
||||
sudo apt install ros-humble-eigen3-cmake-module
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
$ cd ~/px4_ros_com_ros2/src/px4_ros_com/scripts
|
||||
$ source build_ros2_workspace.bash
|
||||
```
|
||||
```sh
|
||||
$ cd ~/px4_ros_com_ros2/src/px4_ros_com/scripts
|
||||
$ source build_ros2_workspace.bash
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
### ros_gz_bridge not publishing on the \clock topic
|
||||
|
||||
|
||||
@@ -733,6 +733,7 @@
|
||||
- [Protocols/Microservices](mavlink/protocols.md)
|
||||
- [Standard Modes Protocol](mavlink/standard_modes.md)
|
||||
- [uXRCE-DDS (PX4-ROS 2/DDS Bridge)](middleware/uxrce_dds.md)
|
||||
- [UORB Bridged to ROS 2](middleware/dds_topics.md)
|
||||
- [Модулі & Команди](modules/modules_main.md)
|
||||
- [Автоматичне підлаштування](modules/modules_autotune.md)
|
||||
- [Команди](modules/modules_command.md)
|
||||
|
||||
@@ -128,21 +128,21 @@ You add some "boilerplate" code to regularly listen for changes in the [uORB Top
|
||||
|
||||
- **px4_platform_common/module_params.h** для отримання макросу `DEFINE_PARAMETERS`:
|
||||
|
||||
```cpp
|
||||
#include <px4_platform_common/module_params.h>
|
||||
```
|
||||
```cpp
|
||||
#include <px4_platform_common/module_params.h>
|
||||
```
|
||||
|
||||
- **parameter_update.h** для доступу до повідомлень uORB `parameter_update`:
|
||||
|
||||
```cpp
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
```
|
||||
```cpp
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
```
|
||||
|
||||
- **Subscription.hpp** для uORB C++ API підписки:
|
||||
|
||||
```cpp
|
||||
#include <uORB/Subscription.hpp>
|
||||
```
|
||||
```cpp
|
||||
#include <uORB/Subscription.hpp>
|
||||
```
|
||||
|
||||
Derive your class from `ModuleParams`, and use `DEFINE_PARAMETERS` to specify a list of parameters and their associated parameter attributes.
|
||||
Назви параметрів мають збігатися з визначеннями метаданих параметрів.
|
||||
@@ -194,7 +194,7 @@ void Module::parameters_update()
|
||||
- `_param_update_sub.updated()` повідомляє нам, чи є _будь-яке_ оновлення в uORB-повідомленні `param_update` (але не вказує, який саме параметр змінено).
|
||||
- Якщо було оновлено "деякий" параметр, ми копіюємо оновлення у `parameter_update_s` (`param_update`), щоб очистити очікуване оновлення.
|
||||
- Then we call `ModuleParams::updateParams()`.
|
||||
This "under the hood" updates all parameter attributes listed in our `DEFINE_PARAMETERS` list.
|
||||
This "under the hood" updates all parameter attributes listed in our `DEFINE_PARAMETERS` list.
|
||||
|
||||
Атрибути параметрів (`_sys_autostart` і `_att_bias_max` у цьому випадку) можна використовувати для відображення параметрів, і вони будуть оновлюватися щоразу, коли значення параметра змінюватиметься.
|
||||
|
||||
@@ -267,12 +267,12 @@ YAML meta data is intended as a full replacement for the **.c** definitions.
|
||||
- Приклад використання визначень YAML можна знайти у визначенні параметрів MAVLink: [/src/modules/mavlink/module.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/mavlink/module.yaml).
|
||||
- YAML-файл реєструється у системі збірки cmake шляхом додавання
|
||||
|
||||
```cmake
|
||||
MODULE_CONFIG
|
||||
module.yaml
|
||||
```
|
||||
```cmake
|
||||
MODULE_CONFIG
|
||||
module.yaml
|
||||
```
|
||||
|
||||
до секції `px4_add_module` файлу `CMakeLists.txt` цього модуля.
|
||||
до секції `px4_add_module` файлу `CMakeLists.txt` цього модуля.
|
||||
|
||||
#### Мета-дані YAML з багатьма екземплярами (шаблонами)
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ This guide walks through the process of setting up the board and connecting to P
|
||||
You will temporarily need the following hardware in order to log into your Jetson and get its IP address, after which you will be able to log in via SSH:
|
||||
|
||||
- External display.
|
||||
If your display doesn't have a mini HDMI connector you will also need a [Mini HDMI to HDMI converter](https://a.co/d/6N815N9) if your external display has HDMI input
|
||||
If your display doesn't have a mini HDMI connector you will also need a [Mini HDMI to HDMI converter](https://a.co/d/6N815N9) if your external display has HDMI input
|
||||
- Ethernet cable
|
||||
- Mouse and keyboard (the baseboard has 4 USB ports exposed from Jetson, two of which are USB 3.0)
|
||||
|
||||
@@ -45,11 +45,11 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- Розміри
|
||||
|
||||
- 126 x 80 x 45mm (with Jetson Orin NX + Heatsink/Fan & FC Module)
|
||||
- 126 x 80 x 22.9mm (without Jetson and FC Module)
|
||||
- 126 x 80 x 45mm (with Jetson Orin NX + Heatsink/Fan & FC Module)
|
||||
- 126 x 80 x 22.9mm (without Jetson and FC Module)
|
||||
|
||||
- Вага
|
||||
- 190g (with Jetson, Heatsink, Flight Controller, M.2 SSD, M.2 Wi-Fi Module)
|
||||
- 190g (with Jetson, Heatsink, Flight Controller, M.2 SSD, M.2 Wi-Fi Module)
|
||||
|
||||
:::
|
||||
|
||||
@@ -57,67 +57,67 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- 2x Gigabit Ethernet Port
|
||||
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- Ethernet Switch powered by the same circuit as the Pixhawk
|
||||
- 8-pin JST-GH
|
||||
- RJ45
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- Ethernet Switch powered by the same circuit as the Pixhawk
|
||||
- 8-pin JST-GH
|
||||
- RJ45
|
||||
|
||||
- 2x MIPI CSI Camera Inputs
|
||||
|
||||
- 4 Lanes each
|
||||
- 22-Pin Raspberry Pi Cam FFC
|
||||
- 4 Lanes each
|
||||
- 22-Pin Raspberry Pi Cam FFC
|
||||
|
||||
- 2x USB 3.0 Host Port
|
||||
|
||||
- USB A
|
||||
- 5A Current Limit
|
||||
- USB A
|
||||
- 5A Current Limit
|
||||
|
||||
- 2x USB 2.0 Host Port
|
||||
|
||||
- 5-Pin JST-GH
|
||||
- 0A Current Limit
|
||||
- 5-Pin JST-GH
|
||||
- 0A Current Limit
|
||||
|
||||
- USB 2.0 for Programming/Debugging
|
||||
|
||||
- USB-C
|
||||
- USB-C
|
||||
|
||||
- 2 Key M 2242/2280 for NVMe SSD
|
||||
|
||||
- PCIEx4
|
||||
- PCIEx4
|
||||
|
||||
- 2 Key E 2230 for WiFi/BT
|
||||
|
||||
- PCIEx2
|
||||
- USB
|
||||
- UART
|
||||
- I2S
|
||||
- PCIEx2
|
||||
- USB
|
||||
- UART
|
||||
- I2S
|
||||
|
||||
- Mini HDMI Out
|
||||
|
||||
- 4x GPIO
|
||||
|
||||
- 6-pin JST-GH
|
||||
- 6-pin JST-GH
|
||||
|
||||
- CAN Port
|
||||
|
||||
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
||||
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
||||
|
||||
- SPI порт
|
||||
|
||||
- 7-Pin JST-GH
|
||||
- 7-Pin JST-GH
|
||||
|
||||
- I2C порт
|
||||
|
||||
- 4-Pin JST-GH
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- I2S Port
|
||||
|
||||
- 7-Pin JST-GH
|
||||
- 7-Pin JST-GH
|
||||
|
||||
- 2x UART Port
|
||||
|
||||
- 1 for debug
|
||||
- 1 connected to Autopilot's telem2
|
||||
- 1 for debug
|
||||
- 1 connected to Autopilot's telem2
|
||||
|
||||
- Fan Power Port
|
||||
|
||||
@@ -129,13 +129,13 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- Pixhawk Autopilot Bus Interface
|
||||
|
||||
- 100 Pin Hirose DF40
|
||||
- 50 Pin Hirose DF40
|
||||
- 100 Pin Hirose DF40
|
||||
- 50 Pin Hirose DF40
|
||||
|
||||
- Redundant Digital Power Module Inputs
|
||||
|
||||
- I2C Power Monitor Support
|
||||
- 2x 6-Pin Molex CLIK-Mate
|
||||
- I2C Power Monitor Support
|
||||
- 2x 6-Pin Molex CLIK-Mate
|
||||
|
||||
- Power Path Selector
|
||||
|
||||
@@ -143,68 +143,68 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- Номінальна напруга
|
||||
|
||||
- Максимальна вхідна напруга: 6 В
|
||||
- Вхід USB Power: 4.75~5.25V
|
||||
- Максимальна вхідна напруга: 6 В
|
||||
- Вхід USB Power: 4.75~5.25V
|
||||
|
||||
- Повноцінний порт перемикача безпеки GPS Plus
|
||||
|
||||
- 10-Pin JST-GH
|
||||
- 10-Pin JST-GH
|
||||
|
||||
- Secondary (GPS2) Port
|
||||
|
||||
- 6-Pin JST-GH
|
||||
- 6-Pin JST-GH
|
||||
|
||||
- 2x CAN Ports
|
||||
|
||||
- 4-Pin JST-GH
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- 3x Telemetry Ports with Flow Control
|
||||
|
||||
- 2x 6-Pin JST-GH
|
||||
- 1 is connected to Jetson's `UART1` Port
|
||||
- 2x 6-Pin JST-GH
|
||||
- 1 is connected to Jetson's `UART1` Port
|
||||
|
||||
- 16 PWM Outputs
|
||||
|
||||
- 2x 10-Pin JST-GH
|
||||
- 2x 10-Pin JST-GH
|
||||
|
||||
- UART4 & I2C Port
|
||||
|
||||
- 6-Pin JST-GH
|
||||
- 6-Pin JST-GH
|
||||
|
||||
- 2x Gigabit Ethernet Port
|
||||
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- 8-Pin JST-GH
|
||||
- RJ45
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- 8-Pin JST-GH
|
||||
- RJ45
|
||||
|
||||
- AD & IO
|
||||
|
||||
- 8-Pin JST-GH
|
||||
- 8-Pin JST-GH
|
||||
|
||||
- USB 2.0
|
||||
|
||||
- USB-C
|
||||
- 4-Pin JST-GH
|
||||
- USB-C
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- DSM Input
|
||||
|
||||
- 3-Pin JST-ZH 1.5mm Pitch
|
||||
- 3-Pin JST-ZH 1.5mm Pitch
|
||||
|
||||
- RC In
|
||||
|
||||
- PPM/SBUS
|
||||
- 5-Pin JST-GH
|
||||
- PPM/SBUS
|
||||
- 5-Pin JST-GH
|
||||
|
||||
- SPI порт
|
||||
|
||||
- External Sensor Bus (SPI5)
|
||||
- 11-Pin JST-GH
|
||||
- External Sensor Bus (SPI5)
|
||||
- 11-Pin JST-GH
|
||||
|
||||
- 2x Debug Port
|
||||
|
||||
- 1 for FMU
|
||||
- 1 for IO
|
||||
- 10-Pin JST-SH
|
||||
- 1 for FMU
|
||||
- 1 for IO
|
||||
- 10-Pin JST-SH
|
||||
|
||||
:::
|
||||
|
||||
@@ -218,7 +218,7 @@ The Jetson has separate input power circuitry from the Pixhawk autopilot:
|
||||
- 8V/3A Minimum (Depends on Usage and Peripherals)
|
||||
- Voltage Rating: 7-21V (3S-4S)
|
||||
- Jetson Baseboard onboard BEC is rated for 7-21V (3S-4S).
|
||||
Note that the external UBEC-12A can be used for applications above 4S
|
||||
Note that the external UBEC-12A can be used for applications above 4S
|
||||
|
||||
During development using the following wired power supply is recommended:
|
||||
|
||||
@@ -698,7 +698,7 @@ On the following screen, confirm your selected device:
|
||||
|
||||
- Choose `Pre-config` for the OEM Configuration (this will skip Ubuntu first time setup screens after reboot).
|
||||
- Choose your preferred username and password (and write them down).
|
||||
These will be used as your login credentials to Jetpack.
|
||||
These will be used as your login credentials to Jetpack.
|
||||
- Choose `NVMe` as the storage device because the board has separate SSD for storage.
|
||||
|
||||

|
||||
@@ -922,95 +922,95 @@ These instructions approximately mirror the [PX4 Ethernet setup](../advanced_con
|
||||
Next we modify the Jetson IP address to be on the same network as the Pixhawk:
|
||||
|
||||
1. Make sure `netplan` is installed.
|
||||
You can check by running the following command:
|
||||
You can check by running the following command:
|
||||
|
||||
```sh
|
||||
netplan -h
|
||||
```
|
||||
```sh
|
||||
netplan -h
|
||||
```
|
||||
|
||||
If not, install it using the commands:
|
||||
If not, install it using the commands:
|
||||
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install netplan.io
|
||||
```
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install netplan.io
|
||||
```
|
||||
|
||||
2. Check `system_networkd` is running:
|
||||
|
||||
```sh
|
||||
sudo systemctl status systemd-networkd
|
||||
```
|
||||
```sh
|
||||
sudo systemctl status systemd-networkd
|
||||
```
|
||||
|
||||
You should see output like below if it is active:
|
||||
You should see output like below if it is active:
|
||||
|
||||
```sh
|
||||
● systemd-networkd.service - Network Configuration
|
||||
Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
|
||||
Active: active (running) since Wed 2024-09-11 23:32:44 EDT; 23min ago
|
||||
TriggeredBy: ● systemd-networkd.socket
|
||||
Docs: man:systemd-networkd.service(8)
|
||||
Main PID: 2452 (systemd-network)
|
||||
Status: "Processing requests..."
|
||||
Tasks: 1 (limit: 18457)
|
||||
Memory: 2.7M
|
||||
CPU: 157ms
|
||||
CGroup: /system.slice/systemd-networkd.service
|
||||
└─2452 /lib/systemd/systemd-networkd
|
||||
```sh
|
||||
● systemd-networkd.service - Network Configuration
|
||||
Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
|
||||
Active: active (running) since Wed 2024-09-11 23:32:44 EDT; 23min ago
|
||||
TriggeredBy: ● systemd-networkd.socket
|
||||
Docs: man:systemd-networkd.service(8)
|
||||
Main PID: 2452 (systemd-network)
|
||||
Status: "Processing requests..."
|
||||
Tasks: 1 (limit: 18457)
|
||||
Memory: 2.7M
|
||||
CPU: 157ms
|
||||
CGroup: /system.slice/systemd-networkd.service
|
||||
└─2452 /lib/systemd/systemd-networkd
|
||||
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: lo: Gained carrier
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: eth0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: Enumeration completed
|
||||
Sep 11 23:32:44 ubuntu systemd[1]: Started Network Configuration.
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Connected WiFi access point: Verizon_7YLWWD (78:67:0e:ea:a6:0>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
```
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: lo: Gained carrier
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: eth0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: Enumeration completed
|
||||
Sep 11 23:32:44 ubuntu systemd[1]: Started Network Configuration.
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Connected WiFi access point: Verizon_7YLWWD (78:67:0e:ea:a6:0>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
```
|
||||
|
||||
If `system_networkd` is not running, it can be enabled using:
|
||||
If `system_networkd` is not running, it can be enabled using:
|
||||
|
||||
```sh
|
||||
sudo systemctl start systemd-networkd
|
||||
sudo systemctl enable systemd-networkd
|
||||
```
|
||||
```sh
|
||||
sudo systemctl start systemd-networkd
|
||||
sudo systemctl enable systemd-networkd
|
||||
```
|
||||
|
||||
3. Open the Netplan configuration file (so we can set up a static IP for the Jetson).
|
||||
|
||||
The Netplan configuration file is usually located in the `/etc/netplan/` directory and named something like `01-netcfg.yaml` (the name can vary).
|
||||
Below we use `nano` to open the file, but you can use your preferred text editor:
|
||||
The Netplan configuration file is usually located in the `/etc/netplan/` directory and named something like `01-netcfg.yaml` (the name can vary).
|
||||
Below we use `nano` to open the file, but you can use your preferred text editor:
|
||||
|
||||
```sh
|
||||
sudo nano /etc/netplan/01-netcfg.yaml
|
||||
```
|
||||
```sh
|
||||
sudo nano /etc/netplan/01-netcfg.yaml
|
||||
```
|
||||
|
||||
4. Modify the yaml configuration, by overwriting the contents with the following information and then saving:
|
||||
|
||||
```sh
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses:
|
||||
- 10.41.10.1/24
|
||||
routes:
|
||||
- to: 0.0.0.0/0
|
||||
via: 10.41.10.254
|
||||
nameservers:
|
||||
addresses:
|
||||
- 10.41.10.254
|
||||
```
|
||||
```sh
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses:
|
||||
- 10.41.10.1/24
|
||||
routes:
|
||||
- to: 0.0.0.0/0
|
||||
via: 10.41.10.254
|
||||
nameservers:
|
||||
addresses:
|
||||
- 10.41.10.254
|
||||
```
|
||||
|
||||
This gives the Jetson a static IP address on the Ethernet interface of `10.41.10.1` .
|
||||
This gives the Jetson a static IP address on the Ethernet interface of `10.41.10.1` .
|
||||
|
||||
5. Apply the changes using the following command:
|
||||
|
||||
```sh
|
||||
sudo netplan apply
|
||||
```
|
||||
```sh
|
||||
sudo netplan apply
|
||||
```
|
||||
|
||||
The Pixhawk Ethernet address is set to `10.41.10.2` by default, which is on the same subnet.
|
||||
We can test our changes above by pinging the Pixhawk from within the Jetson terminal:
|
||||
@@ -1221,15 +1221,15 @@ Assuming the client is set up as defined above:
|
||||
|
||||
- (Serial connection) Start the agent on `/dev/ttyTHS1`:
|
||||
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
||||
```
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
||||
```
|
||||
|
||||
- (Ethernet) Start the agent on UDP port `8888`:
|
||||
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
|
||||
If your agent and client are connected and no nodes are running, you should see output similar to this in the Agent terminal:
|
||||
|
||||
|
||||
@@ -71,42 +71,42 @@ events::send<uint8_t, float>(events::ID("event_name"),
|
||||
- `/* EVENT`: Цей тег вказує, що коментар описує метадані для наступної події.
|
||||
|
||||
- **event_name**: ім'я події (`events::ID(event_name)`).
|
||||
- повинно бути унікальним в межах всього вихідного коду PX4.
|
||||
Як загальне правило, додайте префікс з назвою модуля або вихідного файлу для великих модулів.
|
||||
- має бути дійсна назва змінної, тобто не повинна містити пробіли, двокрапки тощо.
|
||||
- з цього імені отримується 24-бітний ID події за допомогою геш-функції.
|
||||
Це означає, що до тих пір, поки ім'я події залишається однаковим, ID залишиться тим же.
|
||||
- повинно бути унікальним в межах всього вихідного коду PX4.
|
||||
Як загальне правило, додайте префікс з назвою модуля або вихідного файлу для великих модулів.
|
||||
- має бути дійсна назва змінної, тобто не повинна містити пробіли, двокрапки тощо.
|
||||
- з цього імені отримується 24-бітний ID події за допомогою геш-функції.
|
||||
Це означає, що до тих пір, поки ім'я події залишається однаковим, ID залишиться тим же.
|
||||
|
||||
- **Рівень журналювання**:
|
||||
|
||||
- припустимі рівні журналювання такі ж, як і у перерахуванні MAVLink [MAV_SEVERITY](https://mavlink.io/en/messages/common.html#MAV_SEVERITY).
|
||||
Рівні перелічені за зменшенням важливості:
|
||||
- припустимі рівні журналювання такі ж, як і у перерахуванні MAVLink [MAV_SEVERITY](https://mavlink.io/en/messages/common.html#MAV_SEVERITY).
|
||||
Рівні перелічені за зменшенням важливості:
|
||||
|
||||
```plain
|
||||
Emergency,
|
||||
Alert,
|
||||
Critical,
|
||||
Error,
|
||||
Warning,
|
||||
Notice,
|
||||
Info,
|
||||
Debug,
|
||||
Disabled,
|
||||
```
|
||||
```plain
|
||||
Emergency,
|
||||
Alert,
|
||||
Critical,
|
||||
Error,
|
||||
Warning,
|
||||
Notice,
|
||||
Info,
|
||||
Debug,
|
||||
Disabled,
|
||||
```
|
||||
|
||||
- Above we specify a separate external and internal log level, which are the levels displayed to GCS users and in the log file, respectively: `{events::Log::Error, events::LogInternal::Info}`.
|
||||
For the majority of cases you can pass a single log level, and this will be used for both exernal and internal cases.
|
||||
There are cases it makes sense to have two different log levels.
|
||||
For example an RTL failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`.
|
||||
- Above we specify a separate external and internal log level, which are the levels displayed to GCS users and in the log file, respectively: `{events::Log::Error, events::LogInternal::Info}`.
|
||||
For the majority of cases you can pass a single log level, and this will be used for both exernal and internal cases.
|
||||
There are cases it makes sense to have two different log levels.
|
||||
For example an RTL failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`.
|
||||
|
||||
- **Повідомлення про подію**:
|
||||
- Коротке повідомлення про подію в один рядок.
|
||||
Може мати шаблонні замінники для аргументів (наприклад `{1}`). Для додаткової інформації дивіться нижче. Для додаткової інформації дивіться нижче.
|
||||
- Коротке повідомлення про подію в один рядок.
|
||||
Може мати шаблонні замінники для аргументів (наприклад `{1}`). Для додаткової інформації дивіться нижче. Для додаткової інформації дивіться нижче.
|
||||
|
||||
- **Опис події**:
|
||||
- Докладний, необов'язковий опис події.
|
||||
- Може бути кілька рядів/абзаців.
|
||||
- It may contain template placeholders for arguments (e.g. `{2}`) and supported tags (see below)
|
||||
- Докладний, необов'язковий опис події.
|
||||
- Може бути кілька рядів/абзаців.
|
||||
- It may contain template placeholders for arguments (e.g. `{2}`) and supported tags (see below)
|
||||
|
||||
#### Аргументи та перерахування
|
||||
|
||||
@@ -125,35 +125,35 @@ Events can have a fixed set of arguments that can be inserted into the message o
|
||||
|
||||
- символи можна екранувати за допомогою \\
|
||||
|
||||
Ці символи повинні бути екрановані: '\\\\', '\\<', '\\{'.
|
||||
Ці символи повинні бути екрановані: '\\\\', '\\<', '\\{'.
|
||||
|
||||
- теги що підтримуються:
|
||||
|
||||
- Профілі: `<profile name="[!]NAME">CONTENT</profile>`
|
||||
- Профілі: `<profile name="[!]NAME">CONTENT</profile>`
|
||||
|
||||
`CONTENT` буде показано, лише якщо назва збігається з налаштованим профілем.
|
||||
Це може бути використано, наприклад, щоб приховати інформацію для розробників від кінцевих користувачів.
|
||||
`CONTENT` буде показано, лише якщо назва збігається з налаштованим профілем.
|
||||
Це може бути використано, наприклад, щоб приховати інформацію для розробників від кінцевих користувачів.
|
||||
|
||||
- URLs: `<a [href="URL"]>CONTENT</a>`.
|
||||
If `href` is not set, use `CONTENT` as `URL` (i.e.`<a>https://docs.px4.io</a>` is interpreted as `<a href="https://docs.px4.io">https://docs.px4.io</a>`)
|
||||
- URLs: `<a [href="URL"]>CONTENT</a>`.
|
||||
If `href` is not set, use `CONTENT` as `URL` (i.e.`<a>https://docs.px4.io</a>` is interpreted as `<a href="https://docs.px4.io">https://docs.px4.io</a>`)
|
||||
|
||||
- Parameters: `<param>PARAM_NAME</param>`
|
||||
- Parameters: `<param>PARAM_NAME</param>`
|
||||
|
||||
- не дозволено використовувати вкладені теги того ж типу
|
||||
- не дозволено використовувати вкладені теги того ж типу
|
||||
|
||||
- аргументи: шаблонні замінники, що відповідають синтаксису python з індексацією що починається з 1 (замість 0)
|
||||
|
||||
- загальна форма: `{ARG_IDX[:.NUM_DECIMAL_DIGITS][UNIT]}`
|
||||
- загальна форма: `{ARG_IDX[:.NUM_DECIMAL_DIGITS][UNIT]}`
|
||||
|
||||
UNIT:
|
||||
UNIT:
|
||||
|
||||
- m: горизонтальна відстань в метрах
|
||||
- m_v: вертикальна відстань в метрах
|
||||
- m^2: площа в метрах квадратних
|
||||
- m/s: швидкість у метрах в секунду
|
||||
- C: температура у градусах Цельсія
|
||||
- m: горизонтальна відстань в метрах
|
||||
- m_v: вертикальна відстань в метрах
|
||||
- m^2: площа в метрах квадратних
|
||||
- m/s: швидкість у метрах в секунду
|
||||
- C: температура у градусах Цельсія
|
||||
|
||||
- `NUM_DECIMAL_DIGITS` підходить тільки для аргументів у вигляді дійсних чисел.
|
||||
- `NUM_DECIMAL_DIGITS` підходить тільки для аргументів у вигляді дійсних чисел.
|
||||
|
||||
## Логування
|
||||
|
||||
|
||||
+14
-14
@@ -38,9 +38,9 @@ Selecting an airframe applies a [frame configuration file](../dev_airframes/addi
|
||||
Коли ви виводите новий транспортний засіб, рама зазвичай містить досить мінімальну конфігурацію:
|
||||
|
||||
- Кадри з назвою "Загальний" визначають тип транспортного засобу, кількість роторів та позиції роторів-заповнювачі.
|
||||
Після вибору конструкції фюзеляжу ви визначаєте фактичну геометрію, а потім налаштовуєте виходи.
|
||||
Після вибору конструкції фюзеляжу ви визначаєте фактичну геометрію, а потім налаштовуєте виходи.
|
||||
- Кадри з назвою моделі/бренду визначать тип транспортного засобу, кількість роторів, фактичні позиції роторів та напрямки руху двигуна.
|
||||
Після вибору конструкції фюзеляжу вам зазвичай все ще потрібно налаштувати виводи.
|
||||
Після вибору конструкції фюзеляжу вам зазвичай все ще потрібно налаштувати виводи.
|
||||
|
||||
:::
|
||||
|
||||
@@ -52,7 +52,7 @@ If using PWM ESCs and OneShot ESCs (but not DShot and DroneCAN/Cyphal ESC) you s
|
||||
The final step is [Motor Configuration](../config/actuators.md#motor-configuration):
|
||||
|
||||
- [Reverse any motors](../config/actuators.md#reversing-motors) that don't match the spin direction configured in the Geometry.
|
||||
Для DShot ESC ви можете це зробити через інтерфейс тестування приводу.
|
||||
Для DShot ESC ви можете це зробити через інтерфейс тестування приводу.
|
||||
- PWM, OneShot та CAN ESC встановлюють ліміти введення мотора для режимів роззброєння, низької та високої швидкості (не потрібно для DShot ESC)
|
||||
|
||||
Відповідні теми:
|
||||
@@ -123,14 +123,14 @@ PX4 може бути налаштований для автоматичної
|
||||
|
||||
- [Autotune](../config/autotune_mc.md) — Automates tuning PX4 rate and attitude controllers (recommended).
|
||||
|
||||
::: info
|
||||
Automatic tuning works on frames that have reasonable authority and dynamics around all the body axes.
|
||||
Це було перевірено в основному на гоночних квадрокоптерах та X500, і очікується, що воно буде менш ефективним на трикоптерах з нахилом ротора.
|
||||
::: info
|
||||
Automatic tuning works on frames that have reasonable authority and dynamics around all the body axes.
|
||||
Це було перевірено в основному на гоночних квадрокоптерах та X500, і очікується, що воно буде менш ефективним на трикоптерах з нахилом ротора.
|
||||
|
||||
Manual tuning using these guides are only needed if there is a problem with autotune:
|
||||
Manual tuning using these guides are only needed if there is a problem with autotune:
|
||||
|
||||
- [MC PID Tuning (Manual/Basic)](../config_mc/pid_tuning_guide_multicopter_basic.md) — Manual tuning basic how to.
|
||||
- [MC PID Tuning Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
|
||||
- [MC PID Tuning (Manual/Basic)](../config_mc/pid_tuning_guide_multicopter_basic.md) — Manual tuning basic how to.
|
||||
- [MC PID Tuning Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
|
||||
|
||||
|
||||
:::
|
||||
@@ -138,7 +138,7 @@ PX4 може бути налаштований для автоматичної
|
||||
- [MC Filter/Control Latency Tuning](../config_mc/filter_tuning.md) — Trade off control latency and noise filtering.
|
||||
|
||||
- [MC Setpoint Tuning (Trajectory Generator)](../config_mc/mc_trajectory_tuning.md)
|
||||
- [MC Jerk-limited Type Trajectory](../config_mc/mc_jerk_limited_type_trajectory.md)
|
||||
- [MC Jerk-limited Type Trajectory](../config_mc/mc_jerk_limited_type_trajectory.md)
|
||||
|
||||
- [Multicopter Racer Setup](../config_mc/racer_setup.md)
|
||||
|
||||
@@ -167,7 +167,7 @@ Yes but it must be physically feasible. E.g. if you make a quadrotor where all m
|
||||
- [Периферія контролера польоту](../peripherals/README.md) - налаштування конкретних датчиків, опціональних датчиків, приводів тощо.
|
||||
- [Advanced Configuration](../advanced_config/index.md) - Factory/OEM calibration, configuring advanced features, less-common configuration.
|
||||
- Конфігурація/налаштування, що залежать від апарату:
|
||||
- **Multicopter Config/Tuning**
|
||||
- [Конфігурація/налаштування гелікоптера](../config_heli/index.md)
|
||||
- [Fixed Wing Config/Tuning](../config_fw/index.md)
|
||||
- [Конфігурація/налаштування VTOL](../config_vtol/index.md)
|
||||
- **Multicopter Config/Tuning**
|
||||
- [Конфігурація/налаштування гелікоптера](../config_heli/index.md)
|
||||
- [Fixed Wing Config/Tuning](../config_fw/index.md)
|
||||
- [Конфігурація/налаштування VTOL](../config_vtol/index.md)
|
||||
|
||||
@@ -26,13 +26,13 @@ This topic provides full instructions for building the [Holybro X500 V2 ARF Kit]
|
||||
The Holybro [X500 V2 Kit](https://holybro.com/collections/x500-kits) includes almost all the required components:
|
||||
|
||||
- X500V2 Frame Kit
|
||||
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
||||
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
||||
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
||||
- Platform board - With mounting holes for GPS & popular companion computer
|
||||
- Система кріплення з подвійними пружинними валиками 10 мм Ø та довжиною 250 мм
|
||||
- Кріплення батареї з двома стропами для батареї
|
||||
- Ручні інструменти для встановлення
|
||||
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
||||
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
||||
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
||||
- Platform board - With mounting holes for GPS & popular companion computer
|
||||
- Система кріплення з подвійними пружинними валиками 10 мм Ø та довжиною 250 мм
|
||||
- Кріплення батареї з двома стропами для батареї
|
||||
- Ручні інструменти для встановлення
|
||||
- Holybro Motors - 2216 KV880 x6 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||
- Holybro BLHeli S ESC 20A x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||
- Propellers - 1045 x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||
@@ -93,92 +93,92 @@ _Figure 1_: X500 V2 ARF Kit what's inside
|
||||
Орієнтовний час збірки - 55 хвилин (25 хвилин на раму, 30 хвилин на встановлення/налаштування автопілота)
|
||||
|
||||
1. Start by assembling the payload & battery holder.
|
||||
Втисніть гумки в захоплювачі (не використовуйте гострі предмети, щоб їх втиснути в них!).
|
||||
Далі пропустіть тримачі через планки тримача з основами тримача батарей, як показано на рисунку 3.
|
||||
Втисніть гумки в захоплювачі (не використовуйте гострі предмети, щоб їх втиснути в них!).
|
||||
Далі пропустіть тримачі через планки тримача з основами тримача батарей, як показано на рисунку 3.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 2_: Payload holder components
|
||||
_Figure 2_: Payload holder components
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 3_: Payload holder assembled
|
||||
_Figure 3_: Payload holder assembled
|
||||
|
||||
2. Наступним кроком буде прикріплення нижньої пластини до тримача вантажу.
|
||||
|
||||
Вам знадобляться деталі, як показано на рисунку 4.
|
||||
Потім встановіть основу для розподільної плати живлення, використовуючи нейлонові гайки, як зображено на Рис. 5.
|
||||
Нарешті, використовуючи 8 шестигранних гвинтів, ви можете приєднати нижню пластину до тримача навантаження (Рисунок 7)
|
||||
Вам знадобляться деталі, як показано на рисунку 4.
|
||||
Потім встановіть основу для розподільної плати живлення, використовуючи нейлонові гайки, як зображено на Рис. 5.
|
||||
Нарешті, використовуючи 8 шестигранних гвинтів, ви можете приєднати нижню пластину до тримача навантаження (Рисунок 7)
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 4_: Needed Materials
|
||||
_Figure 4_: Needed Materials
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 5_: PDB mount base
|
||||
_Figure 5_: PDB mount base
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 6_: Mounted pdb with nylon nuts
|
||||
_Figure 6_: Mounted pdb with nylon nuts
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 7_: Mounted Plate on payload holder
|
||||
_Figure 7_: Mounted Plate on payload holder
|
||||
|
||||
3. Давайте зберемо речі, необхідні для монтажу посадкового шасі, як на рисунку 8.
|
||||
Використовуйте гвинти, щоб приєднати посадкові шасі до нижньої пластини.
|
||||
Також потрібно відкрити три шестигранних гвинти на кожній з ніжок, щоб ви могли вставити їх у вуглецеві труби.
|
||||
Не забудьте знову їх затягнути.
|
||||
Використовуйте гвинти, щоб приєднати посадкові шасі до нижньої пластини.
|
||||
Також потрібно відкрити три шестигранних гвинти на кожній з ніжок, щоб ви могли вставити їх у вуглецеві труби.
|
||||
Не забудьте знову їх затягнути.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 8_: Required parts for landing gear attachment
|
||||
_Figure 8_: Required parts for landing gear attachment
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 9_: Landing gear attachment to the body
|
||||
_Figure 9_: Landing gear attachment to the body
|
||||
|
||||
4. Зараз ми зберемо все оснащення, щоб встановити верхню пластину.
|
||||
Прошу звернути увагу, що номери моторів на кронштейнах відповідають тим, що згадані на верхній платі.
|
||||
На щастя, мотори встановлені, а ESCs були з'єднані заздалегідь.
|
||||
Почніть, проходячи через всі гвинти, так як ви зафіксували кронштейни на їхніх власних місцях (Вони мають направляючий елемент, як показано на рисунку 11, щоб переконатися, що вони на місці), і трохи підтягніть всі нейлонові гайки.
|
||||
Потім ви зможете підключити роз'єми живлення XT30 до плати живлення.
|
||||
Пам'ятайте, що дроти сигналу повинні бути проведені через верхню пластину так, що ми зможемо пізніше їх підключити до Pixhawk.
|
||||
Прошу звернути увагу, що номери моторів на кронштейнах відповідають тим, що згадані на верхній платі.
|
||||
На щастя, мотори встановлені, а ESCs були з'єднані заздалегідь.
|
||||
Почніть, проходячи через всі гвинти, так як ви зафіксували кронштейни на їхніх власних місцях (Вони мають направляючий елемент, як показано на рисунку 11, щоб переконатися, що вони на місці), і трохи підтягніть всі нейлонові гайки.
|
||||
Потім ви зможете підключити роз'єми живлення XT30 до плати живлення.
|
||||
Пам'ятайте, що дроти сигналу повинні бути проведені через верхню пластину так, що ми зможемо пізніше їх підключити до Pixhawk.
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/needed_stuff_top_plate.png" width="700" title="Arms and top plate materials">
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/needed_stuff_top_plate.png" width="700" title="Arms and top plate materials">
|
||||
|
||||
_Figure 10_: Connecting arms needed materials.
|
||||
_Figure 10_: Connecting arms needed materials.
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/guide_for_arm_mount.png" width="700" title="Guide for the arms mount">
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/guide_for_arm_mount.png" width="700" title="Guide for the arms mount">
|
||||
|
||||
_Figure 11_: Guide for the arms mount
|
||||
_Figure 11_: Guide for the arms mount
|
||||
|
||||
5. Для затягування всіх 16 гвинтів і гайок використовуйте як шестигранний ключ, так і гайковий ключ.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 12_: Mounted top plate
|
||||
_Figure 12_: Mounted top plate
|
||||
|
||||
6. Наступним кроком ви можете закріпити свій pixhawk на верхній плиті, використовуючи наклейки.
|
||||
Рекомендується мати напрямок стрілки вашого Pixhawk таким же, як зазначено на верхній плиті.
|
||||
Рекомендується мати напрямок стрілки вашого Pixhawk таким же, як зазначено на верхній плиті.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 13_: Sticker tapes on Pixhawk
|
||||
_Figure 13_: Sticker tapes on Pixhawk
|
||||
|
||||
7. Якщо ви хочете встановити GPS на плату компаньйона-комп'ютера, тепер ви можете закріпити кріплення GPS на ній за допомогою 4 гвинтів і гайок.
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/gps_mount_plate.png" width="400" title="Secure GPS mount onto companion plate">
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/gps_mount_plate.png" width="400" title="Secure GPS mount onto companion plate">
|
||||
|
||||
_Figure 14_: Secure GPS mount onto companion plate
|
||||
_Figure 14_: Secure GPS mount onto companion plate
|
||||
|
||||
8. За допомогою скотча приклейте GPS до верхньої частини GPS-щогли і встановіть її на щоглу.
|
||||
Переконайтеся, що стрілка на gps вказує вперед (зображення 15).
|
||||
Переконайтеся, що стрілка на gps вказує вперед (зображення 15).
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_holybro_pixhawk4/gps2.jpg" width="400" title="Figure 16: GPS and mast">
|
||||
<img src="../../assets/airframes/multicopter/x500_holybro_pixhawk4/gps2.jpg" width="400" title="Figure 16: GPS and mast">
|
||||
|
||||
_Figure 15_: GPS and mast
|
||||
_Figure 15_: GPS and mast
|
||||
|
||||
9. Наразі ви можете підключити інтерфейси Pixhawk, такі як телеметрійне радіо до 'TELEM1' та відповідно кабелі сигналів для моторів.
|
||||
|
||||
@@ -204,14 +204,14 @@ _QGroundControl_ is used to install the PX4 autopilot and configure/tune it for
|
||||
|
||||
- [Airframe](../config/airframe.md)
|
||||
|
||||
You will need to select the _Holybro X500 V2_ airframe (**Quadrotor x > Holybro 500 V2**)
|
||||
You will need to select the _Holybro X500 V2_ airframe (**Quadrotor x > Holybro 500 V2**)
|
||||
|
||||

|
||||

|
||||
|
||||
- [Actuators](../config/actuators.md)
|
||||
- Вам не потрібно оновлювати геометрію транспортного засобу (оскільки це попередньо налаштована конструкція повітряного каркасу).
|
||||
- Призначте функції приводу до актуаторів, щоб відповідати вашому підключенню.
|
||||
- Перевірте конфігурацію, використовуючи слайдери.
|
||||
- Вам не потрібно оновлювати геометрію транспортного засобу (оскільки це попередньо налаштована конструкція повітряного каркасу).
|
||||
- Призначте функції приводу до актуаторів, щоб відповідати вашому підключенню.
|
||||
- Перевірте конфігурацію, використовуючи слайдери.
|
||||
|
||||
Потім виконайте обов'язкове налаштування / калібрування:
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ The Reptile Dragon 2 is a twin motor RC airplane specifically designed for effic
|
||||
- Видалення V-хвоста або варіанти звичайного хвоста включені
|
||||
- Різьбові вставки в крилах та верхній частині фюзеляжу для зовнішнього монтажу
|
||||
- Чимало кріплень-ознак
|
||||
- Отвір для верхньої антени
|
||||
- Верхнє покриття GPS
|
||||
- Кріплення антени біля гільзи "T"
|
||||
- Задній електронний лоток
|
||||
- Виріз "екшн камери" на передній панелі
|
||||
- Виріз для камери FPV спереду
|
||||
- Отвір для верхньої антени
|
||||
- Верхнє покриття GPS
|
||||
- Кріплення антени біля гільзи "T"
|
||||
- Задній електронний лоток
|
||||
- Виріз "екшн камери" на передній панелі
|
||||
- Виріз для камери FPV спереду
|
||||
- Знімні крила
|
||||
- Низька швидкість стійки
|
||||
- Лагідна обробка
|
||||
@@ -69,10 +69,10 @@ The Reptile Dragon 2 is a twin motor RC airplane specifically designed for effic
|
||||
- [6s2p 18650 LiIon flight battery](https://www.upgradeenergytech.com/product-page/6s-22-2v-5600mah-30c-dark-lithium-liion-drone-battery) (select XT60 connector)
|
||||
|
||||
- [Custom designed 3D printed parts](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/rd2_3d_printed_parts.zip)
|
||||
- Монтаж платформи ARK6X
|
||||
- Кріплення для каркасу Holybro Pixhawk 5x
|
||||
- FPV модуль та кріплення камери
|
||||
- Адаптер "заглушка" статичного зонда Піто
|
||||
- Монтаж платформи ARK6X
|
||||
- Кріплення для каркасу Holybro Pixhawk 5x
|
||||
- FPV модуль та кріплення камери
|
||||
- Адаптер "заглушка" статичного зонда Піто
|
||||
|
||||
- [Custom designed power distribution PCB](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/xt30_power_distro_pcb.zip)
|
||||
|
||||
@@ -425,15 +425,15 @@ With the propellers removed, power the airplane up and use the [Actuator](../con
|
||||
Я рекомендую перевірити наступні елементи:
|
||||
|
||||
- Калібрування датчиків (QGC)
|
||||
- Калібрування магнітів
|
||||
- Калібрування акселерометра
|
||||
- Калібрування швидкості повітря
|
||||
- Калібрування рівня горизонту
|
||||
- Калібрування магнітів
|
||||
- Калібрування акселерометра
|
||||
- Калібрування швидкості повітря
|
||||
- Калібрування рівня горизонту
|
||||
- Перевірка контролю над відхиленням поверхні
|
||||
- Right stick -> Right aileron goes up, left aileron goes down
|
||||
- Left stick -> Left aileron goes up, right aileron goes down
|
||||
- Stick back -> elevator goes up
|
||||
-Stick forward -> elevator goes down
|
||||
-Stick forward -> elevator goes down
|
||||
- Left rudder -> Rudder goes left
|
||||
- Right rudder -> Rudder goes right
|
||||
- Check Px4 inputs (in `stabilized mode`)
|
||||
|
||||
@@ -98,11 +98,11 @@ The mapping between flight controller outputs and specific controls/motors depen
|
||||
Assembly information is covered in several sections:
|
||||
|
||||
- [Basic Assembly](../assembly/index.md) contains topics shows the setup of core components for a number of popular [flight controllers](../flight_controller/index.md).
|
||||
Контролери польоту, для яких у нас немає посібників, зазвичай налаштовуються таким же чином (і майже завжди містять схожі посібники з налаштуванням).
|
||||
Контролери польоту, для яких у нас немає посібників, зазвичай налаштовуються таким же чином (і майже завжди містять схожі посібники з налаштуванням).
|
||||
- [Peripherals](../peripherals/index.md) contains information about other peripherals, including [Airspeed Sensors](../sensor/airspeed.md).
|
||||
- [Airframes Reference > VTOL](../airframes/airframe_reference.md#vtol) explains which flight controller outputs must be connected to different flight controls for each airframe configuration:
|
||||
- Виберіть конфігурацію для вашого транспортного засобу, якщо вона існує, оскільки вона буде достатньо попередньо налаштована для польоту (можливо, потребує тільки дрібного налаштування).
|
||||
- В іншому випадку виберіть "Загальну конструкцію", яка відповідає вашому транспортному засобу.
|
||||
- Виберіть конфігурацію для вашого транспортного засобу, якщо вона існує, оскільки вона буде достатньо попередньо налаштована для польоту (можливо, потребує тільки дрібного налаштування).
|
||||
- В іншому випадку виберіть "Загальну конструкцію", яка відповідає вашому транспортному засобу.
|
||||
|
||||
In addition, build logs showing how others have set up different types of vehicles are provided as sub topics.
|
||||
For example see [FunCub QuadPlane](../frames_vtol/vtol_quadplane_fun_cub_vtol_pixhawk.md).
|
||||
|
||||
+119
-119
@@ -29,151 +29,151 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too
|
||||
|
||||
2. Create a new C file in that directory named **px4_simple_app.c**:
|
||||
|
||||
- Скопіюйте заголовок за замовчуванням у верхній частині сторінки.
|
||||
Це повинно бути присутнім у всіх розміщених файлах!
|
||||
- Скопіюйте заголовок за замовчуванням у верхній частині сторінки.
|
||||
Це повинно бути присутнім у всіх розміщених файлах!
|
||||
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
```
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
```
|
||||
|
||||
- Скопіюйте наступний код під заголовком за замовчуванням.
|
||||
Це повинно бути присутнім у всіх розміщених файлах!
|
||||
- Скопіюйте наступний код під заголовком за замовчуванням.
|
||||
Це повинно бути присутнім у всіх розміщених файлах!
|
||||
|
||||
```c
|
||||
/**
|
||||
* @file px4_simple_app.c
|
||||
* Minimal application example for PX4 autopilot
|
||||
*
|
||||
* @author Example User <mail@example.com>
|
||||
*/
|
||||
```c
|
||||
/**
|
||||
* @file px4_simple_app.c
|
||||
* Minimal application example for PX4 autopilot
|
||||
*
|
||||
* @author Example User <mail@example.com>
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/log.h>
|
||||
#include <px4_platform_common/log.h>
|
||||
|
||||
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
|
||||
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
|
||||
|
||||
int px4_simple_app_main(int argc, char *argv[])
|
||||
{
|
||||
PX4_INFO("Hello Sky!");
|
||||
return OK;
|
||||
}
|
||||
```
|
||||
int px4_simple_app_main(int argc, char *argv[])
|
||||
{
|
||||
PX4_INFO("Hello Sky!");
|
||||
return OK;
|
||||
}
|
||||
```
|
||||
|
||||
:::tip
|
||||
The main function must be named `<module_name>_main` and exported from the module as shown.
|
||||
:::tip
|
||||
The main function must be named `<module_name>_main` and exported from the module as shown.
|
||||
|
||||
:::
|
||||
|
||||
:::tip
|
||||
`PX4_INFO` is the equivalent of `printf` for the PX4 shell (included from **px4_platform_common/log.h**).
|
||||
There are different log levels: `PX4_INFO`, `PX4_WARN`, `PX4_ERR`, `PX4_DEBUG`.
|
||||
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
|
||||
:::tip
|
||||
`PX4_INFO` is the equivalent of `printf` for the PX4 shell (included from **px4_platform_common/log.h**).
|
||||
There are different log levels: `PX4_INFO`, `PX4_WARN`, `PX4_ERR`, `PX4_DEBUG`.
|
||||
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
|
||||
|
||||
:::
|
||||
|
||||
3. Create and open a new _cmake_ definition file named **CMakeLists.txt**.
|
||||
Скопіюйте текст нижче:
|
||||
Скопіюйте текст нижче:
|
||||
|
||||
```cmake
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE examples__px4_simple_app
|
||||
MAIN px4_simple_app
|
||||
STACK_MAIN 2000
|
||||
SRCS
|
||||
px4_simple_app.c
|
||||
DEPENDS
|
||||
)
|
||||
```
|
||||
```cmake
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE examples__px4_simple_app
|
||||
MAIN px4_simple_app
|
||||
STACK_MAIN 2000
|
||||
SRCS
|
||||
px4_simple_app.c
|
||||
DEPENDS
|
||||
)
|
||||
```
|
||||
|
||||
The `px4_add_module()` method builds a static library from a module description.
|
||||
The `px4_add_module()` method builds a static library from a module description.
|
||||
|
||||
- The `MODULE` block is the Firmware-unique name of the module (by convention the module name is prefixed by parent directories back to `src`).
|
||||
- The `MAIN` block lists the entry point of the module, which registers the command with NuttX so that it can be called from the PX4 shell or SITL console.
|
||||
- The `MODULE` block is the Firmware-unique name of the module (by convention the module name is prefixed by parent directories back to `src`).
|
||||
- The `MAIN` block lists the entry point of the module, which registers the command with NuttX so that it can be called from the PX4 shell or SITL console.
|
||||
|
||||
:::tip
|
||||
The `px4_add_module()` format is documented in [PX4-Autopilot/cmake/px4_add_module.cmake](https://github.com/PX4/PX4-Autopilot/blob/main/cmake/px4_add_module.cmake). <!-- NEED px4_version -->
|
||||
:::tip
|
||||
The `px4_add_module()` format is documented in [PX4-Autopilot/cmake/px4_add_module.cmake](https://github.com/PX4/PX4-Autopilot/blob/main/cmake/px4_add_module.cmake). <!-- NEED px4_version -->
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
If you specify `DYNAMIC` as an option to `px4_add_module`, a _shared library_ is created instead of a static library on POSIX platforms (these can be loaded without having to recompile PX4, and shared to others as binaries rather than source code).
|
||||
Your app will not become a builtin command, but ends up in a separate file called `examples__px4_simple_app.px4mod`.
|
||||
You can then run your command by loading the file at runtime using the `dyn` command: `dyn ./examples__px4_simple_app.px4mod`
|
||||
::: info
|
||||
If you specify `DYNAMIC` as an option to `px4_add_module`, a _shared library_ is created instead of a static library on POSIX platforms (these can be loaded without having to recompile PX4, and shared to others as binaries rather than source code).
|
||||
Your app will not become a builtin command, but ends up in a separate file called `examples__px4_simple_app.px4mod`.
|
||||
You can then run your command by loading the file at runtime using the `dyn` command: `dyn ./examples__px4_simple_app.px4mod`
|
||||
|
||||
:::
|
||||
|
||||
4. Create and open a new _Kconfig_ definition file named **Kconfig** and define your symbol for naming (see [Kconfig naming convention](../hardware/porting_guide_config.md#px4-kconfig-symbol-naming-convention)).
|
||||
Скопіюйте текст нижче:
|
||||
Скопіюйте текст нижче:
|
||||
|
||||
```
|
||||
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
||||
bool "px4_simple_app"
|
||||
default n
|
||||
---help---
|
||||
Enable support for px4_simple_app
|
||||
```
|
||||
```
|
||||
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
||||
bool "px4_simple_app"
|
||||
default n
|
||||
---help---
|
||||
Enable support for px4_simple_app
|
||||
```
|
||||
|
||||
## Побудуйте Програму/прошивку
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ CONFIG_DRIVERS_RPM_CAPTURE=y
|
||||
Additionally, to enable the module:
|
||||
|
||||
- Set [ICE_EN](../advanced_config/parameter_reference.md#ICE_EN)
|
||||
to true and adjust the other `ICE_` module parameters according to your needs.
|
||||
to true and adjust the other `ICE_` module parameters according to your needs.
|
||||
- Set [RPM_CAP_ENABLE](../advanced_config/parameter_reference.md#RPM_CAP_ENABLE) to true.
|
||||
|
||||
The module outputs control signals for ignition, throttle, and choke,
|
||||
@@ -367,8 +367,8 @@ The state machine:
|
||||
|
||||
- Checks if [Rpm.msg](../msg_docs/Rpm.md) is updated to know if the engine is running
|
||||
- Allows for user inputs from:
|
||||
- AUX{N}
|
||||
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md)
|
||||
- AUX{N}
|
||||
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md)
|
||||
|
||||
The module publishes [InternalCombustionEngineControl.msg](../msg_docs/InternalCombustionEngineControl.md).
|
||||
|
||||
@@ -484,7 +484,7 @@ The normal log is always a superset of the mission log.
|
||||
The implementation uses two threads:
|
||||
|
||||
- The main thread, running at a fixed rate (or polling on a topic if started with -p) and checking for
|
||||
data updates
|
||||
data updates
|
||||
- The writer thread, writing data to the file
|
||||
|
||||
In between there is a write buffer with configurable size (and another fixed-size buffer for
|
||||
@@ -688,9 +688,9 @@ There are 2 environment variables used for configuration: `replay`, which must b
|
||||
the log file to be replayed. The second is the mode, specified via `replay_mode`:
|
||||
|
||||
- `replay_mode=ekf2`: specific EKF2 replay mode. It can only be used with the ekf2 module, but allows the replay
|
||||
to run as fast as possible.
|
||||
to run as fast as possible.
|
||||
- Generic otherwise: this can be used to replay any module(s), but the replay will be done with the same speed as the
|
||||
log was recorded.
|
||||
log was recorded.
|
||||
|
||||
The module is typically used together with uORB publisher rules, to specify which messages should be replayed.
|
||||
The replay module will just publish all messages that are found in the log. It also applies the parameters from
|
||||
@@ -842,12 +842,12 @@ it into a more usable form, and publishes it for the rest of the system.
|
||||
The provided functionality includes:
|
||||
|
||||
- Read the output from the sensor drivers (`SensorGyro`, etc.).
|
||||
If there are multiple of the same type, do voting and failover handling.
|
||||
Then apply the board rotation and temperature calibration (if enabled). And finally publish the data; one of the
|
||||
topics is `SensorCombined`, used by many parts of the system.
|
||||
If there are multiple of the same type, do voting and failover handling.
|
||||
Then apply the board rotation and temperature calibration (if enabled). And finally publish the data; one of the
|
||||
topics is `SensorCombined`, used by many parts of the system.
|
||||
- Make sure the sensor drivers get the updated calibration parameters (scale & offset) when the parameters change or
|
||||
on startup. The sensor drivers use the ioctl interface for parameter updates. For this to work properly, the
|
||||
sensor drivers must already be running when `sensors` is started.
|
||||
on startup. The sensor drivers use the ioctl interface for parameter updates. For this to work properly, the
|
||||
sensor drivers must already be running when `sensors` is started.
|
||||
- Do sensor consistency checks and publish the `SensorsStatusImu` topic.
|
||||
|
||||
### Імплементація
|
||||
|
||||
@@ -25,37 +25,37 @@ Other examples in Python can be found here: [integrationtests/python_src/px4_it/
|
||||
|
||||
1. Open the terminal and go to `~/catkin_ws/src` directory
|
||||
|
||||
```sh
|
||||
roscd # Should cd into ~/catkin_ws/devel
|
||||
cd ..
|
||||
cd src
|
||||
```
|
||||
```sh
|
||||
roscd # Should cd into ~/catkin_ws/devel
|
||||
cd ..
|
||||
cd src
|
||||
```
|
||||
|
||||
2. In the `~/catkin_ws/src` directory create a new package named `offboard_py` (in this case) with the `rospy` dependency:
|
||||
|
||||
```sh
|
||||
catkin_create_pkg offboard_py rospy
|
||||
```
|
||||
```sh
|
||||
catkin_create_pkg offboard_py rospy
|
||||
```
|
||||
|
||||
3. Build the new package in the `~/catkin_ws/` directory:
|
||||
|
||||
```sh
|
||||
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
||||
catkin build
|
||||
source devel/setup.bash
|
||||
```
|
||||
```sh
|
||||
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
||||
catkin build
|
||||
source devel/setup.bash
|
||||
```
|
||||
|
||||
4. Тепер ви можете мати можливість перейти до пакета, використовуючи:
|
||||
|
||||
```sh
|
||||
```
|
||||
```sh
|
||||
```
|
||||
|
||||
5. To store your Python files, create a new folder called `/scripts` on the package:
|
||||
|
||||
```sh
|
||||
mkdir scripts
|
||||
cd scripts
|
||||
```
|
||||
```sh
|
||||
mkdir scripts
|
||||
cd scripts
|
||||
```
|
||||
|
||||
## Код
|
||||
|
||||
|
||||
@@ -37,63 +37,63 @@ This is needed because, by default, you cannot arm a vehicle without a connectio
|
||||
|
||||
2. Створіть новий каталог робочого простору colcon і перейдіть до нього за допомогою:
|
||||
|
||||
```sh
|
||||
mkdir -p ~/ws_offboard_control/src/
|
||||
cd ~/ws_offboard_control/src/
|
||||
```
|
||||
```sh
|
||||
mkdir -p ~/ws_offboard_control/src/
|
||||
cd ~/ws_offboard_control/src/
|
||||
```
|
||||
|
||||
3. Clone the [px4_msgs](https://github.com/PX4/px4_msgs) repo to the `/src` directory (this repo is needed in every ROS 2 PX4 workspace!):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
# checkout the matching release branch if not using PX4 main.
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
# checkout the matching release branch if not using PX4 main.
|
||||
```
|
||||
|
||||
4. Clone the example repository [px4_ros_com](https://github.com/PX4/px4_ros_com) to the `/src` directory:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
|
||||
5. Source the ROS 2 development environment into the current terminal and compile the workspace using `colcon`:
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
6. Source the `local_setup.bash`:
|
||||
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
|
||||
7. Запустіть приклад.
|
||||
|
||||
```
|
||||
ros2 run px4_ros_com offboard_control
|
||||
```
|
||||
```
|
||||
ros2 run px4_ros_com offboard_control
|
||||
```
|
||||
|
||||
Транспортний засіб повинен озброїтися, піднятися на 5 метрів і потім зачекати (вічно).
|
||||
|
||||
|
||||
@@ -128,21 +128,21 @@ You add some "boilerplate" code to regularly listen for changes in the [uORB Top
|
||||
|
||||
- **px4_platform_common/module_params.h** to get the `DEFINE_PARAMETERS` macro:
|
||||
|
||||
```cpp
|
||||
#include <px4_platform_common/module_params.h>
|
||||
```
|
||||
```cpp
|
||||
#include <px4_platform_common/module_params.h>
|
||||
```
|
||||
|
||||
- **parameter_update.h** to access the uORB `parameter_update` message:
|
||||
|
||||
```cpp
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
```
|
||||
```cpp
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
```
|
||||
|
||||
- **Subscription.hpp** for the uORB C++ subscription API:
|
||||
|
||||
```cpp
|
||||
#include <uORB/Subscription.hpp>
|
||||
```
|
||||
```cpp
|
||||
#include <uORB/Subscription.hpp>
|
||||
```
|
||||
|
||||
Derive your class from `ModuleParams`, and use `DEFINE_PARAMETERS` to specify a list of parameters and their associated parameter attributes.
|
||||
参数的名称必须与其参数元数据定义相同。
|
||||
@@ -194,7 +194,7 @@ void Module::parameters_update()
|
||||
- `_parameter_update_sub.updated()` tells us if there is _any_ update to the `param_update` uORB message (but not what parameter is affected).
|
||||
- If there has been "some" parameter updated, we copy the update into a `parameter_update_s` (`param_update`), to clear the pending update.
|
||||
- Then we call `ModuleParams::updateParams()`.
|
||||
This "under the hood" updates all parameter attributes listed in our `DEFINE_PARAMETERS` list.
|
||||
This "under the hood" updates all parameter attributes listed in our `DEFINE_PARAMETERS` list.
|
||||
|
||||
The parameter attributes (`_sys_autostart` and `_att_bias_max` in this case) can then be used to represent the parameters, and will be updated whenever the parameter value changes.
|
||||
|
||||
@@ -267,12 +267,12 @@ YAML meta data is intended as a full replacement for the **.c** definitions.
|
||||
- An example of YAML definitions being used can be found in the MAVLink parameter definitions: [/src/modules/mavlink/module.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/mavlink/module.yaml).
|
||||
- 通过添加到 cmake 构建系统中注册一个 YAML 文件
|
||||
|
||||
```cmake
|
||||
MODULE_CONFIG
|
||||
module.yaml
|
||||
```
|
||||
```cmake
|
||||
MODULE_CONFIG
|
||||
module.yaml
|
||||
```
|
||||
|
||||
to the `px4_add_module` section of the `CMakeLists.txt` file of that module.
|
||||
to the `px4_add_module` section of the `CMakeLists.txt` file of that module.
|
||||
|
||||
#### 多实例(模块化)YAML 元数据
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ This guide walks through the process of setting up the board and connecting to P
|
||||
You will temporarily need the following hardware in order to log into your Jetson and get its IP address, after which you will be able to log in via SSH:
|
||||
|
||||
- External display.
|
||||
If your display doesn't have a mini HDMI connector you will also need a [Mini HDMI to HDMI converter](https://a.co/d/6N815N9) if your external display has HDMI input
|
||||
If your display doesn't have a mini HDMI connector you will also need a [Mini HDMI to HDMI converter](https://a.co/d/6N815N9) if your external display has HDMI input
|
||||
- Ethernet cable
|
||||
- Mouse and keyboard (the baseboard has 4 USB ports exposed from Jetson, two of which are USB 3.0)
|
||||
|
||||
@@ -45,11 +45,11 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- 尺寸
|
||||
|
||||
- 126 x 80 x 45mm (with Jetson Orin NX + Heatsink/Fan & FC Module)
|
||||
- 126 x 80 x 22.9mm (without Jetson and FC Module)
|
||||
- 126 x 80 x 45mm (with Jetson Orin NX + Heatsink/Fan & FC Module)
|
||||
- 126 x 80 x 22.9mm (without Jetson and FC Module)
|
||||
|
||||
- 重量
|
||||
- 190g (with Jetson, Heatsink, Flight Controller, M.2 SSD, M.2 Wi-Fi Module)
|
||||
- 190g (with Jetson, Heatsink, Flight Controller, M.2 SSD, M.2 Wi-Fi Module)
|
||||
|
||||
:::
|
||||
|
||||
@@ -57,67 +57,67 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- 2x Gigabit Ethernet Port
|
||||
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- Ethernet Switch powered by the same circuit as the Pixhawk
|
||||
- 8-pin JST-GH
|
||||
- RJ45
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- Ethernet Switch powered by the same circuit as the Pixhawk
|
||||
- 8-pin JST-GH
|
||||
- RJ45
|
||||
|
||||
- 2x MIPI CSI Camera Inputs
|
||||
|
||||
- 4 Lanes each
|
||||
- 22-Pin Raspberry Pi Cam FFC
|
||||
- 4 Lanes each
|
||||
- 22-Pin Raspberry Pi Cam FFC
|
||||
|
||||
- 2x USB 3.0 Host Port
|
||||
|
||||
- USB A
|
||||
- 5A Current Limit
|
||||
- USB A
|
||||
- 5A Current Limit
|
||||
|
||||
- 2x USB 2.0 Host Port
|
||||
|
||||
- 5-Pin JST-GH
|
||||
- 0A Current Limit
|
||||
- 5-Pin JST-GH
|
||||
- 0A Current Limit
|
||||
|
||||
- USB 2.0 for Programming/Debugging
|
||||
|
||||
- USB-C
|
||||
- USB-C
|
||||
|
||||
- 2 Key M 2242/2280 for NVMe SSD
|
||||
|
||||
- PCIEx4
|
||||
- PCIEx4
|
||||
|
||||
- 2 Key E 2230 for WiFi/BT
|
||||
|
||||
- PCIEx2
|
||||
- USB
|
||||
- UART
|
||||
- I2S
|
||||
- PCIEx2
|
||||
- USB
|
||||
- UART
|
||||
- I2S
|
||||
|
||||
- Mini HDMI Out
|
||||
|
||||
- 4x GPIO
|
||||
|
||||
- 6-pin JST-GH
|
||||
- 6-pin JST-GH
|
||||
|
||||
- CAN Port
|
||||
|
||||
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
||||
- Connected to Autopilot's CAN2 (4 Pin JST-GH)
|
||||
|
||||
- SPI Port
|
||||
|
||||
- 7-Pin JST-GH
|
||||
- 7-Pin JST-GH
|
||||
|
||||
- I2C Port
|
||||
|
||||
- 4-Pin JST-GH
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- I2S Port
|
||||
|
||||
- 7-Pin JST-GH
|
||||
- 7-Pin JST-GH
|
||||
|
||||
- 2x UART Port
|
||||
|
||||
- 1 for debug
|
||||
- 1 connected to Autopilot's telem2
|
||||
- 1 for debug
|
||||
- 1 connected to Autopilot's telem2
|
||||
|
||||
- Fan Power Port
|
||||
|
||||
@@ -129,13 +129,13 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- Pixhawk Autopilot Bus Interface
|
||||
|
||||
- 100 Pin Hirose DF40
|
||||
- 50 Pin Hirose DF40
|
||||
- 100 Pin Hirose DF40
|
||||
- 50 Pin Hirose DF40
|
||||
|
||||
- Redundant Digital Power Module Inputs
|
||||
|
||||
- I2C Power Monitor Support
|
||||
- 2x 6-Pin Molex CLIK-Mate
|
||||
- I2C Power Monitor Support
|
||||
- 2x 6-Pin Molex CLIK-Mate
|
||||
|
||||
- Power Path Selector
|
||||
|
||||
@@ -143,68 +143,68 @@ This information comes from the [Holybro Pixhawk-Jetson Baseboard Documentation]
|
||||
|
||||
- 额定电压
|
||||
|
||||
- Max input voltage: 6V
|
||||
- USB 电源输入:4.75~5.25V
|
||||
- Max input voltage: 6V
|
||||
- USB 电源输入:4.75~5.25V
|
||||
|
||||
- Full GPS Plus Safety Switch Port
|
||||
|
||||
- 10-Pin JST-GH
|
||||
- 10-Pin JST-GH
|
||||
|
||||
- Secondary (GPS2) Port
|
||||
|
||||
- 6-Pin JST-GH
|
||||
- 6-Pin JST-GH
|
||||
|
||||
- 2x CAN Ports
|
||||
|
||||
- 4-Pin JST-GH
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- 3x Telemetry Ports with Flow Control
|
||||
|
||||
- 2x 6-Pin JST-GH
|
||||
- 1 is connected to Jetson's `UART1` Port
|
||||
- 2x 6-Pin JST-GH
|
||||
- 1 is connected to Jetson's `UART1` Port
|
||||
|
||||
- 16 PWM Outputs
|
||||
|
||||
- 2x 10-Pin JST-GH
|
||||
- 2x 10-Pin JST-GH
|
||||
|
||||
- UART4 & I2C Port
|
||||
|
||||
- 6-Pin JST-GH
|
||||
- 6-Pin JST-GH
|
||||
|
||||
- 2x Gigabit Ethernet Port
|
||||
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- 8-Pin JST-GH
|
||||
- RJ45
|
||||
- Connected to both Jetson & Autopilot via Ethernet switch (RTL8367S)
|
||||
- 8-Pin JST-GH
|
||||
- RJ45
|
||||
|
||||
- AD & IO
|
||||
|
||||
- 8-Pin JST-GH
|
||||
- 8-Pin JST-GH
|
||||
|
||||
- USB 2.0
|
||||
|
||||
- USB-C
|
||||
- 4-Pin JST-GH
|
||||
- USB-C
|
||||
- 4-Pin JST-GH
|
||||
|
||||
- DSM Input
|
||||
|
||||
- 3-Pin JST-ZH 1.5mm Pitch
|
||||
- 3-Pin JST-ZH 1.5mm Pitch
|
||||
|
||||
- RC In
|
||||
|
||||
- PPM/SBUS
|
||||
- 5-Pin JST-GH
|
||||
- PPM/SBUS
|
||||
- 5-Pin JST-GH
|
||||
|
||||
- SPI Port
|
||||
|
||||
- External Sensor Bus (SPI5)
|
||||
- 11-Pin JST-GH
|
||||
- External Sensor Bus (SPI5)
|
||||
- 11-Pin JST-GH
|
||||
|
||||
- 2x Debug Port
|
||||
|
||||
- 1 for FMU
|
||||
- 1 for IO
|
||||
- 10-Pin JST-SH
|
||||
- 1 for FMU
|
||||
- 1 for IO
|
||||
- 10-Pin JST-SH
|
||||
|
||||
:::
|
||||
|
||||
@@ -218,7 +218,7 @@ The Jetson has separate input power circuitry from the Pixhawk autopilot:
|
||||
- 8V/3A Minimum (Depends on Usage and Peripherals)
|
||||
- Voltage Rating: 7-21V (3S-4S)
|
||||
- Jetson Baseboard onboard BEC is rated for 7-21V (3S-4S).
|
||||
Note that the external UBEC-12A can be used for applications above 4S
|
||||
Note that the external UBEC-12A can be used for applications above 4S
|
||||
|
||||
During development using the following wired power supply is recommended:
|
||||
|
||||
@@ -698,7 +698,7 @@ On the following screen, confirm your selected device:
|
||||
|
||||
- Choose `Pre-config` for the OEM Configuration (this will skip Ubuntu first time setup screens after reboot).
|
||||
- Choose your preferred username and password (and write them down).
|
||||
These will be used as your login credentials to Jetpack.
|
||||
These will be used as your login credentials to Jetpack.
|
||||
- Choose `NVMe` as the storage device because the board has separate SSD for storage.
|
||||
|
||||

|
||||
@@ -922,95 +922,95 @@ These instructions approximately mirror the [PX4 Ethernet setup](../advanced_con
|
||||
Next we modify the Jetson IP address to be on the same network as the Pixhawk:
|
||||
|
||||
1. Make sure `netplan` is installed.
|
||||
You can check by running the following command:
|
||||
You can check by running the following command:
|
||||
|
||||
```sh
|
||||
netplan -h
|
||||
```
|
||||
```sh
|
||||
netplan -h
|
||||
```
|
||||
|
||||
If not, install it using the commands:
|
||||
If not, install it using the commands:
|
||||
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install netplan.io
|
||||
```
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install netplan.io
|
||||
```
|
||||
|
||||
2. Check `system_networkd` is running:
|
||||
|
||||
```sh
|
||||
sudo systemctl status systemd-networkd
|
||||
```
|
||||
```sh
|
||||
sudo systemctl status systemd-networkd
|
||||
```
|
||||
|
||||
You should see output like below if it is active:
|
||||
You should see output like below if it is active:
|
||||
|
||||
```sh
|
||||
● systemd-networkd.service - Network Configuration
|
||||
Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
|
||||
Active: active (running) since Wed 2024-09-11 23:32:44 EDT; 23min ago
|
||||
TriggeredBy: ● systemd-networkd.socket
|
||||
Docs: man:systemd-networkd.service(8)
|
||||
Main PID: 2452 (systemd-network)
|
||||
Status: "Processing requests..."
|
||||
Tasks: 1 (limit: 18457)
|
||||
Memory: 2.7M
|
||||
CPU: 157ms
|
||||
CGroup: /system.slice/systemd-networkd.service
|
||||
└─2452 /lib/systemd/systemd-networkd
|
||||
```sh
|
||||
● systemd-networkd.service - Network Configuration
|
||||
Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
|
||||
Active: active (running) since Wed 2024-09-11 23:32:44 EDT; 23min ago
|
||||
TriggeredBy: ● systemd-networkd.socket
|
||||
Docs: man:systemd-networkd.service(8)
|
||||
Main PID: 2452 (systemd-network)
|
||||
Status: "Processing requests..."
|
||||
Tasks: 1 (limit: 18457)
|
||||
Memory: 2.7M
|
||||
CPU: 157ms
|
||||
CGroup: /system.slice/systemd-networkd.service
|
||||
└─2452 /lib/systemd/systemd-networkd
|
||||
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: lo: Gained carrier
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: eth0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: Enumeration completed
|
||||
Sep 11 23:32:44 ubuntu systemd[1]: Started Network Configuration.
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Connected WiFi access point: Verizon_7YLWWD (78:67:0e:ea:a6:0>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
```
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: lo: Gained carrier
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: eth0: Gained IPv6LL
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: Enumeration completed
|
||||
Sep 11 23:32:44 ubuntu systemd[1]: Started Network Configuration.
|
||||
Sep 11 23:32:44 ubuntu systemd-networkd[2452]: wlan0: Connected WiFi access point: Verizon_7YLWWD (78:67:0e:ea:a6:0>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: Re-configuring with /run/systemd/network/10-netplan-eth0.netwo>
|
||||
Sep 11 23:34:16 ubuntu systemd-networkd[2452]: eth0: DHCPv6 lease lost
|
||||
```
|
||||
|
||||
If `system_networkd` is not running, it can be enabled using:
|
||||
If `system_networkd` is not running, it can be enabled using:
|
||||
|
||||
```sh
|
||||
sudo systemctl start systemd-networkd
|
||||
sudo systemctl enable systemd-networkd
|
||||
```
|
||||
```sh
|
||||
sudo systemctl start systemd-networkd
|
||||
sudo systemctl enable systemd-networkd
|
||||
```
|
||||
|
||||
3. Open the Netplan configuration file (so we can set up a static IP for the Jetson).
|
||||
|
||||
The Netplan configuration file is usually located in the `/etc/netplan/` directory and named something like `01-netcfg.yaml` (the name can vary).
|
||||
Below we use `nano` to open the file, but you can use your preferred text editor:
|
||||
The Netplan configuration file is usually located in the `/etc/netplan/` directory and named something like `01-netcfg.yaml` (the name can vary).
|
||||
Below we use `nano` to open the file, but you can use your preferred text editor:
|
||||
|
||||
```sh
|
||||
sudo nano /etc/netplan/01-netcfg.yaml
|
||||
```
|
||||
```sh
|
||||
sudo nano /etc/netplan/01-netcfg.yaml
|
||||
```
|
||||
|
||||
4. Modify the yaml configuration, by overwriting the contents with the following information and then saving:
|
||||
|
||||
```sh
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses:
|
||||
- 10.41.10.1/24
|
||||
routes:
|
||||
- to: 0.0.0.0/0
|
||||
via: 10.41.10.254
|
||||
nameservers:
|
||||
addresses:
|
||||
- 10.41.10.254
|
||||
```
|
||||
```sh
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses:
|
||||
- 10.41.10.1/24
|
||||
routes:
|
||||
- to: 0.0.0.0/0
|
||||
via: 10.41.10.254
|
||||
nameservers:
|
||||
addresses:
|
||||
- 10.41.10.254
|
||||
```
|
||||
|
||||
This gives the Jetson a static IP address on the Ethernet interface of `10.41.10.1` .
|
||||
This gives the Jetson a static IP address on the Ethernet interface of `10.41.10.1` .
|
||||
|
||||
5. Apply the changes using the following command:
|
||||
|
||||
```sh
|
||||
sudo netplan apply
|
||||
```
|
||||
```sh
|
||||
sudo netplan apply
|
||||
```
|
||||
|
||||
The Pixhawk Ethernet address is set to `10.41.10.2` by default, which is on the same subnet.
|
||||
We can test our changes above by pinging the Pixhawk from within the Jetson terminal:
|
||||
@@ -1221,15 +1221,15 @@ Assuming the client is set up as defined above:
|
||||
|
||||
- (Serial connection) Start the agent on `/dev/ttyTHS1`:
|
||||
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
||||
```
|
||||
```sh
|
||||
sudo MicroXRCEAgent serial --dev /dev/ttyTHS1 -b 921600
|
||||
```
|
||||
|
||||
- (Ethernet) Start the agent on UDP port `8888`:
|
||||
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
|
||||
If your agent and client are connected and no nodes are running, you should see output similar to this in the Agent terminal:
|
||||
|
||||
|
||||
@@ -71,42 +71,42 @@ Explanations and requirements:
|
||||
- `/* EVENT`: This tag indicates that a comment defines metadata for the following event.
|
||||
|
||||
- **event_name**: the event name (`events::ID(event_name)`).
|
||||
- must be unique within the whole source code of PX4.
|
||||
As a general convention, prefix it with the module name, or the source file for larger modules.
|
||||
- must be a valid variable name, i.e. must not contain spaces, colons, etc.
|
||||
- from that name, a 24 bit event ID is derived using a hash function.
|
||||
This means as long as the event name stays the same, so will the ID.
|
||||
- must be unique within the whole source code of PX4.
|
||||
As a general convention, prefix it with the module name, or the source file for larger modules.
|
||||
- must be a valid variable name, i.e. must not contain spaces, colons, etc.
|
||||
- from that name, a 24 bit event ID is derived using a hash function.
|
||||
This means as long as the event name stays the same, so will the ID.
|
||||
|
||||
- **Log Level**:
|
||||
|
||||
- valid log levels are the same as used in the MAVLink [MAV_SEVERITY](https://mavlink.io/en/messages/common.html#MAV_SEVERITY) enum.
|
||||
In order of descending importance these are:
|
||||
- valid log levels are the same as used in the MAVLink [MAV_SEVERITY](https://mavlink.io/en/messages/common.html#MAV_SEVERITY) enum.
|
||||
In order of descending importance these are:
|
||||
|
||||
```plain
|
||||
Emergency,
|
||||
Alert,
|
||||
Critical,
|
||||
Error,
|
||||
Warning,
|
||||
Notice,
|
||||
Info,
|
||||
Debug,
|
||||
Disabled,
|
||||
```
|
||||
```plain
|
||||
Emergency,
|
||||
Alert,
|
||||
Critical,
|
||||
Error,
|
||||
Warning,
|
||||
Notice,
|
||||
Info,
|
||||
Debug,
|
||||
Disabled,
|
||||
```
|
||||
|
||||
- Above we specify a separate external and internal log level, which are the levels displayed to GCS users and in the log file, respectively: `{events::Log::Error, events::LogInternal::Info}`.
|
||||
For the majority of cases you can pass a single log level, and this will be used for both exernal and internal cases.
|
||||
There are cases it makes sense to have two different log levels.
|
||||
For example an RTL failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`.
|
||||
- Above we specify a separate external and internal log level, which are the levels displayed to GCS users and in the log file, respectively: `{events::Log::Error, events::LogInternal::Info}`.
|
||||
For the majority of cases you can pass a single log level, and this will be used for both exernal and internal cases.
|
||||
There are cases it makes sense to have two different log levels.
|
||||
For example an RTL failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`.
|
||||
|
||||
- **Event Message**:
|
||||
- Single-line, short message of the event.
|
||||
It may contain template placeholders for arguments (e.g. `{1}`). For more information see below.
|
||||
- Single-line, short message of the event.
|
||||
It may contain template placeholders for arguments (e.g. `{1}`). For more information see below.
|
||||
|
||||
- **Event Description**:
|
||||
- Detailed, optional event description.
|
||||
- Can be multiple lines/paragraphs.
|
||||
- It may contain template placeholders for arguments (e.g. `{2}`) and supported tags (see below)
|
||||
- Detailed, optional event description.
|
||||
- Can be multiple lines/paragraphs.
|
||||
- It may contain template placeholders for arguments (e.g. `{2}`) and supported tags (see below)
|
||||
|
||||
#### Arguments and Enums
|
||||
|
||||
@@ -125,35 +125,35 @@ Text format for event message description:
|
||||
|
||||
- characters can be escaped with \\
|
||||
|
||||
These have to be escaped: '\\\\', '\\<', '\\{'.
|
||||
These have to be escaped: '\\\\', '\\<', '\\{'.
|
||||
|
||||
- supported tags:
|
||||
|
||||
- Profiles: `<profile name="[!]NAME">CONTENT</profile>`
|
||||
- Profiles: `<profile name="[!]NAME">CONTENT</profile>`
|
||||
|
||||
`CONTENT` will only be shown if the name matches the configured profile.
|
||||
This can be used for example to hide developer information from end-users.
|
||||
`CONTENT` will only be shown if the name matches the configured profile.
|
||||
This can be used for example to hide developer information from end-users.
|
||||
|
||||
- URLs: `<a [href="URL"]>CONTENT</a>`.
|
||||
If `href` is not set, use `CONTENT` as `URL` (i.e.`<a>https://docs.px4.io</a>` is interpreted as `<a href="https://docs.px4.io">https://docs.px4.io</a>`)
|
||||
- URLs: `<a [href="URL"]>CONTENT</a>`.
|
||||
If `href` is not set, use `CONTENT` as `URL` (i.e.`<a>https://docs.px4.io</a>` is interpreted as `<a href="https://docs.px4.io">https://docs.px4.io</a>`)
|
||||
|
||||
- Parameters: `<param>PARAM_NAME</param>`
|
||||
- Parameters: `<param>PARAM_NAME</param>`
|
||||
|
||||
- no nested tags of the same type are allowed
|
||||
- no nested tags of the same type are allowed
|
||||
|
||||
- arguments: template placeholders that follow python syntax, with 1-based indexing (instead of 0)
|
||||
|
||||
- general form: `{ARG_IDX[:.NUM_DECIMAL_DIGITS][UNIT]}`
|
||||
- general form: `{ARG_IDX[:.NUM_DECIMAL_DIGITS][UNIT]}`
|
||||
|
||||
UNIT:
|
||||
UNIT:
|
||||
|
||||
- m: horizontal distance in meters
|
||||
- m_v: vertical distance in meters
|
||||
- m^2: area in m^2
|
||||
- m/s: speed in m/s
|
||||
- C: temperature in degrees celsius
|
||||
- m: horizontal distance in meters
|
||||
- m_v: vertical distance in meters
|
||||
- m^2: area in m^2
|
||||
- m/s: speed in m/s
|
||||
- C: temperature in degrees celsius
|
||||
|
||||
- `NUM_DECIMAL_DIGITS` only makes sense for real number arguments.
|
||||
- `NUM_DECIMAL_DIGITS` only makes sense for real number arguments.
|
||||
|
||||
## 日志
|
||||
|
||||
|
||||
+14
-14
@@ -38,9 +38,9 @@ A frame configuration can define everything about a vehicle, from it's geometry
|
||||
When you're bringing up a new vehicle though, the frame will usually contain a fairly minimal configuration:
|
||||
|
||||
- Frames named with "Generic" define the vehicle type, number of rotors, and "placeholder" rotor positions.
|
||||
After selecting the airframe you define the actual geometry and then configure outputs.
|
||||
After selecting the airframe you define the actual geometry and then configure outputs.
|
||||
- Frames named with model/brand will define the vehicle type, number of rotors, actual rotor positions, and motor directions.
|
||||
After selecting the airframe you usually still have to configure outputs.
|
||||
After selecting the airframe you usually still have to configure outputs.
|
||||
|
||||
:::
|
||||
|
||||
@@ -52,7 +52,7 @@ This ensures that all ESC provide exactly the same output for a given input (ide
|
||||
The final step is [Motor Configuration](../config/actuators.md#motor-configuration):
|
||||
|
||||
- [Reverse any motors](../config/actuators.md#reversing-motors) that don't match the spin direction configured in the Geometry.
|
||||
For DShot ESC you can do this through the Acuator Testing UI.
|
||||
For DShot ESC you can do this through the Acuator Testing UI.
|
||||
- PWM, OneShot, and CAN ESC, set the motor input limits for disarmed, low and high speed (not needed for DShot ESC)
|
||||
|
||||
相关章节:
|
||||
@@ -123,14 +123,14 @@ Tuning is the final step, carried out only after most other setup and configurat
|
||||
|
||||
- [Autotune](../config/autotune_mc.md) — Automates tuning PX4 rate and attitude controllers (recommended).
|
||||
|
||||
::: info
|
||||
Automatic tuning works on frames that have reasonable authority and dynamics around all the body axes.
|
||||
It has primarily been tested on racing quads and X500, and is expected to be less effective on tricopters with a tiltable rotor.
|
||||
::: info
|
||||
Automatic tuning works on frames that have reasonable authority and dynamics around all the body axes.
|
||||
It has primarily been tested on racing quads and X500, and is expected to be less effective on tricopters with a tiltable rotor.
|
||||
|
||||
Manual tuning using these guides are only needed if there is a problem with autotune:
|
||||
Manual tuning using these guides are only needed if there is a problem with autotune:
|
||||
|
||||
- [MC PID Tuning (Manual/Basic)](../config_mc/pid_tuning_guide_multicopter_basic.md) — Manual tuning basic how to.
|
||||
- [MC PID Tuning Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
|
||||
- [MC PID Tuning (Manual/Basic)](../config_mc/pid_tuning_guide_multicopter_basic.md) — Manual tuning basic how to.
|
||||
- [MC PID Tuning Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
|
||||
|
||||
|
||||
:::
|
||||
@@ -138,7 +138,7 @@ Tuning is the final step, carried out only after most other setup and configurat
|
||||
- [MC Filter/Control Latency Tuning](../config_mc/filter_tuning.md) — Trade off control latency and noise filtering.
|
||||
|
||||
- [MC Setpoint Tuning (Trajectory Generator)](../config_mc/mc_trajectory_tuning.md)
|
||||
- [MC Jerk-limited Type Trajectory](../config_mc/mc_jerk_limited_type_trajectory.md)
|
||||
- [MC Jerk-limited Type Trajectory](../config_mc/mc_jerk_limited_type_trajectory.md)
|
||||
|
||||
- [Multicopter Racer Setup](../config_mc/racer_setup.md)
|
||||
|
||||
@@ -167,7 +167,7 @@ Yes but it must be physically feasible. E.g. if you make a quadrotor where all m
|
||||
- [飞控外设](../peripherals/index.md) - 设置特定传感器、可选传感器、执行器等。
|
||||
- [Advanced Configuration](../advanced_config/index.md) - Factory/OEM calibration, configuring advanced features, less-common configuration.
|
||||
- Vehicle-Centric Config/Tuning:
|
||||
- **Multicopter Config/Tuning**
|
||||
- [直升机配置/调参](../config_heli/index.md)
|
||||
- [Fixed Wing Config/Tuning](../config_fw/index.md)
|
||||
- [VTOL 配置/调参](../config_vtol/index.md)
|
||||
- **Multicopter Config/Tuning**
|
||||
- [直升机配置/调参](../config_heli/index.md)
|
||||
- [Fixed Wing Config/Tuning](../config_fw/index.md)
|
||||
- [VTOL 配置/调参](../config_vtol/index.md)
|
||||
|
||||
@@ -26,13 +26,13 @@ The ARF kit can be used with most flight controllers supported by PX4.
|
||||
The Holybro [X500 V2 Kit](https://holybro.com/collections/x500-kits) includes almost all the required components:
|
||||
|
||||
- X500V2 Frame Kit
|
||||
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
||||
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
||||
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
||||
- Platform board - With mounting holes for GPS & popular companion computer
|
||||
- Dual 10mm Ø rod x 250 mm long rail mounting system
|
||||
- Battery mount with two Battery Straps
|
||||
- Hand tools for installation
|
||||
- Body - Full Carbon Fiber Top & Bottom plate (144 x 144mm, 2mm thick)
|
||||
- Arm - High strength & ultra-lightweight 16mm carbon fiber tubes
|
||||
- Landing gear - 16mm & 10mm diameter carbon fiber tubes
|
||||
- Platform board - With mounting holes for GPS & popular companion computer
|
||||
- Dual 10mm Ø rod x 250 mm long rail mounting system
|
||||
- Battery mount with two Battery Straps
|
||||
- Hand tools for installation
|
||||
- Holybro Motors - 2216 KV880 x6 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||
- Holybro BLHeli S ESC 20A x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||
- Propellers - 1045 x4 (superseded - check [spare parts list](https://holybro.com/products/spare-parts-x500-v2-kit) for current version).
|
||||
@@ -93,92 +93,92 @@ Tools are included to do the assembly, however you may need:
|
||||
Estimate time to assemble is 55 min (25 minutes for frame, 30 minutes for autopilot installation/configuration)
|
||||
|
||||
1. Start by assembling the payload & battery holder.
|
||||
Push the rubbers into grippers (Do not use sharp items to push them in!).
|
||||
Next, pass the holders through the holder bars with the battery holder bases as Figure 3.
|
||||
Push the rubbers into grippers (Do not use sharp items to push them in!).
|
||||
Next, pass the holders through the holder bars with the battery holder bases as Figure 3.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 2_: Payload holder components
|
||||
_Figure 2_: Payload holder components
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 3_: Payload holder assembled
|
||||
_Figure 3_: Payload holder assembled
|
||||
|
||||
2. The next is to go for attaching the bottom plate to the payload holder.
|
||||
|
||||
You will need the parts as shown in Figure 4.
|
||||
Then mount the base for power distribution board using nylon nuts as Figure 5.
|
||||
Finally using 8 hex screws you can join the bottom plate to the payload holder (Figure 7)
|
||||
You will need the parts as shown in Figure 4.
|
||||
Then mount the base for power distribution board using nylon nuts as Figure 5.
|
||||
Finally using 8 hex screws you can join the bottom plate to the payload holder (Figure 7)
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 4_: Needed Materials
|
||||
_Figure 4_: Needed Materials
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 5_: PDB mount base
|
||||
_Figure 5_: PDB mount base
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 6_: Mounted pdb with nylon nuts
|
||||
_Figure 6_: Mounted pdb with nylon nuts
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 7_: Mounted Plate on payload holder
|
||||
_Figure 7_: Mounted Plate on payload holder
|
||||
|
||||
3. Let's gather the stuff needed for mounting landing gear as Figure 8.
|
||||
Use the hex screws to join landing gears to the bottom plate.
|
||||
You also need to open three hex screws on each of the leg stands so you can push them into carbon fiber pipes.
|
||||
Do not forget to tighten them back again.
|
||||
Use the hex screws to join landing gears to the bottom plate.
|
||||
You also need to open three hex screws on each of the leg stands so you can push them into carbon fiber pipes.
|
||||
Do not forget to tighten them back again.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 8_: Required parts for landing gear attachment
|
||||
_Figure 8_: Required parts for landing gear attachment
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 9_: Landing gear attachment to the body
|
||||
_Figure 9_: Landing gear attachment to the body
|
||||
|
||||
4. We will gather all the arms now to mount the top plate.
|
||||
Please pay attention that the motor numbers on arms are a match with the ones mentioned on the top plate.
|
||||
Fortunately, motors are mounted and ESCs have been connected in advance.
|
||||
Start by passing through all the screws as you have the arms fixed in their own places (They have a guide as shown in Figure 11 to ensure they are in place) and tighten all nylon nuts a bit.
|
||||
Then you can connect XT30 power connectors to the power board.
|
||||
Please keep in mind that the signal wires have to be passed through the top plate such that we can connect them later to Pixhawk.
|
||||
Please pay attention that the motor numbers on arms are a match with the ones mentioned on the top plate.
|
||||
Fortunately, motors are mounted and ESCs have been connected in advance.
|
||||
Start by passing through all the screws as you have the arms fixed in their own places (They have a guide as shown in Figure 11 to ensure they are in place) and tighten all nylon nuts a bit.
|
||||
Then you can connect XT30 power connectors to the power board.
|
||||
Please keep in mind that the signal wires have to be passed through the top plate such that we can connect them later to Pixhawk.
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/needed_stuff_top_plate.png" width="700" title="Arms and top plate materials">
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/needed_stuff_top_plate.png" width="700" title="Arms and top plate materials">
|
||||
|
||||
_Figure 10_: Connecting arms needed materials.
|
||||
_Figure 10_: Connecting arms needed materials.
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/guide_for_arm_mount.png" width="700" title="Guide for the arms mount">
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/guide_for_arm_mount.png" width="700" title="Guide for the arms mount">
|
||||
|
||||
_Figure 11_: Guide for the arms mount
|
||||
_Figure 11_: Guide for the arms mount
|
||||
|
||||
5. Tighten all 16 screws and nuts by using both hex wrench and nut driver.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 12_: Mounted top plate
|
||||
_Figure 12_: Mounted top plate
|
||||
|
||||
6. Next you can mount your pixhawk on the top plate by using the stickers.
|
||||
It is recommended to have the direction of your Pixhawk's arrow the same as the one mentioned on the top plate.
|
||||
It is recommended to have the direction of your Pixhawk's arrow the same as the one mentioned on the top plate.
|
||||
|
||||

|
||||

|
||||
|
||||
_Figure 13_: Sticker tapes on Pixhawk
|
||||
_Figure 13_: Sticker tapes on Pixhawk
|
||||
|
||||
7. If you want to mount the GPS on the companion computer plate, you can now secure the GPS mount onto it using 4 screws and nuts.
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/gps_mount_plate.png" width="400" title="Secure GPS mount onto companion plate">
|
||||
<img src="../../assets/airframes/multicopter/x500_v2_holybro_pixhawk5x/gps_mount_plate.png" width="400" title="Secure GPS mount onto companion plate">
|
||||
|
||||
_Figure 14_: Secure GPS mount onto companion plate
|
||||
_Figure 14_: Secure GPS mount onto companion plate
|
||||
|
||||
8. Use the tape and stick the GPS to the top of the GPS mast and mount the GPS mast.
|
||||
Make sure the arrow on the gps is pointing forward (Figure 15).
|
||||
Make sure the arrow on the gps is pointing forward (Figure 15).
|
||||
|
||||
<img src="../../assets/airframes/multicopter/x500_holybro_pixhawk4/gps2.jpg" width="400" title="Figure 16: GPS and mast">
|
||||
<img src="../../assets/airframes/multicopter/x500_holybro_pixhawk4/gps2.jpg" width="400" title="Figure 16: GPS and mast">
|
||||
|
||||
_Figure 15_: GPS and mast
|
||||
_Figure 15_: GPS and mast
|
||||
|
||||
9. Finally, you can connect the Pixhawk interfaces such as telemetry radio to 'TELEM1' and motors signal cables accordingly.
|
||||
|
||||
@@ -204,14 +204,14 @@ First update the firmware, airframe, and actuator mappings:
|
||||
|
||||
- [Airframe](../config/airframe.md)
|
||||
|
||||
You will need to select the _Holybro X500 V2_ airframe (**Quadrotor x > Holybro 500 V2**)
|
||||
You will need to select the _Holybro X500 V2_ airframe (**Quadrotor x > Holybro 500 V2**)
|
||||
|
||||

|
||||

|
||||
|
||||
- [Actuators](../config/actuators.md)
|
||||
- You should not need to update the vehicle geometry (as this is a preconfigured airframe).
|
||||
- Assign actuator functions to outputs to match your wiring.
|
||||
- Test the configuration using the sliders.
|
||||
- You should not need to update the vehicle geometry (as this is a preconfigured airframe).
|
||||
- Assign actuator functions to outputs to match your wiring.
|
||||
- Test the configuration using the sliders.
|
||||
|
||||
Then perform the mandatory setup/calibration:
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ Key airframe features:
|
||||
- Removable V tail or conventional tail options included
|
||||
- Threaded inserts in the wings and fuselage top for external mounting
|
||||
- Numerous mounting features
|
||||
- Top antenna hole
|
||||
- Top GPS cover
|
||||
- Side "T" antenna mounts
|
||||
- Rear electronics tray
|
||||
- Front facing "action cam" cutout
|
||||
- Front facing FPV camera cutout
|
||||
- Top antenna hole
|
||||
- Top GPS cover
|
||||
- Side "T" antenna mounts
|
||||
- Rear electronics tray
|
||||
- Front facing "action cam" cutout
|
||||
- Front facing FPV camera cutout
|
||||
- Removable wings
|
||||
- Low stall speed
|
||||
- Gentle handling
|
||||
@@ -69,10 +69,10 @@ Key build features
|
||||
- [6s2p 18650 LiIon flight battery](https://www.upgradeenergytech.com/product-page/6s-22-2v-5600mah-30c-dark-lithium-liion-drone-battery) (select XT60 connector)
|
||||
|
||||
- [Custom designed 3D printed parts](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/rd2_3d_printed_parts.zip)
|
||||
- ARK6X carrier mount
|
||||
- Holybro Pixhawk 5x carrier mount
|
||||
- FPV pod and camera mount
|
||||
- Pitot static probe "plug" adapter
|
||||
- ARK6X carrier mount
|
||||
- Holybro Pixhawk 5x carrier mount
|
||||
- FPV pod and camera mount
|
||||
- Pitot static probe "plug" adapter
|
||||
|
||||
- [Custom designed power distribution PCB](https://github.com/PX4/PX4-user_guide/raw/main/assets/airframes/fw/reptile_dragon_2/xt30_power_distro_pcb.zip)
|
||||
|
||||
@@ -426,15 +426,15 @@ Prior to the first flight, a comprehensive preflight must be conducted.
|
||||
I recommend checking the following items:
|
||||
|
||||
- Sensor calibration (QGC)
|
||||
- Mag calibration
|
||||
- Accelerometer calibration
|
||||
- Airspeed calibration
|
||||
- Level horizon calibration
|
||||
- Mag calibration
|
||||
- Accelerometer calibration
|
||||
- Airspeed calibration
|
||||
- Level horizon calibration
|
||||
- Check control surface deflection
|
||||
- Right stick -> Right aileron goes up, left aileron goes down
|
||||
- Left stick -> Left aileron goes up, right aileron goes down
|
||||
- Stick back -> elevator goes up
|
||||
-Stick forward -> elevator goes down
|
||||
-Stick forward -> elevator goes down
|
||||
- Left rudder -> Rudder goes left
|
||||
- Right rudder -> Rudder goes right
|
||||
- Check Px4 inputs (in `stabilized mode`)
|
||||
|
||||
@@ -98,11 +98,11 @@ The mapping between flight controller outputs and specific controls/motors depen
|
||||
Assembly information is covered in several sections:
|
||||
|
||||
- [Basic Assembly](../assembly/index.md) contains topics shows the setup of core components for a number of popular [flight controllers](../flight_controller/index.md).
|
||||
Flight controllers for which we do not have guides are usually set up in much the same way (and almost always include similar setup guides).
|
||||
Flight controllers for which we do not have guides are usually set up in much the same way (and almost always include similar setup guides).
|
||||
- [Peripherals](../peripherals/index.md) contains information about other peripherals, including [Airspeed Sensors](../sensor/airspeed.md).
|
||||
- [Airframes Reference > VTOL](../airframes/airframe_reference.md#vtol) explains which flight controller outputs must be connected to different flight controls for each airframe configuration:
|
||||
- Select the configuration for your vehicle if one exists, as this will have been pre-tuned well enough to fly (may only require fine tuning).
|
||||
- Otherwise select a "Generic Airframe" that matches your vehicle.
|
||||
- Select the configuration for your vehicle if one exists, as this will have been pre-tuned well enough to fly (may only require fine tuning).
|
||||
- Otherwise select a "Generic Airframe" that matches your vehicle.
|
||||
|
||||
In addition, build logs showing how others have set up different types of vehicles are provided as sub topics.
|
||||
For example see [FunCub QuadPlane](../frames_vtol/vtol_quadplane_fun_cub_vtol_pixhawk.md).
|
||||
|
||||
+119
-119
@@ -29,151 +29,151 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too
|
||||
|
||||
2. Create a new C file in that directory named **px4_simple_app.c**:
|
||||
|
||||
- Copy in the default header to the top of the page.
|
||||
该注释应出现在所有贡献的文件中!
|
||||
- Copy in the default header to the top of the page.
|
||||
该注释应出现在所有贡献的文件中!
|
||||
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
```
|
||||
```c
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
```
|
||||
|
||||
- 将下面的代码复制到头部注释的下方,
|
||||
该注释应出现在所有贡献的文件中!
|
||||
- 将下面的代码复制到头部注释的下方,
|
||||
该注释应出现在所有贡献的文件中!
|
||||
|
||||
```c
|
||||
/**
|
||||
* @file px4_simple_app.c
|
||||
* Minimal application example for PX4 autopilot
|
||||
*
|
||||
* @author Example User <mail@example.com>
|
||||
*/
|
||||
```c
|
||||
/**
|
||||
* @file px4_simple_app.c
|
||||
* Minimal application example for PX4 autopilot
|
||||
*
|
||||
* @author Example User <mail@example.com>
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/log.h>
|
||||
#include <px4_platform_common/log.h>
|
||||
|
||||
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
|
||||
__EXPORT int px4_simple_app_main(int argc, char *argv[]);
|
||||
|
||||
int px4_simple_app_main(int argc, char *argv[])
|
||||
{
|
||||
PX4_INFO("Hello Sky!");
|
||||
return OK;
|
||||
}
|
||||
```
|
||||
int px4_simple_app_main(int argc, char *argv[])
|
||||
{
|
||||
PX4_INFO("Hello Sky!");
|
||||
return OK;
|
||||
}
|
||||
```
|
||||
|
||||
:::tip
|
||||
The main function must be named `<module_name>_main` and exported from the module as shown.
|
||||
:::tip
|
||||
The main function must be named `<module_name>_main` and exported from the module as shown.
|
||||
|
||||
:::
|
||||
|
||||
:::tip
|
||||
`PX4_INFO` is the equivalent of `printf` for the PX4 shell (included from **px4_platform_common/log.h**).
|
||||
There are different log levels: `PX4_INFO`, `PX4_WARN`, `PX4_ERR`, `PX4_DEBUG`.
|
||||
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
|
||||
:::tip
|
||||
`PX4_INFO` is the equivalent of `printf` for the PX4 shell (included from **px4_platform_common/log.h**).
|
||||
There are different log levels: `PX4_INFO`, `PX4_WARN`, `PX4_ERR`, `PX4_DEBUG`.
|
||||
Warnings and errors are additionally added to the [ULog](../dev_log/ulog_file_format.md) and shown on [Flight Review](https://logs.px4.io/).
|
||||
|
||||
:::
|
||||
|
||||
3. Create and open a new _cmake_ definition file named **CMakeLists.txt**.
|
||||
复制下面的文本:
|
||||
复制下面的文本:
|
||||
|
||||
```cmake
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE examples__px4_simple_app
|
||||
MAIN px4_simple_app
|
||||
STACK_MAIN 2000
|
||||
SRCS
|
||||
px4_simple_app.c
|
||||
DEPENDS
|
||||
)
|
||||
```
|
||||
```cmake
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE examples__px4_simple_app
|
||||
MAIN px4_simple_app
|
||||
STACK_MAIN 2000
|
||||
SRCS
|
||||
px4_simple_app.c
|
||||
DEPENDS
|
||||
)
|
||||
```
|
||||
|
||||
The `px4_add_module()` method builds a static library from a module description.
|
||||
The `px4_add_module()` method builds a static library from a module description.
|
||||
|
||||
- The `MODULE` block is the Firmware-unique name of the module (by convention the module name is prefixed by parent directories back to `src`).
|
||||
- The `MAIN` block lists the entry point of the module, which registers the command with NuttX so that it can be called from the PX4 shell or SITL console.
|
||||
- The `MODULE` block is the Firmware-unique name of the module (by convention the module name is prefixed by parent directories back to `src`).
|
||||
- The `MAIN` block lists the entry point of the module, which registers the command with NuttX so that it can be called from the PX4 shell or SITL console.
|
||||
|
||||
:::tip
|
||||
The `px4_add_module()` format is documented in [PX4-Autopilot/cmake/px4_add_module.cmake](https://github.com/PX4/PX4-Autopilot/blob/main/cmake/px4_add_module.cmake). <!-- NEED px4_version -->
|
||||
:::tip
|
||||
The `px4_add_module()` format is documented in [PX4-Autopilot/cmake/px4_add_module.cmake](https://github.com/PX4/PX4-Autopilot/blob/main/cmake/px4_add_module.cmake). <!-- NEED px4_version -->
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
If you specify `DYNAMIC` as an option to `px4_add_module`, a _shared library_ is created instead of a static library on POSIX platforms (these can be loaded without having to recompile PX4, and shared to others as binaries rather than source code).
|
||||
Your app will not become a builtin command, but ends up in a separate file called `examples__px4_simple_app.px4mod`.
|
||||
You can then run your command by loading the file at runtime using the `dyn` command: `dyn ./examples__px4_simple_app.px4mod`
|
||||
::: info
|
||||
If you specify `DYNAMIC` as an option to `px4_add_module`, a _shared library_ is created instead of a static library on POSIX platforms (these can be loaded without having to recompile PX4, and shared to others as binaries rather than source code).
|
||||
Your app will not become a builtin command, but ends up in a separate file called `examples__px4_simple_app.px4mod`.
|
||||
You can then run your command by loading the file at runtime using the `dyn` command: `dyn ./examples__px4_simple_app.px4mod`
|
||||
|
||||
:::
|
||||
|
||||
4. Create and open a new _Kconfig_ definition file named **Kconfig** and define your symbol for naming (see [Kconfig naming convention](../hardware/porting_guide_config.md#px4-kconfig-symbol-naming-convention)).
|
||||
复制下面的文本:
|
||||
复制下面的文本:
|
||||
|
||||
```
|
||||
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
||||
bool "px4_simple_app"
|
||||
default n
|
||||
---help---
|
||||
Enable support for px4_simple_app
|
||||
```
|
||||
```
|
||||
menuconfig EXAMPLES_PX4_SIMPLE_APP
|
||||
bool "px4_simple_app"
|
||||
default n
|
||||
---help---
|
||||
Enable support for px4_simple_app
|
||||
```
|
||||
|
||||
## 编译应用程序/固件
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ CONFIG_DRIVERS_RPM_CAPTURE=y
|
||||
Additionally, to enable the module:
|
||||
|
||||
- Set [ICE_EN](../advanced_config/parameter_reference.md#ICE_EN)
|
||||
to true and adjust the other `ICE_` module parameters according to your needs.
|
||||
to true and adjust the other `ICE_` module parameters according to your needs.
|
||||
- Set [RPM_CAP_ENABLE](../advanced_config/parameter_reference.md#RPM_CAP_ENABLE) to true.
|
||||
|
||||
The module outputs control signals for ignition, throttle, and choke,
|
||||
@@ -367,8 +367,8 @@ The state machine:
|
||||
|
||||
- Checks if [Rpm.msg](../msg_docs/Rpm.md) is updated to know if the engine is running
|
||||
- Allows for user inputs from:
|
||||
- AUX{N}
|
||||
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md)
|
||||
- AUX{N}
|
||||
- Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md)
|
||||
|
||||
The module publishes [InternalCombustionEngineControl.msg](../msg_docs/InternalCombustionEngineControl.md).
|
||||
|
||||
@@ -484,7 +484,7 @@ The normal log is always a superset of the mission log.
|
||||
The implementation uses two threads:
|
||||
|
||||
- The main thread, running at a fixed rate (or polling on a topic if started with -p) and checking for
|
||||
data updates
|
||||
data updates
|
||||
- The writer thread, writing data to the file
|
||||
|
||||
In between there is a write buffer with configurable size (and another fixed-size buffer for
|
||||
@@ -688,9 +688,9 @@ There are 2 environment variables used for configuration: `replay`, which must b
|
||||
the log file to be replayed. The second is the mode, specified via `replay_mode`:
|
||||
|
||||
- `replay_mode=ekf2`: specific EKF2 replay mode. It can only be used with the ekf2 module, but allows the replay
|
||||
to run as fast as possible.
|
||||
to run as fast as possible.
|
||||
- Generic otherwise: this can be used to replay any module(s), but the replay will be done with the same speed as the
|
||||
log was recorded.
|
||||
log was recorded.
|
||||
|
||||
The module is typically used together with uORB publisher rules, to specify which messages should be replayed.
|
||||
The replay module will just publish all messages that are found in the log. It also applies the parameters from
|
||||
@@ -842,12 +842,12 @@ it into a more usable form, and publishes it for the rest of the system.
|
||||
The provided functionality includes:
|
||||
|
||||
- Read the output from the sensor drivers (`SensorGyro`, etc.).
|
||||
If there are multiple of the same type, do voting and failover handling.
|
||||
Then apply the board rotation and temperature calibration (if enabled). And finally publish the data; one of the
|
||||
topics is `SensorCombined`, used by many parts of the system.
|
||||
If there are multiple of the same type, do voting and failover handling.
|
||||
Then apply the board rotation and temperature calibration (if enabled). And finally publish the data; one of the
|
||||
topics is `SensorCombined`, used by many parts of the system.
|
||||
- Make sure the sensor drivers get the updated calibration parameters (scale & offset) when the parameters change or
|
||||
on startup. The sensor drivers use the ioctl interface for parameter updates. For this to work properly, the
|
||||
sensor drivers must already be running when `sensors` is started.
|
||||
on startup. The sensor drivers use the ioctl interface for parameter updates. For this to work properly, the
|
||||
sensor drivers must already be running when `sensors` is started.
|
||||
- Do sensor consistency checks and publish the `SensorsStatusImu` topic.
|
||||
|
||||
### 实现
|
||||
|
||||
@@ -25,38 +25,38 @@ Other examples in Python can be found here: [integrationtests/python_src/px4_it/
|
||||
|
||||
1. Open the terminal and go to `~/catkin_ws/src` directory
|
||||
|
||||
```sh
|
||||
roscd # Should cd into ~/catkin_ws/devel
|
||||
cd ..
|
||||
cd src
|
||||
```
|
||||
```sh
|
||||
roscd # Should cd into ~/catkin_ws/devel
|
||||
cd ..
|
||||
cd src
|
||||
```
|
||||
|
||||
2. In the `~/catkin_ws/src` directory create a new package named `offboard_py` (in this case) with the `rospy` dependency:
|
||||
|
||||
```sh
|
||||
catkin_create_pkg offboard_py rospy
|
||||
```
|
||||
```sh
|
||||
catkin_create_pkg offboard_py rospy
|
||||
```
|
||||
|
||||
3. Build the new package in the `~/catkin_ws/` directory:
|
||||
|
||||
```sh
|
||||
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
||||
catkin build
|
||||
source devel/setup.bash
|
||||
```
|
||||
```sh
|
||||
cd .. # Assuming previous directory to be ~/catkin_ws/src
|
||||
catkin build
|
||||
source devel/setup.bash
|
||||
```
|
||||
|
||||
4. 您现在应该能够通过使用以下方法切换至包目录:
|
||||
|
||||
```sh
|
||||
roscd offboard_py
|
||||
```
|
||||
```sh
|
||||
roscd offboard_py
|
||||
```
|
||||
|
||||
5. To store your Python files, create a new folder called `/scripts` on the package:
|
||||
|
||||
```sh
|
||||
mkdir scripts
|
||||
cd scripts
|
||||
```
|
||||
```sh
|
||||
mkdir scripts
|
||||
cd scripts
|
||||
```
|
||||
|
||||
## 代码
|
||||
|
||||
|
||||
@@ -37,63 +37,63 @@ This is needed because, by default, you cannot arm a vehicle without a connectio
|
||||
|
||||
2. 使用以下方法创建并切换至新的 colcon工作目录:
|
||||
|
||||
```sh
|
||||
mkdir -p ~/ws_offboard_control/src/
|
||||
cd ~/ws_offboard_control/src/
|
||||
```
|
||||
```sh
|
||||
mkdir -p ~/ws_offboard_control/src/
|
||||
cd ~/ws_offboard_control/src/
|
||||
```
|
||||
|
||||
3. Clone the [px4_msgs](https://github.com/PX4/px4_msgs) repo to the `/src` directory (this repo is needed in every ROS 2 PX4 workspace!):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
# checkout the matching release branch if not using PX4 main.
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
# checkout the matching release branch if not using PX4 main.
|
||||
```
|
||||
|
||||
4. Clone the example repository [px4_ros_com](https://github.com/PX4/px4_ros_com) to the `/src` directory:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
```
|
||||
|
||||
5. Source the ROS 2 development environment into the current terminal and compile the workspace using `colcon`:
|
||||
|
||||
:::: tabs
|
||||
:::: tabs
|
||||
|
||||
::: tab humble
|
||||
::: tab humble
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/humble/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::: tab foxy
|
||||
::: tab foxy
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
```sh
|
||||
cd ..
|
||||
source /opt/ros/foxy/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
|
||||
:::
|
||||
|
||||
::::
|
||||
::::
|
||||
|
||||
6. Source the `local_setup.bash`:
|
||||
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
```sh
|
||||
source install/local_setup.bash
|
||||
```
|
||||
|
||||
7. 启动例程。
|
||||
|
||||
```
|
||||
ros2 run px4_ros_com offboard_control
|
||||
```
|
||||
```
|
||||
ros2 run px4_ros_com offboard_control
|
||||
```
|
||||
|
||||
飞行器将解锁、起飞至5米并悬停等待(永久)。
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ float32 variance_east # Wind estimate error variance in east / Y direction (m/s
|
||||
|
||||
float32 tas_innov # True airspeed innovation
|
||||
float32 tas_innov_var # True airspeed innovation variance
|
||||
float32 tas_innov_integ_test_ratio # Value > 1 indicates that innovation failure check has triggered
|
||||
|
||||
float32 tas_scale_raw # Estimated true airspeed scale factor (not validated)
|
||||
float32 tas_scale_raw_var # True airspeed scale factor variance
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
# Motor control message
|
||||
#
|
||||
# Normalised thrust setpoint for up to 12 motors.
|
||||
# Published by the vehicle's allocation and consumed by the ESC protocol drivers e.g. PWM, DSHOT, UAVCAN.
|
||||
|
||||
uint32 MESSAGE_VERSION = 0
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint64 timestamp_sample # the timestamp the data this control response is based on was sampled
|
||||
uint64 timestamp # [us] Time since system start
|
||||
uint64 timestamp_sample # [us] Sampling timestamp of the data this control response is based on
|
||||
|
||||
uint16 reversible_flags # bitset which motors are configured to be reversible
|
||||
uint16 reversible_flags # Bitset indicating which motors are configured to be reversible
|
||||
|
||||
uint8 ACTUATOR_FUNCTION_MOTOR1 = 101
|
||||
|
||||
uint8 NUM_CONTROLS = 12
|
||||
float32[12] control # range: [-1, 1], where 1 means maximum positive thrust,
|
||||
# -1 maximum negative (if not supported by the output, <0 maps to NaN),
|
||||
# and NaN maps to disarmed (stop the motors)
|
||||
float32[12] control # [@range -1, 1] Normalized thrust. where 1 means maximum positive thrust, -1 maximum negative (if not supported by the output, <0 maps to NaN). NaN maps to disarmed (stop the motors)
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
# Servo control message
|
||||
#
|
||||
# Normalised output setpoint for up to 8 servos.
|
||||
# Published by the vehicle's allocation and consumed by the actuator output drivers.
|
||||
|
||||
uint32 MESSAGE_VERSION = 0
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint64 timestamp_sample # the timestamp the data this control response is based on was sampled
|
||||
uint64 timestamp # [us] Time since system start
|
||||
uint64 timestamp_sample # [us] Sampling timestamp of the data this control response is based on
|
||||
|
||||
uint8 NUM_CONTROLS = 8
|
||||
float32[8] control # range: [-1, 1], where 1 means maximum positive position,
|
||||
# -1 maximum negative,
|
||||
# and NaN maps to disarmed
|
||||
float32[8] control # [@range -1, 1] Normalized output. 1 means maximum positive position. -1 maximum negative position (if not supported by the output, <0 maps to NaN). NaN maps to disarmed.
|
||||
|
||||
@@ -1,74 +1,79 @@
|
||||
# Battery status
|
||||
#
|
||||
# Battery status information for up to 4 battery instances.
|
||||
# These are populated from power module and smart battery device drivers, and one battery updated from MAVLink.
|
||||
# Battery instance information is also logged and streamed in MAVLink telemetry.
|
||||
|
||||
uint32 MESSAGE_VERSION = 0
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
bool connected # Whether or not a battery is connected, based on a voltage threshold
|
||||
float32 voltage_v # Battery voltage in volts, 0 if unknown
|
||||
float32 current_a # Battery current in amperes, -1 if unknown
|
||||
float32 current_average_a # Battery current average in amperes (for FW average in level flight), -1 if unknown
|
||||
float32 discharged_mah # Discharged amount in mAh, -1 if unknown
|
||||
float32 remaining # From 1 to 0, -1 if unknown
|
||||
float32 scale # Power scaling factor, >= 1, or -1 if unknown
|
||||
float32 time_remaining_s # predicted time in seconds remaining until battery is empty under previous averaged load, NAN if unknown
|
||||
float32 temperature # Temperature of the battery in degrees Celcius, NaN if unknown
|
||||
uint8 cell_count # Number of cells, 0 if unknown
|
||||
|
||||
uint8 SOURCE_POWER_MODULE = 0
|
||||
uint8 SOURCE_EXTERNAL = 1
|
||||
uint8 SOURCE_ESCS = 2
|
||||
uint8 source # Battery source
|
||||
uint8 priority # Zero based priority is the connection on the Power Controller V1..Vn AKA BrickN-1
|
||||
uint16 capacity # actual capacity of the battery
|
||||
uint16 cycle_count # number of discharge cycles the battery has experienced
|
||||
uint16 average_time_to_empty # predicted remaining battery capacity based on the average rate of discharge in min
|
||||
uint16 serial_number # serial number of the battery pack
|
||||
uint16 manufacture_date # manufacture date, part of serial number of the battery pack. Formatted as: Day + Month×32 + (Year–1980)×512
|
||||
uint16 state_of_health # state of health. FullChargeCapacity/DesignCapacity, 0-100%.
|
||||
uint16 max_error # max error, expected margin of error in % in the state-of-charge calculation with a range of 1 to 100%
|
||||
uint8 id # ID number of a battery. Should be unique and consistent for the lifetime of a vehicle. 1-indexed.
|
||||
uint16 interface_error # interface error counter
|
||||
|
||||
float32[14] voltage_cell_v # Battery individual cell voltages, 0 if unknown
|
||||
float32 max_cell_voltage_delta # Max difference between individual cell voltages
|
||||
|
||||
bool is_powering_off # Power off event imminent indication, false if unknown
|
||||
bool is_required # Set if the battery is explicitly required before arming
|
||||
|
||||
|
||||
uint8 WARNING_NONE = 0 # no battery low voltage warning active
|
||||
uint8 WARNING_LOW = 1 # warning of low voltage
|
||||
uint8 WARNING_CRITICAL = 2 # critical voltage, return / abort immediately
|
||||
uint8 WARNING_EMERGENCY = 3 # immediate landing required
|
||||
uint8 WARNING_FAILED = 4 # the battery has failed completely
|
||||
uint8 STATE_UNHEALTHY = 6 # Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in faults field.
|
||||
uint8 STATE_CHARGING = 7 # Battery is charging
|
||||
|
||||
uint8 FAULT_DEEP_DISCHARGE = 0 # Battery has deep discharged
|
||||
uint8 FAULT_SPIKES = 1 # Voltage spikes
|
||||
uint8 FAULT_CELL_FAIL= 2 # One or more cells have failed
|
||||
uint8 FAULT_OVER_CURRENT = 3 # Over-current
|
||||
uint8 FAULT_OVER_TEMPERATURE = 4 # Over-temperature
|
||||
uint8 FAULT_UNDER_TEMPERATURE = 5 # Under-temperature fault
|
||||
uint8 FAULT_INCOMPATIBLE_VOLTAGE = 6 # Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage).
|
||||
uint8 FAULT_INCOMPATIBLE_FIRMWARE = 7 # Battery firmware is not compatible with current autopilot firmware
|
||||
uint8 FAULT_INCOMPATIBLE_MODEL = 8 # Battery model is not supported by the system
|
||||
uint8 FAULT_HARDWARE_FAILURE = 9 # hardware problem
|
||||
uint8 FAULT_FAILED_TO_ARM = 10 # Battery had a problem while arming
|
||||
uint8 FAULT_COUNT = 11 # Counter - keep it as last element!
|
||||
|
||||
uint16 faults # Smart battery supply status/fault flags (bitmask) for health indication.
|
||||
uint8 warning # Current battery warning
|
||||
|
||||
uint8 MAX_INSTANCES = 4
|
||||
|
||||
float32 full_charge_capacity_wh # The compensated battery capacity
|
||||
float32 remaining_capacity_wh # The compensated battery capacity remaining
|
||||
uint16 over_discharge_count # Number of battery overdischarge
|
||||
float32 nominal_voltage # Nominal voltage of the battery pack
|
||||
uint64 timestamp # [us] Time since system start
|
||||
bool connected # Whether or not a battery is connected. For power modules this is based on a voltage threshold.
|
||||
float32 voltage_v # [V] [@invalid 0] Battery voltage
|
||||
float32 current_a # [A] [@invalid -1] Battery current
|
||||
float32 current_average_a # [A] [@invalid -1] Battery current average (for FW average in level flight)
|
||||
float32 discharged_mah # [mAh] [@invalid -1] Discharged amount
|
||||
float32 remaining # [@range 0,1] [@invalid -1] Remaining capacity
|
||||
float32 scale # [@range 1,] [@invalid -1] Scaling factor to compensate for lower actuation power caused by voltage sag
|
||||
float32 time_remaining_s # [s] [@invalid NaN] Predicted time remaining until battery is empty under previous averaged load
|
||||
float32 temperature # [°C] [@invalid NaN] Temperature of the battery
|
||||
uint8 cell_count # [@invalid 0] Number of cells
|
||||
|
||||
float32 internal_resistance_estimate # [Ohm] Internal resistance per cell estimate
|
||||
float32 ocv_estimate # [V] Open circuit voltage estimate
|
||||
float32 ocv_estimate_filtered # [V] Filtered open circuit voltage estimate
|
||||
float32 volt_based_soc_estimate # [0, 1] Normalized volt based state of charge estimate
|
||||
float32 voltage_prediction # [V] Predicted voltage
|
||||
float32 prediction_error # [V] Prediction error
|
||||
float32 estimation_covariance_norm # Norm of the covariance matrix
|
||||
|
||||
uint8 source # [@enum SOURCE] Battery source
|
||||
uint8 SOURCE_POWER_MODULE = 0 # Power module
|
||||
uint8 SOURCE_EXTERNAL = 1 # External
|
||||
uint8 SOURCE_ESCS = 2 # ESCs
|
||||
|
||||
uint8 priority # Zero based priority is the connection on the Power Controller V1..Vn AKA BrickN-1
|
||||
uint16 capacity # [mAh] Capacity of the battery when fully charged
|
||||
uint16 cycle_count # Number of discharge cycles the battery has experienced
|
||||
uint16 average_time_to_empty # [minutes] Predicted remaining battery capacity based on the average rate of discharge
|
||||
uint16 serial_number # Serial number of the battery pack
|
||||
uint16 manufacture_date # Manufacture date, part of serial number of the battery pack. Formatted as: Day + Month×32 + (Year–1980)×512
|
||||
uint16 state_of_health # [%] [@range 0, 100] State of health. FullChargeCapacity/DesignCapacity
|
||||
uint16 max_error # [%] [@range 1, 100] Max error, expected margin of error in the state-of-charge calculation
|
||||
uint8 id # ID number of a battery. Should be unique and consistent for the lifetime of a vehicle. 1-indexed
|
||||
uint16 interface_error # Interface error counter
|
||||
|
||||
float32[14] voltage_cell_v # [V] [@invalid 0] Battery individual cell voltages
|
||||
float32 max_cell_voltage_delta # Max difference between individual cell voltages
|
||||
|
||||
bool is_powering_off # Power off event imminent indication, false if unknown
|
||||
bool is_required # Set if the battery is explicitly required before arming
|
||||
|
||||
uint8 warning # [@enum WARNING STATE] Current battery warning
|
||||
uint8 WARNING_NONE = 0 # No battery low voltage warning active
|
||||
uint8 WARNING_LOW = 1 # Low voltage warning
|
||||
uint8 WARNING_CRITICAL = 2 # Critical voltage, return / abort immediately
|
||||
uint8 WARNING_EMERGENCY = 3 # Immediate landing required
|
||||
uint8 WARNING_FAILED = 4 # Battery has failed completely
|
||||
uint8 STATE_UNHEALTHY = 6 # Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in faults field
|
||||
uint8 STATE_CHARGING = 7 # Battery is charging
|
||||
|
||||
uint16 faults # [@enum FAULT] Smart battery supply status/fault flags (bitmask) for health indication
|
||||
uint8 FAULT_DEEP_DISCHARGE = 0 # Battery has deep discharged
|
||||
uint8 FAULT_SPIKES = 1 # Voltage spikes
|
||||
uint8 FAULT_CELL_FAIL= 2 # One or more cells have failed
|
||||
uint8 FAULT_OVER_CURRENT = 3 # Over-current
|
||||
uint8 FAULT_OVER_TEMPERATURE = 4 # Over-temperature
|
||||
uint8 FAULT_UNDER_TEMPERATURE = 5 # Under-temperature fault
|
||||
uint8 FAULT_INCOMPATIBLE_VOLTAGE = 6 # Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)
|
||||
uint8 FAULT_INCOMPATIBLE_FIRMWARE = 7 # Battery firmware is not compatible with current autopilot firmware
|
||||
uint8 FAULT_INCOMPATIBLE_MODEL = 8 # Battery model is not supported by the system
|
||||
uint8 FAULT_HARDWARE_FAILURE = 9 # Hardware problem
|
||||
uint8 FAULT_FAILED_TO_ARM = 10 # Battery had a problem while arming
|
||||
uint8 FAULT_COUNT = 11 # Counter. Keep this as last element
|
||||
|
||||
float32 full_charge_capacity_wh # [Wh] Compensated battery capacity
|
||||
float32 remaining_capacity_wh # [Wh] Compensated battery capacity remaining
|
||||
uint16 over_discharge_count # Number of battery overdischarge
|
||||
float32 nominal_voltage # [V] Nominal voltage of the battery pack
|
||||
|
||||
float32 internal_resistance_estimate # [Ohm] Internal resistance per cell estimate
|
||||
float32 ocv_estimate # [V] Open circuit voltage estimate
|
||||
float32 ocv_estimate_filtered # [V] Filtered open circuit voltage estimate
|
||||
float32 volt_based_soc_estimate # [@range 0, 1] Normalized volt based state of charge estimate
|
||||
float32 voltage_prediction # [V] Predicted voltage
|
||||
float32 prediction_error # [V] Prediction error
|
||||
float32 estimation_covariance_norm # Norm of the covariance matrix
|
||||
|
||||
@@ -89,6 +89,7 @@ uint8 HIL_STATE_ON = 1
|
||||
|
||||
# Current vehicle locomotion method. A vehicle can have different methods (e.g. VTOL transitions from RW to FW method)
|
||||
uint8 vehicle_type
|
||||
uint8 VEHICLE_TYPE_UNSPECIFIED = 0
|
||||
uint8 VEHICLE_TYPE_ROTARY_WING = 1
|
||||
uint8 VEHICLE_TYPE_FIXED_WING = 2
|
||||
uint8 VEHICLE_TYPE_ROVER = 3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2021 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2025 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -31,27 +31,21 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* Include Files */
|
||||
#include "AFBRS50.hpp"
|
||||
#include "argus_hal_test.h"
|
||||
#include "s2pi.h"
|
||||
|
||||
#include <lib/drivers/device/Device.hpp>
|
||||
|
||||
#include <px4_platform_common/getopt.h>
|
||||
#include <px4_platform_common/module.h>
|
||||
|
||||
/*! Define the SPI baud rate (to be used in the SPI module). */
|
||||
#define SPI_BAUD_RATE 5000000
|
||||
|
||||
#include "s2pi.h"
|
||||
#include "timer.h"
|
||||
#include "argus_hal_test.h"
|
||||
using namespace time_literals;
|
||||
|
||||
AFBRS50 *g_dev{nullptr};
|
||||
|
||||
AFBRS50::AFBRS50(uint8_t device_orientation):
|
||||
ModuleParams(nullptr),
|
||||
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
|
||||
// ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::SPI6),
|
||||
_px4_rangefinder(0, device_orientation)
|
||||
{
|
||||
device::Device::DeviceId device_id{};
|
||||
@@ -65,278 +59,263 @@ AFBRS50::AFBRS50(uint8_t device_orientation):
|
||||
|
||||
AFBRS50::~AFBRS50()
|
||||
{
|
||||
stop();
|
||||
ScheduleClear();
|
||||
|
||||
Argus_StopMeasurementTimer(_hnd);
|
||||
Argus_Deinit(_hnd);
|
||||
Argus_DestroyHandle(_hnd);
|
||||
|
||||
perf_free(_sample_perf);
|
||||
perf_free(_comms_errors);
|
||||
perf_free(_not_ready_perf);
|
||||
}
|
||||
|
||||
status_t AFBRS50::measurement_ready_callback(status_t status, argus_hnd_t *hnd)
|
||||
status_t AFBRS50::measurementReadyCallback(status_t status, argus_hnd_t *hnd)
|
||||
{
|
||||
if (!up_interrupt_context()) {
|
||||
if (status == STATUS_OK) {
|
||||
if (g_dev) {
|
||||
g_dev->ProcessMeasurement(hnd);
|
||||
}
|
||||
// Called from the SPI comms thread context
|
||||
|
||||
} else {
|
||||
PX4_ERR("Measurement Ready Callback received error!: %i", (int)status);
|
||||
}
|
||||
if (up_interrupt_context()) {
|
||||
// We cannot be in interrupt context
|
||||
g_dev->recordCommsError();
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
if ((g_dev == nullptr) || (status != STATUS_OK)) {
|
||||
g_dev->recordCommsError();
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
g_dev->scheduleCollect();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void AFBRS50::ProcessMeasurement(argus_hnd_t *hnd)
|
||||
void AFBRS50::scheduleCollect()
|
||||
{
|
||||
_state = STATE::COLLECT;
|
||||
ScheduleNow();
|
||||
}
|
||||
|
||||
void AFBRS50::recordCommsError()
|
||||
{
|
||||
perf_count(_comms_errors);
|
||||
}
|
||||
|
||||
void AFBRS50::processMeasurement()
|
||||
{
|
||||
perf_count(_sample_perf);
|
||||
|
||||
argus_results_t res{};
|
||||
status_t evaluate_status = Argus_EvaluateData(hnd, &res);
|
||||
status_t evaluate_status = Argus_EvaluateData(_hnd, &res);
|
||||
|
||||
if ((evaluate_status == STATUS_OK) && (res.Status == STATUS_OK)) {
|
||||
uint32_t result_mm = res.Bin.Range / (Q9_22_ONE / 1000);
|
||||
float result_m = static_cast<float>(result_mm) / 1000.f;
|
||||
int8_t quality = res.Bin.SignalQuality;
|
||||
|
||||
// Signal quality indicates 100% for good signals, 50% and lower for weak signals.
|
||||
// 1% is an errored signal (not reliable). Signal Quality of 0% is unknown.
|
||||
if (quality == 1) {
|
||||
quality = 0;
|
||||
}
|
||||
|
||||
// distance quality check
|
||||
if (result_m > _max_distance) {
|
||||
result_m = 0.0;
|
||||
quality = 0;
|
||||
}
|
||||
|
||||
_current_distance = result_m;
|
||||
_current_quality = quality;
|
||||
_px4_rangefinder.update(((res.TimeStamp.sec * 1000000ULL) + res.TimeStamp.usec), result_m, quality);
|
||||
if ((evaluate_status != STATUS_OK) || (res.Status != STATUS_OK)) {
|
||||
perf_count(_comms_errors);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t result_mm = res.Bin.Range / (Q9_22_ONE / 1000);
|
||||
float distance = static_cast<float>(result_mm) / 1000.f;
|
||||
int8_t quality = res.Bin.SignalQuality;
|
||||
|
||||
// Signal quality indicates 100% for good signals, 50% and lower for weak signals.
|
||||
// 1% is an errored signal (not reliable). Signal Quality of 0% is unknown.
|
||||
if (quality == 1) {
|
||||
quality = 0;
|
||||
}
|
||||
|
||||
// TODO: I don't think we need this..
|
||||
if (distance > _max_distance) {
|
||||
distance = 0.0;
|
||||
quality = 0;
|
||||
}
|
||||
|
||||
_current_distance = distance;
|
||||
_current_quality = quality;
|
||||
_px4_rangefinder.update(((res.TimeStamp.sec * 1000000ULL) + res.TimeStamp.usec), distance, quality);
|
||||
}
|
||||
|
||||
int AFBRS50::init()
|
||||
{
|
||||
// Retry initialization 3 times
|
||||
for (int32_t i = 0; i < 3; i++) {
|
||||
if (_hnd != nullptr) {
|
||||
// retry
|
||||
Argus_Deinit(_hnd);
|
||||
Argus_DestroyHandle(_hnd);
|
||||
_hnd = nullptr;
|
||||
}
|
||||
|
||||
_hnd = Argus_CreateHandle();
|
||||
|
||||
if (_hnd == nullptr) {
|
||||
PX4_ERR("Handle not initialized");
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
// Initialize the S2PI hardware required by the API.
|
||||
S2PI_Init(BROADCOM_AFBR_S50_S2PI_SPI_BUS, SPI_BAUD_RATE);
|
||||
|
||||
int32_t mode_param = _p_sens_afbr_mode.get();
|
||||
|
||||
if (mode_param < 0 || mode_param > 3) {
|
||||
PX4_ERR("Invalid mode parameter: %li", mode_param);
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
argus_mode_t mode = ARGUS_MODE_SHORT_RANGE;
|
||||
|
||||
switch (mode_param) {
|
||||
case 0:
|
||||
mode = ARGUS_MODE_SHORT_RANGE;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
mode = ARGUS_MODE_LONG_RANGE;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
mode = ARGUS_MODE_HIGH_SPEED_SHORT_RANGE;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
mode = ARGUS_MODE_HIGH_SPEED_LONG_RANGE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
status_t status = Argus_InitMode(_hnd, BROADCOM_AFBR_S50_S2PI_SPI_BUS, mode);
|
||||
|
||||
if (status == STATUS_OK) {
|
||||
uint32_t id = Argus_GetChipID(_hnd);
|
||||
uint32_t value = Argus_GetAPIVersion();
|
||||
uint8_t a = (value >> 24) & 0xFFU;
|
||||
uint8_t b = (value >> 16) & 0xFFU;
|
||||
uint8_t c = value & 0xFFFFU;
|
||||
PX4_INFO_RAW("AFBR-S50 Chip ID: %u, API Version: %u v%d.%d.%d\n", (uint)id, (uint)value, a, b, c);
|
||||
|
||||
argus_module_version_t mv = Argus_GetModuleVersion(_hnd);
|
||||
|
||||
switch (mv) {
|
||||
case AFBR_S50MV85G_V1:
|
||||
|
||||
// FALLTHROUGH
|
||||
case AFBR_S50MV85G_V2:
|
||||
|
||||
// FALLTHROUGH
|
||||
case AFBR_S50MV85G_V3:
|
||||
_min_distance = 0.0f;
|
||||
_max_distance = 10.f;
|
||||
_px4_rangefinder.set_min_distance(_min_distance);
|
||||
_px4_rangefinder.set_max_distance(_max_distance);
|
||||
_px4_rangefinder.set_fov(math::radians(6.f));
|
||||
PX4_INFO_RAW("AFBR-S50MV85G\n");
|
||||
break;
|
||||
|
||||
case AFBR_S50LV85D_V1:
|
||||
_min_distance = 0.0f;
|
||||
_max_distance = 30.f;
|
||||
_px4_rangefinder.set_min_distance(_min_distance);
|
||||
_px4_rangefinder.set_max_distance(_max_distance);
|
||||
_px4_rangefinder.set_fov(math::radians(6.f));
|
||||
PX4_INFO_RAW("AFBR-S50LV85D\n");
|
||||
break;
|
||||
|
||||
case AFBR_S50LX85D_V1:
|
||||
_min_distance = 0.0f;
|
||||
_max_distance = 50.f;
|
||||
_px4_rangefinder.set_min_distance(_min_distance);
|
||||
_px4_rangefinder.set_max_distance(_max_distance);
|
||||
_px4_rangefinder.set_fov(math::radians(6.f));
|
||||
PX4_INFO_RAW("AFBR-S50LX85D\n");
|
||||
break;
|
||||
|
||||
case AFBR_S50MV68B_V1:
|
||||
_min_distance = 0.0f;
|
||||
_max_distance = 10.f;
|
||||
_px4_rangefinder.set_min_distance(_min_distance);
|
||||
_px4_rangefinder.set_max_distance(_max_distance);
|
||||
_px4_rangefinder.set_fov(math::radians(1.f));
|
||||
PX4_INFO_RAW("AFBR-S50MV68B (v1)\n");
|
||||
break;
|
||||
|
||||
case AFBR_S50MV85I_V1:
|
||||
_min_distance = 0.0f;
|
||||
_max_distance = 5.f;
|
||||
_px4_rangefinder.set_min_distance(_min_distance);
|
||||
_px4_rangefinder.set_max_distance(_max_distance);
|
||||
_px4_rangefinder.set_fov(math::radians(6.f));
|
||||
PX4_INFO_RAW("AFBR-S50MV85I (v1)\n");
|
||||
break;
|
||||
|
||||
case AFBR_S50SV85K_V1:
|
||||
_min_distance = 0.0f;
|
||||
_max_distance = 10.f;
|
||||
_px4_rangefinder.set_min_distance(_min_distance);
|
||||
_px4_rangefinder.set_max_distance(_max_distance);
|
||||
_px4_rangefinder.set_fov(math::radians(4.f));
|
||||
PX4_INFO_RAW("AFBR-S50SV85K (v1)\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (_testing) {
|
||||
_state = STATE::TEST;
|
||||
|
||||
} else {
|
||||
_state = STATE::CONFIGURE;
|
||||
}
|
||||
|
||||
ScheduleDelayed(_measure_interval);
|
||||
return PX4_OK;
|
||||
|
||||
} else {
|
||||
PX4_ERR("Argus_InitMode failed: %ld", status);
|
||||
}
|
||||
if (hrt_absolute_time() < 1_ms) {
|
||||
PX4_WARN("Power-up time requires at least 1ms!");
|
||||
}
|
||||
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
void AFBRS50::Run()
|
||||
{
|
||||
if (_parameter_update_sub.updated()) {
|
||||
// clear update
|
||||
parameter_update_s param_update;
|
||||
_parameter_update_sub.copy(¶m_update);
|
||||
|
||||
// update parameters from storage
|
||||
ModuleParams::updateParams();
|
||||
if (_hnd != nullptr) {
|
||||
Argus_Deinit(_hnd);
|
||||
Argus_DestroyHandle(_hnd);
|
||||
_hnd = nullptr;
|
||||
}
|
||||
|
||||
switch (_state) {
|
||||
case STATE::TEST: {
|
||||
if (_testing) {
|
||||
Argus_VerifyHALImplementation(Argus_GetSPISlave(_hnd));
|
||||
_testing = false;
|
||||
_hnd = Argus_CreateHandle();
|
||||
|
||||
} else {
|
||||
_state = STATE::CONFIGURE;
|
||||
}
|
||||
}
|
||||
if (_hnd == nullptr) {
|
||||
PX4_ERR("Handle not initialized");
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
// Initialize the S2PI hardware required by the API.
|
||||
static constexpr uint32_t SPI_BAUD_RATE = 5000000;
|
||||
S2PI_Init(BROADCOM_AFBR_S50_S2PI_SPI_BUS, SPI_BAUD_RATE);
|
||||
|
||||
// Initialize device with initial mode
|
||||
status_t status = Argus_InitMode(_hnd, BROADCOM_AFBR_S50_S2PI_SPI_BUS, argusModeFromParameter());
|
||||
|
||||
if (status != STATUS_OK) {
|
||||
PX4_ERR("Argus_InitMode failed: %ld", status);
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
uint32_t id = Argus_GetChipID(_hnd);
|
||||
uint32_t value = Argus_GetAPIVersion();
|
||||
uint8_t a = (value >> 24) & 0xFFU;
|
||||
uint8_t b = (value >> 16) & 0xFFU;
|
||||
uint8_t c = value & 0xFFFFU;
|
||||
PX4_INFO("AFBR-S50 Chip ID: %u, API Version: %u v%d.%d.%d", (uint)id, (uint)value, a, b, c);
|
||||
|
||||
char module_string[20] = {};
|
||||
argus_module_version_t mv = Argus_GetModuleVersion(_hnd);
|
||||
|
||||
float min_distance = 0.f;
|
||||
float max_distance = 30.f;
|
||||
float fov_degrees = 6.f;
|
||||
|
||||
switch (mv) {
|
||||
case AFBR_S50MV85G_V1:
|
||||
case AFBR_S50MV85G_V2:
|
||||
case AFBR_S50MV85G_V3:
|
||||
max_distance = 10.f;
|
||||
fov_degrees = 6.f;
|
||||
snprintf(module_string, sizeof(module_string), "AFBR-S50MV85G");
|
||||
break;
|
||||
|
||||
case STATE::CONFIGURE: {
|
||||
_current_rate = (uint32_t)_p_sens_afbr_s_rate.get();
|
||||
status_t status = set_rate_and_dfm(_current_rate, DFM_MODE_OFF);
|
||||
|
||||
if (status != STATUS_OK) {
|
||||
PX4_ERR("CONFIGURE status not okay: %i", (int)status);
|
||||
_state = STATE::STOP;
|
||||
ScheduleNow();
|
||||
}
|
||||
|
||||
status = Argus_SetConfigurationSmartPowerSaveEnabled(_hnd, false);
|
||||
|
||||
if (status != STATUS_OK) {
|
||||
PX4_ERR("Argus_SetConfigurationSmartPowerSaveEnabled status not okay: %i", (int)status);
|
||||
ScheduleNow();
|
||||
|
||||
} else {
|
||||
_state = STATE::COLLECT;
|
||||
ScheduleDelayed(_measure_interval);
|
||||
}
|
||||
}
|
||||
case AFBR_S50LV85D_V1:
|
||||
max_distance = 30.f;
|
||||
fov_degrees = 6.f;
|
||||
snprintf(module_string, sizeof(module_string), "AFBR-S50LV85D");
|
||||
break;
|
||||
|
||||
case STATE::COLLECT: {
|
||||
// Only start a new measurement if one is not ongoing
|
||||
if (Argus_GetStatus(_hnd) == STATUS_IDLE) {
|
||||
status_t status = Argus_TriggerMeasurement(_hnd, measurement_ready_callback);
|
||||
|
||||
if (status != STATUS_OK) {
|
||||
PX4_ERR("Argus_TriggerMeasurement status not okay: %i", (int)status);
|
||||
}
|
||||
}
|
||||
|
||||
Evaluate_rate();
|
||||
}
|
||||
case AFBR_S50LX85D_V1:
|
||||
max_distance = 50.f;
|
||||
fov_degrees = 6.f;
|
||||
snprintf(module_string, sizeof(module_string), "AFBR-S50LX85D");
|
||||
break;
|
||||
|
||||
case STATE::STOP: {
|
||||
Argus_StopMeasurementTimer(_hnd);
|
||||
Argus_Deinit(_hnd);
|
||||
Argus_DestroyHandle(_hnd);
|
||||
}
|
||||
case AFBR_S50MV68B_V1:
|
||||
max_distance = 10.f;
|
||||
fov_degrees = 1.f;
|
||||
snprintf(module_string, sizeof(module_string), "AFBR-S50MV68B");
|
||||
break;
|
||||
|
||||
case AFBR_S50MV85I_V1:
|
||||
max_distance = 5.f;
|
||||
fov_degrees = 6.f;
|
||||
snprintf(module_string, sizeof(module_string), "AFBR-S50MV85I");
|
||||
break;
|
||||
|
||||
case AFBR_S50SV85K_V1:
|
||||
max_distance = 10.f;
|
||||
fov_degrees = 4.f;
|
||||
snprintf(module_string, sizeof(module_string), "AFBR-S50SV85K");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ScheduleDelayed(_measure_interval);
|
||||
PX4_INFO("Module: %s", module_string);
|
||||
_max_distance = max_distance;
|
||||
_px4_rangefinder.set_min_distance(min_distance);
|
||||
_px4_rangefinder.set_max_distance(max_distance);
|
||||
_px4_rangefinder.set_fov(math::radians(fov_degrees));
|
||||
|
||||
_state = STATE::CONFIGURE;
|
||||
// Initialization Time is 300ms
|
||||
ScheduleDelayed(350_ms);
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
void AFBRS50::Evaluate_rate()
|
||||
void AFBRS50::Run()
|
||||
{
|
||||
if (_parameter_update_sub.updated()) {
|
||||
parameter_update_s param_update;
|
||||
_parameter_update_sub.copy(¶m_update);
|
||||
ModuleParams::updateParams();
|
||||
}
|
||||
|
||||
switch (_state) {
|
||||
case STATE::CONFIGURE: {
|
||||
_current_rate = (uint32_t)_p_sens_afbr_s_rate.get();
|
||||
status_t status = setRateAndDfm(_current_rate, DFM_MODE_OFF);
|
||||
|
||||
if (status != STATUS_OK) {
|
||||
PX4_ERR("CONFIGURE status not okay: %i", (int)status);
|
||||
ScheduleDelayed(350_ms);
|
||||
return;
|
||||
}
|
||||
|
||||
status = Argus_SetConfigurationSmartPowerSaveEnabled(_hnd, false);
|
||||
|
||||
if (status != STATUS_OK) {
|
||||
PX4_ERR("Argus_SetConfigurationSmartPowerSaveEnabled status not okay: %i", (int)status);
|
||||
// TODO: delay?
|
||||
ScheduleNow();
|
||||
return;
|
||||
}
|
||||
|
||||
// Enable interrupt on falling edge
|
||||
px4_arch_configgpio(BROADCOM_AFBR_S50_S2PI_IRQ);
|
||||
_state = STATE::TRIGGER;
|
||||
// TODO: delay after configure?
|
||||
ScheduleNow();
|
||||
// ScheduleDelayed(50_ms);
|
||||
}
|
||||
break;
|
||||
|
||||
case STATE::TRIGGER: {
|
||||
if (Argus_GetStatus(_hnd) != STATUS_IDLE) {
|
||||
perf_count(_not_ready_perf);
|
||||
ScheduleDelayed(10_ms);
|
||||
return;
|
||||
}
|
||||
|
||||
// Trigger continuous measurement mode. An hrt_call_after will trigger
|
||||
// measurements periodically -- see API/Src/timer.c
|
||||
status_t status = Argus_StartMeasurementTimer(_hnd, measurementReadyCallback);
|
||||
|
||||
if (status != STATUS_OK) {
|
||||
PX4_ERR("Argus_TriggerMeasurement status not okay: %i", (int)status);
|
||||
perf_count(_not_ready_perf);
|
||||
ScheduleDelayed(50_ms);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case STATE::COLLECT: {
|
||||
processMeasurement();
|
||||
|
||||
// Change measurement rate and mode based on range
|
||||
updateMeasurementRateFromRange();
|
||||
|
||||
// Rechedule watchdog, push back by 2x measurement rate
|
||||
_state = STATE::WATCHDOG;
|
||||
ScheduleDelayed(_measurement_inverval * 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case STATE::WATCHDOG: {
|
||||
PX4_WARN("watchdog triggered, rescheduling");
|
||||
_state = STATE::TRIGGER;
|
||||
// When this occurs the device locks up for ~160ms
|
||||
ScheduleDelayed(160_ms);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AFBRS50::updateMeasurementRateFromRange()
|
||||
{
|
||||
// only update mode if _current_distance is a valid measurement and if the last rate switch was more than 1 second ago
|
||||
if ((_current_distance > 0) && (_current_quality > 0) && ((hrt_absolute_time() - _last_rate_switch) > 1_s)) {
|
||||
@@ -347,7 +326,7 @@ void AFBRS50::Evaluate_rate()
|
||||
&& (_current_rate != (uint32_t)_p_sens_afbr_l_rate.get())) {
|
||||
|
||||
_current_rate = (uint32_t)_p_sens_afbr_l_rate.get();
|
||||
status = set_rate_and_dfm(_current_rate, DFM_MODE_8X);
|
||||
status = setRateAndDfm(_current_rate, DFM_MODE_8X);
|
||||
|
||||
if (status != STATUS_OK) {
|
||||
PX4_ERR("set_rate status not okay: %i", (int)status);
|
||||
@@ -361,7 +340,7 @@ void AFBRS50::Evaluate_rate()
|
||||
&& (_current_rate != (uint32_t)_p_sens_afbr_s_rate.get())) {
|
||||
|
||||
_current_rate = (uint32_t)_p_sens_afbr_s_rate.get();
|
||||
status = set_rate_and_dfm(_current_rate, DFM_MODE_OFF);
|
||||
status = setRateAndDfm(_current_rate, DFM_MODE_OFF);
|
||||
|
||||
if (status != STATUS_OK) {
|
||||
PX4_ERR("set_rate status not okay: %i", (int)status);
|
||||
@@ -374,28 +353,7 @@ void AFBRS50::Evaluate_rate()
|
||||
}
|
||||
}
|
||||
|
||||
void AFBRS50::stop()
|
||||
{
|
||||
_state = STATE::STOP;
|
||||
ScheduleNow();
|
||||
}
|
||||
|
||||
int AFBRS50::test()
|
||||
{
|
||||
_testing = true;
|
||||
|
||||
init();
|
||||
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
void AFBRS50::print_info()
|
||||
{
|
||||
perf_print_counter(_sample_perf);
|
||||
get_info();
|
||||
}
|
||||
|
||||
status_t AFBRS50::set_rate_and_dfm(uint32_t rate_hz, argus_dfm_mode_t dfm_mode)
|
||||
status_t AFBRS50::setRateAndDfm(uint32_t rate_hz, argus_dfm_mode_t dfm_mode)
|
||||
{
|
||||
while (Argus_GetStatus(_hnd) != STATUS_IDLE) {
|
||||
px4_usleep(1_ms);
|
||||
@@ -423,20 +381,53 @@ status_t AFBRS50::set_rate_and_dfm(uint32_t rate_hz, argus_dfm_mode_t dfm_mode)
|
||||
return status;
|
||||
|
||||
} else {
|
||||
_measure_interval = current_rate;
|
||||
_measurement_inverval = current_rate;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void AFBRS50::get_info()
|
||||
argus_mode_t AFBRS50::argusModeFromParameter()
|
||||
{
|
||||
argus_dfm_mode_t dfm_mode;
|
||||
Argus_GetConfigurationDFMMode(_hnd, &dfm_mode);
|
||||
int32_t mode_param = _p_sens_afbr_mode.get();
|
||||
argus_mode_t mode = ARGUS_MODE_SHORT_RANGE;
|
||||
|
||||
if (mode_param < 0 || mode_param > 3) {
|
||||
PX4_ERR("Invalid mode parameter: %li", mode_param);
|
||||
return mode;
|
||||
}
|
||||
|
||||
switch (mode_param) {
|
||||
case 0:
|
||||
mode = ARGUS_MODE_SHORT_RANGE;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
mode = ARGUS_MODE_LONG_RANGE;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
mode = ARGUS_MODE_HIGH_SPEED_SHORT_RANGE;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
mode = ARGUS_MODE_HIGH_SPEED_LONG_RANGE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return mode;
|
||||
}
|
||||
|
||||
void AFBRS50::printInfo()
|
||||
{
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
perf_print_counter(_not_ready_perf);
|
||||
PX4_INFO_RAW("distance: %.3fm\n", (double)_current_distance);
|
||||
PX4_INFO_RAW("dfm mode: %d\n", dfm_mode);
|
||||
PX4_INFO_RAW("rate: %u Hz\n", (uint)(1000000 / _measure_interval));
|
||||
PX4_INFO_RAW("rate: %u Hz\n", (uint)(1000000 / _measurement_inverval));
|
||||
}
|
||||
|
||||
namespace afbrs50
|
||||
@@ -456,7 +447,6 @@ static int start(const uint8_t rotation)
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
// Initialize the sensor.
|
||||
if (g_dev->init() != PX4_OK) {
|
||||
PX4_ERR("driver start failed");
|
||||
delete g_dev;
|
||||
@@ -474,7 +464,7 @@ static int status()
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
g_dev->print_info();
|
||||
g_dev->printInfo();
|
||||
|
||||
return PX4_OK;
|
||||
}
|
||||
@@ -495,30 +485,6 @@ static int stop()
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
static int test(const uint8_t rotation)
|
||||
{
|
||||
if (g_dev != nullptr) {
|
||||
PX4_ERR("already started");
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
g_dev = new AFBRS50(rotation);
|
||||
|
||||
if (g_dev == nullptr) {
|
||||
PX4_ERR("object instantiate failed");
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
if (g_dev->test() != PX4_OK) {
|
||||
PX4_ERR("driver test failed");
|
||||
delete g_dev;
|
||||
g_dev = nullptr;
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
static int usage()
|
||||
{
|
||||
PRINT_MODULE_DESCRIPTION(
|
||||
@@ -540,7 +506,6 @@ $ afbrs50 stop
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("start", "Start driver");
|
||||
PRINT_MODULE_USAGE_PARAM_STRING('d', nullptr, nullptr, "Serial device", false);
|
||||
PRINT_MODULE_USAGE_PARAM_INT('r', 25, 0, 25, "Sensor rotation - downward facing by default", true);
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("test", "Test driver");
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("stop", "Stop driver");
|
||||
return PX4_OK;
|
||||
}
|
||||
@@ -581,9 +546,6 @@ extern "C" __EXPORT int afbrs50_main(int argc, char *argv[])
|
||||
} else if (!strcmp(argv[myoptind], "stop")) {
|
||||
return afbrs50::stop();
|
||||
|
||||
} else if (!strcmp(argv[myoptind], "test")) {
|
||||
return afbrs50::test(rotation);
|
||||
|
||||
}
|
||||
|
||||
return afbrs50::usage();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2021 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2025 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -31,12 +31,6 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file AFBRS50.hpp
|
||||
*
|
||||
* Driver for the Broadcom AFBR-S50 connected via SPI.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "argus.h"
|
||||
@@ -51,8 +45,6 @@
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
|
||||
using namespace time_literals;
|
||||
|
||||
class AFBRS50 : public ModuleParams, public px4::ScheduledWorkItem
|
||||
{
|
||||
public:
|
||||
@@ -60,63 +52,53 @@ public:
|
||||
~AFBRS50() override;
|
||||
|
||||
int init();
|
||||
|
||||
/**
|
||||
* Diagnostics - print some basic information about the driver.
|
||||
*/
|
||||
void print_info();
|
||||
|
||||
/**50
|
||||
* Stop the automatic measurement state machine.
|
||||
*/
|
||||
void stop();
|
||||
|
||||
int test();
|
||||
|
||||
bool _testing = false;
|
||||
void printInfo();
|
||||
|
||||
private:
|
||||
void Run() override;
|
||||
|
||||
void Evaluate_rate();
|
||||
void recordCommsError();
|
||||
void scheduleCollect();
|
||||
void processMeasurement();
|
||||
void updateMeasurementRateFromRange();
|
||||
|
||||
void ProcessMeasurement(argus_hnd_t *hnd);
|
||||
static status_t measurementReadyCallback(status_t status, argus_hnd_t *hnd);
|
||||
|
||||
static status_t measurement_ready_callback(status_t status, argus_hnd_t *hnd);
|
||||
status_t setRateAndDfm(uint32_t rate_hz, argus_dfm_mode_t dfm_mode);
|
||||
argus_mode_t argusModeFromParameter();
|
||||
|
||||
void get_info();
|
||||
status_t set_rate_and_dfm(uint32_t rate_hz, argus_dfm_mode_t dfm_mode);
|
||||
|
||||
argus_hnd_t *_hnd{nullptr};
|
||||
private:
|
||||
argus_hnd_t *_hnd {nullptr};
|
||||
|
||||
enum class STATE : uint8_t {
|
||||
TEST,
|
||||
CONFIGURE,
|
||||
TRIGGER,
|
||||
COLLECT,
|
||||
STOP
|
||||
WATCHDOG
|
||||
} _state{STATE::CONFIGURE};
|
||||
|
||||
PX4Rangefinder _px4_rangefinder;
|
||||
|
||||
hrt_abstime _measurement_time{0};
|
||||
hrt_abstime _last_rate_switch{0};
|
||||
|
||||
perf_counter_t _sample_perf{perf_alloc(PC_INTERVAL, MODULE_NAME": sample interval")};
|
||||
perf_counter_t _sample_perf{perf_alloc(PC_COUNT, MODULE_NAME": sample count")};
|
||||
perf_counter_t _comms_errors{perf_alloc(PC_COUNT, MODULE_NAME": comms error")};
|
||||
perf_counter_t _not_ready_perf{perf_alloc(PC_COUNT, MODULE_NAME": not ready")};
|
||||
|
||||
uint32_t _measure_interval{1000000 / 50}; // 50Hz
|
||||
float _current_distance{0};
|
||||
int8_t _current_quality{0};
|
||||
float _max_distance;
|
||||
float _min_distance;
|
||||
float _max_distance{30.f};
|
||||
uint32_t _current_rate{0};
|
||||
|
||||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)};
|
||||
|
||||
uint32_t _measurement_inverval {1000000 / 50}; // 50Hz
|
||||
|
||||
DEFINE_PARAMETERS(
|
||||
(ParamInt<px4::params::SENS_AFBR_MODE>) _p_sens_afbr_mode,
|
||||
(ParamInt<px4::params::SENS_AFBR_S_RATE>) _p_sens_afbr_s_rate,
|
||||
(ParamInt<px4::params::SENS_AFBR_L_RATE>) _p_sens_afbr_l_rate,
|
||||
(ParamInt<px4::params::SENS_AFBR_S_RATE>) _p_sens_afbr_s_rate,
|
||||
(ParamInt<px4::params::SENS_AFBR_L_RATE>) _p_sens_afbr_l_rate,
|
||||
(ParamInt<px4::params::SENS_AFBR_THRESH>) _p_sens_afbr_thresh,
|
||||
(ParamInt<px4::params::SENS_AFBR_HYSTER>) _p_sens_afbr_hyster
|
||||
(ParamInt<px4::params::SENS_AFBR_HYSTER>) _p_sens_afbr_hyster
|
||||
);
|
||||
};
|
||||
|
||||
+87
-42
@@ -14,6 +14,8 @@
|
||||
|
||||
#include <lib/perf/perf_counter.h>
|
||||
|
||||
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
|
||||
|
||||
/*! A structure to hold all internal data required by the S2PI module. */
|
||||
typedef struct {
|
||||
/*! Determines the current driver status. */
|
||||
@@ -52,11 +54,71 @@ s2pi_handle_t s2pi_ = { .GPIOs = { [ S2PI_CLK ] = BROADCOM_AFBR_S50_S2PI_CLK,
|
||||
}
|
||||
};
|
||||
|
||||
static struct work_s broadcom_s2pi_transfer_work = {};
|
||||
static perf_counter_t irq_perf = NULL;
|
||||
|
||||
static perf_counter_t s2pi_transfer_perf = NULL;
|
||||
static perf_counter_t s2pi_transfer_callback_perf = NULL;
|
||||
static perf_counter_t s2pi_irq_callback_perf = NULL;
|
||||
class AFBRS50_SPI : public px4::ScheduledWorkItem
|
||||
{
|
||||
public:
|
||||
AFBRS50_SPI();
|
||||
void schedule_now();
|
||||
void schedule_clear();
|
||||
|
||||
private:
|
||||
|
||||
void Run() override;
|
||||
|
||||
};
|
||||
|
||||
AFBRS50_SPI::AFBRS50_SPI():
|
||||
// NOTE: we use SPI0 WQ since it is the 2nd highest priority thread (behind rate_ctrl).
|
||||
// TODO: we should fix how SPI comms work. Async SPI comms is
|
||||
// undesirable. We should use SPI TX DMA complete callback
|
||||
// instead of relying on a high priority thread.
|
||||
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::SPI0)
|
||||
{
|
||||
// Anything to do?
|
||||
}
|
||||
|
||||
void AFBRS50_SPI::Run()
|
||||
{
|
||||
px4_arch_gpiowrite(s2pi_.GPIOs[S2PI_CS], 0);
|
||||
SPI_EXCHANGE(s2pi_.spidev, s2pi_.spi_tx_data, s2pi_.spi_rx_data, s2pi_.spi_frame_size);
|
||||
px4_arch_gpiowrite(s2pi_.GPIOs[S2PI_CS], 1);
|
||||
|
||||
//// WARNING!
|
||||
// After the last SPI TX we have ~60us to execute the below
|
||||
// callback otherwise the IRQ will fire and we're screwed.
|
||||
// The proper way to solve this problem is to either fix
|
||||
// the API or to configure SPI TX DMA callback complete
|
||||
// to execute the below callback immediately.
|
||||
|
||||
|
||||
// If we are pre-empted here and the IRQ fires before the
|
||||
// callback has been invoked -- we're screwed.
|
||||
|
||||
IRQ_LOCK();
|
||||
s2pi_.Status = STATUS_IDLE;
|
||||
|
||||
if (s2pi_.Callback != 0) {
|
||||
s2pi_callback_t callback = s2pi_.Callback;
|
||||
s2pi_.Callback = 0;
|
||||
callback(STATUS_OK, s2pi_.CallbackData);
|
||||
}
|
||||
|
||||
IRQ_UNLOCK();
|
||||
}
|
||||
|
||||
void AFBRS50_SPI::schedule_now()
|
||||
{
|
||||
ScheduleNow();
|
||||
}
|
||||
|
||||
void AFBRS50_SPI::schedule_clear()
|
||||
{
|
||||
ScheduleClear();
|
||||
}
|
||||
|
||||
static AFBRS50_SPI *_spi_iface = nullptr;
|
||||
|
||||
/*!***************************************************************************
|
||||
* @brief Initialize the S2PI module.
|
||||
@@ -71,18 +133,6 @@ static perf_counter_t s2pi_irq_callback_perf = NULL;
|
||||
*
|
||||
* @return Returns the \link #status_t status\endlink (#STATUS_OK on success).
|
||||
*****************************************************************************/
|
||||
|
||||
static int gpio_falling_edge(int irq, void *context, void *arg)
|
||||
{
|
||||
if (s2pi_.IrqCallback != 0) {
|
||||
perf_begin(s2pi_irq_callback_perf);
|
||||
s2pi_.IrqCallback(s2pi_.IrqCallbackData);
|
||||
perf_end(s2pi_irq_callback_perf);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
status_t S2PI_Init(s2pi_slave_t defaultSlave, uint32_t baudRate_Bps)
|
||||
{
|
||||
(void)defaultSlave;
|
||||
@@ -91,12 +141,25 @@ status_t S2PI_Init(s2pi_slave_t defaultSlave, uint32_t baudRate_Bps)
|
||||
|
||||
s2pi_.spidev = px4_spibus_initialize(BROADCOM_AFBR_S50_S2PI_SPI_BUS);
|
||||
|
||||
px4_arch_configgpio(BROADCOM_AFBR_S50_S2PI_IRQ);
|
||||
px4_arch_gpiosetevent(BROADCOM_AFBR_S50_S2PI_IRQ, false, true, false, &gpio_falling_edge, NULL);
|
||||
// Falling edge callback
|
||||
auto callback = [](int irq, void *context, void *arg) -> int {
|
||||
if (s2pi_.IrqCallback != 0)
|
||||
{
|
||||
perf_begin(irq_perf);
|
||||
s2pi_.IrqCallback(s2pi_.IrqCallbackData);
|
||||
perf_end(irq_perf);
|
||||
}
|
||||
|
||||
s2pi_transfer_perf = perf_alloc(PC_ELAPSED, MODULE_NAME": transfer");
|
||||
s2pi_transfer_callback_perf = perf_alloc(PC_ELAPSED, MODULE_NAME": transfer callback");
|
||||
s2pi_irq_callback_perf = perf_alloc(PC_ELAPSED, MODULE_NAME": irq callback");
|
||||
return 0;
|
||||
};
|
||||
// NOTE: we enable the interrupt event here but do not configure the GPIO.
|
||||
// We configure the GPIO and enable the interrupt after the device mode
|
||||
// has been configured. This prevents erroneous interrupts from occuring.
|
||||
px4_arch_gpiosetevent(BROADCOM_AFBR_S50_S2PI_IRQ, false, true, false, callback, NULL);
|
||||
|
||||
irq_perf = perf_alloc(PC_ELAPSED, MODULE_NAME": irq callback");
|
||||
|
||||
_spi_iface = new AFBRS50_SPI();
|
||||
|
||||
return S2PI_SetBaudRate(baudRate_Bps);
|
||||
}
|
||||
@@ -334,25 +397,6 @@ status_t S2PI_CycleCsPin(s2pi_slave_t slave)
|
||||
* was not started.
|
||||
*****************************************************************************/
|
||||
|
||||
static void broadcom_s2pi_transfer_callout(void *arg)
|
||||
{
|
||||
perf_begin(s2pi_transfer_perf);
|
||||
px4_arch_gpiowrite(s2pi_.GPIOs[S2PI_CS], 0);
|
||||
SPI_EXCHANGE(s2pi_.spidev, s2pi_.spi_tx_data, s2pi_.spi_rx_data, s2pi_.spi_frame_size);
|
||||
s2pi_.Status = STATUS_IDLE;
|
||||
px4_arch_gpiowrite(s2pi_.GPIOs[S2PI_CS], 1);
|
||||
perf_end(s2pi_transfer_perf);
|
||||
|
||||
/* Invoke callback if there is one */
|
||||
if (s2pi_.Callback != 0) {
|
||||
perf_begin(s2pi_transfer_callback_perf);
|
||||
s2pi_callback_t callback = s2pi_.Callback;
|
||||
s2pi_.Callback = 0;
|
||||
callback(STATUS_OK, s2pi_.CallbackData);
|
||||
perf_end(s2pi_transfer_callback_perf);
|
||||
}
|
||||
}
|
||||
|
||||
status_t S2PI_TransferFrame(s2pi_slave_t spi_slave, uint8_t const *txData, uint8_t *rxData, size_t frameSize,
|
||||
s2pi_callback_t callback, void *callbackData)
|
||||
{
|
||||
@@ -384,7 +428,8 @@ status_t S2PI_TransferFrame(s2pi_slave_t spi_slave, uint8_t const *txData, uint8
|
||||
s2pi_.spi_tx_data = (uint8_t *)txData;
|
||||
s2pi_.spi_rx_data = rxData;
|
||||
s2pi_.spi_frame_size = frameSize;
|
||||
work_queue(HPWORK, &broadcom_s2pi_transfer_work, broadcom_s2pi_transfer_callout, NULL, 0);
|
||||
|
||||
_spi_iface->schedule_now();
|
||||
|
||||
IRQ_UNLOCK();
|
||||
|
||||
@@ -410,7 +455,7 @@ status_t S2PI_Abort(s2pi_slave_t slave)
|
||||
|
||||
/* Abort SPI transfer. */
|
||||
if (status == STATUS_BUSY) {
|
||||
work_cancel(HPWORK, &broadcom_s2pi_transfer_work);
|
||||
_spi_iface->schedule_clear();
|
||||
}
|
||||
|
||||
return STATUS_OK;
|
||||
@@ -47,7 +47,7 @@ px4_add_module(
|
||||
AFBRS50.cpp
|
||||
AFBRS50.hpp
|
||||
API/Src/irq.c
|
||||
API/Src/s2pi.c
|
||||
API/Src/s2pi.cpp
|
||||
API/Src/timer.c
|
||||
argus_hal_test.c
|
||||
DEPENDS
|
||||
|
||||
@@ -150,7 +150,7 @@ The sensor/driver must be enabled using the parameter SENS_EN_LL40LS.
|
||||
Setup/usage information: https://docs.px4.io/main/en/sensor/lidar_lite.html
|
||||
)DESCR_STR");
|
||||
|
||||
PRINT_MODULE_USAGE_NAME("ll40ls", "driver");
|
||||
PRINT_MODULE_USAGE_NAME("ll40ls_pwm", "driver");
|
||||
PRINT_MODULE_USAGE_SUBCATEGORY("distance_sensor");
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("start","Start driver");
|
||||
PRINT_MODULE_USAGE_PARAM_INT('R', 25, 0, 25, "Sensor rotation - downward facing by default", true);
|
||||
|
||||
@@ -118,6 +118,7 @@ int Decoder::parse(Header *header) const
|
||||
int Decoder::parse(DOP *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::DOP) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
memcpy(message, _message.payload, sizeof(DOP));
|
||||
return PX4_OK;
|
||||
}
|
||||
@@ -128,6 +129,7 @@ int Decoder::parse(DOP *message) const
|
||||
int Decoder::parse(PVTGeodetic *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::PVTGeodetic) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
memcpy(message, _message.payload, sizeof(PVTGeodetic));
|
||||
return PX4_OK;
|
||||
}
|
||||
@@ -138,6 +140,7 @@ int Decoder::parse(PVTGeodetic *message) const
|
||||
int Decoder::parse(ReceiverStatus *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::ReceiverStatus) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
memcpy(message, _message.payload, sizeof(ReceiverStatus));
|
||||
return PX4_OK;
|
||||
}
|
||||
@@ -148,6 +151,7 @@ int Decoder::parse(ReceiverStatus *message) const
|
||||
int Decoder::parse(QualityInd *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::QualityInd) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
// Safe to copy entire size of the message as it is smaller than the maximum expected SBF message size.
|
||||
// It's up to the user of the parsed message to ignore the invalid fields.
|
||||
memcpy(message, _message.payload, sizeof(QualityInd));
|
||||
@@ -160,11 +164,16 @@ int Decoder::parse(QualityInd *message) const
|
||||
int Decoder::parse(RFStatus *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::PVTGeodetic) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
memcpy(message, _message.payload, sizeof(RFStatus) - sizeof(RFStatus::rf_band));
|
||||
|
||||
for (uint8_t i = 0; i < math::min(message->n, k_max_rfband_blocks); i++) {
|
||||
memcpy(&message->rf_band[i], &_message.payload[sizeof(RFStatus) - sizeof(RFStatus::rf_band) + i *
|
||||
message->sb_length], sizeof(RFBand));
|
||||
const unsigned offset = sizeof(RFStatus) - sizeof(RFStatus::rf_band) + i *
|
||||
message->sb_length;
|
||||
|
||||
if (offset + sizeof(RFBand) <= sizeof(_message.payload)) {
|
||||
memcpy(&message->rf_band[i], &_message.payload[offset], sizeof(RFBand));
|
||||
}
|
||||
}
|
||||
|
||||
return PX4_OK;
|
||||
@@ -176,6 +185,7 @@ int Decoder::parse(RFStatus *message) const
|
||||
int Decoder::parse(GALAuthStatus *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::GALAuthStatus) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
memcpy(message, _message.payload, sizeof(GALAuthStatus));
|
||||
return PX4_OK;
|
||||
}
|
||||
@@ -186,6 +196,7 @@ int Decoder::parse(GALAuthStatus *message) const
|
||||
int Decoder::parse(VelCovGeodetic *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::VelCovGeodetic) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
memcpy(message, _message.payload, sizeof(VelCovGeodetic));
|
||||
return PX4_OK;
|
||||
}
|
||||
@@ -196,11 +207,17 @@ int Decoder::parse(VelCovGeodetic *message) const
|
||||
int Decoder::parse(GEOIonoDelay *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::GEOIonoDelay) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
memcpy(message, _message.payload, sizeof(GEOIonoDelay) - sizeof(GEOIonoDelay::idc));
|
||||
|
||||
for (size_t i = 0; i < math::min(message->n, (uint8_t)4); i++) {
|
||||
memcpy(&message->idc[i], &_message.payload[sizeof(GEOIonoDelay) - sizeof(GEOIonoDelay::idc) + i *
|
||||
message->sb_length], sizeof(IDC));
|
||||
for (size_t i = 0; i < math::min(message->n, (uint8_t)(sizeof(GEOIonoDelay::idc) / sizeof(GEOIonoDelay::idc[0])));
|
||||
i++) {
|
||||
const unsigned offset = sizeof(GEOIonoDelay) - sizeof(GEOIonoDelay::idc) + i *
|
||||
message->sb_length;
|
||||
|
||||
if (offset + sizeof(IDC) <= sizeof(_message.payload)) {
|
||||
memcpy(&message->idc[i], &_message.payload[offset], sizeof(IDC));
|
||||
}
|
||||
}
|
||||
|
||||
return PX4_OK;
|
||||
@@ -212,6 +229,7 @@ int Decoder::parse(GEOIonoDelay *message) const
|
||||
int Decoder::parse(AttEuler *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::AttEuler) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
memcpy(message, _message.payload, sizeof(AttEuler));
|
||||
return PX4_OK;
|
||||
}
|
||||
@@ -222,6 +240,7 @@ int Decoder::parse(AttEuler *message) const
|
||||
int Decoder::parse(AttCovEuler *message) const
|
||||
{
|
||||
if (can_parse() && id() == BlockID::AttCovEuler) {
|
||||
static_assert(sizeof(*message) <= sizeof(_message.payload), "Buffer too small");
|
||||
memcpy(message, _message.payload, sizeof(AttCovEuler));
|
||||
return PX4_OK;
|
||||
}
|
||||
@@ -243,7 +262,7 @@ bool Decoder::done() const
|
||||
|
||||
bool Decoder::can_parse() const
|
||||
{
|
||||
return done()
|
||||
return done() && _message.header.length <= sizeof(_message) && _message.header.length > 4
|
||||
&& _message.header.crc == buffer_crc16(reinterpret_cast<const uint8_t *>(&_message) + 4, _message.header.length - 4);
|
||||
}
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ private:
|
||||
bool can_parse() const;
|
||||
|
||||
State _state{State::SearchingSync1};
|
||||
uint16_t _current_index;
|
||||
uint16_t _current_index{0};
|
||||
message_t _message;
|
||||
};
|
||||
|
||||
|
||||
@@ -614,7 +614,7 @@ void SagetechMXS::handle_svr(sg_svr_t svr)
|
||||
}
|
||||
|
||||
if (svr.validity.surfHeading) {
|
||||
t.heading = matrix::wrap_pi((float)svr.surface.heading * (M_PI_F / 180.0f) + M_PI_F);
|
||||
t.heading = matrix::wrap_pi((float)svr.surface.heading * (M_PI_F / 180.0f));
|
||||
t.flags |= transponder_report_s::PX4_ADSB_FLAGS_VALID_HEADING;
|
||||
}
|
||||
}
|
||||
@@ -622,7 +622,7 @@ void SagetechMXS::handle_svr(sg_svr_t svr)
|
||||
if (svr.type == svrAirborne) {
|
||||
if (svr.validity.airSpeed) {
|
||||
t.hor_velocity = (svr.airborne.speed * SAGETECH_SCALE_KNOTS_TO_M_PER_SEC); //Convert from knots to meters/second
|
||||
t.heading = matrix::wrap_pi((float)svr.airborne.heading * (M_PI_F / 180.0f) + M_PI_F);
|
||||
t.heading = matrix::wrap_pi((float)svr.airborne.heading * (M_PI_F / 180.0f));
|
||||
t.flags |= transponder_report_s::PX4_ADSB_FLAGS_VALID_HEADING;
|
||||
t.flags |= transponder_report_s::PX4_ADSB_FLAGS_VALID_VELOCITY;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ bool AdsbConflict::handle_traffic_conflict()
|
||||
|
||||
case TRAFFIC_STATE::ADD_CONFLICT:
|
||||
case TRAFFIC_STATE::REMIND_CONFLICT: {
|
||||
take_action = send_traffic_warning((int)(math::degrees(_transponder_report.heading) + 180.f),
|
||||
take_action = send_traffic_warning((int)math::degrees(_transponder_report.heading),
|
||||
(int)fabsf(_crosstrack_error.distance), _transponder_report.flags,
|
||||
_transponder_report.callsign,
|
||||
_transponder_report.icao_address,
|
||||
|
||||
@@ -128,7 +128,6 @@ PARAM_DEFINE_FLOAT(WEIGHT_GROSS, -1.0f);
|
||||
*
|
||||
* @unit m/s
|
||||
* @min 1.0
|
||||
* @max 15.0
|
||||
* @decimal 1
|
||||
* @increment 0.5
|
||||
* @group FW Performance
|
||||
@@ -144,7 +143,6 @@ PARAM_DEFINE_FLOAT(FW_T_CLMB_MAX, 5.0f);
|
||||
*
|
||||
* @unit m/s
|
||||
* @min 1.0
|
||||
* @max 5.0
|
||||
* @decimal 1
|
||||
* @increment 0.5
|
||||
* @group FW Performance
|
||||
|
||||
@@ -107,6 +107,8 @@ AirspeedValidator::get_wind_estimator_states(uint64_t timestamp)
|
||||
wind_est.tas_scale_raw = _wind_estimator.get_tas_scale();
|
||||
wind_est.tas_scale_raw_var = _wind_estimator.get_tas_scale_var();
|
||||
wind_est.tas_scale_validated = _CAS_scale_validated;
|
||||
wind_est.tas_innov_integ_test_ratio = _tas_innov_integ_threshold > FLT_EPSILON ? _aspd_innov_integ_state /
|
||||
_tas_innov_integ_threshold : 0.f;
|
||||
return wind_est;
|
||||
}
|
||||
|
||||
|
||||
@@ -688,7 +688,7 @@ Commander::Commander() :
|
||||
_vehicle_status.system_id = 1;
|
||||
_vehicle_status.component_id = 1;
|
||||
_vehicle_status.system_type = 0;
|
||||
_vehicle_status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_ROTARY_WING;
|
||||
_vehicle_status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_UNSPECIFIED;
|
||||
_vehicle_status.nav_state = _user_mode_intention.get();
|
||||
_vehicle_status.nav_state_user_intention = _user_mode_intention.get();
|
||||
_vehicle_status.nav_state_timestamp = hrt_absolute_time();
|
||||
|
||||
@@ -127,6 +127,7 @@ PARAM_DEFINE_INT32(COM_HLDL_REG_T, 0);
|
||||
*
|
||||
* The time in seconds without a new setpoint from RC or Joystick, after which the connection is considered lost.
|
||||
* This must be kept short as the vehicle will use the last supplied setpoint until the timeout triggers.
|
||||
* Ensure the value is not set lower than the update interval of the RC or Joystick.
|
||||
*
|
||||
* @group Commander
|
||||
* @unit s
|
||||
|
||||
@@ -144,7 +144,7 @@ PARAM_DEFINE_FLOAT(FW_P_LIM_MIN, -30.0f);
|
||||
*
|
||||
* @unit deg
|
||||
* @min 0.0
|
||||
* @max 60.0
|
||||
* @max 80.0
|
||||
* @decimal 1
|
||||
* @increment 0.5
|
||||
* @group FW General
|
||||
@@ -158,7 +158,7 @@ PARAM_DEFINE_FLOAT(FW_P_LIM_MAX, 30.0f);
|
||||
*
|
||||
* @unit deg
|
||||
* @min 35.0
|
||||
* @max 65.0
|
||||
* @max 75.0
|
||||
* @decimal 1
|
||||
* @increment 0.5
|
||||
* @group FW General
|
||||
@@ -203,7 +203,7 @@ PARAM_DEFINE_FLOAT(FW_THR_MIN, 0.0f);
|
||||
*
|
||||
* @unit norm
|
||||
* @min 0.0
|
||||
* @max 0.4
|
||||
* @max 1.0
|
||||
* @decimal 2
|
||||
* @increment 0.01
|
||||
* @group FW General
|
||||
@@ -218,7 +218,7 @@ PARAM_DEFINE_FLOAT(FW_THR_IDLE, 0.0f);
|
||||
*
|
||||
* @unit deg
|
||||
* @min 1.0
|
||||
* @max 15.0
|
||||
* @max 45.0
|
||||
* @decimal 1
|
||||
* @increment 0.5
|
||||
* @group FW Auto Landing
|
||||
@@ -230,7 +230,7 @@ PARAM_DEFINE_FLOAT(FW_LND_ANG, 5.0f);
|
||||
*
|
||||
* @unit deg
|
||||
* @min -5.0
|
||||
* @max 30.0
|
||||
* @max 80.0
|
||||
* @decimal 1
|
||||
* @increment 0.5
|
||||
* @group FW Auto Takeoff
|
||||
@@ -390,8 +390,7 @@ PARAM_DEFINE_INT32(FW_POS_STK_CONF, 2);
|
||||
* In manual modes: maximum climb rate setpoint.
|
||||
*
|
||||
* @unit m/s
|
||||
* @min 0.5
|
||||
* @max 15
|
||||
* @min 0.1
|
||||
* @decimal 2
|
||||
* @increment 0.01
|
||||
* @group FW General
|
||||
@@ -405,8 +404,7 @@ PARAM_DEFINE_FLOAT(FW_T_CLMB_R_SP, 3.0f);
|
||||
* In manual modes: maximum sink rate setpoint.
|
||||
*
|
||||
* @unit m/s
|
||||
* @min 0.5
|
||||
* @max 15
|
||||
* @min 0.1
|
||||
* @decimal 2
|
||||
* @increment 0.01
|
||||
* @group FW General
|
||||
@@ -422,7 +420,6 @@ PARAM_DEFINE_FLOAT(FW_T_SINK_R_SP, 2.0f);
|
||||
*
|
||||
* @unit s
|
||||
* @min 0
|
||||
* @max 3600
|
||||
* @group FW General
|
||||
*/
|
||||
PARAM_DEFINE_INT32(FW_GPSF_LT, 30);
|
||||
@@ -434,7 +431,7 @@ PARAM_DEFINE_INT32(FW_GPSF_LT, 30);
|
||||
*
|
||||
* @unit deg
|
||||
* @min 0.0
|
||||
* @max 30.0
|
||||
* @max 60.0
|
||||
* @decimal 1
|
||||
* @increment 0.5
|
||||
* @group FW General
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2016-2025 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE modules__hardfault_stream
|
||||
MAIN hardfault_stream
|
||||
COMPILE_FLAGS
|
||||
SRCS
|
||||
HardfaultStream.cpp
|
||||
HardfaultStream.hpp
|
||||
DEPENDS
|
||||
px4_work_queue
|
||||
)
|
||||
@@ -0,0 +1,224 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "HardfaultStream.hpp"
|
||||
|
||||
using namespace time_literals;
|
||||
|
||||
namespace hardfault_stream
|
||||
{
|
||||
|
||||
HardfaultStream::HardfaultStream() :
|
||||
ModuleParams(nullptr),
|
||||
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default)
|
||||
{
|
||||
}
|
||||
|
||||
HardfaultStream::~HardfaultStream()
|
||||
{
|
||||
ScheduleClear();
|
||||
|
||||
if (_hardfault_file != nullptr) {
|
||||
fclose(_hardfault_file);
|
||||
}
|
||||
}
|
||||
|
||||
int HardfaultStream::task_spawn(int argc, char *argv[])
|
||||
{
|
||||
HardfaultStream *obj = new HardfaultStream();
|
||||
|
||||
if (!obj) {
|
||||
PX4_ERR("alloc failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
_object.store(obj);
|
||||
_task_id = task_id_is_work_queue;
|
||||
|
||||
/* Schedule a cycle to start things. */
|
||||
obj->start();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void HardfaultStream::start()
|
||||
{
|
||||
ScheduleOnInterval(150_ms);
|
||||
}
|
||||
|
||||
bool HardfaultStream::mavlink_gcs_up()
|
||||
{
|
||||
for (auto &telemetry_status : _telemetry_status_subs) {
|
||||
telemetry_status_s telemetry;
|
||||
|
||||
if (telemetry_status.update(&telemetry)) {
|
||||
if (telemetry.heartbeat_type_gcs) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void HardfaultStream::search_hardfault_file()
|
||||
{
|
||||
DIR *dp = opendir(PX4_STORAGEDIR);
|
||||
|
||||
if (dp != nullptr) {
|
||||
|
||||
struct dirent *result;
|
||||
struct stat st;
|
||||
time_t latest_mtime = 0;
|
||||
|
||||
while ((result = readdir(dp))) {
|
||||
// Check for pattern fault_*.log
|
||||
if (strncmp("fault_", result->d_name, 6) == 0 && strcmp(result->d_name + strlen(result->d_name) - 4, ".log") == 0) {
|
||||
char current_file_path[CONFIG_PATH_MAX + 1];
|
||||
snprintf(current_file_path, sizeof(current_file_path), "%s/%s", PX4_STORAGEDIR, result->d_name);
|
||||
|
||||
if (stat(current_file_path, &st) == 0) {
|
||||
if (st.st_mtime >= latest_mtime) {
|
||||
latest_mtime = st.st_mtime;
|
||||
strncpy(_hardfault_file_path, current_file_path, sizeof(_hardfault_file_path));
|
||||
_hardfault_file_path[sizeof(_hardfault_file_path) - 1] = '\0';
|
||||
_hardfault_file_present = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
}
|
||||
|
||||
void HardfaultStream::stream_hardfault()
|
||||
{
|
||||
if (_hardfault_file == nullptr) {
|
||||
_hardfault_file = fopen(_hardfault_file_path, "rb");
|
||||
|
||||
if (_hardfault_file == nullptr) {
|
||||
PX4_ERR("Can't open hardfault log: %s", _hardfault_file_path);
|
||||
_state = State::RequestStop;
|
||||
return;
|
||||
}
|
||||
|
||||
PX4_INFO("Streaming hardfault log: %s", _hardfault_file_path);
|
||||
}
|
||||
|
||||
static constexpr int chunk_size = sizeof(mavlink_log_s::text) - 1;
|
||||
uint8_t chunk[chunk_size];
|
||||
size_t bytes_read = fread(chunk, 1, chunk_size, _hardfault_file);
|
||||
|
||||
if (bytes_read > 0) {
|
||||
mavlink_vasprintf(_MSG_PRIO_CRITICAL, &_mavlink_log_pub, "%.*s", bytes_read, chunk);
|
||||
|
||||
} else {
|
||||
fclose(_hardfault_file);
|
||||
_hardfault_file = nullptr;
|
||||
_stream_finished = true;
|
||||
}
|
||||
}
|
||||
|
||||
void HardfaultStream::Run()
|
||||
{
|
||||
if (should_exit()) {
|
||||
ScheduleClear();
|
||||
exit_and_cleanup();
|
||||
}
|
||||
|
||||
switch (_state) {
|
||||
case State::SearchFile:
|
||||
search_hardfault_file();
|
||||
_state = State::WaitMavlink;
|
||||
ScheduleNow();
|
||||
break;
|
||||
|
||||
case State::WaitMavlink:
|
||||
if (mavlink_gcs_up()) {
|
||||
_state = State::StreamFile;
|
||||
ScheduleNow();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case State::StreamFile:
|
||||
if (!_hardfault_file_present || _stream_finished) {
|
||||
_state = State::RequestStop;
|
||||
|
||||
} else {
|
||||
stream_hardfault();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case State::RequestStop:
|
||||
request_stop();
|
||||
_state = State::WaitStop;
|
||||
|
||||
case State::WaitStop:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int HardfaultStream::print_usage(const char *reason)
|
||||
{
|
||||
if (reason) {
|
||||
PX4_ERR("%s\n", reason);
|
||||
}
|
||||
|
||||
PRINT_MODULE_DESCRIPTION(
|
||||
R"DESCR_STR(
|
||||
### Description
|
||||
Background process that streams the latest hardfault via MAVLink.
|
||||
|
||||
The module is especially useful when it is necessary to quickly push a hard fault to the ground station.
|
||||
This is useful in cases where the drone experiences a hard fault during flight.
|
||||
It ensures that some data is retained in case the permanent storage is destroyed during a crash.
|
||||
|
||||
To reliably stream, it is necessary to send the STATUSTEXT message via MAVLink at a
|
||||
high enough frequency. The recommended frequency is 10 Hz or higher.
|
||||
)DESCR_STR");
|
||||
|
||||
PRINT_MODULE_USAGE_NAME("hardfault_stream", "system");
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("start", "Start the background task");
|
||||
PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" __EXPORT int hardfault_stream_main(int argc, char *argv[])
|
||||
{
|
||||
return HardfaultStream::main(argc, argv);
|
||||
}
|
||||
|
||||
} // namespace hardfault_stream
|
||||
@@ -0,0 +1,102 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <px4_platform_common/defines.h>
|
||||
#include <px4_platform_common/module.h>
|
||||
#include <px4_platform_common/module_params.h>
|
||||
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
|
||||
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/SubscriptionMultiArray.hpp>
|
||||
#include <uORB/topics/mavlink_log.h>
|
||||
#include <uORB/topics/telemetry_status.h>
|
||||
|
||||
#include <systemlib/mavlink_log.h>
|
||||
|
||||
namespace hardfault_stream
|
||||
{
|
||||
|
||||
class HardfaultStream : public ModuleBase<HardfaultStream>, public ModuleParams, public px4::ScheduledWorkItem
|
||||
{
|
||||
public:
|
||||
HardfaultStream();
|
||||
~HardfaultStream() override;
|
||||
|
||||
static int task_spawn(int argc, char *argv[]);
|
||||
|
||||
/** @see ModuleBase */
|
||||
static int custom_command(int argc, char *argv[])
|
||||
{
|
||||
return print_usage("unknown command");
|
||||
}
|
||||
|
||||
/** @see ModuleBase */
|
||||
static int print_usage(const char *reason = nullptr);
|
||||
|
||||
void start();
|
||||
|
||||
private:
|
||||
enum class State {
|
||||
SearchFile,
|
||||
WaitMavlink,
|
||||
StreamFile,
|
||||
RequestStop,
|
||||
WaitStop,
|
||||
};
|
||||
|
||||
/** Do a compute and schedule the next cycle. */
|
||||
void Run() override;
|
||||
|
||||
bool mavlink_gcs_up();
|
||||
void search_hardfault_file();
|
||||
void stream_hardfault();
|
||||
|
||||
State _state {State::SearchFile};
|
||||
|
||||
bool _stream_finished {false};
|
||||
bool _hardfault_file_present {false};
|
||||
|
||||
char _hardfault_file_path[CONFIG_PATH_MAX + 1];
|
||||
FILE *_hardfault_file {nullptr};
|
||||
|
||||
orb_advert_t _mavlink_log_pub {nullptr};
|
||||
uORB::SubscriptionMultiArray<telemetry_status_s> _telemetry_status_subs{ORB_ID::telemetry_status};
|
||||
};
|
||||
|
||||
} // namespace hardfault_stream
|
||||
@@ -0,0 +1,6 @@
|
||||
menuconfig MODULES_HARDFAULT_STREAM
|
||||
bool "hardfault_stream"
|
||||
default n
|
||||
depends on PLATFORM_NUTTX
|
||||
---help---
|
||||
Enable support for hardfault_stream
|
||||
@@ -0,0 +1,44 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013-2025 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* Enable FMU SD card hardfault streaming
|
||||
*
|
||||
* When this is enabled all the hardfaults on the SD card are streamed
|
||||
* over MAVLink. This is useful for cases where the FMU does reset in-flight due
|
||||
* to a hardfault and the SD card may not survive a crash.
|
||||
*
|
||||
* @group System
|
||||
* @boolean
|
||||
*/
|
||||
PARAM_DEFINE_INT32(SYS_HF_MAV, 1);
|
||||
Submodule src/modules/mavlink/mavlink updated: 5bfd76d802...067abb83cd
@@ -278,9 +278,14 @@ MavlinkMissionManager::send_mission_ack(uint8_t sysid, uint8_t compid, uint8_t t
|
||||
void
|
||||
MavlinkMissionManager::send_mission_current(uint16_t seq)
|
||||
{
|
||||
// Update mission state before sending
|
||||
update_mission_state();
|
||||
|
||||
mavlink_mission_current_t wpc{};
|
||||
wpc.seq = seq;
|
||||
wpc.total = _count[MAV_MISSION_TYPE_MISSION] > 0 ? _count[MAV_MISSION_TYPE_MISSION] : UINT16_MAX;
|
||||
wpc.mission_state = static_cast<uint8_t>(_mission_state);
|
||||
wpc.mission_mode = static_cast<uint8_t>(_mission_mode);
|
||||
wpc.mission_id = _crc32[MAV_MISSION_TYPE_MISSION];
|
||||
wpc.fence_id = _crc32[MAV_MISSION_TYPE_FENCE];
|
||||
wpc.rally_points_id = _crc32[MAV_MISSION_TYPE_RALLY];
|
||||
@@ -911,6 +916,7 @@ MavlinkMissionManager::handle_mission_count(const mavlink_message_t *msg)
|
||||
_transfer_partner_compid = msg->compid;
|
||||
_mission_type = (MAV_MISSION_TYPE)wpc.mission_type;
|
||||
_transfer_current_crc32 = 0;
|
||||
_last_reached = -1; // Reset last reached waypoint when new mission starts
|
||||
|
||||
if (wpc.count > current_max_item_count()) {
|
||||
PX4_DEBUG("WPM: MISSION_COUNT ERROR: too many waypoints (%d), supported: %d", wpc.count, current_max_item_count());
|
||||
@@ -1907,3 +1913,51 @@ uint32_t MavlinkMissionManager::crc32_for_mission_item(const mavlink_mission_ite
|
||||
|
||||
return crc32part(u.raw, sizeof(u), prev_crc32);
|
||||
}
|
||||
|
||||
void
|
||||
MavlinkMissionManager::update_mission_state()
|
||||
{
|
||||
// Get vehicle status
|
||||
vehicle_status_s vehicle_status;
|
||||
|
||||
if (!_vehicle_status_sub.update(&vehicle_status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get mission result
|
||||
mission_result_s mission_result;
|
||||
|
||||
if (!_mission_result_sub.update(&mission_result)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update mission mode
|
||||
if (vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION ||
|
||||
vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_TAKEOFF ||
|
||||
vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_LAND) {
|
||||
_mission_mode = MISSION_MODE_ACTIVE;
|
||||
|
||||
} else {
|
||||
_mission_mode = MISSION_MODE_SUSPENDED;
|
||||
}
|
||||
|
||||
// Update mission state
|
||||
if (_count[MAV_MISSION_TYPE_MISSION] == 0) {
|
||||
_mission_state = MISSION_STATE_NO_MISSION;
|
||||
|
||||
} else if (mission_result.finished) {
|
||||
// Mission is complete if the navigator says it's finished
|
||||
_mission_state = MISSION_STATE_COMPLETE;
|
||||
|
||||
} else if (_mission_mode == MISSION_MODE_ACTIVE
|
||||
&& vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED) {
|
||||
_mission_state = MISSION_STATE_ACTIVE;
|
||||
|
||||
} else if (_mission_mode == MISSION_MODE_SUSPENDED && _last_reached >= 0) {
|
||||
// Only PAUSED if we were actually in the middle of a mission
|
||||
_mission_state = MISSION_STATE_PAUSED;
|
||||
|
||||
} else {
|
||||
_mission_state = MISSION_STATE_NOT_STARTED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <uORB/Publication.hpp>
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/topics/mission_result.h>
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
|
||||
#include "mavlink_bridge_header.h"
|
||||
#include "mavlink_rate_limiter.h"
|
||||
@@ -60,6 +61,13 @@ enum MAVLINK_WPM_STATES {
|
||||
MAVLINK_WPM_STATE_ENUM_END
|
||||
};
|
||||
|
||||
// Mission mode states
|
||||
enum MISSION_MODE {
|
||||
MISSION_MODE_UNKNOWN = 0,
|
||||
MISSION_MODE_ACTIVE = 1,
|
||||
MISSION_MODE_SUSPENDED = 2
|
||||
};
|
||||
|
||||
enum MAVLINK_WPM_CODES {
|
||||
MAVLINK_WPM_CODE_OK = 0,
|
||||
MAVLINK_WPM_CODE_ERR_WAYPOINT_ACTION_NOT_SUPPORTED,
|
||||
@@ -94,9 +102,13 @@ public:
|
||||
private:
|
||||
enum MAVLINK_WPM_STATES _state {MAVLINK_WPM_STATE_IDLE}; ///< Current state
|
||||
enum MAV_MISSION_TYPE _mission_type {MAV_MISSION_TYPE_MISSION}; ///< mission type of current transmission (only one at a time possible)
|
||||
enum MISSION_STATE _mission_state {MISSION_STATE_UNKNOWN}; ///< Current mission state machine state
|
||||
enum MISSION_MODE _mission_mode {MISSION_MODE_UNKNOWN}; ///< Current mission mode
|
||||
|
||||
DatamanClient _dataman_client{};
|
||||
|
||||
void update_mission_state();
|
||||
|
||||
uint64_t _time_last_recv{0};
|
||||
uint64_t _time_last_sent{0};
|
||||
|
||||
@@ -138,6 +150,7 @@ private:
|
||||
|
||||
uORB::Subscription _mission_result_sub{ORB_ID(mission_result)};
|
||||
uORB::SubscriptionData<mission_s> _mission_sub{ORB_ID(mission)};
|
||||
uORB::Subscription _vehicle_status_sub{ORB_ID(vehicle_status)}; ///< vehicle status subscription
|
||||
|
||||
uORB::Publication<mission_s> _offboard_mission_pub{ORB_ID(mission)};
|
||||
|
||||
|
||||
@@ -2548,7 +2548,7 @@ MavlinkReceiver::handle_message_adsb_vehicle(mavlink_message_t *msg)
|
||||
t.lon = adsb.lon * 1e-7;
|
||||
t.altitude_type = adsb.altitude_type;
|
||||
t.altitude = adsb.altitude / 1000.0f;
|
||||
t.heading = adsb.heading / 100.0f / 180.0f * M_PI_F - M_PI_F;
|
||||
t.heading = adsb.heading / 100.0f / 180.0f * M_PI_F;
|
||||
t.hor_velocity = adsb.hor_velocity / 100.0f;
|
||||
t.ver_velocity = adsb.ver_velocity / 100.0f;
|
||||
memcpy(&t.callsign[0], &adsb.callsign[0], sizeof(t.callsign));
|
||||
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
msg.lon = pos.lon * 1e7;
|
||||
msg.altitude_type = pos.altitude_type;
|
||||
msg.altitude = pos.altitude * 1e3f;
|
||||
msg.heading = (pos.heading + M_PI_F) / M_PI_F * 180.0f * 100.0f;
|
||||
msg.heading = pos.heading / M_PI_F * 180.0f * 100.0f;
|
||||
msg.hor_velocity = pos.hor_velocity * 100.0f;
|
||||
msg.ver_velocity = pos.ver_velocity * 100.0f;
|
||||
memcpy(&msg.callsign[0], &pos.callsign[0], sizeof(msg.callsign));
|
||||
|
||||
@@ -168,33 +168,44 @@ PARAM_DEFINE_FLOAT(SENS_DPRES_ANSC, 0);
|
||||
PARAM_DEFINE_INT32(SENS_BOARD_ROT, 0);
|
||||
|
||||
/**
|
||||
* Board rotation Y (Pitch) offset
|
||||
* Board rotation Y (pitch) offset
|
||||
*
|
||||
* This parameter defines a rotational offset in degrees around the Y (Pitch) axis. It allows the user
|
||||
* to fine tune the board offset in the event of misalignment.
|
||||
* Rotation from flight controller board to vehicle body frame.
|
||||
* This parameter gets set during the "level horizon" calibration or can be
|
||||
* set manually.
|
||||
*
|
||||
* @min -45.0
|
||||
* @max 45.0
|
||||
* @decimal 1
|
||||
* @unit deg
|
||||
* @group Sensors
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(SENS_BOARD_Y_OFF, 0.0f);
|
||||
|
||||
/**
|
||||
* Board rotation X (Roll) offset
|
||||
* Board rotation X (roll) offset
|
||||
*
|
||||
* This parameter defines a rotational offset in degrees around the X (Roll) axis It allows the user
|
||||
* to fine tune the board offset in the event of misalignment.
|
||||
* Rotation from flight controller board to vehicle body frame.
|
||||
* This parameter gets set during the "level horizon" calibration or can be
|
||||
* set manually.
|
||||
*
|
||||
* @unit deg
|
||||
* @min -45.0
|
||||
* @max 45.0
|
||||
* @decimal 1
|
||||
* @group Sensors
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(SENS_BOARD_X_OFF, 0.0f);
|
||||
|
||||
/**
|
||||
* Board rotation Z (YAW) offset
|
||||
* Board rotation Z (yaw) offset
|
||||
*
|
||||
* This parameter defines a rotational offset in degrees around the Z (Yaw) axis. It allows the user
|
||||
* to fine tune the board offset in the event of misalignment.
|
||||
* Rotation from flight controller board to vehicle body frame.
|
||||
* Has to be set manually (not set by any calibration).
|
||||
*
|
||||
* @min -45.0
|
||||
* @max 45.0
|
||||
* @decimal 1
|
||||
* @unit deg
|
||||
* @group Sensors
|
||||
*/
|
||||
|
||||
@@ -169,7 +169,7 @@ PARAM_DEFINE_INT32(IMU_GYRO_RATEMAX, 400);
|
||||
* @reboot_required false
|
||||
* @group Sensors
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(IMU_DGYRO_CUTOFF, 30.0f);
|
||||
PARAM_DEFINE_FLOAT(IMU_DGYRO_CUTOFF, 20.0f);
|
||||
|
||||
/**
|
||||
* IMU gyro dynamic notch filtering
|
||||
|
||||
Reference in New Issue
Block a user