mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-24 13:50:36 +08:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62714d6c5d | |||
| 6938d24ec7 | |||
| 2716ce7a56 | |||
| 4454fe9770 | |||
| 19952768fb | |||
| 6fb1c79ef0 | |||
| f1016dc32c | |||
| 17328bef69 | |||
| 258cde668c | |||
| 0e29cb31e6 | |||
| ff3a76d918 | |||
| ea9c64dcd9 | |||
| fd96bbf9b9 | |||
| 4247e1320b | |||
| c0f75b1c79 | |||
| 757424c2c0 | |||
| 8a2b310b83 | |||
| a0e72b35a4 | |||
| 4c73ac3805 | |||
| 9aaf6e3f3e | |||
| f4a85fa951 | |||
| 6daa579e46 | |||
| 21163d859e |
+18
-76
@@ -21,7 +21,7 @@ pipeline {
|
||||
sh 'make cubepilot_cubeorange_test'
|
||||
sh 'make cubepilot_cubeorange_test bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'cubepilot_cubeorange_test'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'cubepilot_cubeorange_test'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -70,6 +70,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/cubepilot_cubeorange_test/cubepilot_cubeorange_test.elf || true'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
@@ -91,7 +92,7 @@ pipeline {
|
||||
sh 'make cuav_x7pro_test'
|
||||
sh 'make cuav_x7pro_test bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'cuav_x7pro_test'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'cuav_x7pro_test'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -138,6 +139,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/cuav_x7pro_test/cuav_x7pro_test.elf || true'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
@@ -159,7 +161,7 @@ pipeline {
|
||||
sh 'make px4_fmu-v3_test'
|
||||
sh 'make px4_fmu-v3_test bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v3_test'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v3_test'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -206,6 +208,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v3_test/px4_fmu-v3_test.elf || true'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
@@ -227,7 +230,7 @@ pipeline {
|
||||
sh 'make px4_fmu-v4_test'
|
||||
sh 'make px4_fmu-v4_test bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v4_test'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v4_test'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -273,6 +276,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v4_test/px4_fmu-v4_test.elf || true'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
@@ -294,7 +298,7 @@ pipeline {
|
||||
sh 'make px4_fmu-v4pro_test'
|
||||
sh 'make px4_fmu-v4pro_test bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v4pro_test'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v4pro_test'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -341,6 +345,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v4pro_test/px4_fmu-v4pro_test.elf || true'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
@@ -362,7 +367,7 @@ pipeline {
|
||||
sh 'make px4_fmu-v5_debug'
|
||||
sh 'make px4_fmu-v5_debug bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v5_debug'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v5_debug'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -420,6 +425,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v5_debug/px4_fmu-v5_debug.elf || true'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
@@ -441,7 +447,7 @@ pipeline {
|
||||
sh 'make px4_fmu-v5_stackcheck'
|
||||
sh 'make px4_fmu-v5_stackcheck bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v5_stackcheck'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v5_stackcheck'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -498,6 +504,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v5_stackcheck/px4_fmu-v5_stackcheck.elf || true'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
@@ -519,7 +526,7 @@ pipeline {
|
||||
sh 'make px4_fmu-v5_test'
|
||||
sh 'make px4_fmu-v5_test bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v5_test'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v5_test'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -566,6 +573,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v5_test/px4_fmu-v5_test.elf || true'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
@@ -573,73 +581,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
// stage("modalai_fc-v1_test") {
|
||||
// stages {
|
||||
// stage("build modalai_fc-v1_test") {
|
||||
// agent {
|
||||
// docker {
|
||||
// image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
// args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
// }
|
||||
// }
|
||||
// steps {
|
||||
// checkout scm
|
||||
// sh 'export'
|
||||
// sh 'make distclean'
|
||||
// sh 'ccache -s'
|
||||
// sh 'git fetch --tags'
|
||||
// sh 'make modalai_fc-v1_test'
|
||||
// sh 'make modalai_fc-v1_test bootloader_elf'
|
||||
// sh 'ccache -s'
|
||||
// stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'modalai_fc-v1_test'
|
||||
// }
|
||||
// post {
|
||||
// always {
|
||||
// sh 'make distclean'
|
||||
// }
|
||||
// }
|
||||
// } // stage build
|
||||
// stage("hardware") {
|
||||
// agent {
|
||||
// label 'modalai_fc-v1'
|
||||
// }
|
||||
// stages {
|
||||
// stage("flash") {
|
||||
// steps {
|
||||
// sh 'export'
|
||||
// sh 'find /dev/serial'
|
||||
// unstash 'modalai_fc-v1_test'
|
||||
// sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/modalai_fc-v1_test/modalai_fc-v1_bootloader.elf'
|
||||
// // flash board and watch bootup
|
||||
// sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/modalai_fc-v1_test/modalai_fc-v1_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
|
||||
// }
|
||||
// }
|
||||
// stage("tests") {
|
||||
// steps {
|
||||
// runTests()
|
||||
// }
|
||||
// }
|
||||
// stage("status") {
|
||||
// steps {
|
||||
// // configure
|
||||
// resetParameters()
|
||||
// sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "4001"' // generic quadcopter
|
||||
// sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
|
||||
// checkStatus()
|
||||
// quickCalibrate()
|
||||
// }
|
||||
// }
|
||||
// stage("print topics") {
|
||||
// steps {
|
||||
// printTopics()
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// } // stage test
|
||||
// }
|
||||
// }
|
||||
|
||||
stage("nxp_fmuk66-v3_test") {
|
||||
stages {
|
||||
stage("build nxp_fmuk66-v3_test") {
|
||||
@@ -654,7 +595,7 @@ pipeline {
|
||||
sh 'make nxp_fmuk66-v3_test'
|
||||
//sh 'make nxp_fmuk66-v3_test bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'nxp_fmuk66-v3_test'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'nxp_fmuk66-v3_test'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
@@ -701,6 +642,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/nxp_fmuk66-v3_test/nxp_fmuk66-v3_test.elf || true'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -74,6 +74,7 @@ Checks: '*,
|
||||
-modernize-deprecated-headers,
|
||||
-modernize-loop-convert,
|
||||
-modernize-pass-by-value,
|
||||
-modernize-raw-string-literal,
|
||||
-modernize-return-braced-init-list,
|
||||
-modernize-use-auto,
|
||||
-modernize-use-bool-literals,
|
||||
@@ -81,8 +82,8 @@ Checks: '*,
|
||||
-modernize-use-equals-default,
|
||||
-modernize-use-equals-delete,
|
||||
-modernize-use-override,
|
||||
-modernize-use-using,
|
||||
-modernize-use-trailing-return-type,
|
||||
-modernize-use-using,
|
||||
-performance-inefficient-string-concatenation,
|
||||
-readability-avoid-const-params-in-decls,
|
||||
-readability-container-size-empty,
|
||||
|
||||
Vendored
+5
@@ -106,6 +106,11 @@ CONFIG:
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: ark_can-rtk-gps_default
|
||||
ark_can-rtk-gps_debug:
|
||||
short: ark_can-rtk-gps_debug
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: ark_can-rtk-gps_debug
|
||||
ark_can-rtk-gps_canbootloader:
|
||||
short: ark_can-rtk-gps_canbootloader
|
||||
buildType: MinSizeRel
|
||||
|
||||
@@ -7,4 +7,3 @@
|
||||
|
||||
param set-default FW_THR_CRUISE 0.0
|
||||
param set-default RWTO_TKOFF 0
|
||||
|
||||
|
||||
@@ -56,4 +56,3 @@ 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
|
||||
|
||||
|
||||
@@ -77,4 +77,3 @@ param set-default IMU_DGYRO_CUTOFF 100
|
||||
|
||||
# enable to use high-rate logging for better rate tracking analysis
|
||||
param set-default SDLOG_PROFILE 27
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# External airframe startup script (on SD card)
|
||||
#
|
||||
set SDCARD_MIXERS_PATH ${SDCARD_EXT_PATH}/mixers
|
||||
|
||||
if [ -e ${SDCARD_EXT_PATH}/rc.autostart ]
|
||||
then
|
||||
. ${SDCARD_EXT_PATH}/rc.autostart
|
||||
else
|
||||
echo "Error: ${SDCARD_EXT_PATH}/rc.autostart does not exist"
|
||||
fi
|
||||
@@ -15,7 +15,7 @@ param set-default RTL_RETURN_ALT 30
|
||||
param set-default RTL_DESCEND_ALT 10
|
||||
|
||||
param set-default PWM_MAIN_MAX 1950
|
||||
param set-default PWM_MAIN_MIN 1075
|
||||
param set-default PWM_MAIN_MIN1 1075
|
||||
param set-default PWM_MAIN_RATE 400
|
||||
|
||||
param set-default GPS_UBX_DYNMODEL 6
|
||||
|
||||
@@ -44,6 +44,8 @@ set PWM_EXTRA_OUT none
|
||||
set PWM_EXTRA_RATE p:PWM_EXTRA_RATE
|
||||
set EXTRA_MIXER_MODE none
|
||||
set RC_INPUT_ARGS ""
|
||||
set SDCARD_AVAILABLE no
|
||||
set SDCARD_EXT_PATH /fs/microsd/ext_autostart
|
||||
set SDCARD_MIXERS_PATH /fs/microsd/etc/mixers
|
||||
set STARTUP_TUNE 1
|
||||
set USE_IO no
|
||||
@@ -57,7 +59,6 @@ ver all
|
||||
#
|
||||
# Try to mount the microSD card.
|
||||
#
|
||||
set SDCARD_AVAILABLE no
|
||||
# REBOOTWORK this needs to start after the flight control loop.
|
||||
if mount -t vfat /dev/mmcsd0 /fs/microsd
|
||||
then
|
||||
@@ -104,7 +105,6 @@ then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
unset SDCARD_AVAILABLE
|
||||
|
||||
#
|
||||
# Look for an init script on the microSD card.
|
||||
@@ -206,10 +206,22 @@ else
|
||||
#
|
||||
# Set parameters and env variables for selected AUTOSTART.
|
||||
#
|
||||
set AUTOSTART_PATH etc/init.d/rc.autostart
|
||||
if ! param compare SYS_AUTOSTART 0
|
||||
then
|
||||
. ${R}etc/init.d/rc.autostart
|
||||
if param greater SYS_AUTOSTART 1000000
|
||||
then
|
||||
# Use external startup file
|
||||
if [ $SDCARD_AVAILABLE = yes ]
|
||||
then
|
||||
set AUTOSTART_PATH etc/init.d/rc.autostart_ext
|
||||
else
|
||||
echo "ERROR [init] SD card not mounted - trying to load airframe from ROMFS"
|
||||
fi
|
||||
fi
|
||||
. ${R}$AUTOSTART_PATH
|
||||
fi
|
||||
unset AUTOSTART_PATH
|
||||
|
||||
#
|
||||
# Override parameters from user configuration file.
|
||||
@@ -540,6 +552,8 @@ unset PWM_OUT
|
||||
unset PWM_EXTRA_OUT
|
||||
unset PWM_EXTRA_RATE
|
||||
unset RC_INPUT_ARGS
|
||||
unset SDCARD_AVAILABLE
|
||||
unset SDCARD_EXT_PATH
|
||||
unset SDCARD_MIXERS_PATH
|
||||
unset STARTUP_TUNE
|
||||
unset USE_IO
|
||||
|
||||
@@ -8,18 +8,16 @@ if [ -f "$FILE" ]; then
|
||||
if [ -n "$CHECK_FAILED" ]; then
|
||||
${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
|
||||
|
||||
echo -e 'Formatting issue found in' $FILE
|
||||
echo
|
||||
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty
|
||||
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty | grep -vE -e "^.{,4}diff.*\.pretty.{,3}$" -e "^.{,4}--- a/.*$" -e "^.{,4}\+\+\+ b/.*$" -e "^.{,5}@@ .* @@.*$" -e "^.{,4}index .{10}\.\."
|
||||
rm -f $FILE.pretty
|
||||
echo
|
||||
|
||||
if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then
|
||||
${DIR}/fix_code_style.sh $FILE
|
||||
else
|
||||
# Make sure this file is not staged for comitting
|
||||
git reset $FILE
|
||||
# Provide instructions
|
||||
echo $FILE 'bad formatting, please run "make format" or "./Tools/astyle/fix_code_style.sh' $FILE'"'
|
||||
echo 'to fix automatically run "make format" or "./Tools/astyle/fix_code_style.sh' $FILE'"'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
PATTERN="-e ."
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
PATTERN="$1"
|
||||
fi
|
||||
|
||||
exec find boards msg src platforms test \
|
||||
-path msg/templates/urtps -prune -o \
|
||||
-path platforms/nuttx/NuttX -prune -o \
|
||||
@@ -27,4 +21,4 @@ exec find boards msg src platforms test \
|
||||
-path src/lib/crypto/monocypher -prune -o \
|
||||
-path src/lib/crypto/libtomcrypt -prune -o \
|
||||
-path src/lib/crypto/libtommath -prune -o \
|
||||
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
|
||||
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \)
|
||||
|
||||
@@ -54,12 +54,9 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
|
||||
# Check for code style, only in changed files
|
||||
for i in `git diff --cached --name-only --diff-filter=ACM`
|
||||
do
|
||||
./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh %
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Pre-commit style error: Bad formatting according to astyle rules"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
bash -c "comm -12 <(./Tools/astyle/files_to_check_code_style.sh | sort) <(git diff --cached --name-only --diff-filter=ACM) | xargs -P 8 -I % ./Tools/astyle/check_code_style.sh %"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Pre-commit style error: Bad formatting according to astyle rules"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -17,4 +17,3 @@ def save_compressed(filename):
|
||||
f.write(content_file.read())
|
||||
|
||||
save_compressed(filename)
|
||||
|
||||
|
||||
@@ -342,4 +342,3 @@ for yaml_file in args.config_files:
|
||||
if verbose: print("Generating {:}".format(params_output_file))
|
||||
with open(params_output_file, 'w') as fid:
|
||||
fid.write(all_params)
|
||||
|
||||
|
||||
@@ -199,4 +199,3 @@ if __name__ == '__main__':
|
||||
output_groups, timer_params = get_output_groups(timer_groups, verbose=verbose)
|
||||
print('output groups: {:}'.format(output_groups))
|
||||
print('timer params: {:}'.format(timer_params))
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ div.frame_common table, div.frame_common table {
|
||||
}
|
||||
|
||||
div.frame_common table {
|
||||
float: right;
|
||||
float: right;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,4 +55,3 @@ class JsonOutput():
|
||||
if need_to_write:
|
||||
with codecs.open(filename, 'w', 'utf-8') as f:
|
||||
f.write(json.dumps(self.json,indent=2))
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//Public key to verify signed binaries
|
||||
0x4d, 0xb0, 0xc2, 0x1, 0x5, 0x55, 0x2a, 0x3c,
|
||||
0xd7, 0xfb, 0xaf, 0x5c, 0xba, 0x7a, 0xb0, 0x81,
|
||||
0x1b, 0x36, 0x63, 0xdb, 0x28, 0x52, 0x5e, 0xdb,
|
||||
0x14, 0x36, 0xf2, 0x57, 0x8d, 0x2, 0xb7, 0xfd,
|
||||
0x4d, 0xb0, 0xc2, 0x1, 0x5, 0x55, 0x2a, 0x3c,
|
||||
0xd7, 0xfb, 0xaf, 0x5c, 0xba, 0x7a, 0xb0, 0x81,
|
||||
0x1b, 0x36, 0x63, 0xdb, 0x28, 0x52, 0x5e, 0xdb,
|
||||
0x14, 0x36, 0xf2, 0x57, 0x8d, 0x2, 0xb7, 0xfd,
|
||||
|
||||
+37
-37
@@ -1,38 +1,38 @@
|
||||
|
||||
0x30, 0x82, 0x1, 0x22, 0x30, 0xd, 0x6, 0x9,
|
||||
0x2a, 0x86, 0x48, 0x86, 0xf7, 0xd, 0x1, 0x1,
|
||||
0x1, 0x5, 0x0, 0x3, 0x82, 0x1, 0xf, 0x0,
|
||||
0x30, 0x82, 0x1, 0xa, 0x2, 0x82, 0x1, 0x1,
|
||||
0x0, 0xcf, 0xa3, 0xb8, 0xec, 0x4f, 0xac, 0x37,
|
||||
0xe6, 0x1b, 0xfa, 0x1e, 0xb3, 0x92, 0xe9, 0x1a,
|
||||
0x83, 0x36, 0x2d, 0x27, 0xa6, 0x4a, 0xab, 0x7e,
|
||||
0x38, 0x6f, 0x93, 0x7a, 0x1f, 0x60, 0x83, 0x83,
|
||||
0xac, 0xfd, 0x2e, 0x61, 0xbf, 0x19, 0x10, 0x1f,
|
||||
0x39, 0xe3, 0x6c, 0xb6, 0xcc, 0xf5, 0x85, 0x7c,
|
||||
0xb2, 0x38, 0x27, 0x14, 0x43, 0xd7, 0xfe, 0xbc,
|
||||
0xa1, 0xe8, 0x7d, 0x33, 0x74, 0x93, 0xe7, 0xd6,
|
||||
0x2b, 0x2f, 0x79, 0x87, 0x59, 0xb0, 0x63, 0x95,
|
||||
0x5c, 0xe7, 0x4f, 0x60, 0x46, 0xc9, 0xa9, 0xf,
|
||||
0xde, 0xa9, 0x36, 0x9e, 0x3e, 0x34, 0xba, 0x77,
|
||||
0x18, 0x50, 0xe3, 0x6b, 0x3, 0x93, 0xaa, 0xc7,
|
||||
0xf2, 0x2d, 0xe, 0xf3, 0x2b, 0x5, 0x34, 0x60,
|
||||
0xa4, 0xf7, 0xa9, 0xe2, 0x37, 0xa3, 0x6d, 0x27,
|
||||
0xd8, 0xa3, 0x71, 0x9c, 0x6b, 0xb2, 0x5e, 0xdd,
|
||||
0x12, 0x2b, 0x73, 0xe1, 0xdb, 0x9d, 0xf4, 0xc3,
|
||||
0xc, 0xd6, 0x5, 0x1d, 0xac, 0xa4, 0xdc, 0x69,
|
||||
0x2a, 0xf5, 0x7c, 0x30, 0x24, 0x7b, 0x2b, 0x80,
|
||||
0x1b, 0x7a, 0xec, 0x68, 0x77, 0x12, 0x97, 0x2a,
|
||||
0xb2, 0xe5, 0xd2, 0xff, 0x41, 0x1d, 0xf5, 0x6,
|
||||
0xa4, 0xb6, 0x47, 0xa5, 0xfa, 0x5, 0x7e, 0xf0,
|
||||
0xa1, 0xb8, 0xad, 0xde, 0x5c, 0xae, 0x2c, 0x8b,
|
||||
0x4e, 0xad, 0xaf, 0xac, 0x6d, 0x46, 0x62, 0xe1,
|
||||
0xe9, 0xfe, 0xa1, 0xc5, 0xc9, 0xf4, 0x48, 0xd2,
|
||||
0x80, 0x2b, 0xe5, 0xa9, 0x3e, 0xc1, 0xfc, 0x98,
|
||||
0xde, 0x3, 0xa9, 0xac, 0x86, 0xb7, 0xb5, 0x19,
|
||||
0xe5, 0x75, 0x6a, 0x63, 0x83, 0x3f, 0x27, 0x7a,
|
||||
0x5e, 0xf8, 0xf1, 0x6d, 0xb2, 0xd2, 0x36, 0xa1,
|
||||
0xc0, 0xd2, 0x5f, 0x93, 0x9c, 0x90, 0xe8, 0x3e,
|
||||
0xca, 0x89, 0xd7, 0xca, 0xd0, 0xc7, 0xe8, 0x8f,
|
||||
0x4b, 0xb7, 0x60, 0x92, 0x5e, 0x36, 0x43, 0x70,
|
||||
0x23, 0x36, 0xfb, 0xb5, 0xa5, 0x6, 0x9a, 0xc0,
|
||||
0xcb, 0x2, 0x3, 0x1, 0x0, 0x1,
|
||||
0x30, 0x82, 0x1, 0x22, 0x30, 0xd, 0x6, 0x9,
|
||||
0x2a, 0x86, 0x48, 0x86, 0xf7, 0xd, 0x1, 0x1,
|
||||
0x1, 0x5, 0x0, 0x3, 0x82, 0x1, 0xf, 0x0,
|
||||
0x30, 0x82, 0x1, 0xa, 0x2, 0x82, 0x1, 0x1,
|
||||
0x0, 0xcf, 0xa3, 0xb8, 0xec, 0x4f, 0xac, 0x37,
|
||||
0xe6, 0x1b, 0xfa, 0x1e, 0xb3, 0x92, 0xe9, 0x1a,
|
||||
0x83, 0x36, 0x2d, 0x27, 0xa6, 0x4a, 0xab, 0x7e,
|
||||
0x38, 0x6f, 0x93, 0x7a, 0x1f, 0x60, 0x83, 0x83,
|
||||
0xac, 0xfd, 0x2e, 0x61, 0xbf, 0x19, 0x10, 0x1f,
|
||||
0x39, 0xe3, 0x6c, 0xb6, 0xcc, 0xf5, 0x85, 0x7c,
|
||||
0xb2, 0x38, 0x27, 0x14, 0x43, 0xd7, 0xfe, 0xbc,
|
||||
0xa1, 0xe8, 0x7d, 0x33, 0x74, 0x93, 0xe7, 0xd6,
|
||||
0x2b, 0x2f, 0x79, 0x87, 0x59, 0xb0, 0x63, 0x95,
|
||||
0x5c, 0xe7, 0x4f, 0x60, 0x46, 0xc9, 0xa9, 0xf,
|
||||
0xde, 0xa9, 0x36, 0x9e, 0x3e, 0x34, 0xba, 0x77,
|
||||
0x18, 0x50, 0xe3, 0x6b, 0x3, 0x93, 0xaa, 0xc7,
|
||||
0xf2, 0x2d, 0xe, 0xf3, 0x2b, 0x5, 0x34, 0x60,
|
||||
0xa4, 0xf7, 0xa9, 0xe2, 0x37, 0xa3, 0x6d, 0x27,
|
||||
0xd8, 0xa3, 0x71, 0x9c, 0x6b, 0xb2, 0x5e, 0xdd,
|
||||
0x12, 0x2b, 0x73, 0xe1, 0xdb, 0x9d, 0xf4, 0xc3,
|
||||
0xc, 0xd6, 0x5, 0x1d, 0xac, 0xa4, 0xdc, 0x69,
|
||||
0x2a, 0xf5, 0x7c, 0x30, 0x24, 0x7b, 0x2b, 0x80,
|
||||
0x1b, 0x7a, 0xec, 0x68, 0x77, 0x12, 0x97, 0x2a,
|
||||
0xb2, 0xe5, 0xd2, 0xff, 0x41, 0x1d, 0xf5, 0x6,
|
||||
0xa4, 0xb6, 0x47, 0xa5, 0xfa, 0x5, 0x7e, 0xf0,
|
||||
0xa1, 0xb8, 0xad, 0xde, 0x5c, 0xae, 0x2c, 0x8b,
|
||||
0x4e, 0xad, 0xaf, 0xac, 0x6d, 0x46, 0x62, 0xe1,
|
||||
0xe9, 0xfe, 0xa1, 0xc5, 0xc9, 0xf4, 0x48, 0xd2,
|
||||
0x80, 0x2b, 0xe5, 0xa9, 0x3e, 0xc1, 0xfc, 0x98,
|
||||
0xde, 0x3, 0xa9, 0xac, 0x86, 0xb7, 0xb5, 0x19,
|
||||
0xe5, 0x75, 0x6a, 0x63, 0x83, 0x3f, 0x27, 0x7a,
|
||||
0x5e, 0xf8, 0xf1, 0x6d, 0xb2, 0xd2, 0x36, 0xa1,
|
||||
0xc0, 0xd2, 0x5f, 0x93, 0x9c, 0x90, 0xe8, 0x3e,
|
||||
0xca, 0x89, 0xd7, 0xca, 0xd0, 0xc7, 0xe8, 0x8f,
|
||||
0x4b, 0xb7, 0x60, 0x92, 0x5e, 0x36, 0x43, 0x70,
|
||||
0x23, 0x36, 0xfb, 0xb5, 0xa5, 0x6, 0x9a, 0xc0,
|
||||
0xcb, 0x2, 0x3, 0x1, 0x0, 0x1,
|
||||
|
||||
@@ -13,3 +13,4 @@ CONFIG_DRIVERS_UAVCANNODE=y
|
||||
CONFIG_SYSTEMCMDS_PARAM=y
|
||||
CONFIG_SYSTEMCMDS_PERF=y
|
||||
CONFIG_SYSTEMCMDS_TOP=y
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
|
||||
|
||||
@@ -15,3 +15,4 @@ CONFIG_DRIVERS_TONE_ALARM=y
|
||||
CONFIG_BOARD_UAVCAN_INTERFACES=1
|
||||
CONFIG_DRIVERS_UAVCANNODE=y
|
||||
CONFIG_SYSTEMCMDS_PARAM=y
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
CONFIG_BOARD_CONSTRAINED_FLASH=n
|
||||
CONFIG_BOARD_NO_HELP=n
|
||||
CONFIG_BOARD_CONSTRAINED_MEMORY=y
|
||||
CONFIG_SYSTEMCMDS_TOP=y
|
||||
CONFIG_SYSTEMCMDS_REBOOT=y
|
||||
CONFIG_SYSTEMCMDS_UORB=y
|
||||
@@ -15,3 +15,4 @@ CONFIG_DRIVERS_TONE_ALARM=y
|
||||
CONFIG_BOARD_UAVCAN_INTERFACES=1
|
||||
CONFIG_DRIVERS_UAVCANNODE=y
|
||||
CONFIG_SYSTEMCMDS_PARAM=y
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
|
||||
|
||||
@@ -39,5 +39,8 @@
|
||||
|
||||
// DMA2 Channel/Stream Selections
|
||||
//--------------------------------------------//---------------------------//----------------
|
||||
#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3
|
||||
#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 5, Channel 3
|
||||
#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3
|
||||
#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3
|
||||
#define DMACHAN_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4
|
||||
#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1
|
||||
//#define DMACHAN_USART1_TX DMAMAP_USART1_TX // DMA2, Stream 7, Channel 4
|
||||
|
||||
@@ -150,8 +150,9 @@ CONFIG_STM32_WWDG=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TASK_NAME_SIZE=24
|
||||
CONFIG_USART1_BAUD=57600
|
||||
CONFIG_USART1_RXBUFSIZE=600
|
||||
CONFIG_USART1_TXBUFSIZE=1100
|
||||
CONFIG_USART1_RXBUFSIZE=2000
|
||||
CONFIG_USART1_RXDMA=y
|
||||
CONFIG_USART1_TXBUFSIZE=2000
|
||||
CONFIG_USART2_BAUD=57600
|
||||
CONFIG_USART2_RXBUFSIZE=600
|
||||
CONFIG_USART2_SERIAL_CONSOLE=y
|
||||
|
||||
@@ -139,6 +139,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
px4_platform_init();
|
||||
|
||||
#if defined(SERIAL_HAVE_RXDMA)
|
||||
// set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event.
|
||||
static struct hrt_call serial_dma_call;
|
||||
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||
#endif
|
||||
|
||||
#if defined(FLASH_BASED_PARAMS)
|
||||
static sector_descriptor_t params_sector_map[] = {
|
||||
{2, 16 * 1024, 0x08008000},
|
||||
|
||||
@@ -13,3 +13,4 @@ CONFIG_DRIVERS_TONE_ALARM=y
|
||||
CONFIG_BOARD_UAVCAN_INTERFACES=1
|
||||
CONFIG_DRIVERS_UAVCANNODE=y
|
||||
CONFIG_SYSTEMCMDS_PARAM=y
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
CONFIG_COMMON_OPTICAL_FLOW=n
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_DRIVERS_OSD=n
|
||||
CONFIG_DRIVERS_PCA9685=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
CONFIG_DRIVERS_ROBOCLAW=n
|
||||
CONFIG_DRIVERS_RPM=n
|
||||
CONFIG_DRIVERS_SMART_BATTERY_BATMON=n
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
|
||||
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
|
||||
CONFIG_MODULES_ROVER_POS_CONTROL=n
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_DRIVERS_PCA9685=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
CONFIG_DRIVERS_ROBOCLAW=n
|
||||
CONFIG_DRIVERS_SMART_BATTERY_BATMON=n
|
||||
CONFIG_DRIVERS_RPM=n
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
|
||||
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
|
||||
CONFIG_MODULES_ROVER_POS_CONTROL=n
|
||||
CONFIG_MODULES_SIH=n
|
||||
CONFIG_MODULES_TEMPERATURE_COMPENSATION=n
|
||||
CONFIG_SYSTEMCMDS_MOTOR_RAMP=n
|
||||
CONFIG_SYSTEMCMDS_REFLECT=n
|
||||
CONFIG_SYSTEMCMDS_SYSTEM_TIME=n
|
||||
CONFIG_BOARD_TESTING=y
|
||||
CONFIG_DRIVERS_TEST_PPM=y
|
||||
CONFIG_DRIVERS_UAVCAN=n
|
||||
CONFIG_SYSTEMCMDS_MICROBENCH=y
|
||||
|
||||
@@ -14,3 +14,4 @@ CONFIG_BOARD_UAVCAN_INTERFACES=1
|
||||
CONFIG_DRIVERS_UAVCANNODE=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
CONFIG_SYSTEMCMDS_PARAM=y
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
|
||||
|
||||
@@ -2,4 +2,3 @@
|
||||
#
|
||||
# ModalAI FC-v2 specific board defaults
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_DRIVERS_PCA9685=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
CONFIG_DRIVERS_RPM=n
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
|
||||
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
|
||||
CONFIG_BOARD_TESTING=y
|
||||
CONFIG_EXAMPLES_FAKE_IMU=y
|
||||
CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y
|
||||
CONFIG_EXAMPLES_FIXEDWING_CONTROL=y
|
||||
CONFIG_EXAMPLES_HELLO=y
|
||||
CONFIG_EXAMPLES_HWTEST=y
|
||||
CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y
|
||||
CONFIG_EXAMPLES_PX4_SIMPLE_APP=y
|
||||
CONFIG_EXAMPLES_ROVER_STEERING_CONTROL=y
|
||||
CONFIG_EXAMPLES_UUV_EXAMPLE_APP=y
|
||||
CONFIG_EXAMPLES_WORK_ITEM=y
|
||||
CONFIG_SYSTEMCMDS_MICROBENCH=y
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
|
||||
CONFIG_BOARD_ARCHITECTURE="cortex-m7"
|
||||
CONFIG_BOARD_LINKER_PREFIX="ocram"
|
||||
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1"
|
||||
CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS4"
|
||||
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2"
|
||||
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3"
|
||||
CONFIG_BOARD_CONSTRAINED_FLASH=y
|
||||
CONFIG_DRIVERS_ADC_BOARD_ADC=y
|
||||
CONFIG_DRIVERS_BAROMETER_MS5611=y
|
||||
CONFIG_DRIVERS_BATT_SMBUS=y
|
||||
CONFIG_DRIVERS_CAMERA_CAPTURE=y
|
||||
CONFIG_DRIVERS_CAMERA_TRIGGER=y
|
||||
CONFIG_COMMON_DISTANCE_SENSOR=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_LASER_I2C=y
|
||||
CONFIG_DRIVERS_IMU_BOSCH_BMI055=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y
|
||||
CONFIG_COMMON_LIGHT=y
|
||||
CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y
|
||||
CONFIG_COMMON_MAGNETOMETER=y
|
||||
CONFIG_DRIVERS_PWM_OUT=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
|
||||
CONFIG_DRIVERS_PWM_OUT_SIM=y
|
||||
CONFIG_DRIVERS_RC_INPUT=y
|
||||
CONFIG_DRIVERS_SAFETY_BUTTON=y
|
||||
@@ -31,6 +28,8 @@ CONFIG_MODULES_DATAMAN=y
|
||||
CONFIG_MODULES_EKF2=y
|
||||
CONFIG_MODULES_EVENTS=y
|
||||
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -101,6 +101,7 @@ SECTIONS
|
||||
} > flash
|
||||
|
||||
/* Catch all the section we want not in OCRAM so that the *(.text .text.*) in flash does not */
|
||||
/* Sift and sort with arm-none-eabi-nm -C -S -n build/nxp_fmurt1062-v1_default/nxp_fmurt1062-v1_default.elf > list.txt */
|
||||
|
||||
.flashxip : ALIGN(4)
|
||||
{
|
||||
@@ -108,8 +109,82 @@ SECTIONS
|
||||
/* Order matters */
|
||||
*(.text.__start)
|
||||
*(.text.imxrt_ocram_initialize)
|
||||
|
||||
*(.slow_memory)
|
||||
*(.text.romfs*)
|
||||
*(.text.cromfs*)
|
||||
*(.text.mpu*)
|
||||
*(.text.arm_memfault*)
|
||||
*(.text.arm_hardfault*)
|
||||
*(.text.up_assert*)
|
||||
*(.text.up_stackdump*)
|
||||
*(.text.up_taskdump*)
|
||||
*(.text.up_mdelay*)
|
||||
*(.text.up_udelay*)
|
||||
*(.text.board_on_reset*)
|
||||
*(.text.board_spi_reset*)
|
||||
*(.text.board_query_manifest*)
|
||||
*(.text.board_reset*)
|
||||
*(.text.board_get*)
|
||||
*(.text.board_mcu*)
|
||||
*(.text.imxrt_xbar_connect*)
|
||||
*(.text.bson*)
|
||||
*(.text.*print_load*)
|
||||
*(.text.*px4_mft*)
|
||||
*(.text.*px4_mtd*)
|
||||
*(.text.syslog*)
|
||||
*(.text.register_driver*)
|
||||
*(.text.nx_start*)
|
||||
*(.text.nx_bringup*)
|
||||
*(.text.irq_unexpected_isr*)
|
||||
*(.text.group*)
|
||||
*(.text.*setenv*)
|
||||
*(.text.*env*)
|
||||
*(.text.cmd*)
|
||||
*(.text.readline*)
|
||||
*(.text.mkfatfs*)
|
||||
*(.text.builtin*)
|
||||
*(.text.basename*)
|
||||
*(.text.dirname*)
|
||||
*(.text.gmtime_r*)
|
||||
*(.text.chdir*)
|
||||
*(.text.devnull*)
|
||||
*(.text.ramdisk*)
|
||||
*(.text.files*)
|
||||
*(.text.unregister_driver*)
|
||||
*(.text.register_blockdriver*)
|
||||
*(.text.bchdev_register*)
|
||||
*(.text.part*)
|
||||
*(.text.ftl*)
|
||||
*(.text.*I2CBusIterator*)
|
||||
*(.text.*SPIBusIterator*)
|
||||
*(.text.*BusCLIArguments*)
|
||||
*(.text.*WorkQueueManager*)
|
||||
*(.text.*param_export*)
|
||||
*(.text.*param_import*)
|
||||
*(.text.*param_load*)
|
||||
*(.text.*BusInstanceIterator*)
|
||||
*(.text.*PRINT_MODULE_USAGE*)
|
||||
*(.text.*px4_getopt*)
|
||||
*(.text.*main*)
|
||||
*(.text.*instantiate*)
|
||||
*(.text.*ADC*)
|
||||
*(.text.*MS5611*)
|
||||
*(.text.*I2CSPIDriver*)
|
||||
*(.text.*CameraCapture*)
|
||||
*(.text.*i2cdetect*)
|
||||
*(.text.*usage*)
|
||||
/* *(.text.*Bosch*) 2% CPU .5% RAM */
|
||||
*(.text.*Tunes*)
|
||||
*(.text.*printStatistics*)
|
||||
*(.text.*init*)
|
||||
*(.text.*test*)
|
||||
*(.text.*task_spawn*)
|
||||
*(.text.*custom_command*)
|
||||
*(.text.*print_usage*)
|
||||
*(.text.*print_status*)
|
||||
*(.text.*status*)
|
||||
*(.text.*CameraInterface*)
|
||||
*(.text.*CameraTrigger*)
|
||||
*(.text.*ModuleBase*)
|
||||
*(.text.*print_message*)
|
||||
*(.text._ZN4Ekf2C2Eb)
|
||||
@@ -127,6 +202,8 @@ SECTIONS
|
||||
*(.text.*configure_streams_to_default*)
|
||||
*(.text.*_main)
|
||||
*(.text.*GPSDriverAshtech*)
|
||||
*(.text.*GPSDriver*)
|
||||
*(.text.*Mavlink*)
|
||||
*(.rodata .rodata.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
|
||||
@@ -115,4 +115,5 @@ CONFIG_SYSTEM_I2CTOOL=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_SYSTEM_SPITOOL=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_USERMAIN_STACKSIZE=2176
|
||||
CONFIG_WATCHDOG=y
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
CONFIG_BOARD_TESTING=y
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_TEST_PPM=y
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_DRIVERS_PCA9685=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
CONFIG_EXAMPLES_FAKE_IMU=y
|
||||
CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y
|
||||
CONFIG_EXAMPLES_FIXEDWING_CONTROL=y
|
||||
CONFIG_EXAMPLES_HELLO=y
|
||||
CONFIG_EXAMPLES_HWTEST=y
|
||||
CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y
|
||||
CONFIG_EXAMPLES_PX4_SIMPLE_APP=y
|
||||
CONFIG_EXAMPLES_ROVER_STEERING_CONTROL=y
|
||||
CONFIG_EXAMPLES_UUV_EXAMPLE_APP=y
|
||||
CONFIG_EXAMPLES_WORK_ITEM=y
|
||||
CONFIG_DRIVERS_RPM=n
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
|
||||
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
|
||||
CONFIG_BOARD_TESTING=y
|
||||
CONFIG_DRIVERS_TEST_PPM=y
|
||||
CONFIG_SYSTEMCMDS_MICROBENCH=y
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_DRIVERS_PCA9685=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
CONFIG_DRIVERS_RPM=n
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
|
||||
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
|
||||
CONFIG_BOARD_TESTING=y
|
||||
CONFIG_DRIVERS_TEST_PPM=y
|
||||
CONFIG_EXAMPLES_FAKE_IMU=y
|
||||
CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y
|
||||
CONFIG_EXAMPLES_FIXEDWING_CONTROL=y
|
||||
CONFIG_EXAMPLES_HELLO=y
|
||||
CONFIG_EXAMPLES_HWTEST=y
|
||||
CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y
|
||||
CONFIG_EXAMPLES_PX4_SIMPLE_APP=y
|
||||
CONFIG_EXAMPLES_ROVER_STEERING_CONTROL=y
|
||||
CONFIG_EXAMPLES_UUV_EXAMPLE_APP=y
|
||||
CONFIG_EXAMPLES_WORK_ITEM=y
|
||||
CONFIG_SYSTEMCMDS_MICROBENCH=y
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
|
||||
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
|
||||
CONFIG_BOARD_TESTING=y
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_TEST_PPM=y
|
||||
CONFIG_EXAMPLES_FAKE_IMU=y
|
||||
CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y
|
||||
CONFIG_EXAMPLES_FIXEDWING_CONTROL=y
|
||||
CONFIG_EXAMPLES_HELLO=y
|
||||
CONFIG_EXAMPLES_HWTEST=y
|
||||
CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y
|
||||
CONFIG_EXAMPLES_PX4_SIMPLE_APP=y
|
||||
CONFIG_EXAMPLES_ROVER_STEERING_CONTROL=y
|
||||
CONFIG_EXAMPLES_UUV_EXAMPLE_APP=y
|
||||
CONFIG_EXAMPLES_WORK_ITEM=y
|
||||
CONFIG_DRIVERS_PCA9685=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
CONFIG_SYSTEMCMDS_MICROBENCH=y
|
||||
CONFIG_DRIVERS_RPM=n
|
||||
CONFIG_DRIVERS_PCA9685=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_DRIVERS_PCA9685=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
CONFIG_DRIVERS_RPM=n
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
|
||||
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
|
||||
CONFIG_MODULES_ROVER_POS_CONTROL=n
|
||||
CONFIG_BOARD_TESTING=y
|
||||
CONFIG_DRIVERS_TEST_PPM=y
|
||||
CONFIG_SYSTEMCMDS_MICROBENCH=y
|
||||
|
||||
@@ -55,4 +55,3 @@ function(px4_list_make_absolute var prefix)
|
||||
endforeach(f)
|
||||
set(${var} "${list_var}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -7,4 +7,3 @@ bool lockdown # Set to true if actuators are forced to being disabled (due to e
|
||||
bool manual_lockdown # Set to true if manual throttle kill switch is engaged
|
||||
bool force_failsafe # Set to true if the actuators are forced to the failsafe position
|
||||
bool in_esc_calibration_mode # IO/FMU should ignore messages from the actuator controls topics
|
||||
bool soft_stop # Set to true if we need to ESCs to remove the idle constraint
|
||||
|
||||
@@ -6,4 +6,3 @@ uint8 NUM_CONTROLS = 8
|
||||
float32[8] 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)
|
||||
|
||||
|
||||
@@ -6,4 +6,3 @@ uint8 NUM_CONTROLS = 8
|
||||
float32[8] control # range: [-1, 1], where 1 means maximum positive position,
|
||||
# -1 maximum negative,
|
||||
# and NaN maps to disarmed
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ topic_name = spec.short_name
|
||||
|
||||
sorted_fields = sorted(spec.parsed_fields(), key=sizeof_field_type, reverse=True)
|
||||
struct_size, padding_end_size = add_padding_bytes(sorted_fields, search_path)
|
||||
topic_fields = ["%s %s" % (convert_type(field.type), field.name) for field in sorted_fields]
|
||||
topic_fields = ["%s %s" % (convert_type(field.type, True), field.name) for field in sorted_fields]
|
||||
}@
|
||||
|
||||
#include <inttypes.h>
|
||||
@@ -82,19 +82,11 @@ constexpr char __orb_@(topic_name)_fields[] = "@( ";".join(topic_fields) );";
|
||||
ORB_DEFINE(@multi_topic, struct @uorb_struct, @(struct_size-padding_end_size), __orb_@(topic_name)_fields, static_cast<uint8_t>(ORB_ID::@multi_topic));
|
||||
@[end for]
|
||||
|
||||
void print_message(const @uorb_struct &message)
|
||||
void print_message(const orb_metadata *meta, const @uorb_struct& message)
|
||||
{
|
||||
@[if constrained_flash]
|
||||
(void)message;
|
||||
PX4_INFO_RAW("Not implemented on flash constrained hardware\n");
|
||||
@[else]
|
||||
PX4_INFO_RAW(" @(uorb_struct)\n");
|
||||
|
||||
const hrt_abstime now = hrt_absolute_time();
|
||||
|
||||
@[for field in sorted_fields]@
|
||||
@( print_field(field) )@
|
||||
@[end for]@
|
||||
@[end if]@
|
||||
|
||||
if (sizeof(message) != meta->o_size) {
|
||||
printf("unexpected message size for %s: %zu != %i\n", meta->o_name, sizeof(message), meta->o_size);
|
||||
return;
|
||||
}
|
||||
orb_print_message_internal(meta, &message, true);
|
||||
}
|
||||
|
||||
@@ -133,5 +133,5 @@ ORB_DECLARE(@multi_topic);
|
||||
@[end for]
|
||||
|
||||
#ifdef __cplusplus
|
||||
void print_message(const @uorb_struct& message);
|
||||
void print_message(const orb_metadata *meta, const @uorb_struct& message);
|
||||
#endif
|
||||
|
||||
@@ -28,24 +28,24 @@ if __name__ == "__main__":
|
||||
msg_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"..")
|
||||
msg_files = get_msgs_list(msg_path)
|
||||
msg_files.sort()
|
||||
|
||||
|
||||
filelist_in_markdown=''
|
||||
|
||||
|
||||
for msg_file in msg_files:
|
||||
msg_name = os.path.splitext(msg_file)[0]
|
||||
output_file = os.path.join(output_dir, msg_name+'.md')
|
||||
msg_filename = os.path.join(msg_path, msg_file)
|
||||
print("{:} -> {:}".format(msg_filename, output_file))
|
||||
|
||||
|
||||
#Format msg url
|
||||
msg_url="[source file](https://github.com/PX4/PX4-Autopilot/blob/master/msg/%s)" % msg_file
|
||||
|
||||
|
||||
msg_description = ""
|
||||
summary_description = ""
|
||||
|
||||
#Get msg description (first non-empty comment line from top of msg)
|
||||
with open(msg_filename, 'r') as lineparser:
|
||||
line = lineparser.readline()
|
||||
line = lineparser.readline()
|
||||
while line.startswith('#') or (line.strip() == ''):
|
||||
print('DEBUG: line: %s' % line)
|
||||
line=line[1:].strip()+'\n'
|
||||
@@ -65,10 +65,10 @@ if __name__ == "__main__":
|
||||
#Get msg contents (read the file)
|
||||
with open(msg_filename, 'r') as source_file:
|
||||
msg_contents = source_file.read()
|
||||
|
||||
|
||||
#Format markdown using msg name, comment, url, contents.
|
||||
markdown_output="""# %s (UORB message)
|
||||
|
||||
|
||||
%s
|
||||
|
||||
%s
|
||||
@@ -78,27 +78,26 @@ if __name__ == "__main__":
|
||||
```
|
||||
""" % (msg_name, msg_description, msg_url, msg_contents)
|
||||
|
||||
|
||||
with open(output_file, 'w') as content_file:
|
||||
content_file.write(markdown_output)
|
||||
|
||||
|
||||
readme_markdown_file_link='- [%s](%s.md)' % (msg_name,msg_name)
|
||||
if summary_description:
|
||||
readme_markdown_file_link+=" — %s" % summary_description
|
||||
filelist_in_markdown+=readme_markdown_file_link+"\n"
|
||||
|
||||
|
||||
# Write out the README.md file
|
||||
readme_text="""# uORB Message Reference
|
||||
|
||||
:::note
|
||||
This list is [auto-generated](https://github.com/PX4/PX4-Autopilot/blob/master/msg/tools/generate_msg_docs.py) from the source code.
|
||||
:::
|
||||
|
||||
|
||||
This topic lists the UORB messages available in PX4 (some of which may be may be shared by the [PX4-ROS 2 Bridge](../ros/ros2_comm.md)).
|
||||
Graphs showing how these are used [can be found here](../middleware/uorb_graph.md).
|
||||
|
||||
|
||||
%s
|
||||
""" % (filelist_in_markdown)
|
||||
readme_file = os.path.join(output_dir, 'README.md')
|
||||
with open(readme_file, 'w') as content_file:
|
||||
content_file.write(readme_text)
|
||||
content_file.write(readme_text)
|
||||
|
||||
@@ -60,6 +60,23 @@ type_map = {
|
||||
'char': 'char',
|
||||
}
|
||||
|
||||
type_map_short = {
|
||||
# We use some range outside of alpha-numeric and special characters.
|
||||
# This needs to match with orb_get_c_type()
|
||||
'int8': '\\x82',
|
||||
'int16': '\\x83',
|
||||
'int32': '\\x84',
|
||||
'int64': '\\x85',
|
||||
'uint8': '\\x86',
|
||||
'uint16': '\\x87',
|
||||
'uint32': '\\x88',
|
||||
'uint64': '\\x89',
|
||||
'float32': '\\x8a',
|
||||
'float64': '\\x8b',
|
||||
'bool': '\\x8c',
|
||||
'char': '\\x8d',
|
||||
}
|
||||
|
||||
type_serialize_map = {
|
||||
'int8': 'int8_t',
|
||||
'int16': 'int16_t',
|
||||
@@ -204,7 +221,7 @@ def add_padding_bytes(fields, search_path):
|
||||
return (struct_size, num_padding_bytes)
|
||||
|
||||
|
||||
def convert_type(spec_type):
|
||||
def convert_type(spec_type, use_short_type=False):
|
||||
"""
|
||||
Convert from msg type to C type
|
||||
"""
|
||||
@@ -215,135 +232,15 @@ def convert_type(spec_type):
|
||||
|
||||
msg_type, is_array, array_length = genmsg.msgs.parse_type(bare_type)
|
||||
c_type = msg_type
|
||||
if msg_type in type_map:
|
||||
if use_short_type and msg_type in type_map_short:
|
||||
c_type = type_map_short[msg_type]
|
||||
elif msg_type in type_map:
|
||||
c_type = type_map[msg_type]
|
||||
if is_array:
|
||||
return c_type + "[" + str(array_length) + "]"
|
||||
return c_type
|
||||
|
||||
|
||||
def print_field(field):
|
||||
"""
|
||||
Echo printf line
|
||||
"""
|
||||
|
||||
# check if there are any upper case letters in the field name
|
||||
assert not any(a.isupper()
|
||||
for a in field.name), "%r field contains uppercase letters" % field.name
|
||||
|
||||
# skip padding
|
||||
if field.name.startswith('_padding'):
|
||||
return
|
||||
|
||||
bare_type = field.type
|
||||
if '/' in field.type:
|
||||
# removing prefix
|
||||
bare_type = (bare_type.split('/'))[1]
|
||||
|
||||
msg_type, is_array, array_length = genmsg.msgs.parse_type(bare_type)
|
||||
|
||||
field_name = ""
|
||||
|
||||
if is_array:
|
||||
c_type = "["
|
||||
|
||||
if msg_type in type_map:
|
||||
p_type = type_printf_map[msg_type]
|
||||
|
||||
else:
|
||||
for i in range(array_length):
|
||||
print(("PX4_INFO_RAW(\"\\t" + field.type +
|
||||
" " + field.name + "[" + str(i) + "]\");"))
|
||||
print((" print_message(message." +
|
||||
field.name + "[" + str(i) + "]);"))
|
||||
return
|
||||
|
||||
for i in range(array_length):
|
||||
|
||||
if i > 0:
|
||||
c_type += ", "
|
||||
field_name += ", "
|
||||
|
||||
if "float32" in field.type:
|
||||
field_name += "(double)message." + \
|
||||
field.name + "[" + str(i) + "]"
|
||||
else:
|
||||
field_name += "message." + field.name + "[" + str(i) + "]"
|
||||
|
||||
c_type += str(p_type)
|
||||
|
||||
c_type += "]"
|
||||
|
||||
else:
|
||||
c_type = msg_type
|
||||
if msg_type in type_map:
|
||||
c_type = type_printf_map[msg_type]
|
||||
|
||||
field_name = "message." + field.name
|
||||
|
||||
# cast double
|
||||
if field.type == "float32":
|
||||
field_name = "(double)" + field_name
|
||||
elif field.type == "bool":
|
||||
c_type = '%s'
|
||||
field_name = "(" + field_name + " ? \"True\" : \"False\")"
|
||||
|
||||
else:
|
||||
print(("PX4_INFO_RAW(\"\\n\\t" + field.name + "\");"))
|
||||
print(("\tprint_message(message." + field.name + ");"))
|
||||
return
|
||||
|
||||
if field.name == 'timestamp':
|
||||
print(("if (message.timestamp != 0) {\n\t\tPX4_INFO_RAW(\"\\t" + field.name +
|
||||
": " + c_type + " (%.6f seconds ago)\\n\", " + field_name +
|
||||
", (now - message.timestamp) / 1e6);\n\t} else {\n\t\tPX4_INFO_RAW(\"\\n\");\n\t}"))
|
||||
elif field.name == 'timestamp_sample':
|
||||
print(("\n\tPX4_INFO_RAW(\"\\t" + field.name + ": " + c_type + " (" + c_type +
|
||||
" us before timestamp)\\n\", " + field_name + ", message.timestamp - message.timestamp_sample);\n\t"))
|
||||
elif field.name == 'device_id':
|
||||
print("char device_id_buffer[80];")
|
||||
print("device::Device::device_id_print_buffer(device_id_buffer, sizeof(device_id_buffer), message.device_id);")
|
||||
print("PX4_INFO_RAW(\"\\tdevice_id: %\" PRId32 \" (%s) \\n\", message.device_id, device_id_buffer);")
|
||||
elif field.name == 'accel_device_id':
|
||||
print("char accel_device_id_buffer[80];")
|
||||
print("device::Device::device_id_print_buffer(accel_device_id_buffer, sizeof(accel_device_id_buffer), message.accel_device_id);")
|
||||
print("PX4_INFO_RAW(\"\\taccel_device_id: %\" PRId32 \" (%s) \\n\", message.accel_device_id, accel_device_id_buffer);")
|
||||
elif field.name == 'gyro_device_id':
|
||||
print("char gyro_device_id_buffer[80];")
|
||||
print("device::Device::device_id_print_buffer(gyro_device_id_buffer, sizeof(gyro_device_id_buffer), message.gyro_device_id);")
|
||||
print("PX4_INFO_RAW(\"\\tgyro_device_id: %\" PRId32 \" (%s) \\n\", message.gyro_device_id, gyro_device_id_buffer);")
|
||||
elif field.name == 'baro_device_id':
|
||||
print("char baro_device_id_buffer[80];")
|
||||
print("device::Device::device_id_print_buffer(baro_device_id_buffer, sizeof(baro_device_id_buffer), message.baro_device_id);")
|
||||
print("PX4_INFO_RAW(\"\\tbaro_device_id: %\" PRId32 \" (%s) \\n\", message.baro_device_id, baro_device_id_buffer);")
|
||||
elif field.name == 'mag_device_id':
|
||||
print("char mag_device_id_buffer[80];")
|
||||
print("device::Device::device_id_print_buffer(mag_device_id_buffer, sizeof(mag_device_id_buffer), message.mag_device_id);")
|
||||
print("PX4_INFO_RAW(\"\\tmag_device_id: %\" PRId32 \" (%s) \\n\", message.mag_device_id, mag_device_id_buffer);")
|
||||
elif (field.name == 'q' or 'q_' in field.name) and field.type == 'float32[4]':
|
||||
# float32[4] q/q_d/q_reset/delta_q_reset
|
||||
print("{")
|
||||
print(
|
||||
"\t\tmatrix::Eulerf euler{matrix::Quatf{message." + field.name + "}};")
|
||||
print("\t\tPX4_INFO_RAW(\"\\t" + field.name + ": " + c_type + " (Roll: %.1f deg, Pitch: %.1f deg, Yaw: %.1f deg" ")\\n\", " +
|
||||
field_name + ", (double)math::degrees(euler(0)), (double)math::degrees(euler(1)), (double)math::degrees(euler(2)));\n\t")
|
||||
print("\t}")
|
||||
|
||||
elif ("flags" in field.name or "bits" in field.name) and "uint" in field.type:
|
||||
# print bits of fixed width unsigned integers (uint8, uint16, uint32) if name contains flags or bits
|
||||
print("PX4_INFO_RAW(\"\\t" + field.name + ": " +
|
||||
c_type + " (0b\", " + field_name + ");")
|
||||
print("\tfor (int i = (sizeof(" + field_name + ") * 8) - 1; i >= 0; i--) { PX4_INFO_RAW(\"%lu%s\", (unsigned long) "
|
||||
+ field_name + " >> i & 1, ((unsigned)i < (sizeof(" + field_name + ") * 8) - 1 && i % 4 == 0 && i > 0) ? \"'\" : \"\"); }")
|
||||
print("\tPX4_INFO_RAW(\")\\n\");")
|
||||
elif is_array and 'char' in field.type:
|
||||
print(("PX4_INFO_RAW(\"\\t" + field.name + ": \\\"%." +
|
||||
str(array_length) + "s\\\" \\n\", message." + field.name + ");"))
|
||||
else:
|
||||
print(("PX4_INFO_RAW(\"\\t" + field.name + ": " +
|
||||
c_type + "\\n\", " + field_name + ");"))
|
||||
|
||||
|
||||
def print_field_def(field):
|
||||
"""
|
||||
Print the C type from a field
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
#include "uORBManager.hpp"
|
||||
#include "uORBCommon.hpp"
|
||||
|
||||
#include <lib/drivers/device/Device.hpp>
|
||||
#include <matrix/Quaternion.hpp>
|
||||
#include <mathlib/mathlib.h>
|
||||
|
||||
static uORB::DeviceMaster *g_dev = nullptr;
|
||||
|
||||
int uorb_start(void)
|
||||
@@ -172,3 +176,302 @@ int orb_get_interval(int handle, unsigned *interval)
|
||||
{
|
||||
return uORB::Manager::get_instance()->orb_get_interval(handle, interval);
|
||||
}
|
||||
|
||||
const char *orb_get_c_type(unsigned char short_type)
|
||||
{
|
||||
// this matches with the uorb o_fields generator
|
||||
switch (short_type) {
|
||||
case 0x82: return "int8_t";
|
||||
|
||||
case 0x83: return "int16_t";
|
||||
|
||||
case 0x84: return "int32_t";
|
||||
|
||||
case 0x85: return "int64_t";
|
||||
|
||||
case 0x86: return "uint8_t";
|
||||
|
||||
case 0x87: return "uint16_t";
|
||||
|
||||
case 0x88: return "uint32_t";
|
||||
|
||||
case 0x89: return "uint64_t";
|
||||
|
||||
case 0x8a: return "float";
|
||||
|
||||
case 0x8b: return "double";
|
||||
|
||||
case 0x8c: return "bool";
|
||||
|
||||
case 0x8d: return "char";
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void orb_print_message_internal(const orb_metadata *meta, const void *data, bool print_topic_name)
|
||||
{
|
||||
if (print_topic_name) {
|
||||
PX4_INFO_RAW(" %s\n", meta->o_name);
|
||||
}
|
||||
|
||||
const hrt_abstime now = hrt_absolute_time();
|
||||
hrt_abstime topic_timestamp = 0;
|
||||
|
||||
const uint8_t *data_ptr = (const uint8_t *)data;
|
||||
int data_offset = 0;
|
||||
|
||||
for (int format_idx = 0; meta->o_fields[format_idx] != 0;) {
|
||||
const char *end_field = strchr(meta->o_fields + format_idx, ';');
|
||||
|
||||
if (!end_field) {
|
||||
PX4_ERR("Format error in %s", meta->o_fields);
|
||||
return;
|
||||
}
|
||||
|
||||
const char *c_type = orb_get_c_type(meta->o_fields[format_idx]);
|
||||
const int end_field_idx = end_field - meta->o_fields;
|
||||
|
||||
int array_idx = -1;
|
||||
int field_name_idx = -1;
|
||||
|
||||
for (int field_idx = format_idx; field_idx != end_field_idx; ++field_idx) {
|
||||
if (meta->o_fields[field_idx] == '[') {
|
||||
array_idx = field_idx + 1;
|
||||
|
||||
} else if (meta->o_fields[field_idx] == ' ') {
|
||||
field_name_idx = field_idx + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int array_size = 1;
|
||||
|
||||
if (array_idx >= 0) {
|
||||
array_size = strtol(meta->o_fields + array_idx, nullptr, 10);
|
||||
}
|
||||
|
||||
char field_name[80];
|
||||
size_t field_name_len = end_field_idx - field_name_idx;
|
||||
|
||||
if (field_name_len >= sizeof(field_name)) {
|
||||
PX4_ERR("field name too long %s (max: %u)", meta->o_fields, (unsigned)sizeof(field_name));
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(field_name, meta->o_fields + field_name_idx, field_name_len);
|
||||
field_name[field_name_len] = '\0';
|
||||
|
||||
if (c_type) { // built-in type
|
||||
bool dont_print = false;
|
||||
|
||||
// handle special cases
|
||||
if (strncmp(field_name, "_padding", 8) == 0) {
|
||||
dont_print = true;
|
||||
|
||||
} else if (strcmp(c_type, "char") == 0 && array_size > 1) { // string
|
||||
PX4_INFO_RAW(" %s: \"%.*s\"\n", field_name, array_size, (char *)(data_ptr + data_offset));
|
||||
dont_print = true;
|
||||
}
|
||||
|
||||
if (!dont_print) {
|
||||
PX4_INFO_RAW(" %s: ", field_name);
|
||||
}
|
||||
|
||||
if (!dont_print && array_size > 1) {
|
||||
PX4_INFO_RAW("[");
|
||||
}
|
||||
|
||||
const int previous_data_offset = data_offset;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-align" // the caller ensures data is aligned
|
||||
|
||||
for (int i = 0; i < array_size; ++i) {
|
||||
if (strcmp(c_type, "int8_t") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%" PRIi8, *(int8_t *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(int8_t);
|
||||
|
||||
} else if (strcmp(c_type, "int16_t") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%" PRIi16, *(int16_t *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(int16_t);
|
||||
|
||||
} else if (strcmp(c_type, "int32_t") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%" PRIi32, *(int32_t *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(int32_t);
|
||||
|
||||
} else if (strcmp(c_type, "int64_t") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%" PRIi64, *(int64_t *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(int64_t);
|
||||
|
||||
} else if (strcmp(c_type, "uint8_t") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%" PRIu8, *(uint8_t *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(uint8_t);
|
||||
|
||||
} else if (strcmp(c_type, "uint16_t") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%" PRIu16, *(uint16_t *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(uint16_t);
|
||||
|
||||
} else if (strcmp(c_type, "uint32_t") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%" PRIu32, *(uint32_t *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(uint32_t);
|
||||
|
||||
} else if (strcmp(c_type, "uint64_t") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%" PRIu64, *(uint64_t *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(uint64_t);
|
||||
|
||||
} else if (strcmp(c_type, "float") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%.4f", (double) * (float *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(float);
|
||||
|
||||
} else if (strcmp(c_type, "double") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%.4f", *(double *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(double);
|
||||
|
||||
} else if (strcmp(c_type, "bool") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%s", *(bool *)(data_ptr + data_offset) ? "True" : "False"); }
|
||||
|
||||
data_offset += sizeof(bool);
|
||||
|
||||
} else if (strcmp(c_type, "char") == 0) {
|
||||
if (!dont_print) { PX4_INFO_RAW("%i", (int) * (char *)(data_ptr + data_offset)); }
|
||||
|
||||
data_offset += sizeof(char);
|
||||
|
||||
} else {
|
||||
PX4_ERR("unknown type: %s", c_type);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dont_print && i < array_size - 1) {
|
||||
PX4_INFO_RAW(", ");
|
||||
}
|
||||
}
|
||||
|
||||
if (!dont_print && array_size > 1) {
|
||||
PX4_INFO_RAW("]");
|
||||
}
|
||||
|
||||
// handle special cases
|
||||
if (array_size == 1) {
|
||||
if (strcmp(c_type, "uint64_t") == 0 && strcmp(field_name, "timestamp") == 0) {
|
||||
topic_timestamp = *(uint64_t *)(data_ptr + previous_data_offset);
|
||||
|
||||
if (topic_timestamp != 0) {
|
||||
PX4_INFO_RAW(" (%.6f seconds ago)", (double)((now - topic_timestamp) / 1e6f));
|
||||
}
|
||||
|
||||
} else if (strcmp(c_type, "uint64_t") == 0 && strcmp(field_name, "timestamp_sample") == 0) {
|
||||
hrt_abstime timestamp = *(uint64_t *)(data_ptr + previous_data_offset);
|
||||
|
||||
if (topic_timestamp != 0 && timestamp != 0) {
|
||||
PX4_INFO_RAW(" (%i us before timestamp)", (int)(topic_timestamp - timestamp));
|
||||
}
|
||||
|
||||
} else if (strstr(field_name, "flags") != nullptr) {
|
||||
// bitfield
|
||||
unsigned field_size = 0;
|
||||
unsigned long value = 0;
|
||||
|
||||
if (strcmp(c_type, "uint8_t") == 0) {
|
||||
field_size = sizeof(uint8_t);
|
||||
value = *(uint8_t *)(data_ptr + previous_data_offset);
|
||||
|
||||
} else if (strcmp(c_type, "uint16_t") == 0) {
|
||||
field_size = sizeof(uint16_t);
|
||||
value = *(uint16_t *)(data_ptr + previous_data_offset);
|
||||
|
||||
} else if (strcmp(c_type, "uint32_t") == 0) {
|
||||
field_size = sizeof(uint32_t);
|
||||
value = *(uint32_t *)(data_ptr + previous_data_offset);
|
||||
}
|
||||
|
||||
if (field_size > 0) {
|
||||
PX4_INFO_RAW(" (0b");
|
||||
|
||||
for (int i = (field_size * 8) - 1; i >= 0; i--) {
|
||||
PX4_INFO_RAW("%lu%s", (value >> i) & 1, ((unsigned)i < (field_size * 8) - 1 && i % 4 == 0 && i > 0) ? "'" : "");
|
||||
}
|
||||
|
||||
PX4_INFO_RAW(")");
|
||||
}
|
||||
|
||||
} else if (strcmp(c_type, "uint32_t") == 0 && strstr(field_name, "device_id") != nullptr) {
|
||||
// Device ID
|
||||
uint32_t device_id = *(uint32_t *)(data_ptr + previous_data_offset);
|
||||
char device_id_buffer[80];
|
||||
device::Device::device_id_print_buffer(device_id_buffer, sizeof(device_id_buffer), device_id);
|
||||
PX4_INFO_RAW(" (%s)", device_id_buffer);
|
||||
}
|
||||
|
||||
} else if (array_size == 4 && strcmp(c_type, "float") == 0 && (strcmp(field_name, "q") == 0
|
||||
|| strncmp(field_name, "q_", 2) == 0)) {
|
||||
// attitude
|
||||
float *attitude = (float *)(data_ptr + previous_data_offset);
|
||||
matrix::Eulerf euler{matrix::Quatf{attitude}};
|
||||
PX4_INFO_RAW(" (Roll: %.1f deg, Pitch: %.1f deg, Yaw: %.1f deg)",
|
||||
(double)math::degrees(euler(0)), (double)math::degrees(euler(1)), (double)math::degrees(euler(2)));
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
PX4_INFO_RAW("\n");
|
||||
|
||||
} else {
|
||||
|
||||
// extract the topic name
|
||||
char topic_name[80];
|
||||
const size_t topic_name_len = array_size > 1 ? array_idx - format_idx - 1 : field_name_idx - format_idx - 1;
|
||||
|
||||
if (topic_name_len >= sizeof(topic_name)) {
|
||||
PX4_ERR("topic name too long in %s (max: %u)", meta->o_name, (unsigned)sizeof(topic_name));
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(topic_name, meta->o_fields + format_idx, topic_name_len);
|
||||
field_name[topic_name_len] = '\0';
|
||||
|
||||
// find the metadata
|
||||
const orb_metadata *const *topics = orb_get_topics();
|
||||
const orb_metadata *found_topic = nullptr;
|
||||
|
||||
for (size_t i = 0; i < orb_topics_count(); i++) {
|
||||
if (strcmp(topics[i]->o_name, topic_name) == 0) {
|
||||
found_topic = topics[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found_topic) {
|
||||
PX4_ERR("Topic %s did not match any known topics", topic_name);
|
||||
return;
|
||||
}
|
||||
|
||||
// print recursively
|
||||
for (int i = 0; i < array_size; ++i) {
|
||||
PX4_INFO_RAW(" %s", field_name);
|
||||
|
||||
if (array_size > 1) {
|
||||
PX4_INFO_RAW("[%i]", i);
|
||||
}
|
||||
|
||||
PX4_INFO_RAW(" (%s):\n", topic_name);
|
||||
orb_print_message_internal(found_topic, data_ptr + data_offset, false);
|
||||
data_offset += found_topic->o_size;
|
||||
}
|
||||
}
|
||||
|
||||
format_idx = end_field_idx + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _UORB_UORB_H
|
||||
#define _UORB_UORB_H
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @file uORB.h
|
||||
@@ -235,6 +234,20 @@ extern int orb_set_interval(int handle, unsigned interval) __EXPORT;
|
||||
*/
|
||||
extern int orb_get_interval(int handle, unsigned *interval) __EXPORT;
|
||||
|
||||
/**
|
||||
* Returns the C type string from a short type in o_fields metadata, or nullptr
|
||||
* if not a short type
|
||||
*/
|
||||
const char *orb_get_c_type(unsigned char short_type);
|
||||
|
||||
/**
|
||||
* Print a topic to console. Do not call this directly, use print_message() instead.
|
||||
* @param meta orb topic metadata
|
||||
* @param data expected to be aligned to the largest member
|
||||
*/
|
||||
void orb_print_message_internal(const struct orb_metadata *meta, const void *data, bool print_topic_name);
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
/* Diverse uORB header defines */ //XXX: move to better location
|
||||
@@ -245,4 +258,3 @@ typedef uint8_t hil_state_t;
|
||||
typedef uint8_t navigation_state_t;
|
||||
typedef uint8_t switch_pos_t;
|
||||
|
||||
#endif /* _UORB_UORB_H */
|
||||
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#! /bin/sh
|
||||
|
||||
if command -v gdb-multiarch &> /dev/null
|
||||
then
|
||||
GDB_CMD=$(command -v gdb-multiarch)
|
||||
|
||||
elif command -v arm-none-eabi-gdb &> /dev/null
|
||||
then
|
||||
GDB_CMD=$(command -v arm-none-eabi-gdb)
|
||||
|
||||
else
|
||||
echo "gdb arm-none-eabi or multi-arch not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
file ${1}
|
||||
|
||||
gdb_cmd_file=$(mktemp)
|
||||
|
||||
cat >"${gdb_cmd_file}" <<EOL
|
||||
|
||||
source ${WORKSPACE}/platforms/nuttx/Debug/NuttX
|
||||
source ${WORKSPACE}/platforms/nuttx/Debug/ARMv7M
|
||||
|
||||
target remote localhost:2331
|
||||
|
||||
monitor regs
|
||||
|
||||
showtasks
|
||||
|
||||
vecstate
|
||||
|
||||
info threads
|
||||
|
||||
backtrace
|
||||
|
||||
bt full
|
||||
|
||||
EOL
|
||||
|
||||
${GDB_CMD} -silent --nh --nx --nw -batch -x ${gdb_cmd_file} ${1}
|
||||
@@ -48,6 +48,18 @@ if(JLinkGDBServerCLExe_PATH)
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
# jlink_gdb_backtrace (attach, print current tasks, back trace, exit)
|
||||
add_custom_target(jlink_gdb_backtrace
|
||||
COMMAND ${PX4_BINARY_DIR}/jlink_gdb_start.sh
|
||||
COMMAND ${CMAKE_COMMAND} -E env WORKSPACE=${PX4_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Debug/jlink_gdb_backtrace.sh $<TARGET_FILE:px4>
|
||||
DEPENDS
|
||||
px4
|
||||
${PX4_BINARY_DIR}/jlink_gdb_start.sh
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Debug/jlink_gdb_backtrace.sh
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
|
||||
# jlink_upload_bootloader
|
||||
# board directory supplied bootloader.bin
|
||||
|
||||
@@ -32,4 +32,3 @@
|
||||
############################################################################
|
||||
|
||||
add_subdirectory(${PX4_CHIP})
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ int up_dshot_init(uint32_t channel_mask, unsigned dshot_pwm_freq)
|
||||
}
|
||||
|
||||
// we know the uint8_t* cast to uint32_t* is fine, since we're aligned to cache line size
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
dshot_burst_buffer[timer] = (uint32_t *)&dshot_burst_buffer_array[buffer_offset];
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
@@ -41,4 +41,3 @@ add_subdirectory(lps33hw)
|
||||
add_subdirectory(maiertek)
|
||||
add_subdirectory(ms5611)
|
||||
#add_subdirectory(tcbp001ta) # only for users who really need this
|
||||
|
||||
|
||||
@@ -118,11 +118,6 @@ struct pwm_output_values {
|
||||
|
||||
#endif // not PX4_PWM_ALTERNATE_RANGES
|
||||
|
||||
/**
|
||||
* Do not output a channel with this value
|
||||
*/
|
||||
#define PWM_IGNORE_THIS_CHANNEL UINT16_MAX
|
||||
|
||||
/**
|
||||
* Servo output signal type, value is actual servo output pulse
|
||||
* width in microseconds.
|
||||
@@ -170,15 +165,9 @@ typedef uint16_t servo_position_t;
|
||||
/** start DSM bind */
|
||||
#define DSM_BIND_START _PX4_IOC(_PWM_SERVO_BASE, 10)
|
||||
|
||||
/** set the PWM value for failsafe */
|
||||
#define PWM_SERVO_SET_FAILSAFE_PWM _PX4_IOC(_PWM_SERVO_BASE, 12)
|
||||
|
||||
/** get the PWM value for failsafe */
|
||||
#define PWM_SERVO_GET_FAILSAFE_PWM _PX4_IOC(_PWM_SERVO_BASE, 13)
|
||||
|
||||
/** set the PWM value when disarmed - should be no PWM (zero) by default */
|
||||
#define PWM_SERVO_SET_DISARMED_PWM _PX4_IOC(_PWM_SERVO_BASE, 14)
|
||||
|
||||
/** get the PWM value when disarmed */
|
||||
#define PWM_SERVO_GET_DISARMED_PWM _PX4_IOC(_PWM_SERVO_BASE, 15)
|
||||
|
||||
@@ -197,21 +186,9 @@ typedef uint16_t servo_position_t;
|
||||
/** get the TRIM value the output will send */
|
||||
#define PWM_SERVO_GET_TRIM_PWM _PX4_IOC(_PWM_SERVO_BASE, 21)
|
||||
|
||||
/** set the lockdown override flag to enable outputs in HIL */
|
||||
#define PWM_SERVO_SET_DISABLE_LOCKDOWN _PX4_IOC(_PWM_SERVO_BASE, 23)
|
||||
|
||||
/** get the lockdown override flag to enable outputs in HIL */
|
||||
#define PWM_SERVO_GET_DISABLE_LOCKDOWN _PX4_IOC(_PWM_SERVO_BASE, 24)
|
||||
|
||||
/** force safety switch off (to disable use of safety switch) */
|
||||
#define PWM_SERVO_SET_FORCE_SAFETY_OFF _PX4_IOC(_PWM_SERVO_BASE, 25)
|
||||
|
||||
/** force failsafe mode (failsafe values are set immediately even if failsafe condition not met) */
|
||||
#define PWM_SERVO_SET_FORCE_FAILSAFE _PX4_IOC(_PWM_SERVO_BASE, 26)
|
||||
|
||||
/** make failsafe non-recoverable (termination) if it occurs */
|
||||
#define PWM_SERVO_SET_TERMINATION_FAILSAFE _PX4_IOC(_PWM_SERVO_BASE, 27)
|
||||
|
||||
/** force safety switch on (to enable use of safety switch) */
|
||||
#define PWM_SERVO_SET_FORCE_SAFETY_ON _PX4_IOC(_PWM_SERVO_BASE, 28)
|
||||
|
||||
|
||||
@@ -1045,7 +1045,7 @@ GPS::print_status()
|
||||
PX4_INFO("rate publication:\t\t%6.2f Hz", (double)_rate);
|
||||
PX4_INFO("rate RTCM injection:\t%6.2f Hz", (double)_rate_rtcm_injection);
|
||||
|
||||
print_message(_report_gps_pos);
|
||||
print_message(ORB_ID(sensor_gps), _report_gps_pos);
|
||||
}
|
||||
|
||||
if (_instance == Instance::Main && _secondary_instance.load()) {
|
||||
|
||||
@@ -44,10 +44,6 @@ LinuxPWMOut::LinuxPWMOut() :
|
||||
_cycle_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")),
|
||||
_interval_perf(perf_alloc(PC_INTERVAL, MODULE_NAME": interval"))
|
||||
{
|
||||
if (!_mixing_output.useDynamicMixing()) {
|
||||
_mixing_output.setAllMinValues(PWM_DEFAULT_MIN);
|
||||
_mixing_output.setAllMaxValues(PWM_DEFAULT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
LinuxPWMOut::~LinuxPWMOut()
|
||||
@@ -161,128 +157,6 @@ void LinuxPWMOut::update_params()
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t pwm_min_default = PWM_DEFAULT_MIN;
|
||||
int32_t pwm_max_default = PWM_DEFAULT_MAX;
|
||||
int32_t pwm_disarmed_default = 0;
|
||||
|
||||
const char *prefix;
|
||||
|
||||
if (_class_instance == CLASS_DEVICE_PRIMARY) {
|
||||
prefix = "PWM_MAIN";
|
||||
|
||||
param_get(param_find("PWM_MAIN_MIN"), &pwm_min_default);
|
||||
param_get(param_find("PWM_MAIN_MAX"), &pwm_max_default);
|
||||
param_get(param_find("PWM_MAIN_DISARM"), &pwm_disarmed_default);
|
||||
|
||||
} else if (_class_instance == CLASS_DEVICE_SECONDARY) {
|
||||
prefix = "PWM_AUX";
|
||||
|
||||
param_get(param_find("PWM_AUX_MIN"), &pwm_min_default);
|
||||
param_get(param_find("PWM_AUX_MAX"), &pwm_max_default);
|
||||
param_get(param_find("PWM_AUX_DISARM"), &pwm_disarmed_default);
|
||||
|
||||
} else if (_class_instance == CLASS_DEVICE_TERTIARY) {
|
||||
prefix = "PWM_EXTRA";
|
||||
|
||||
param_get(param_find("PWM_EXTRA_MIN"), &pwm_min_default);
|
||||
param_get(param_find("PWM_EXTRA_MAX"), &pwm_max_default);
|
||||
param_get(param_find("PWM_EXTRA_DISARM"), &pwm_disarmed_default);
|
||||
|
||||
} else {
|
||||
PX4_ERR("invalid class instance %d", _class_instance);
|
||||
return;
|
||||
}
|
||||
|
||||
char str[17];
|
||||
|
||||
for (unsigned i = 0; i < MAX_ACTUATORS; i++) {
|
||||
// PWM_MAIN_MINx
|
||||
{
|
||||
sprintf(str, "%s_MIN%u", prefix, i + 1);
|
||||
int32_t pwm_min = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_min) == PX4_OK && pwm_min >= 0) {
|
||||
_mixing_output.minValue(i) = math::constrain(pwm_min, PWM_LOWEST_MIN, PWM_HIGHEST_MIN);
|
||||
|
||||
if (pwm_min != _mixing_output.minValue(i)) {
|
||||
int32_t pwm_min_new = _mixing_output.minValue(i);
|
||||
param_set(param_find(str), &pwm_min_new);
|
||||
}
|
||||
|
||||
} else {
|
||||
_mixing_output.minValue(i) = pwm_min_default;
|
||||
}
|
||||
}
|
||||
|
||||
// PWM_MAIN_MAXx
|
||||
{
|
||||
sprintf(str, "%s_MAX%u", prefix, i + 1);
|
||||
int32_t pwm_max = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_max) == PX4_OK && pwm_max >= 0) {
|
||||
_mixing_output.maxValue(i) = math::constrain(pwm_max, PWM_LOWEST_MAX, PWM_HIGHEST_MAX);
|
||||
|
||||
if (pwm_max != _mixing_output.maxValue(i)) {
|
||||
int32_t pwm_max_new = _mixing_output.maxValue(i);
|
||||
param_set(param_find(str), &pwm_max_new);
|
||||
}
|
||||
|
||||
} else {
|
||||
_mixing_output.maxValue(i) = pwm_max_default;
|
||||
}
|
||||
}
|
||||
|
||||
// PWM_MAIN_FAILx
|
||||
{
|
||||
sprintf(str, "%s_FAIL%u", prefix, i + 1);
|
||||
int32_t pwm_failsafe = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_failsafe) == PX4_OK && pwm_failsafe >= 0) {
|
||||
_mixing_output.failsafeValue(i) = math::constrain(pwm_failsafe, 0, PWM_HIGHEST_MAX);
|
||||
|
||||
if (pwm_failsafe != _mixing_output.failsafeValue(i)) {
|
||||
int32_t pwm_fail_new = _mixing_output.failsafeValue(i);
|
||||
param_set(param_find(str), &pwm_fail_new);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PWM_MAIN_DISx
|
||||
{
|
||||
sprintf(str, "%s_DIS%u", prefix, i + 1);
|
||||
int32_t pwm_dis = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_dis) == PX4_OK && pwm_dis >= 0) {
|
||||
_mixing_output.disarmedValue(i) = math::constrain(pwm_dis, 0, PWM_HIGHEST_MAX);
|
||||
|
||||
if (pwm_dis != _mixing_output.disarmedValue(i)) {
|
||||
int32_t pwm_dis_new = _mixing_output.disarmedValue(i);
|
||||
param_set(param_find(str), &pwm_dis_new);
|
||||
}
|
||||
|
||||
} else {
|
||||
_mixing_output.disarmedValue(i) = pwm_disarmed_default;
|
||||
}
|
||||
}
|
||||
|
||||
// PWM_MAIN_REVx
|
||||
{
|
||||
sprintf(str, "%s_REV%u", prefix, i + 1);
|
||||
int32_t pwm_rev = 0;
|
||||
|
||||
if (param_get(param_find(str), &pwm_rev) == PX4_OK) {
|
||||
uint16_t &reverse_pwm_mask = _mixing_output.reverseOutputMask();
|
||||
|
||||
if (pwm_rev >= 1) {
|
||||
reverse_pwm_mask = reverse_pwm_mask | (2 << i);
|
||||
|
||||
} else {
|
||||
reverse_pwm_mask = reverse_pwm_mask & ~(2 << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_mixing_output.mixers()) {
|
||||
int16_t values[MAX_ACTUATORS] {};
|
||||
|
||||
|
||||
@@ -9,4 +9,3 @@ actuator_output:
|
||||
max: { min: 1600, max: 2200, default: 2000 }
|
||||
failsafe: { min: 800, max: 2200 }
|
||||
num_channels: 8
|
||||
|
||||
|
||||
@@ -124,10 +124,6 @@ PCA9685Wrapper::PCA9685Wrapper(int schd_rate_limit) :
|
||||
_cycle_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")),
|
||||
_schd_rate_limit(schd_rate_limit)
|
||||
{
|
||||
if (!_mixing_output.useDynamicMixing()) {
|
||||
_mixing_output.setAllMinValues(PWM_DEFAULT_MIN);
|
||||
_mixing_output.setAllMaxValues(PWM_DEFAULT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
PCA9685Wrapper::~PCA9685Wrapper()
|
||||
@@ -179,151 +175,6 @@ void PCA9685Wrapper::updatePWMParams()
|
||||
return;
|
||||
}
|
||||
|
||||
// update pwm params
|
||||
const char *pname_format_pwm_ch_max[2] = {"PWM_MAIN_MAX%d", "PWM_AUX_MAX%d"};
|
||||
const char *pname_format_pwm_ch_min[2] = {"PWM_MAIN_MIN%d", "PWM_AUX_MIN%d"};
|
||||
const char *pname_format_pwm_ch_fail[2] = {"PWM_MAIN_FAIL%d", "PWM_AUX_FAIL%d"};
|
||||
const char *pname_format_pwm_ch_dis[2] = {"PWM_MAIN_DIS%d", "PWM_AUX_DIS%d"};
|
||||
const char *pname_format_pwm_ch_rev[2] = {"PWM_MAIN_REV%d", "PWM_AUX_REV%d"};
|
||||
|
||||
int32_t default_pwm_max = PWM_DEFAULT_MAX,
|
||||
default_pwm_min = PWM_DEFAULT_MIN,
|
||||
default_pwm_fail = PWM_DEFAULT_MIN,
|
||||
default_pwm_dis = PWM_MOTOR_OFF;
|
||||
|
||||
param_t param_h = param_find("PWM_MAIN_MAX");
|
||||
|
||||
if (param_h != PARAM_INVALID) {
|
||||
param_get(param_h, &default_pwm_max);
|
||||
|
||||
} else {
|
||||
PX4_DEBUG("PARAM_INVALID: %s", "PWM_MAIN_MAX");
|
||||
}
|
||||
|
||||
param_h = param_find("PWM_MAIN_MIN");
|
||||
|
||||
if (param_h != PARAM_INVALID) {
|
||||
param_get(param_h, &default_pwm_min);
|
||||
|
||||
} else {
|
||||
PX4_DEBUG("PARAM_INVALID: %s", "PWM_MAIN_MIN");
|
||||
}
|
||||
|
||||
param_h = param_find("PWM_MAIN_RATE");
|
||||
|
||||
if (param_h != PARAM_INVALID) {
|
||||
int32_t pval = 0;
|
||||
param_get(param_h, &pval);
|
||||
|
||||
if (_last_fetched_Freq != pval) {
|
||||
_last_fetched_Freq = pval;
|
||||
_targetFreq = (float)pval; // update only if changed
|
||||
}
|
||||
|
||||
} else {
|
||||
PX4_DEBUG("PARAM_INVALID: %s", "PWM_MAIN_RATE");
|
||||
}
|
||||
|
||||
for (int i = 0; i < PCA9685_PWM_CHANNEL_COUNT; i++) {
|
||||
char pname[16];
|
||||
uint8_t param_group, param_index;
|
||||
|
||||
if (i <= 7) { // Main channel
|
||||
param_group = 0;
|
||||
param_index = i + 1;
|
||||
|
||||
} else { // AUX
|
||||
param_group = 1;
|
||||
param_index = i - 8 + 1;
|
||||
}
|
||||
|
||||
sprintf(pname, pname_format_pwm_ch_max[param_group], param_index);
|
||||
param_h = param_find(pname);
|
||||
|
||||
if (param_h != PARAM_INVALID) {
|
||||
int32_t pval = 0;
|
||||
param_get(param_h, &pval);
|
||||
|
||||
if (pval != -1) {
|
||||
_mixing_output.maxValue(i) = pval;
|
||||
|
||||
} else {
|
||||
_mixing_output.maxValue(i) = default_pwm_max;
|
||||
}
|
||||
|
||||
} else {
|
||||
PX4_DEBUG("PARAM_INVALID: %s", pname);
|
||||
}
|
||||
|
||||
sprintf(pname, pname_format_pwm_ch_min[param_group], param_index);
|
||||
param_h = param_find(pname);
|
||||
|
||||
if (param_h != PARAM_INVALID) {
|
||||
int32_t pval = 0;
|
||||
param_get(param_h, &pval);
|
||||
|
||||
if (pval != -1) {
|
||||
_mixing_output.minValue(i) = pval;
|
||||
|
||||
} else {
|
||||
_mixing_output.minValue(i) = default_pwm_min;
|
||||
}
|
||||
|
||||
} else {
|
||||
PX4_DEBUG("PARAM_INVALID: %s", pname);
|
||||
}
|
||||
|
||||
sprintf(pname, pname_format_pwm_ch_fail[param_group], param_index);
|
||||
param_h = param_find(pname);
|
||||
|
||||
if (param_h != PARAM_INVALID) {
|
||||
int32_t pval = 0;
|
||||
param_get(param_h, &pval);
|
||||
|
||||
if (pval != -1) {
|
||||
_mixing_output.failsafeValue(i) = pval;
|
||||
|
||||
} else {
|
||||
_mixing_output.failsafeValue(i) = default_pwm_fail;
|
||||
}
|
||||
|
||||
} else {
|
||||
PX4_DEBUG("PARAM_INVALID: %s", pname);
|
||||
}
|
||||
|
||||
sprintf(pname, pname_format_pwm_ch_dis[param_group], param_index);
|
||||
param_h = param_find(pname);
|
||||
|
||||
if (param_h != PARAM_INVALID) {
|
||||
int32_t pval = 0;
|
||||
param_get(param_h, &pval);
|
||||
|
||||
if (pval != -1) {
|
||||
_mixing_output.disarmedValue(i) = pval;
|
||||
|
||||
} else {
|
||||
_mixing_output.disarmedValue(i) = default_pwm_dis;
|
||||
}
|
||||
|
||||
} else {
|
||||
PX4_DEBUG("PARAM_INVALID: %s", pname);
|
||||
}
|
||||
|
||||
sprintf(pname, pname_format_pwm_ch_rev[param_group], param_index);
|
||||
param_h = param_find(pname);
|
||||
|
||||
if (param_h != PARAM_INVALID) {
|
||||
uint16_t &reverse_pwm_mask = _mixing_output.reverseOutputMask();
|
||||
int32_t pval = 0;
|
||||
param_get(param_h, &pval);
|
||||
reverse_pwm_mask &= (0xfffe << i); // clear this bit
|
||||
reverse_pwm_mask |= (((uint16_t)(pval != 0)) << i); // set to new val
|
||||
|
||||
} else {
|
||||
PX4_DEBUG("PARAM_INVALID: %s", pname);
|
||||
}
|
||||
}
|
||||
|
||||
if (_mixing_output.mixers()) { // only update trims if mixer loaded
|
||||
updatePWMParamTrim();
|
||||
}
|
||||
|
||||
@@ -9,4 +9,3 @@ actuator_output:
|
||||
max: { min: 1600, max: 2200, default: 2000 }
|
||||
failsafe: { min: 800, max: 2200 }
|
||||
num_channels: 16
|
||||
|
||||
|
||||
@@ -56,10 +56,6 @@ PWMOut::PWMOut(int instance, uint8_t output_base) :
|
||||
_cycle_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")),
|
||||
_interval_perf(perf_alloc(PC_INTERVAL, MODULE_NAME": interval"))
|
||||
{
|
||||
if (!_mixing_output.useDynamicMixing()) {
|
||||
_mixing_output.setAllMinValues(PWM_DEFAULT_MIN);
|
||||
_mixing_output.setAllMaxValues(PWM_DEFAULT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
PWMOut::~PWMOut()
|
||||
@@ -487,10 +483,6 @@ void PWMOut::Run()
|
||||
}
|
||||
}
|
||||
|
||||
if (_pwm_initialized && _current_update_rate == 0 && !_mixing_output.useDynamicMixing()) {
|
||||
update_current_rate();
|
||||
}
|
||||
|
||||
// check at end of cycle (updateSubscriptions() can potentially change to a different WorkQueue thread)
|
||||
_mixing_output.updateSubscriptions(true, true);
|
||||
|
||||
@@ -505,9 +497,6 @@ void PWMOut::update_params()
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t pwm_min_default = PWM_DEFAULT_MIN;
|
||||
int32_t pwm_max_default = PWM_DEFAULT_MAX;
|
||||
int32_t pwm_disarmed_default = 0;
|
||||
int32_t pwm_rate_default = 50;
|
||||
int32_t pwm_default_channels = 0;
|
||||
|
||||
@@ -516,28 +505,20 @@ void PWMOut::update_params()
|
||||
if (_class_instance == CLASS_DEVICE_PRIMARY) {
|
||||
prefix = "PWM_MAIN";
|
||||
|
||||
param_get(param_find("PWM_MAIN_MIN"), &pwm_min_default);
|
||||
param_get(param_find("PWM_MAIN_MAX"), &pwm_max_default);
|
||||
param_get(param_find("PWM_MAIN_DISARM"), &pwm_disarmed_default);
|
||||
param_get(param_find("PWM_MAIN_RATE"), &pwm_rate_default);
|
||||
param_get(param_find("PWM_MAIN_OUT"), &pwm_default_channels);
|
||||
|
||||
} else if (_class_instance == CLASS_DEVICE_SECONDARY) {
|
||||
prefix = "PWM_AUX";
|
||||
|
||||
param_get(param_find("PWM_AUX_MIN"), &pwm_min_default);
|
||||
param_get(param_find("PWM_AUX_MAX"), &pwm_max_default);
|
||||
param_get(param_find("PWM_AUX_DISARM"), &pwm_disarmed_default);
|
||||
param_get(param_find("PWM_AUX_RATE"), &pwm_rate_default);
|
||||
param_get(param_find("PWM_AUX_OUT"), &pwm_default_channels);
|
||||
|
||||
} else if (_class_instance == CLASS_DEVICE_TERTIARY) {
|
||||
prefix = "PWM_EXTRA";
|
||||
|
||||
param_get(param_find("PWM_EXTRA_MIN"), &pwm_min_default);
|
||||
param_get(param_find("PWM_EXTRA_MAX"), &pwm_max_default);
|
||||
param_get(param_find("PWM_EXTRA_DISARM"), &pwm_disarmed_default);
|
||||
param_get(param_find("PWM_EXTRA_RATE"), &pwm_rate_default);
|
||||
param_get(param_find("PWM_EXTRA_OUT"), &pwm_default_channels);
|
||||
|
||||
} else {
|
||||
PX4_ERR("invalid class instance %d", _class_instance);
|
||||
@@ -558,106 +539,6 @@ void PWMOut::update_params()
|
||||
|
||||
char str[17];
|
||||
|
||||
for (unsigned i = 0; i < _num_outputs; i++) {
|
||||
// PWM_MAIN_MINx
|
||||
{
|
||||
sprintf(str, "%s_MIN%u", prefix, i + 1);
|
||||
int32_t pwm_min = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_min) == PX4_OK) {
|
||||
if (pwm_min >= 0 && pwm_min != 1000) {
|
||||
_mixing_output.minValue(i) = math::constrain(pwm_min, (int32_t) PWM_LOWEST_MIN, (int32_t) PWM_HIGHEST_MIN);
|
||||
|
||||
if (pwm_min != _mixing_output.minValue(i)) {
|
||||
int32_t pwm_min_new = _mixing_output.minValue(i);
|
||||
param_set(param_find(str), &pwm_min_new);
|
||||
}
|
||||
|
||||
} else if (pwm_default_channel_mask & 1 << i) {
|
||||
_mixing_output.minValue(i) = pwm_min_default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PWM_MAIN_MAXx
|
||||
{
|
||||
sprintf(str, "%s_MAX%u", prefix, i + 1);
|
||||
int32_t pwm_max = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_max) == PX4_OK) {
|
||||
if (pwm_max >= 0 && pwm_max != 2000) {
|
||||
_mixing_output.maxValue(i) = math::constrain(pwm_max, (int32_t) PWM_LOWEST_MAX, (int32_t) PWM_HIGHEST_MAX);
|
||||
|
||||
if (pwm_max != _mixing_output.maxValue(i)) {
|
||||
int32_t pwm_max_new = _mixing_output.maxValue(i);
|
||||
param_set(param_find(str), &pwm_max_new);
|
||||
}
|
||||
|
||||
} else if (pwm_default_channel_mask & 1 << i) {
|
||||
_mixing_output.maxValue(i) = pwm_max_default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PWM_MAIN_FAILx
|
||||
{
|
||||
sprintf(str, "%s_FAIL%u", prefix, i + 1);
|
||||
int32_t pwm_failsafe = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_failsafe) == PX4_OK) {
|
||||
if (pwm_failsafe >= 0) {
|
||||
_mixing_output.failsafeValue(i) = math::constrain(pwm_failsafe, (int32_t) 0, (int32_t) PWM_HIGHEST_MAX);
|
||||
|
||||
if (pwm_failsafe != _mixing_output.failsafeValue(i)) {
|
||||
int32_t pwm_fail_new = _mixing_output.failsafeValue(i);
|
||||
param_set(param_find(str), &pwm_fail_new);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PWM_MAIN_DISx
|
||||
{
|
||||
sprintf(str, "%s_DIS%u", prefix, i + 1);
|
||||
int32_t pwm_dis = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_dis) == PX4_OK) {
|
||||
if (pwm_dis >= 0 && pwm_dis != 900) {
|
||||
_mixing_output.disarmedValue(i) = math::constrain(pwm_dis, (int32_t) 0, (int32_t) PWM_HIGHEST_MAX);
|
||||
|
||||
if (pwm_dis != _mixing_output.disarmedValue(i)) {
|
||||
int32_t pwm_dis_new = _mixing_output.disarmedValue(i);
|
||||
param_set(param_find(str), &pwm_dis_new);
|
||||
}
|
||||
|
||||
} else if (pwm_default_channel_mask & 1 << i) {
|
||||
_mixing_output.disarmedValue(i) = pwm_disarmed_default;
|
||||
}
|
||||
}
|
||||
|
||||
if (_mixing_output.disarmedValue(i) > 0) {
|
||||
num_disarmed_set++;
|
||||
}
|
||||
}
|
||||
|
||||
// PWM_MAIN_REVx
|
||||
{
|
||||
sprintf(str, "%s_REV%u", prefix, i + 1);
|
||||
int32_t pwm_rev = 0;
|
||||
|
||||
if (param_get(param_find(str), &pwm_rev) == PX4_OK) {
|
||||
uint16_t &reverse_pwm_mask = _mixing_output.reverseOutputMask();
|
||||
|
||||
if (pwm_rev >= 1) {
|
||||
reverse_pwm_mask = reverse_pwm_mask | (1 << i);
|
||||
|
||||
} else {
|
||||
reverse_pwm_mask = reverse_pwm_mask & ~(1 << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_mixing_output.mixers()) {
|
||||
int16_t values[FMU_MAX_ACTUATORS] {};
|
||||
|
||||
@@ -736,40 +617,6 @@ int PWMOut::pwm_ioctl(file *filp, int cmd, unsigned long arg)
|
||||
*(uint32_t *)arg = _pwm_alt_rate_channels;
|
||||
break;
|
||||
|
||||
case PWM_SERVO_SET_FAILSAFE_PWM: {
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
/* discard if too many values are sent */
|
||||
if (pwm->channel_count > FMU_MAX_ACTUATORS || _mixing_output.useDynamicMixing()) {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < pwm->channel_count; i++) {
|
||||
if (pwm->values[i] == 0) {
|
||||
/* ignore 0 */
|
||||
} else if (pwm->values[i] > PWM_HIGHEST_MAX) {
|
||||
_mixing_output.failsafeValue(i) = PWM_HIGHEST_MAX;
|
||||
|
||||
}
|
||||
|
||||
#if PWM_LOWEST_MIN > 0
|
||||
|
||||
else if (pwm->values[i] < PWM_LOWEST_MIN) {
|
||||
_mixing_output.failsafeValue(i) = PWM_LOWEST_MIN;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
else {
|
||||
_mixing_output.failsafeValue(i) = pwm->values[i];
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PWM_SERVO_GET_FAILSAFE_PWM: {
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
@@ -781,50 +628,6 @@ int PWMOut::pwm_ioctl(file *filp, int cmd, unsigned long arg)
|
||||
break;
|
||||
}
|
||||
|
||||
case PWM_SERVO_SET_DISARMED_PWM: {
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
/* discard if too many values are sent */
|
||||
if (pwm->channel_count > FMU_MAX_ACTUATORS || _mixing_output.useDynamicMixing()) {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < pwm->channel_count; i++) {
|
||||
if (pwm->values[i] == 0) {
|
||||
/* ignore 0 */
|
||||
} else if (pwm->values[i] > PWM_HIGHEST_MAX) {
|
||||
_mixing_output.disarmedValue(i) = PWM_HIGHEST_MAX;
|
||||
}
|
||||
|
||||
#if PWM_LOWEST_MIN > 0
|
||||
|
||||
else if (pwm->values[i] < PWM_LOWEST_MIN) {
|
||||
_mixing_output.disarmedValue(i) = PWM_LOWEST_MIN;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
else {
|
||||
_mixing_output.disarmedValue(i) = pwm->values[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* update the counter
|
||||
* this is needed to decide if disarmed PWM output should be turned on or not
|
||||
*/
|
||||
_num_disarmed_set = 0;
|
||||
|
||||
for (unsigned i = 0; i < FMU_MAX_ACTUATORS; i++) {
|
||||
if (_mixing_output.disarmedValue(i) > 0) {
|
||||
_num_disarmed_set++;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PWM_SERVO_GET_DISARMED_PWM: {
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ actuator_output:
|
||||
- generator: pwm
|
||||
param_prefix: '${PWM_MAIN_OR_AUX}'
|
||||
channel_labels: ['${PWM_MAIN_OR_AUX}', 'PWM Capture']
|
||||
standard_params:
|
||||
standard_params:
|
||||
disarmed: { min: 800, max: 2200, default: 900 }
|
||||
min: { min: 800, max: 1400, default: 1000 }
|
||||
max: { min: 1600, max: 2200, default: 2000 }
|
||||
@@ -30,4 +30,3 @@ actuator_output:
|
||||
200: PWM200
|
||||
400: PWM400
|
||||
reboot_required: true
|
||||
|
||||
|
||||
@@ -5,4 +5,3 @@ actuator_output:
|
||||
- param_prefix: ${PWM_MAIN_OR_HIL}
|
||||
channel_label: ${PWM_MAIN_OR_HIL}
|
||||
num_channels: 16
|
||||
|
||||
|
||||
@@ -26,4 +26,3 @@ actuator_output:
|
||||
200: PWM200
|
||||
400: PWM400
|
||||
reboot_required: true
|
||||
|
||||
|
||||
+7
-282
@@ -178,7 +178,6 @@ private:
|
||||
|
||||
static int checkcrc(int argc, char *argv[]);
|
||||
static int bind(int argc, char *argv[]);
|
||||
static int lockdown(int argc, char *argv[]);
|
||||
static int monitor();
|
||||
|
||||
static constexpr int PX4IO_MAX_ACTUATORS = 8;
|
||||
@@ -239,12 +238,6 @@ private:
|
||||
|
||||
MixingOutput _mixing_output{"PWM_MAIN", PX4IO_MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, true};
|
||||
|
||||
bool _pwm_min_configured{false};
|
||||
bool _pwm_max_configured{false};
|
||||
bool _pwm_fail_configured{false};
|
||||
bool _pwm_dis_configured{false};
|
||||
bool _pwm_rev_configured{false};
|
||||
|
||||
/**
|
||||
* Update IO's arming-related state
|
||||
*/
|
||||
@@ -366,11 +359,6 @@ PX4IO::PX4IO(device::Device *interface) :
|
||||
OutputModuleInterface(MODULE_NAME, px4::serial_port_to_wq(PX4IO_SERIAL_DEVICE)),
|
||||
_interface(interface)
|
||||
{
|
||||
if (!_mixing_output.useDynamicMixing()) {
|
||||
_mixing_output.setAllMinValues(PWM_DEFAULT_MIN);
|
||||
_mixing_output.setAllMaxValues(PWM_DEFAULT_MAX);
|
||||
}
|
||||
|
||||
_mixing_output.setLowrateSchedulingInterval(20_ms);
|
||||
}
|
||||
|
||||
@@ -708,7 +696,7 @@ void PX4IO::Run()
|
||||
}
|
||||
}
|
||||
|
||||
_mixing_output.updateSubscriptions(false, true);
|
||||
_mixing_output.updateSubscriptions(true, true);
|
||||
|
||||
perf_end(_cycle_perf);
|
||||
}
|
||||
@@ -757,11 +745,14 @@ void PX4IO::updateTimerRateGroups()
|
||||
|
||||
void PX4IO::update_params()
|
||||
{
|
||||
if (!_mixing_output.armed().armed) {
|
||||
updateFailsafe();
|
||||
updateDisarmed();
|
||||
}
|
||||
|
||||
if (!_mixing_output.armed().armed && _mixing_output.useDynamicMixing()) {
|
||||
// sync params to IO
|
||||
updateTimerRateGroups();
|
||||
updateFailsafe();
|
||||
updateDisarmed();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -770,17 +761,11 @@ void PX4IO::update_params()
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t pwm_min_default = PWM_DEFAULT_MIN;
|
||||
int32_t pwm_max_default = PWM_DEFAULT_MAX;
|
||||
int32_t pwm_disarmed_default = 0;
|
||||
int32_t pwm_rate_default = 50;
|
||||
int32_t pwm_default_channels = 0;
|
||||
|
||||
const char *prefix = "PWM_MAIN";
|
||||
|
||||
param_get(param_find("PWM_MAIN_MIN"), &pwm_min_default);
|
||||
param_get(param_find("PWM_MAIN_MAX"), &pwm_max_default);
|
||||
param_get(param_find("PWM_MAIN_DISARM"), &pwm_disarmed_default);
|
||||
param_get(param_find("PWM_MAIN_RATE"), &pwm_rate_default);
|
||||
param_get(param_find("PWM_MAIN_OUT"), &pwm_default_channels);
|
||||
|
||||
@@ -794,125 +779,6 @@ void PX4IO::update_params()
|
||||
|
||||
char str[17];
|
||||
|
||||
// PWM_MAIN_MINx
|
||||
if (!_pwm_min_configured) {
|
||||
for (unsigned i = 0; i < _max_actuators; i++) {
|
||||
sprintf(str, "%s_MIN%u", prefix, i + 1);
|
||||
int32_t pwm_min = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_min) == PX4_OK) {
|
||||
if (pwm_min >= 0 && pwm_min != 1000) {
|
||||
_mixing_output.minValue(i) = math::constrain(pwm_min, static_cast<int32_t>(PWM_LOWEST_MIN),
|
||||
static_cast<int32_t>(PWM_HIGHEST_MIN));
|
||||
|
||||
if (pwm_min != _mixing_output.minValue(i)) {
|
||||
int32_t pwm_min_new = _mixing_output.minValue(i);
|
||||
param_set(param_find(str), &pwm_min_new);
|
||||
}
|
||||
|
||||
} else if (pwm_default_channel_mask & 1 << i) {
|
||||
_mixing_output.minValue(i) = pwm_min_default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_pwm_min_configured = true;
|
||||
}
|
||||
|
||||
// PWM_MAIN_MAXx
|
||||
if (!_pwm_max_configured) {
|
||||
for (unsigned i = 0; i < _max_actuators; i++) {
|
||||
sprintf(str, "%s_MAX%u", prefix, i + 1);
|
||||
int32_t pwm_max = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_max) == PX4_OK) {
|
||||
if (pwm_max >= 0 && pwm_max != 2000) {
|
||||
_mixing_output.maxValue(i) = math::constrain(pwm_max, static_cast<int32_t>(PWM_LOWEST_MAX),
|
||||
static_cast<int32_t>(PWM_HIGHEST_MAX));
|
||||
|
||||
if (pwm_max != _mixing_output.maxValue(i)) {
|
||||
int32_t pwm_max_new = _mixing_output.maxValue(i);
|
||||
param_set(param_find(str), &pwm_max_new);
|
||||
}
|
||||
|
||||
} else if (pwm_default_channel_mask & 1 << i) {
|
||||
_mixing_output.maxValue(i) = pwm_max_default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_pwm_max_configured = true;
|
||||
}
|
||||
|
||||
// PWM_MAIN_FAILx
|
||||
if (!_pwm_fail_configured) {
|
||||
for (unsigned i = 0; i < _max_actuators; i++) {
|
||||
sprintf(str, "%s_FAIL%u", prefix, i + 1);
|
||||
int32_t pwm_fail = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_fail) == PX4_OK) {
|
||||
if (pwm_fail >= 0) {
|
||||
_mixing_output.failsafeValue(i) = math::constrain(pwm_fail, static_cast<int32_t>(0),
|
||||
static_cast<int32_t>(PWM_HIGHEST_MAX));
|
||||
|
||||
if (pwm_fail != _mixing_output.failsafeValue(i)) {
|
||||
int32_t pwm_fail_new = _mixing_output.failsafeValue(i);
|
||||
param_set(param_find(str), &pwm_fail_new);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_pwm_fail_configured = true;
|
||||
updateFailsafe();
|
||||
}
|
||||
|
||||
// PWM_MAIN_DISx
|
||||
if (!_pwm_dis_configured) {
|
||||
for (unsigned i = 0; i < _max_actuators; i++) {
|
||||
sprintf(str, "%s_DIS%u", prefix, i + 1);
|
||||
int32_t pwm_dis = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_dis) == PX4_OK) {
|
||||
if (pwm_dis >= 0 && pwm_dis != 900) {
|
||||
_mixing_output.disarmedValue(i) = math::constrain(pwm_dis, static_cast<int32_t>(0),
|
||||
static_cast<int32_t>(PWM_HIGHEST_MAX));
|
||||
|
||||
if (pwm_dis != _mixing_output.disarmedValue(i)) {
|
||||
int32_t pwm_dis_new = _mixing_output.disarmedValue(i);
|
||||
param_set(param_find(str), &pwm_dis_new);
|
||||
}
|
||||
|
||||
} else if (pwm_default_channel_mask & 1 << i) {
|
||||
_mixing_output.disarmedValue(i) = pwm_disarmed_default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_pwm_dis_configured = true;
|
||||
updateDisarmed();
|
||||
}
|
||||
|
||||
// PWM_MAIN_REVx
|
||||
if (!_pwm_rev_configured) {
|
||||
uint16_t &reverse_pwm_mask = _mixing_output.reverseOutputMask();
|
||||
reverse_pwm_mask = 0;
|
||||
|
||||
for (unsigned i = 0; i < _max_actuators; i++) {
|
||||
sprintf(str, "%s_REV%u", prefix, i + 1);
|
||||
int32_t pwm_rev = -1;
|
||||
|
||||
if (param_get(param_find(str), &pwm_rev) == PX4_OK) {
|
||||
if (pwm_rev >= 1) {
|
||||
reverse_pwm_mask |= (1 << i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
_pwm_rev_configured = true;
|
||||
}
|
||||
|
||||
// PWM_MAIN_TRIMx
|
||||
if (_mixing_output.mixers()) {
|
||||
int16_t values[8] {};
|
||||
@@ -1508,7 +1374,7 @@ int PX4IO::print_status()
|
||||
uORB::SubscriptionData<px4io_status_s> status_sub{ORB_ID(px4io_status)};
|
||||
status_sub.update();
|
||||
|
||||
print_message(status_sub.get());
|
||||
print_message(ORB_ID(px4io_status), status_sub.get());
|
||||
|
||||
/* now clear alarms */
|
||||
io_reg_set(PX4IO_PAGE_STATUS, PX4IO_P_STATUS_ALARMS, 0x0000);
|
||||
@@ -1648,27 +1514,6 @@ int PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
||||
*(unsigned *)arg = io_reg_get(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_PWM_RATES);
|
||||
break;
|
||||
|
||||
case PWM_SERVO_SET_FAILSAFE_PWM: {
|
||||
PX4_DEBUG("PWM_SERVO_SET_FAILSAFE_PWM");
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
if (pwm->channel_count > _max_actuators)
|
||||
/* fail with error */
|
||||
{
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < pwm->channel_count; i++) {
|
||||
if (pwm->values[i] != 0 && !_mixing_output.useDynamicMixing()) {
|
||||
_mixing_output.failsafeValue(i) = math::constrain(pwm->values[i], (uint16_t)PWM_LOWEST_MIN, (uint16_t)PWM_HIGHEST_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
updateFailsafe();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PWM_SERVO_GET_FAILSAFE_PWM: {
|
||||
PX4_DEBUG("PWM_SERVO_GET_FAILSAFE_PWM");
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
@@ -1683,26 +1528,6 @@ int PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
||||
break;
|
||||
}
|
||||
|
||||
case PWM_SERVO_SET_DISARMED_PWM: {
|
||||
PX4_DEBUG("PWM_SERVO_SET_DISARMED_PWM");
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
if (pwm->channel_count > _max_actuators) {
|
||||
/* fail with error */
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < pwm->channel_count; i++) {
|
||||
if (pwm->values[i] != 0 && !_mixing_output.useDynamicMixing()) {
|
||||
_mixing_output.disarmedValue(i) = math::constrain(pwm->values[i], (uint16_t)PWM_LOWEST_MIN, (uint16_t)PWM_HIGHEST_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
updateDisarmed();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PWM_SERVO_GET_DISARMED_PWM: {
|
||||
PX4_DEBUG("PWM_SERVO_GET_DISARMED_PWM");
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
@@ -1794,16 +1619,6 @@ int PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
||||
*(unsigned *)arg = _max_actuators;
|
||||
break;
|
||||
|
||||
case PWM_SERVO_SET_DISABLE_LOCKDOWN:
|
||||
PX4_DEBUG("PWM_SERVO_SET_DISABLE_LOCKDOWN");
|
||||
_lockdown_override = arg;
|
||||
break;
|
||||
|
||||
case PWM_SERVO_GET_DISABLE_LOCKDOWN:
|
||||
PX4_DEBUG("PWM_SERVO_GET_DISABLE_LOCKDOWN");
|
||||
*(unsigned *)arg = _lockdown_override;
|
||||
break;
|
||||
|
||||
case PWM_SERVO_SET_FORCE_SAFETY_OFF:
|
||||
PX4_DEBUG("PWM_SERVO_SET_FORCE_SAFETY_OFF");
|
||||
/* force safety swith off */
|
||||
@@ -1816,36 +1631,6 @@ int PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
||||
ret = io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_FORCE_SAFETY_ON, PX4IO_FORCE_SAFETY_MAGIC);
|
||||
break;
|
||||
|
||||
case PWM_SERVO_SET_FORCE_FAILSAFE:
|
||||
PX4_DEBUG("PWM_SERVO_SET_FORCE_FAILSAFE");
|
||||
|
||||
/* force failsafe mode instantly */
|
||||
if (arg == 0) {
|
||||
/* clear force failsafe flag */
|
||||
ret = io_reg_modify(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING, PX4IO_P_SETUP_ARMING_FORCE_FAILSAFE, 0);
|
||||
|
||||
} else {
|
||||
/* set force failsafe flag */
|
||||
ret = io_reg_modify(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING, 0, PX4IO_P_SETUP_ARMING_FORCE_FAILSAFE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PWM_SERVO_SET_TERMINATION_FAILSAFE:
|
||||
PX4_DEBUG("PWM_SERVO_SET_TERMINATION_FAILSAFE");
|
||||
|
||||
/* if failsafe occurs, do not allow the system to recover */
|
||||
if (arg == 0) {
|
||||
/* clear termination failsafe flag */
|
||||
ret = io_reg_modify(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING, PX4IO_P_SETUP_ARMING_TERMINATION_FAILSAFE, 0);
|
||||
|
||||
} else {
|
||||
/* set termination failsafe flag */
|
||||
ret = io_reg_modify(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING, 0, PX4IO_P_SETUP_ARMING_TERMINATION_FAILSAFE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DSM_BIND_START:
|
||||
/* bind a DSM receiver */
|
||||
ret = dsm_bind_ioctl(arg);
|
||||
@@ -2211,60 +1996,6 @@ int PX4IO::monitor()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PX4IO::lockdown(int argc, char *argv[])
|
||||
{
|
||||
if (argc > 1 && !strcmp(argv[1], "disable")) {
|
||||
|
||||
PX4_WARN("WARNING: ACTUATORS WILL BE LIVE IN HIL! PROCEED?");
|
||||
PX4_WARN("Press 'y' to enable, any other key to abort.");
|
||||
|
||||
/* check if user wants to abort */
|
||||
char c;
|
||||
|
||||
struct pollfd fds;
|
||||
int ret;
|
||||
hrt_abstime start = hrt_absolute_time();
|
||||
const unsigned long timeout = 5000000;
|
||||
|
||||
while (hrt_elapsed_time(&start) < timeout) {
|
||||
fds.fd = 0; /* stdin */
|
||||
fds.events = POLLIN;
|
||||
ret = ::poll(&fds, 1, 0);
|
||||
|
||||
if (ret > 0) {
|
||||
|
||||
if (::read(0, &c, 1) > 0) {
|
||||
|
||||
if (c != 'y') {
|
||||
return 0;
|
||||
|
||||
} else if (c == 'y') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
px4_usleep(10000);
|
||||
}
|
||||
|
||||
if (hrt_elapsed_time(&start) > timeout) {
|
||||
PX4_ERR("TIMEOUT! ABORTED WITHOUT CHANGES.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
get_instance()->ioctl(0, PWM_SERVO_SET_DISABLE_LOCKDOWN, 1);
|
||||
|
||||
PX4_WARN("ACTUATORS ARE NOW LIVE IN HIL!");
|
||||
|
||||
} else {
|
||||
get_instance()->ioctl(0, PWM_SERVO_SET_DISABLE_LOCKDOWN, 0);
|
||||
PX4_WARN("ACTUATORS ARE NOW SAFE IN HIL.");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int PX4IO::task_spawn(int argc, char *argv[])
|
||||
{
|
||||
device::Device *interface = get_interface();
|
||||
@@ -2468,10 +2199,6 @@ int PX4IO::custom_command(int argc, char *argv[])
|
||||
return bind(argc - 1, argv + 1);
|
||||
}
|
||||
|
||||
if (!strcmp(verb, "lockdown")) {
|
||||
return lockdown(argc, argv);
|
||||
}
|
||||
|
||||
if (!strcmp(verb, "sbus1_out")) {
|
||||
int ret = get_instance()->ioctl(nullptr, SBUS_SET_PROTO_VERSION, 1);
|
||||
|
||||
@@ -2534,8 +2261,6 @@ Output driver communicating with the IO co-processor.
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("monitor", "continuously monitor status");
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("bind", "DSM bind");
|
||||
PRINT_MODULE_USAGE_ARG("dsm2|dsmx|dsmx8", "protocol", false);
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("lockdown", "enable (or disable) lockdown");
|
||||
PRINT_MODULE_USAGE_ARG("disable", "disable lockdown", true);
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("sbus1_out", "enable sbus1 out");
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("sbus2_out", "enable sbus2 out");
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("test_fmu_fail", "test: turn off IO updates");
|
||||
|
||||
@@ -861,7 +861,7 @@ int RCInput::print_status()
|
||||
perf_print_counter(_publish_interval_perf);
|
||||
|
||||
if (hrt_elapsed_time(&_rc_in.timestamp) < 1_s) {
|
||||
print_message(_rc_in);
|
||||
print_message(ORB_ID(input_rc), _rc_in);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -72,7 +72,7 @@ int rpm_simulator_main(int argc, char *argv[])
|
||||
|
||||
// Publish data and let the user know what was published
|
||||
rpm_pub.publish(rpm);
|
||||
print_message(rpm);
|
||||
print_message(ORB_ID(rpm), rpm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -50,4 +50,3 @@ px4_add_module(
|
||||
output_limit
|
||||
tunes
|
||||
)
|
||||
|
||||
|
||||
@@ -4,4 +4,3 @@ actuator_output:
|
||||
- param_prefix: TAP_ESC
|
||||
channel_label: 'TAP ESC'
|
||||
num_channels: 8
|
||||
|
||||
|
||||
@@ -17,4 +17,3 @@ actuator_output:
|
||||
max: { min: 0, max: 1000, default: 1000 }
|
||||
failsafe: { min: 0, max: 1000 }
|
||||
num_channels: 8
|
||||
|
||||
|
||||
@@ -56,28 +56,89 @@
|
||||
*/
|
||||
void IUavcanSensorBridge::make_all(uavcan::INode &node, List<IUavcanSensorBridge *> &list)
|
||||
{
|
||||
list.add(new UavcanBarometerBridge(node));
|
||||
list.add(new UavcanMagnetometerBridge(node));
|
||||
list.add(new UavcanGnssBridge(node));
|
||||
list.add(new UavcanFlowBridge(node));
|
||||
// airspeed
|
||||
int32_t uavcan_sub_aspd = 1;
|
||||
param_get(param_find("UAVCAN_SUB_ASPD"), &uavcan_sub_aspd);
|
||||
|
||||
int32_t bat_monitor;
|
||||
param_t _param_bat_monitor = param_find("UAVCAN_BAT_MON");
|
||||
param_get(_param_bat_monitor, &bat_monitor);
|
||||
if (uavcan_sub_aspd != 0) {
|
||||
list.add(new UavcanAirspeedBridge(node));
|
||||
}
|
||||
|
||||
if (bat_monitor == 0) {
|
||||
// baro
|
||||
int32_t uavcan_sub_baro = 1;
|
||||
param_get(param_find("UAVCAN_SUB_BARO"), &uavcan_sub_baro);
|
||||
|
||||
if (uavcan_sub_baro != 0) {
|
||||
list.add(new UavcanBarometerBridge(node));
|
||||
}
|
||||
|
||||
// battery
|
||||
int32_t uavcan_sub_bat = 1;
|
||||
param_get(param_find("UAVCAN_SUB_BAT"), &uavcan_sub_bat);
|
||||
|
||||
if (uavcan_sub_bat == 1) {
|
||||
list.add(new UavcanBatteryBridge(node));
|
||||
|
||||
} else if (bat_monitor == 1) {
|
||||
} else if (uavcan_sub_bat == 2) {
|
||||
list.add(new UavcanCBATBridge(node));
|
||||
}
|
||||
|
||||
list.add(new UavcanAirspeedBridge(node));
|
||||
list.add(new UavcanDifferentialPressureBridge(node));
|
||||
list.add(new UavcanRangefinderBridge(node));
|
||||
list.add(new UavcanAccelBridge(node));
|
||||
list.add(new UavcanGyroBridge(node));
|
||||
list.add(new UavcanIceStatusBridge(node));
|
||||
// differential pressure
|
||||
int32_t uavcan_sub_dpres = 1;
|
||||
param_get(param_find("UAVCAN_SUB_DPRES"), &uavcan_sub_dpres);
|
||||
|
||||
if (uavcan_sub_dpres != 0) {
|
||||
list.add(new UavcanDifferentialPressureBridge(node));
|
||||
}
|
||||
|
||||
// flow
|
||||
int32_t uavcan_sub_flow = 1;
|
||||
param_get(param_find("UAVCAN_SUB_FLOW"), &uavcan_sub_flow);
|
||||
|
||||
if (uavcan_sub_flow != 0) {
|
||||
list.add(new UavcanFlowBridge(node));
|
||||
}
|
||||
|
||||
// GPS
|
||||
int32_t uavcan_sub_gps = 1;
|
||||
param_get(param_find("UAVCAN_SUB_GPS"), &uavcan_sub_gps);
|
||||
|
||||
if (uavcan_sub_gps != 0) {
|
||||
list.add(new UavcanGnssBridge(node));
|
||||
}
|
||||
|
||||
// ice (internal combustion engine)
|
||||
int32_t uavcan_sub_ice = 1;
|
||||
param_get(param_find("UAVCAN_SUB_ICE"), &uavcan_sub_ice);
|
||||
|
||||
if (uavcan_sub_ice != 0) {
|
||||
list.add(new UavcanIceStatusBridge(node));
|
||||
}
|
||||
|
||||
// IMU
|
||||
int32_t uavcan_sub_imu = 1;
|
||||
param_get(param_find("UAVCAN_SUB_IMU"), &uavcan_sub_imu);
|
||||
|
||||
if (uavcan_sub_imu != 0) {
|
||||
list.add(new UavcanAccelBridge(node));
|
||||
list.add(new UavcanGyroBridge(node));
|
||||
}
|
||||
|
||||
// magnetometer
|
||||
int32_t uavcan_sub_mag = 1;
|
||||
param_get(param_find("UAVCAN_SUB_MAG"), &uavcan_sub_mag);
|
||||
|
||||
if (uavcan_sub_mag != 0) {
|
||||
list.add(new UavcanMagnetometerBridge(node));
|
||||
}
|
||||
|
||||
// range finder
|
||||
int32_t uavcan_sub_rng = 1;
|
||||
param_get(param_find("UAVCAN_SUB_RNG"), &uavcan_sub_rng);
|
||||
|
||||
if (uavcan_sub_rng != 0) {
|
||||
list.add(new UavcanRangefinderBridge(node));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2014, 2015 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2014-2021 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
|
||||
|
||||
@@ -676,17 +676,6 @@ UavcanNode::init(uavcan::NodeID node_id, UAVCAN_DRIVER::BusEvent &bus_events)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
_mixing_interface_esc.mixingOutput().setAllDisarmedValues(UavcanEscController::DISARMED_OUTPUT_VALUE);
|
||||
|
||||
if (!_mixing_interface_esc.mixingOutput().useDynamicMixing()) {
|
||||
// these are configurable with dynamic mixing
|
||||
_mixing_interface_esc.mixingOutput().setAllMinValues(0); // Can be changed to 1 later, according to UAVCAN_ESC_IDLT
|
||||
_mixing_interface_esc.mixingOutput().setAllMaxValues(UavcanEscController::max_output_value());
|
||||
|
||||
param_get(param_find("UAVCAN_ESC_IDLT"), &_idle_throttle_when_armed_param);
|
||||
enable_idle_throttle_when_armed(true);
|
||||
}
|
||||
|
||||
/* Start the Node */
|
||||
return _node.start();
|
||||
}
|
||||
@@ -791,10 +780,6 @@ UavcanNode::Run()
|
||||
|
||||
node_spin_once(); // expected to be non-blocking
|
||||
|
||||
// Check arming state
|
||||
const actuator_armed_s &armed = _mixing_interface_esc.mixingOutput().armed();
|
||||
enable_idle_throttle_when_armed(!armed.soft_stop);
|
||||
|
||||
// check for parameter updates
|
||||
if (_parameter_update_sub.updated()) {
|
||||
// clear update
|
||||
@@ -838,19 +823,6 @@ UavcanNode::Run()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
UavcanNode::enable_idle_throttle_when_armed(bool value)
|
||||
{
|
||||
value &= _idle_throttle_when_armed_param > 0;
|
||||
|
||||
if (!_mixing_interface_esc.mixingOutput().useDynamicMixing()) {
|
||||
if (value != _idle_throttle_when_armed) {
|
||||
_mixing_interface_esc.mixingOutput().setAllMinValues(value ? 1 : 0);
|
||||
_idle_throttle_when_armed = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
UavcanNode::teardown()
|
||||
{
|
||||
|
||||
@@ -216,8 +216,6 @@ private:
|
||||
void set_setget_response(uavcan::protocol::param::GetSet::Response *resp) { _setget_response = resp; }
|
||||
void free_setget_response(void) { _setget_response = nullptr; }
|
||||
|
||||
void enable_idle_throttle_when_armed(bool value);
|
||||
|
||||
px4::atomic_bool _task_should_exit{false}; ///< flag to indicate to tear down the CAN driver
|
||||
px4::atomic<int> _fw_server_action{None};
|
||||
int _fw_server_status{-1};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2014-2017 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2014-2021 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
|
||||
@@ -77,15 +77,6 @@ PARAM_DEFINE_INT32(UAVCAN_NODE_ID, 1);
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_BITRATE, 1000000);
|
||||
|
||||
/**
|
||||
* UAVCAN ESC will spin at idle throttle when armed, even if the mixer outputs zero setpoints.
|
||||
*
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_ESC_IDLT, 1);
|
||||
|
||||
/**
|
||||
* UAVCAN rangefinder minimum range
|
||||
*
|
||||
@@ -195,18 +186,131 @@ PARAM_DEFINE_INT32(UAVCAN_LGT_NAV, 3);
|
||||
PARAM_DEFINE_INT32(UAVCAN_LGT_LAND, 0);
|
||||
|
||||
/**
|
||||
* UAVCAN BATTERY_MONITOR battery monitor selection
|
||||
* subscription airspeed
|
||||
*
|
||||
* This parameter defines that the system will select the battery monitor under the following conditions
|
||||
* Enable UAVCAN airspeed subscriptions.
|
||||
* uavcan::equipment::air_data::IndicatedAirspeed
|
||||
* uavcan::equipment::air_data::TrueAirspeed
|
||||
* uavcan::equipment::air_data::StaticTemperature
|
||||
*
|
||||
* 0 - default battery monitor
|
||||
* 1 - CUAV battery monitor
|
||||
*
|
||||
* @min 0
|
||||
* @max 1
|
||||
* @value 0 default battery monitor
|
||||
* @value 1 CUAV battery monitor
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_BAT_MON, 0);
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_ASPD, 0);
|
||||
|
||||
/**
|
||||
* subscription barometer
|
||||
*
|
||||
* Enable UAVCAN barometer subscription.
|
||||
* uavcan::equipment::air_data::StaticPressure
|
||||
* uavcan::equipment::air_data::StaticTemperature
|
||||
*
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_BARO, 0);
|
||||
|
||||
/**
|
||||
* subscription battery
|
||||
*
|
||||
* Enable UAVCAN battery subscription.
|
||||
* 1) uavcan::equipment::power::BatteryInfo
|
||||
* 2) cuav::equipment::power::CBAT
|
||||
*
|
||||
* @min 0
|
||||
* @max 2
|
||||
* @value 0 disabled
|
||||
* @value 1 default
|
||||
* @value 2 CUAV battery monitor
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_BAT, 0);
|
||||
|
||||
/**
|
||||
* subscription differential pressure
|
||||
*
|
||||
* Enable UAVCAN differential pressure subscription.
|
||||
* uavcan::equipment::air_data::RawAirData
|
||||
*
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_DPRES, 0);
|
||||
|
||||
/**
|
||||
* subscription flow
|
||||
*
|
||||
* Enable UAVCAN optical flow subscription.
|
||||
*
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_FLOW, 0);
|
||||
|
||||
/**
|
||||
* subscription GPS
|
||||
*
|
||||
* Enable UAVCAN GPS subscriptions.
|
||||
* uavcan::equipment::gnss::Fix
|
||||
* uavcan::equipment::gnss::Fix2
|
||||
* uavcan::equipment::gnss::Auxiliary
|
||||
*
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_GPS, 1);
|
||||
|
||||
/**
|
||||
* subscription ICE
|
||||
*
|
||||
* Enable UAVCAN internal combusion engine (ICE) subscription.
|
||||
* uavcan::equipment::ice::reciprocating::Status
|
||||
*
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_ICE, 0);
|
||||
|
||||
/**
|
||||
* subscription IMU
|
||||
*
|
||||
* Enable UAVCAN IMU subscription.
|
||||
* uavcan::equipment::ahrs::RawIMU
|
||||
*
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_IMU, 0);
|
||||
|
||||
/**
|
||||
* subscription magnetometer
|
||||
*
|
||||
* Enable UAVCAN GPS subscription.
|
||||
* uavcan::equipment::ahrs::MagneticFieldStrength
|
||||
* uavcan::equipment::ahrs::MagneticFieldStrength2
|
||||
*
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_MAG, 1);
|
||||
|
||||
/**
|
||||
* subscription range finder
|
||||
*
|
||||
* Enable UAVCAN GPS subscription.
|
||||
* uavcan::equipment::range_sensor::Measurement
|
||||
*
|
||||
* @boolean
|
||||
* @reboot_required true
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(UAVCAN_SUB_RNG, 0);
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
|
||||
|
||||
_battery_status_pub.publish(bat_status);
|
||||
print_message(bat_status);
|
||||
print_message(ORB_ID(battery_status), bat_status);
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
@@ -89,6 +89,3 @@ add_custom_command(OUTPUT ${component_general_json} ${component_general_json}.xz
|
||||
COMMENT "Generating component_general.json and checksums.h"
|
||||
)
|
||||
add_custom_target(component_general_json DEPENDS ${component_general_json})
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -110,4 +110,3 @@ add_custom_command(OUTPUT ${generated_events_header}
|
||||
)
|
||||
add_custom_target(events_header DEPENDS ${generated_events_header})
|
||||
add_dependencies(prebuild_targets events_header)
|
||||
|
||||
|
||||
@@ -240,4 +240,3 @@ private:
|
||||
uORB::Subscription _topic{ORB_ID(actuator_controls_2)};
|
||||
float _data[3] { NAN, NAN, NAN };
|
||||
};
|
||||
|
||||
|
||||
@@ -72,4 +72,3 @@ enum class OutputFunction : int32_t {{
|
||||
{2}
|
||||
}};
|
||||
'''.format(os.path.basename(__file__), yaml_file, function_defs))
|
||||
|
||||
|
||||
@@ -104,15 +104,13 @@ _param_prefix(param_prefix)
|
||||
|
||||
_use_dynamic_mixing = _param_sys_ctrl_alloc.get();
|
||||
|
||||
if (_use_dynamic_mixing) {
|
||||
initParamHandles();
|
||||
initParamHandles();
|
||||
|
||||
for (unsigned i = 0; i < MAX_ACTUATORS; i++) {
|
||||
_failsafe_value[i] = UINT16_MAX;
|
||||
}
|
||||
|
||||
updateParams();
|
||||
for (unsigned i = 0; i < MAX_ACTUATORS; i++) {
|
||||
_failsafe_value[i] = UINT16_MAX;
|
||||
}
|
||||
|
||||
updateParams();
|
||||
}
|
||||
|
||||
MixingOutput::~MixingOutput()
|
||||
@@ -129,8 +127,6 @@ void MixingOutput::initParamHandles()
|
||||
char param_name[17];
|
||||
|
||||
for (unsigned i = 0; i < _max_num_outputs; ++i) {
|
||||
snprintf(param_name, sizeof(param_name), "%s_%s%d", _param_prefix, "FUNC", i + 1);
|
||||
_param_handles[i].function = param_find(param_name);
|
||||
snprintf(param_name, sizeof(param_name), "%s_%s%d", _param_prefix, "DIS", i + 1);
|
||||
_param_handles[i].disarmed = param_find(param_name);
|
||||
snprintf(param_name, sizeof(param_name), "%s_%s%d", _param_prefix, "MIN", i + 1);
|
||||
@@ -140,6 +136,13 @@ void MixingOutput::initParamHandles()
|
||||
snprintf(param_name, sizeof(param_name), "%s_%s%d", _param_prefix, "FAIL", i + 1);
|
||||
_param_handles[i].failsafe = param_find(param_name);
|
||||
}
|
||||
|
||||
if (_use_dynamic_mixing) {
|
||||
for (unsigned i = 0; i < _max_num_outputs; ++i) {
|
||||
snprintf(param_name, sizeof(param_name), "%s_%s%d", _param_prefix, "FUNC", i + 1);
|
||||
_param_handles[i].function = param_find(param_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MixingOutput::printStatus() const
|
||||
@@ -190,13 +193,40 @@ void MixingOutput::updateParams()
|
||||
_mixers->set_airmode((Mixer::Airmode)_param_mc_airmode.get());
|
||||
}
|
||||
|
||||
_reverse_output_mask = 0;
|
||||
|
||||
for (unsigned i = 0; i < _max_num_outputs; i++) {
|
||||
int32_t val;
|
||||
|
||||
if (_param_handles[i].disarmed != PARAM_INVALID && param_get(_param_handles[i].disarmed, &val) == 0) {
|
||||
_disarmed_value[i] = val;
|
||||
}
|
||||
|
||||
if (_param_handles[i].min != PARAM_INVALID && param_get(_param_handles[i].min, &val) == 0) {
|
||||
_min_value[i] = val;
|
||||
}
|
||||
|
||||
if (_param_handles[i].max != PARAM_INVALID && param_get(_param_handles[i].max, &val) == 0) {
|
||||
_max_value[i] = val;
|
||||
}
|
||||
|
||||
if (_min_value[i] > _max_value[i]) {
|
||||
_reverse_output_mask |= 1 << i;
|
||||
uint16_t tmp = _min_value[i];
|
||||
_min_value[i] = _max_value[i];
|
||||
_max_value[i] = tmp;
|
||||
}
|
||||
|
||||
if (_param_handles[i].failsafe != PARAM_INVALID && param_get(_param_handles[i].failsafe, &val) == 0) {
|
||||
_failsafe_value[i] = val;
|
||||
}
|
||||
}
|
||||
|
||||
if (_use_dynamic_mixing) {
|
||||
_param_mot_ordering.set(0); // not used with dynamic mixing
|
||||
|
||||
bool function_changed = false;
|
||||
|
||||
_reverse_output_mask = 0;
|
||||
|
||||
for (unsigned i = 0; i < _max_num_outputs; i++) {
|
||||
int32_t val;
|
||||
|
||||
@@ -207,29 +237,6 @@ void MixingOutput::updateParams()
|
||||
|
||||
// we set _function_assignment[i] later to ensure _functions[i] is updated at the same time
|
||||
}
|
||||
|
||||
if (_param_handles[i].disarmed != PARAM_INVALID && param_get(_param_handles[i].disarmed, &val) == 0) {
|
||||
_disarmed_value[i] = val;
|
||||
}
|
||||
|
||||
if (_param_handles[i].min != PARAM_INVALID && param_get(_param_handles[i].min, &val) == 0) {
|
||||
_min_value[i] = val;
|
||||
}
|
||||
|
||||
if (_param_handles[i].max != PARAM_INVALID && param_get(_param_handles[i].max, &val) == 0) {
|
||||
_max_value[i] = val;
|
||||
}
|
||||
|
||||
if (_min_value[i] > _max_value[i]) {
|
||||
_reverse_output_mask |= 1 << i;
|
||||
uint16_t tmp = _min_value[i];
|
||||
_min_value[i] = _max_value[i];
|
||||
_max_value[i] = tmp;
|
||||
}
|
||||
|
||||
if (_param_handles[i].failsafe != PARAM_INVALID && param_get(_param_handles[i].failsafe, &val) == 0) {
|
||||
_failsafe_value[i] = val;
|
||||
}
|
||||
}
|
||||
|
||||
if (function_changed) {
|
||||
@@ -1067,6 +1074,11 @@ void MixingOutput::handleCommands()
|
||||
|
||||
void MixingOutput::resetMixerThreadSafe()
|
||||
{
|
||||
if (_use_dynamic_mixing) {
|
||||
PX4_ERR("mixer reset unavailable, not using static mixers");
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Command::Type)_command.command.load() != Command::Type::None) {
|
||||
// Cannot happen, because we expect only one other thread to call this.
|
||||
// But as a safety precaution we return here.
|
||||
@@ -1091,6 +1103,11 @@ void MixingOutput::resetMixerThreadSafe()
|
||||
|
||||
int MixingOutput::loadMixerThreadSafe(const char *buf, unsigned len)
|
||||
{
|
||||
if (_use_dynamic_mixing) {
|
||||
PX4_ERR("mixer load unavailable, not using static mixers");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((Command::Type)_command.command.load() != Command::Type::None) {
|
||||
// Cannot happen, because we expect only one other thread to call this.
|
||||
// But as a safety precaution we return here.
|
||||
|
||||
@@ -155,29 +155,6 @@ bool param_modify_on_import(bson_node_t node)
|
||||
}
|
||||
}
|
||||
|
||||
// 2021-01-31 (v1.12 alpha): translate PWM_MIN/PWM_MAX/PWM_DISARMED to PWM_MAIN
|
||||
{
|
||||
if (strcmp("PWM_MIN", node->name) == 0) {
|
||||
strcpy(node->name, "PWM_MAIN_MIN");
|
||||
PX4_INFO("copying %s -> %s", "PWM_MIN", "PWM_MAIN_MIN");
|
||||
}
|
||||
|
||||
if (strcmp("PWM_MAX", node->name) == 0) {
|
||||
strcpy(node->name, "PWM_MAIN_MAX");
|
||||
PX4_INFO("copying %s -> %s", "PWM_MAX", "PWM_MAIN_MAX");
|
||||
}
|
||||
|
||||
if (strcmp("PWM_RATE", node->name) == 0) {
|
||||
strcpy(node->name, "PWM_MAIN_RATE");
|
||||
PX4_INFO("copying %s -> %s", "PWM_RATE", "PWM_MAIN_RATE");
|
||||
}
|
||||
|
||||
if (strcmp("PWM_DISARMED", node->name) == 0) {
|
||||
strcpy(node->name, "PWM_MAIN_DISARM");
|
||||
PX4_INFO("copying %s -> %s", "PWM_DISARMED", "PWM_MAIN_DISARM");
|
||||
}
|
||||
}
|
||||
|
||||
// 2021-04-30: translate ASPD_STALL to FW_AIRSPD_STALL
|
||||
{
|
||||
if (strcmp("ASPD_STALL", node->name) == 0) {
|
||||
|
||||
@@ -29,40 +29,6 @@ parameters:
|
||||
max: 2000
|
||||
default: 50
|
||||
|
||||
PWM_AUX_MIN:
|
||||
description:
|
||||
short: PWM aux minimum value
|
||||
long: |
|
||||
Set to 1000 for industry default or 900 to increase servo travel.
|
||||
type: int32
|
||||
unit: us
|
||||
min: 800
|
||||
max: 1400
|
||||
default: 1000
|
||||
|
||||
PWM_AUX_MAX:
|
||||
description:
|
||||
short: PWM aux maximum value
|
||||
long: |
|
||||
Set to 2000 for industry default or 2100 to increase servo travel.
|
||||
type: int32
|
||||
unit: us
|
||||
min: 1600
|
||||
max: 2200
|
||||
default: 2000
|
||||
|
||||
PWM_AUX_DISARM:
|
||||
description:
|
||||
short: PWM aux disarmed value
|
||||
long: |
|
||||
This is the PWM pulse the autopilot is outputting if not armed.
|
||||
The main use of this parameter is to silence ESCs when they are disarmed.
|
||||
type: int32
|
||||
unit: us
|
||||
min: 0
|
||||
max: 2200
|
||||
default: 1500
|
||||
|
||||
PWM_AUX_TRIM${i}:
|
||||
description:
|
||||
short: PWM aux ${i} trim value
|
||||
@@ -75,27 +41,3 @@ parameters:
|
||||
num_instances: *max_num_config_instances
|
||||
instance_start: 1
|
||||
default: 0
|
||||
|
||||
PWM_AUX_REV${i}:
|
||||
description:
|
||||
short: PWM aux ${i} reverse value
|
||||
long: |
|
||||
Enable to invert the channel.
|
||||
Warning: Use this parameter when connected to a servo only.
|
||||
For a brushless motor, invert manually two phases to reverse the direction.
|
||||
type: boolean
|
||||
num_instances: *max_num_config_instances
|
||||
instance_start: 1
|
||||
default: 0
|
||||
|
||||
PWM_AUX_RATE${i}:
|
||||
description:
|
||||
short: PWM aux ${i} rate
|
||||
long: |
|
||||
Set the default PWM output frequency for the aux outputs
|
||||
type: int32
|
||||
unit: Hz
|
||||
min: 0
|
||||
max: 400
|
||||
instance_start: 1
|
||||
default: 50
|
||||
|
||||
@@ -121,27 +121,3 @@ parameters:
|
||||
num_instances: *max_num_config_instances
|
||||
instance_start: 1
|
||||
default: 0
|
||||
|
||||
PWM_EXTRA_REV${i}:
|
||||
description:
|
||||
short: PWM extra ${i} reverse value
|
||||
long: |
|
||||
Enable to invert the channel.
|
||||
Warning: Use this parameter when connected to a servo only.
|
||||
For a brushless motor, invert manually two phases to reverse the direction.
|
||||
type: boolean
|
||||
num_instances: *max_num_config_instances
|
||||
instance_start: 1
|
||||
default: 0
|
||||
|
||||
PWM_EXTRA_RATE${i}:
|
||||
description:
|
||||
short: PWM extra ${i} rate
|
||||
long: |
|
||||
Set the default PWM output frequency for the main outputs
|
||||
type: int32
|
||||
unit: Hz
|
||||
min: 0
|
||||
max: 400
|
||||
instance_start: 1
|
||||
default: 50
|
||||
|
||||
@@ -29,40 +29,6 @@ parameters:
|
||||
max: 2000
|
||||
default: 400
|
||||
|
||||
PWM_MAIN_MIN:
|
||||
description:
|
||||
short: PWM main minimum value
|
||||
long: |
|
||||
Set to 1000 for industry default or 900 to increase servo travel.
|
||||
type: int32
|
||||
unit: us
|
||||
min: 800
|
||||
max: 1400
|
||||
default: 1000
|
||||
|
||||
PWM_MAIN_MAX:
|
||||
description:
|
||||
short: PWM main maximum value
|
||||
long: |
|
||||
Set to 2000 for industry default or 2100 to increase servo travel.
|
||||
type: int32
|
||||
unit: us
|
||||
min: 1600
|
||||
max: 2200
|
||||
default: 2000
|
||||
|
||||
PWM_MAIN_DISARM:
|
||||
description:
|
||||
short: PWM main disarmed value
|
||||
long: |
|
||||
This is the PWM pulse the autopilot is outputting if not armed.
|
||||
The main use of this parameter is to silence ESCs when they are disarmed.
|
||||
type: int32
|
||||
unit: us
|
||||
min: 0
|
||||
max: 2200
|
||||
default: 900
|
||||
|
||||
PWM_MAIN_TRIM${i}:
|
||||
description:
|
||||
short: PWM main ${i} trim value
|
||||
@@ -75,27 +41,3 @@ parameters:
|
||||
num_instances: *max_num_config_instances
|
||||
instance_start: 1
|
||||
default: 0
|
||||
|
||||
PWM_MAIN_REV${i}:
|
||||
description:
|
||||
short: PWM main ${i} reverse value
|
||||
long: |
|
||||
Enable to invert the channel.
|
||||
Warning: Use this parameter when connected to a servo only.
|
||||
For a brushless motor, invert manually two phases to reverse the direction.
|
||||
type: boolean
|
||||
num_instances: *max_num_config_instances
|
||||
instance_start: 1
|
||||
default: 0
|
||||
|
||||
PWM_MAIN_RATE${i}:
|
||||
description:
|
||||
short: PWM main ${i} rate
|
||||
long: |
|
||||
Set the default PWM output frequency for the main outputs
|
||||
type: int32
|
||||
unit: Hz
|
||||
min: 0
|
||||
max: 400
|
||||
instance_start: 1
|
||||
default: 50
|
||||
|
||||
@@ -281,4 +281,3 @@ PARAM_DEFINE_INT32(SYS_FAILURE_EN, 0);
|
||||
* @group System
|
||||
*/
|
||||
PARAM_DEFINE_INT32(SYS_CTRL_ALLOC, 0);
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ int AirshipAttitudeControl::print_status()
|
||||
|
||||
perf_print_counter(_loop_perf);
|
||||
|
||||
print_message(_actuators);
|
||||
print_message(ORB_ID(actuator_controls), _actuators);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2036,13 +2036,6 @@ Commander::run()
|
||||
_status_flags.vtol_transition_failure = _vtol_status.vtol_transition_failsafe;
|
||||
_status_changed = true;
|
||||
}
|
||||
|
||||
const bool should_soft_stop = (_status.vehicle_type != vehicle_status_s::VEHICLE_TYPE_ROTARY_WING);
|
||||
|
||||
if (_armed.soft_stop != should_soft_stop) {
|
||||
_armed.soft_stop = should_soft_stop;
|
||||
_status_changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,5 +19,3 @@ quaterion(3,1) = (cosPhi*sinTheta*cosPsi + sinPhi*cosTheta*sinPsi);
|
||||
quaterion(4,1) = (cosPhi*cosTheta*sinPsi - sinPhi*sinTheta*cosPsi);
|
||||
|
||||
return;
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ q0 = quat(1);
|
||||
q1 = quat(2);
|
||||
q2 = quat(3);
|
||||
q3 = quat(4);
|
||||
|
||||
|
||||
Tbn = [q0^2 + q1^2 - q2^2 - q3^2, 2*(q1*q2 - q0*q3), 2*(q1*q3 + q0*q2); ...
|
||||
2*(q1*q2 + q0*q3), q0^2 - q1^2 + q2^2 - q3^2, 2*(q2*q3 - q0*q1); ...
|
||||
2*(q1*q3-q0*q2), 2*(q2*q3 + q0*q1), q0^2 - q1^2 - q2^2 + q3^2];
|
||||
2*(q1*q3-q0*q2), 2*(q2*q3 + q0*q1), q0^2 - q1^2 - q2^2 + q3^2];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function quatOut = QuatMult(quatA,quatB)
|
||||
% Calculate the following quaternion product quatA * quatB using the
|
||||
% Calculate the following quaternion product quatA * quatB using the
|
||||
% standard identity
|
||||
|
||||
quatOut = [quatA(1)*quatB(1)-quatA(2:4)'*quatB(2:4); quatA(1)*quatB(2:4) + quatB(1)*quatA(2:4) + cross(quatA(2:4),quatB(2:4))];
|
||||
@@ -1,6 +1,6 @@
|
||||
function quat = AlignHeading( ...
|
||||
quat, ... % quaternion state vector
|
||||
magMea, ... % body frame magnetic flux measurements
|
||||
magMea, ... % body frame magnetic flux measurements
|
||||
declination) % Estimated magnetic field delination at current location (rad)
|
||||
|
||||
% Get the Euler angles and set yaw to zero
|
||||
@@ -20,4 +20,4 @@ euler(3) = declination - atan2(magMeasNED(2),magMeasNED(1));
|
||||
% convert to a quaternion
|
||||
quat = EulToQuat(euler);
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@ relVelBodyPred = transpose(Tbn)*[vn;ve;vd];
|
||||
|
||||
% calculate the observation jacobian, innovation variance and innovation
|
||||
for obsIndex = 1:3
|
||||
|
||||
|
||||
% Calculate corrections using X component
|
||||
if (obsIndex == 1)
|
||||
H(1,:) = calcH_VELX(q0,q1,q2,q3,vd,ve,vn);
|
||||
@@ -53,30 +53,30 @@ end
|
||||
for obsIndex = 1:3
|
||||
|
||||
Kfusion = (P*transpose(H(obsIndex,:)))/varInnov(obsIndex);
|
||||
|
||||
|
||||
% correct the state vector
|
||||
states = states - Kfusion * innovation(obsIndex);
|
||||
|
||||
|
||||
% normalise the updated quaternion states
|
||||
quatMag = sqrt(states(1)^2 + states(2)^2 + states(3)^2 + states(4)^2);
|
||||
if (quatMag > 1e-12)
|
||||
states(1:4) = states(1:4) / quatMag;
|
||||
end
|
||||
|
||||
|
||||
% correct the covariance P = P - K*H*P
|
||||
P = P - Kfusion*H(obsIndex,:)*P;
|
||||
|
||||
|
||||
% Force symmetry on the covariance matrix to prevent ill-conditioning
|
||||
% of the matrix which would cause the filter to blow-up
|
||||
P = 0.5*(P + transpose(P));
|
||||
|
||||
|
||||
% ensure diagonals are positive
|
||||
for i=1:24
|
||||
if P(i,i) < 0
|
||||
P(i,i) = 0;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,7 +33,7 @@ magPred = transpose(Tbn)*[magN;magE;magD] + [magXbias;magYbias;magZbias];
|
||||
|
||||
% calculate the observation jacobian, innovation variance and innovation
|
||||
for obsIndex = 1:3
|
||||
|
||||
|
||||
% Calculate corrections using X component
|
||||
if (obsIndex == 1)
|
||||
H(1,:) = calcH_MAGX(magD,magE,magN,q0,q1,q2,q3);
|
||||
@@ -58,30 +58,30 @@ end
|
||||
for obsIndex = 1:3
|
||||
|
||||
Kfusion = (P*transpose(H(obsIndex,:)))/varInnov(obsIndex);
|
||||
|
||||
|
||||
% correct the state vector
|
||||
states = states - Kfusion * innovation(obsIndex);
|
||||
|
||||
|
||||
% normalise the updated quaternion states
|
||||
quatMag = sqrt(states(1)^2 + states(2)^2 + states(3)^2 + states(4)^2);
|
||||
if (quatMag > 1e-12)
|
||||
states(1:4) = states(1:4) / quatMag;
|
||||
end
|
||||
|
||||
|
||||
% correct the covariance P = P - K*H*P
|
||||
P = P - Kfusion*H(obsIndex,:)*P;
|
||||
|
||||
|
||||
% Force symmetry on the covariance matrix to prevent ill-conditioning
|
||||
% of the matrix which would cause the filter to blow-up
|
||||
P = 0.5*(P + transpose(P));
|
||||
|
||||
|
||||
% ensure diagonals are positive
|
||||
for i=1:24
|
||||
if P(i,i) < 0
|
||||
P(i,i) = 0;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -36,7 +36,7 @@ losRateMea = - flowRate + bodyRate;
|
||||
|
||||
% calculate the observation jacobian, innovation variance and innovation
|
||||
for obsIndex = 1:2
|
||||
|
||||
|
||||
% Calculate corrections using X component
|
||||
if (obsIndex == 1)
|
||||
H(1,:) = calcH_LOSX(q0,q1,q2,q3,range,vd,ve,vn);
|
||||
@@ -59,30 +59,30 @@ end
|
||||
for obsIndex = 1:2
|
||||
|
||||
Kfusion = (P*transpose(H(obsIndex,:)))/varInnov(obsIndex);
|
||||
|
||||
|
||||
% correct the state vector
|
||||
states = states - Kfusion * innovation(obsIndex);
|
||||
|
||||
|
||||
% normalise the updated quaternion states
|
||||
quatMag = sqrt(states(1)^2 + states(2)^2 + states(3)^2 + states(4)^2);
|
||||
if (quatMag > 1e-12)
|
||||
states(1:4) = states(1:4) / quatMag;
|
||||
end
|
||||
|
||||
|
||||
% correct the covariance P = P - K*H*P
|
||||
P = P - Kfusion*H(obsIndex,:)*P;
|
||||
|
||||
|
||||
% Force symmetry on the covariance matrix to prevent ill-conditioning
|
||||
% of the matrix which would cause the filter to blow-up
|
||||
P = 0.5*(P + transpose(P));
|
||||
|
||||
|
||||
% ensure diagonals are positive
|
||||
for i=1:24
|
||||
if P(i,i) < 0
|
||||
P(i,i) = 0;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,54 +15,54 @@ varInnov = zeros(1,2);
|
||||
H = zeros(2,24);
|
||||
|
||||
for obsIndex = 1:2
|
||||
|
||||
|
||||
% velocity states start at index 8
|
||||
stateIndex = 7 + obsIndex;
|
||||
|
||||
% Calculate the velocity measurement innovation
|
||||
innovation(obsIndex) = states(stateIndex) - measPos(obsIndex);
|
||||
|
||||
|
||||
% Calculate the observation Jacobian
|
||||
H(obsIndex,stateIndex) = 1;
|
||||
|
||||
|
||||
varInnov(obsIndex) = (H(obsIndex,:)*P*transpose(H(obsIndex,:)) + R_OBS);
|
||||
|
||||
|
||||
end
|
||||
|
||||
% Apply an innovation consistency check
|
||||
for obsIndex = 1:2
|
||||
|
||||
|
||||
if (innovation(obsIndex)^2 / (gateSize^2 * varInnov(obsIndex))) > 1.0
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
% Calculate Kalman gains and update states and covariances
|
||||
for obsIndex = 1:2
|
||||
|
||||
|
||||
% Calculate the Kalman gains
|
||||
K = (P*transpose(H(obsIndex,:)))/varInnov(obsIndex);
|
||||
|
||||
|
||||
% Calculate state corrections
|
||||
xk = K * innovation(obsIndex);
|
||||
|
||||
|
||||
% Apply the state corrections
|
||||
states = states - xk;
|
||||
|
||||
|
||||
% Update the covariance
|
||||
P = P - K*H(obsIndex,:)*P;
|
||||
|
||||
|
||||
% Force symmetry on the covariance matrix to prevent ill-conditioning
|
||||
P = 0.5*(P + transpose(P));
|
||||
|
||||
|
||||
% ensure diagonals are positive
|
||||
for i=1:24
|
||||
if P(i,i) < 0
|
||||
P(i,i) = 0;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,54 +15,54 @@ varInnov = zeros(1,3);
|
||||
H = zeros(3,24);
|
||||
|
||||
for obsIndex = 1:3
|
||||
|
||||
|
||||
% velocity states start at index 5
|
||||
stateIndex = 4 + obsIndex;
|
||||
|
||||
% Calculate the velocity measurement innovation
|
||||
innovation(obsIndex) = states(stateIndex) - measVel(obsIndex);
|
||||
|
||||
|
||||
% Calculate the observation Jacobian
|
||||
H(obsIndex,stateIndex) = 1;
|
||||
|
||||
|
||||
varInnov(obsIndex) = (H(obsIndex,:)*P*transpose(H(obsIndex,:)) + R_OBS);
|
||||
|
||||
|
||||
end
|
||||
|
||||
% Apply an innovation consistency check
|
||||
for obsIndex = 1:3
|
||||
|
||||
|
||||
if (innovation(obsIndex)^2 / (gateSize^2 * varInnov(obsIndex))) > 1.0
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
% Calculate Kalman gains and update states and covariances
|
||||
for obsIndex = 1:3
|
||||
|
||||
|
||||
% Calculate the Kalman gains
|
||||
K = (P*transpose(H(obsIndex,:)))/varInnov(obsIndex);
|
||||
|
||||
|
||||
% Calculate state corrections
|
||||
xk = K * innovation(obsIndex);
|
||||
|
||||
|
||||
% Apply the state corrections
|
||||
states = states - xk;
|
||||
|
||||
|
||||
% Update the covariance
|
||||
P = P - K*H(obsIndex,:)*P;
|
||||
|
||||
|
||||
% Force symmetry on the covariance matrix to prevent ill-conditioning
|
||||
P = 0.5*(P + transpose(P));
|
||||
|
||||
|
||||
% ensure diagonals are positive
|
||||
for i=1:24
|
||||
if P(i,i) < 0
|
||||
P(i,i) = 0;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@ quat = [q0;q1;q2;q3];
|
||||
Tbn = Quat2Tbn(quat);
|
||||
|
||||
% define the truth delta angle
|
||||
% ignore coning compensation as these effects are negligible in terms of
|
||||
% ignore coning compensation as these effects are negligible in terms of
|
||||
% covariance growth for our application and grade of sensor
|
||||
dAngTruth = dAngMeas - dAngBias;
|
||||
|
||||
@@ -137,7 +137,7 @@ f = matlabFunction(H_MAGD,'file','calcH_MAGD.m');
|
||||
%% derive equations for fusion of a single magneic compass heading measurement
|
||||
|
||||
% rotate body measured field into earth axes
|
||||
magMeasNED = Tbn*[magX;magY;magZ];
|
||||
magMeasNED = Tbn*[magX;magY;magZ];
|
||||
|
||||
% the predicted measurement is the angle wrt true north of the horizontal
|
||||
% component of the measured field
|
||||
|
||||
@@ -33,4 +33,3 @@ Sigma_wind = param.alignment.windErrNE * [1;1];
|
||||
% Convert to variances and write to covariance matrix diagonals
|
||||
covariance = diag([Sigma_quat;Sigma_velocity;Sigma_position;Sigma_dAngBias;Sigma_dVelBias;Sigma_magNED;Sigma_magXYZ;Sigma_wind].^2);
|
||||
end
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ if (output.magFuseMethod <= 1)
|
||||
set(h,'PaperOrientation','portrait');
|
||||
set(h,'PaperUnits','normalized');
|
||||
set(h,'PaperPosition', [0 0 1 1]);
|
||||
|
||||
|
||||
subplot(3,1,1);
|
||||
plot(output.time_lapsed',[output.mag_XYZ(:,1),output.mag_XYZ(:,1)+2*sqrt(output.state_variances(:,20)),output.mag_XYZ(:,1)-2*sqrt(output.state_variances(:,20))]);
|
||||
grid on;
|
||||
@@ -224,21 +224,21 @@ if (output.magFuseMethod <= 1)
|
||||
ylabel('X bias (gauss)');
|
||||
xlabel('time (sec)');
|
||||
legend('estimate','upper 95% bound','lower 95% bound');
|
||||
|
||||
|
||||
subplot(3,1,2);
|
||||
plot(output.time_lapsed',[output.mag_XYZ(:,2),output.mag_XYZ(:,2)+2*sqrt(output.state_variances(:,21)),output.mag_XYZ(:,2)-2*sqrt(output.state_variances(:,21))]);
|
||||
grid on;
|
||||
ylabel('Y bias (gauss)');
|
||||
xlabel('time (sec)');
|
||||
legend('estimate','upper 95% bound','lower 95% bound');
|
||||
|
||||
|
||||
subplot(3,1,3);
|
||||
plot(output.time_lapsed',[output.mag_XYZ(:,3),output.mag_XYZ(:,3)+2*sqrt(output.state_variances(:,22)),output.mag_XYZ(:,3)-2*sqrt(output.state_variances(:,22))]);
|
||||
grid on;
|
||||
ylabel('Z bias (gauss)');
|
||||
xlabel('time (sec)');
|
||||
legend('estimate','upper 95% bound','lower 95% bound');
|
||||
|
||||
|
||||
fileName='body_field_estimates.png';
|
||||
fullFileName = fullfile(folder, fileName);
|
||||
saveas(h,fullFileName);
|
||||
@@ -251,9 +251,9 @@ if (output.magFuseMethod <= 1)
|
||||
set(h,'PaperOrientation','portrait');
|
||||
set(h,'PaperUnits','normalized');
|
||||
set(h,'PaperPosition', [0 0 1 1]);
|
||||
|
||||
|
||||
margin = 0.1;
|
||||
|
||||
|
||||
subplot(4,1,1);
|
||||
plot(output.time_lapsed',[output.mag_NED(:,1),output.mag_NED(:,1)+2*sqrt(output.state_variances(:,17)),output.mag_NED(:,1)-2*sqrt(output.state_variances(:,17))]);
|
||||
minVal = min(output.mag_NED(:,1))-margin;
|
||||
@@ -265,7 +265,7 @@ if (output.magFuseMethod <= 1)
|
||||
ylabel('North (gauss)');
|
||||
xlabel('time (sec)');
|
||||
legend('estimate','upper 95% bound','lower 95% bound');
|
||||
|
||||
|
||||
subplot(4,1,2);
|
||||
plot(output.time_lapsed',[output.mag_NED(:,2),output.mag_NED(:,2)+2*sqrt(output.state_variances(:,18)),output.mag_NED(:,2)-2*sqrt(output.state_variances(:,18))]);
|
||||
minVal = min(output.mag_NED(:,2))-margin;
|
||||
@@ -275,7 +275,7 @@ if (output.magFuseMethod <= 1)
|
||||
ylabel('East (gauss)');
|
||||
xlabel('time (sec)');
|
||||
legend('estimate','upper 95% bound','lower 95% bound');
|
||||
|
||||
|
||||
subplot(4,1,3);
|
||||
plot(output.time_lapsed',[output.mag_NED(:,3),output.mag_NED(:,3)+2*sqrt(output.state_variances(:,19)),output.mag_NED(:,3)-2*sqrt(output.state_variances(:,19))]);
|
||||
grid on;
|
||||
@@ -285,7 +285,7 @@ if (output.magFuseMethod <= 1)
|
||||
ylabel('Down (gauss)');
|
||||
xlabel('time (sec)');
|
||||
legend('estimate','upper 95% bound','lower 95% bound');
|
||||
|
||||
|
||||
subplot(4,1,4);
|
||||
plot(output.time_lapsed',rad2deg*atan2(output.mag_NED(:,2),output.mag_NED(:,1)));
|
||||
grid on;
|
||||
@@ -293,7 +293,7 @@ if (output.magFuseMethod <= 1)
|
||||
title(titleText);
|
||||
ylabel('declination (deg)');
|
||||
xlabel('time (sec)');
|
||||
|
||||
|
||||
fileName='earth_field_estimates.png';
|
||||
fullFileName = fullfile(folder, fileName);
|
||||
saveas(h,fullFileName);
|
||||
@@ -301,13 +301,13 @@ end
|
||||
|
||||
%% plot velocity innovations
|
||||
if isfield(output.innovations,'vel_innov')
|
||||
|
||||
|
||||
figure('Units','Pixels','Position',plotDimensions,'PaperOrientation','portrait');
|
||||
h=gcf;
|
||||
set(h,'PaperOrientation','portrait');
|
||||
set(h,'PaperUnits','normalized');
|
||||
set(h,'PaperPosition', [0 0 1 1]);
|
||||
|
||||
|
||||
subplot(3,1,1);
|
||||
plot(output.innovations.vel_time_lapsed',[output.innovations.vel_innov(:,1),sqrt(output.innovations.vel_innov_var(:,1)),-sqrt(output.innovations.vel_innov_var(:,1))]);
|
||||
grid on;
|
||||
@@ -316,21 +316,21 @@ if isfield(output.innovations,'vel_innov')
|
||||
ylabel('North (m/s)');
|
||||
xlabel('time (sec)');
|
||||
legend('innovation','variance sqrt','variance sqrt');
|
||||
|
||||
|
||||
subplot(3,1,2);
|
||||
plot(output.innovations.vel_time_lapsed',[output.innovations.vel_innov(:,2),sqrt(output.innovations.vel_innov_var(:,2)),-sqrt(output.innovations.vel_innov_var(:,2))]);
|
||||
grid on;
|
||||
ylabel('East (m/s)');
|
||||
xlabel('time (sec)');
|
||||
legend('innovation','variance sqrt','variance sqrt');
|
||||
|
||||
|
||||
subplot(3,1,3);
|
||||
plot(output.innovations.vel_time_lapsed',[output.innovations.vel_innov(:,3),sqrt(output.innovations.vel_innov_var(:,3)),-sqrt(output.innovations.vel_innov_var(:,3))]);
|
||||
grid on;
|
||||
ylabel('Down (m/s)');
|
||||
xlabel('time (sec)');
|
||||
legend('innovation','variance sqrt','variance sqrt');
|
||||
|
||||
|
||||
fileName='velocity_fusion.png';
|
||||
fullFileName = fullfile(folder, fileName);
|
||||
saveas(h,fullFileName);
|
||||
@@ -343,7 +343,7 @@ if isfield(output.innovations,'posInnov')
|
||||
set(h,'PaperOrientation','portrait');
|
||||
set(h,'PaperUnits','normalized');
|
||||
set(h,'PaperPosition', [0 0 1 1]);
|
||||
|
||||
|
||||
subplot(3,1,1);
|
||||
plot(output.innovations.vel_time_lapsed',[output.innovations.posInnov(:,1),sqrt(output.innovations.posInnovVar(:,1)),-sqrt(output.innovations.posInnovVar(:,1))]);
|
||||
grid on;
|
||||
@@ -352,21 +352,21 @@ if isfield(output.innovations,'posInnov')
|
||||
ylabel('North (m)');
|
||||
xlabel('time (sec)');
|
||||
legend('innovation','variance sqrt','variance sqrt');
|
||||
|
||||
|
||||
subplot(3,1,2);
|
||||
plot(output.innovations.vel_time_lapsed',[output.innovations.posInnov(:,2),sqrt(output.innovations.posInnovVar(:,2)),-sqrt(output.innovations.posInnovVar(:,2))]);
|
||||
grid on;
|
||||
ylabel('East (m)');
|
||||
xlabel('time (sec)');
|
||||
legend('innovation','variance sqrt','variance sqrt');
|
||||
|
||||
|
||||
subplot(3,1,3);
|
||||
plot(output.innovations.hgt_time_lapsed',[output.innovations.hgtInnov(:),sqrt(output.innovations.hgtInnovVar(:)),-sqrt(output.innovations.hgtInnovVar(:))]);
|
||||
grid on;
|
||||
ylabel('Up (m)');
|
||||
xlabel('time (sec)');
|
||||
legend('innovation','variance sqrt','variance sqrt');
|
||||
|
||||
|
||||
fileName='position_fusion.png';
|
||||
fullFileName = fullfile(folder, fileName);
|
||||
saveas(h,fullFileName);
|
||||
@@ -374,7 +374,7 @@ end
|
||||
|
||||
%% plot magnetometer innovations
|
||||
if isfield(output.innovations,'magInnov')
|
||||
|
||||
|
||||
figure('Units','Pixels','Position',plotDimensions,'PaperOrientation','portrait');
|
||||
h=gcf;
|
||||
set(h,'PaperOrientation','portrait');
|
||||
@@ -412,18 +412,18 @@ if isfield(output.innovations,'magInnov')
|
||||
fileName='magnetometer_fusion.png';
|
||||
fullFileName = fullfile(folder, fileName);
|
||||
saveas(h,fullFileName);
|
||||
|
||||
|
||||
end
|
||||
|
||||
%% plot magnetic yaw innovations
|
||||
if isfield(output.innovations,'hdgInnov')
|
||||
|
||||
|
||||
figure('Units','Pixels','Position',plotDimensions,'PaperOrientation','portrait');
|
||||
h=gcf;
|
||||
set(h,'PaperOrientation','portrait');
|
||||
set(h,'PaperUnits','normalized');
|
||||
set(h,'PaperPosition', [0 0 1 1]);
|
||||
|
||||
|
||||
subplot(2,1,1);
|
||||
plot(output.innovations.mag_time_lapsed,[output.innovations.hdgInnov*rad2deg;sqrt(output.innovations.hdgInnovVar)*rad2deg;-sqrt(output.innovations.hdgInnovVar)*rad2deg]);
|
||||
ylim([-30 30]);
|
||||
@@ -442,12 +442,12 @@ if isfield(output.innovations,'hdgInnov')
|
||||
fileName='magnetometer_fusion.png';
|
||||
fullFileName = fullfile(folder, fileName);
|
||||
saveas(h,fullFileName);
|
||||
|
||||
|
||||
end
|
||||
|
||||
%% plot optical flow innovations
|
||||
if isfield(output.innovations,'flowInnov')
|
||||
|
||||
|
||||
figure('Units','Pixels','Position',plotDimensions,'PaperOrientation','portrait');
|
||||
h=gcf;
|
||||
set(h,'PaperOrientation','portrait');
|
||||
@@ -471,17 +471,18 @@ if isfield(output.innovations,'flowInnov')
|
||||
fileName='optical_flow_fusion.png';
|
||||
fullFileName = fullfile(folder, fileName);
|
||||
saveas(h,fullFileName);
|
||||
|
||||
|
||||
end
|
||||
|
||||
%% plot ZED camera innovations
|
||||
if isfield(output.innovations,'bodyVelInnov')
|
||||
|
||||
|
||||
figure('Units','Pixels','Position',plotDimensions,'PaperOrientation','portrait');
|
||||
h=gcf;
|
||||
set(h,'PaperOrientation','portrait');
|
||||
set(h,'PaperUnits','normalized');
|
||||
set(h,'PaperPosition', [0 0 1 1]);
|
||||
|
||||
|
||||
subplot(3,1,1);
|
||||
plot(output.innovations.bodyVel_time_lapsed,[output.innovations.bodyVelInnov(:,1)';sqrt(output.innovations.bodyVelInnovVar(:,1))';-sqrt(output.innovations.bodyVelInnovVar(:,1))']);
|
||||
grid on;
|
||||
@@ -489,23 +490,23 @@ if isfield(output.innovations,'bodyVelInnov')
|
||||
ylabel('X (m/sec)');
|
||||
xlabel('time (sec)');
|
||||
legend('innovation','innovation variance sqrt','innovation variance sqrt');
|
||||
|
||||
|
||||
subplot(3,1,2);
|
||||
plot(output.innovations.bodyVel_time_lapsed,[output.innovations.bodyVelInnov(:,2)';sqrt(output.innovations.bodyVelInnovVar(:,2))';-sqrt(output.innovations.bodyVelInnovVar(:,2))']);
|
||||
grid on;
|
||||
ylabel('Y (m/sec)');
|
||||
xlabel('time (sec)');
|
||||
legend('innovation','innovation variance sqrt','innovation variance sqrt');
|
||||
|
||||
|
||||
subplot(3,1,3);
|
||||
plot(output.innovations.bodyVel_time_lapsed,[output.innovations.bodyVelInnov(:,3)';sqrt(output.innovations.bodyVelInnovVar(:,3))';-sqrt(output.innovations.bodyVelInnovVar(:,3))']);
|
||||
grid on;
|
||||
ylabel('Z (m/sec)');
|
||||
xlabel('time (sec)');
|
||||
legend('innovation','innovation variance sqrt','innovation variance sqrt');
|
||||
|
||||
|
||||
fileName='zed_camera_fusion.png';
|
||||
fullFileName = fullfile(folder, fileName);
|
||||
saveas(h,fullFileName);
|
||||
|
||||
|
||||
end
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user