mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-17 18:41:28 +08:00
Compare commits
No commits in common. "v1.3.3" and "v1.1.1" have entirely different histories.
12
.gitignore
vendored
12
.gitignore
vendored
@ -2,7 +2,6 @@
|
||||
!ROMFS/*/*.d
|
||||
!ROMFS/*/*/*.d
|
||||
!ROMFS/*/*/*/*.d
|
||||
*.px4log
|
||||
*.dSYM
|
||||
*.o
|
||||
*.pyc
|
||||
@ -23,8 +22,6 @@ build/*
|
||||
build_*/
|
||||
core
|
||||
cscope.out
|
||||
cscope.in.out
|
||||
cscope.po.out
|
||||
Firmware.sublime-workspace
|
||||
user.sublime*
|
||||
Images/*.bin
|
||||
@ -64,12 +61,3 @@ CMakeLists.txt.user
|
||||
GPATH
|
||||
GRTAGS
|
||||
GTAGS
|
||||
*.config
|
||||
*.creator
|
||||
*.creator.user
|
||||
*.files
|
||||
*.includes
|
||||
|
||||
# uavcan firmware
|
||||
ROMFS/px4fmu_common/uavcan/
|
||||
vectorcontrol/
|
||||
|
||||
10
.gitmodules
vendored
10
.gitmodules
vendored
@ -13,6 +13,9 @@
|
||||
[submodule "Tools/gencpp"]
|
||||
path = Tools/gencpp
|
||||
url = https://github.com/ros/gencpp.git
|
||||
[submodule "src/lib/dspal"]
|
||||
path = src/lib/dspal
|
||||
url = https://github.com/ATLFlight/dspal.git
|
||||
[submodule "Tools/jMAVSim"]
|
||||
path = Tools/jMAVSim
|
||||
url = https://github.com/PX4/jMAVSim.git
|
||||
@ -22,7 +25,6 @@
|
||||
[submodule "unittests/googletest"]
|
||||
path = unittests/googletest
|
||||
url = https://github.com/google/googletest.git
|
||||
ignore = untracked
|
||||
[submodule "src/lib/matrix"]
|
||||
path = src/lib/matrix
|
||||
url = https://github.com/PX4/Matrix.git
|
||||
@ -32,9 +34,3 @@
|
||||
[submodule "src/lib/ecl"]
|
||||
path = src/lib/ecl
|
||||
url = https://github.com/PX4/ecl.git
|
||||
[submodule "cmake/cmake_hexagon"]
|
||||
path = cmake/cmake_hexagon
|
||||
url = https://github.com/ATLFlight/cmake_hexagon
|
||||
[submodule "src/drivers/gps/devices"]
|
||||
path = src/drivers/gps/devices
|
||||
url = https://github.com/PX4/GpsDrivers.git
|
||||
|
||||
63
.travis.yml
63
.travis.yml
@ -8,10 +8,6 @@ matrix:
|
||||
include:
|
||||
- os: linux
|
||||
sudo: false
|
||||
env: GCC_VER=4.8
|
||||
- os: linux
|
||||
sudo: false
|
||||
env: GCC_VER=4.9
|
||||
- os: osx
|
||||
osx_image: xcode7
|
||||
sudo: true
|
||||
@ -39,6 +35,7 @@ addons:
|
||||
- ninja-build
|
||||
- python-argparse
|
||||
- python-empy
|
||||
- python-serial
|
||||
- s3cmd
|
||||
- texinfo
|
||||
- zlib1g-dev
|
||||
@ -46,12 +43,10 @@ addons:
|
||||
before_install:
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
pushd .
|
||||
&& cd ~ && mkdir gcc && cd gcc
|
||||
&& if [ "$GCC_VER" = "4.8" ]; then GCC_URL="https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2" ; fi
|
||||
&& if [ "$GCC_VER" = "4.9" ]; then GCC_URL="https://launchpad.net/gcc-arm-embedded/4.9/4.9-2014-q4-major/+download/gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2" ; fi
|
||||
&& wget -O gcc.tar.bz2 ${GCC_URL}
|
||||
&& tar -jxf gcc.tar.bz2 --strip 1
|
||||
&& exportline="export PATH=$HOME/gcc/bin:\$PATH"
|
||||
&& cd ~
|
||||
&& wget https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2
|
||||
&& tar -jxf gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2
|
||||
&& exportline="export PATH=$HOME/gcc-arm-none-eabi-4_8-2014q3/bin:\$PATH"
|
||||
&& if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
|
||||
&& . ~/.profile
|
||||
&& popd
|
||||
@ -65,10 +60,11 @@ before_install:
|
||||
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||
brew tap PX4/homebrew-px4
|
||||
&& brew update; brew update
|
||||
&& brew install cmake ninja
|
||||
&& brew install cmake ninja astyle gcc-arm-none-eabi
|
||||
&& brew install genromfs
|
||||
&& brew install kconfig-frontends
|
||||
&& sudo easy_install pip
|
||||
&& sudo pip install empy
|
||||
&& sudo pip install pyserial empy
|
||||
;
|
||||
fi
|
||||
|
||||
@ -97,25 +93,39 @@ env:
|
||||
- PX4_AWS_BUCKET=px4-travis
|
||||
|
||||
script:
|
||||
- git submodule update --quiet --init --recursive
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
arm-none-eabi-gcc --version && make check VECTORCONTROL=1;
|
||||
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||
make check_posix_sitl_default;
|
||||
fi
|
||||
- make check_format
|
||||
- arm-none-eabi-gcc --version
|
||||
- echo 'Building POSIX Firmware..' && make posix_sitl_default
|
||||
- echo 'Running Tests..' && make posix_sitl_default test
|
||||
- echo 'Running Unittests..' && cd unittests && ./run_tests.sh
|
||||
- cd ..
|
||||
- echo 'Building NuttX px4fmu-v1 Firmware..' && make px4fmu-v1_default
|
||||
- echo 'Building NuttX px4fmu-v2 Firmware..' && make px4fmu-v2_default
|
||||
# Only provide UAVCAN firmware binaries for Pixracer and Pixhawk 3
|
||||
- echo 'Building UAVCAN node firmware..' && git clone https://github.com/thiemar/vectorcontrol
|
||||
- cd vectorcontrol
|
||||
- BOARD=s2740vc_1_0 make && BOARD=px4esc_1_6 make
|
||||
- ../Tools/uavcan_copy.sh
|
||||
- cd ..
|
||||
- echo 'Building NuttX px4fmu-v4 Firmware..' && make px4fmu-v4_default
|
||||
- echo 'Building NuttX px4-stm32f4discovery Firmware..' && make px4-stm32f4discovery_default
|
||||
- echo 'Running Tests..' && make px4fmu-v2_default test
|
||||
|
||||
after_success:
|
||||
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${GCC_VER}" = "4.8" ]]; then
|
||||
make package_firmware
|
||||
&& find . -name \*.px4 -exec cp "{}" . \;
|
||||
&& find . -maxdepth 1 -mindepth 1 -type f -name 'nuttx-*-default.px4' | sed 's/.\/nuttx-//' | sed 's/-default.px4//' | xargs -I{} mv nuttx-{}-default.px4 {}_default.px4
|
||||
&& ./CI-Tools/s3cmd-put `find . -maxdepth 1 -mindepth 1 -type f -name '*_default.px4'` build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
cp build_px4fmu-v1_default/src/firmware/nuttx/nuttx-px4fmu-v1-default.px4 px4fmu-v1_default.px4
|
||||
&& cp build_px4fmu-v2_default/src/firmware/nuttx/nuttx-px4fmu-v2-default.px4 px4fmu-v2_default.px4
|
||||
&& cp build_px4fmu-v4_default/src/firmware/nuttx/nuttx-px4fmu-v4-default.px4 px4fmu-v4_default.px4
|
||||
&& cp build_px4-stm32f4discovery_default/src/firmware/nuttx/nuttx-px4-stm32f4discovery-default.px4 px4-stm32f4discovery-default.px4
|
||||
&& zip Firmware.zip px4fmu-v1_default.px4 px4fmu-v2_default.px4 px4fmu-v4_default.px4 px4-stm32f4discovery-default.px4
|
||||
&& ./CI-Tools/s3cmd-put px4fmu-v1_default.px4 px4fmu-v2_default.px4 px4fmu-v4_default.px4 px4-stm32f4discovery-default.px4 build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/
|
||||
&& ./CI-Tools/s3cmd-put Firmware.zip archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/
|
||||
&& ./CI-Tools/s3cmd-put CI-Tools/directory/index.html archives/Firmware/$TRAVIS_BRANCH/
|
||||
&& ./CI-Tools/s3cmd-put CI-Tools/index.html index.html
|
||||
&& ./CI-Tools/s3cmd-put CI-Tools/timestamp.html timestamp.html
|
||||
&& echo ""
|
||||
&& echo "Binaries have been posted to:" https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip
|
||||
&& echo "Binaries have been posted to:"
|
||||
&& echo https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip
|
||||
;
|
||||
fi
|
||||
|
||||
@ -129,7 +139,6 @@ deploy:
|
||||
tags: true
|
||||
all_branches: true
|
||||
repo: PX4/Firmware
|
||||
condition: $GCC_VER = 4.8
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
@ -137,7 +146,3 @@ notifications:
|
||||
- https://webhooks.gitter.im/e/2b9c4a4cb2211f8befba
|
||||
on_success: always # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
slack:
|
||||
secure: "QKw73Zel/s3JAbe/7XyO9tPnJwiiGFpYzSjdR8lG3tYFjRdXZnhxG4c+G7bkgkaPTS4Hult33VXE3kcEqOI7+C+eRwRlZhDfL0knQbXVCxjcLjzmUFdoPOwurlgZDw66PFWCi5tZcLKSRo3u4U8ibT4WKi3jm9sDSyOcfBAucMU="
|
||||
on_success: change # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
# * If a target from add_custom_* is set in a function, explicitly pass it
|
||||
# as an output argument so that the target name is clear to the user.
|
||||
#
|
||||
# * Avoid use of global variables in functions. Functions in a nested
|
||||
# * Avoid use of global variables in functions. Functions in a nested
|
||||
# scope may use global variables, but this makes it difficult to
|
||||
# resuse functions.
|
||||
#
|
||||
@ -150,6 +150,16 @@ list(GET config_args 1 BOARD)
|
||||
list(GET config_args 2 LABEL)
|
||||
set(target_name "${OS}-${BOARD}-${LABEL}")
|
||||
|
||||
if("${OS}" STREQUAL "posix")
|
||||
if (APPLE)
|
||||
set(DF_TARGET darwin)
|
||||
else()
|
||||
set(DF_TARGET linux)
|
||||
endif()
|
||||
else()
|
||||
set(DF_TARGET ${OS})
|
||||
endif()
|
||||
|
||||
message(STATUS "${target_name}")
|
||||
|
||||
# switch to ros CMake file if building ros
|
||||
@ -183,11 +193,6 @@ foreach(conf ${px4_required_config})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# List the DriverFramework drivers
|
||||
if(DEFINED config_df_driver_list)
|
||||
message("DF Drivers: ${config_df_driver_list}")
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# project definition
|
||||
#
|
||||
@ -238,12 +243,12 @@ px4_add_git_submodule(TARGET git_mavlink PATH "mavlink/include/mavlink/v1.0")
|
||||
px4_add_git_submodule(TARGET git_gtest PATH "unittets/gtest")
|
||||
px4_add_git_submodule(TARGET git_uavcan PATH "src/modules/uavcan/libuavcan")
|
||||
px4_add_git_submodule(TARGET git_nuttx PATH "NuttX")
|
||||
px4_add_git_submodule(TARGET git_dspal PATH "src/lib/dspal")
|
||||
px4_add_git_submodule(TARGET git_driverframework PATH "src/lib/DriverFramework")
|
||||
px4_add_git_submodule(TARGET git_ecl PATH "src/lib/ecl")
|
||||
px4_add_git_submodule(TARGET git_jmavsim PATH "Tools/jMAVSim")
|
||||
px4_add_git_submodule(TARGET git_gazebo PATH "Tools/sitl_gazebo")
|
||||
px4_add_git_submodule(TARGET git_matrix PATH "src/lib/matrix")
|
||||
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "cmake/cmake_hexagon")
|
||||
|
||||
add_custom_target(submodule_clean
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
@ -288,7 +293,6 @@ px4_join(OUT CMAKE_C_FLAGS LIST "${c_flags}" GLUE " ")
|
||||
px4_join(OUT CMAKE_CXX_FLAGS LIST "${cxx_flags}" GLUE " ")
|
||||
|
||||
include_directories(${include_dirs})
|
||||
#message("INCLUDE_DIRS=${include_dirs}")
|
||||
link_directories(${link_dirs})
|
||||
add_definitions(${definitions})
|
||||
|
||||
@ -320,29 +324,12 @@ include_directories(${ep_base}/Install/include)
|
||||
execute_process(COMMAND cmake -E make_directory ${ep_base}/Install/lib)
|
||||
execute_process(COMMAND cmake -E make_directory ${ep_base}/Install/include)
|
||||
|
||||
#=============================================================================
|
||||
# DriverFramework Drivers
|
||||
#
|
||||
set(df_driver_libs)
|
||||
foreach(driver ${config_df_driver_list})
|
||||
add_subdirectory(src/lib/DriverFramework/drivers/${driver})
|
||||
list(APPEND df_driver_libs df_${driver})
|
||||
message("Adding DF driver: ${driver}")
|
||||
endforeach()
|
||||
|
||||
#=============================================================================
|
||||
# subdirectories
|
||||
#
|
||||
set(module_libraries)
|
||||
foreach(module ${config_module_list})
|
||||
string(REGEX MATCH "^[./]" external_module ${module})
|
||||
if(external_module)
|
||||
STRING(REGEX REPLACE "//" "/" EXT_MODULE ${module})
|
||||
STRING(REGEX REPLACE "/" "__" EXT_MODULE_PREFIX ${EXT_MODULE})
|
||||
add_subdirectory(${module} ${CMAKE_BINARY_DIR}/${EXT_MODULE_PREFIX})
|
||||
else()
|
||||
add_subdirectory(src/${module})
|
||||
endif()
|
||||
add_subdirectory(src/${module})
|
||||
px4_mangle_name(${module} mangled_name)
|
||||
list(APPEND module_libraries ${mangled_name})
|
||||
#message(STATUS "adding module: ${module}")
|
||||
@ -350,6 +337,7 @@ endforeach()
|
||||
|
||||
add_subdirectory(src/firmware/${OS})
|
||||
|
||||
add_subdirectory(src/lib/DriverFramework/framework/src)
|
||||
#add_dependencies(df_driver_framework nuttx_export_${CONFIG}.stamp)
|
||||
if (NOT "${OS}" STREQUAL "nuttx")
|
||||
endif()
|
||||
|
||||
@ -16,7 +16,7 @@ git checkout -b mydescriptivebranchname
|
||||
|
||||
### Edit and build the code
|
||||
|
||||
The [developer guide](http://dev.px4.io/) explains how to set up the development environment on Mac OS, Linux or Windows. Please take note of our [coding style](http://px4.io/dev/code_style) when editing files.
|
||||
The [developer guide](http://px4.io/dev/start) explains how to set up the development environment on Mac OS, Linux or Windows. Please take note of our [coding style](http://px4.io/dev/code_style) when editing files.
|
||||
|
||||
### Commit your changes
|
||||
|
||||
|
||||
@ -281,7 +281,7 @@ TYPEDEF_HIDES_STRUCT = NO
|
||||
# causing a significant performance penality.
|
||||
# If the system has enough physical memory increasing the cache will improve the
|
||||
# performance by keeping more symbols in memory. Note that the value works on
|
||||
# a logarithmic scale so increasing the size by one will roughly double the
|
||||
# a logarithmic scale so increasing the size by one will rougly double the
|
||||
# memory usage. The cache size is given by this formula:
|
||||
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
|
||||
# corresponding to a cache size of 2^16 = 65536 symbols
|
||||
@ -599,7 +599,8 @@ RECURSIVE = YES
|
||||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE = ../src/modules/attitude_estimator_ekf/codegen
|
||||
EXCLUDE = ../src/lib/mathlib/CMSIS \
|
||||
../src/modules/attitude_estimator_ekf/codegen
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
||||
|
||||
@ -9,7 +9,7 @@ http://www.stack.nl/~dimitri/doxygen/download.html for the correct download.
|
||||
Then go to the following website for inforamtion on the install:
|
||||
http://www.stack.nl/~dimitri/doxygen/install.html
|
||||
|
||||
Then to generate the html, run the following code while you are in this directory:
|
||||
Then to generate the html, run the following code while you are in the qgroundcontrol/doc directory:
|
||||
$doxygen Doxyfile
|
||||
|
||||
The html file index.html should be in doc/html unless you changed the output directory.
|
||||
@ -48,7 +48,7 @@ Download QGC from http://qgroundcontrol.org/downloads and install using the wind
|
||||
|
||||
## PX4
|
||||
|
||||
### Platform Requirements
|
||||
### Platfrom Requirements
|
||||
Linux or Eagle with a working IP interface (?? does this need further instructions?)
|
||||
|
||||
### Build Host Requirements
|
||||
|
||||
@ -70,13 +70,6 @@
|
||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"cmd": ["make posix"],
|
||||
"shell": true
|
||||
},
|
||||
{
|
||||
"name": "MindPX_V2: make and upload",
|
||||
"working_dir": "${project_path}",
|
||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"cmd": ["make upload mindpx-v2_default -j8"],
|
||||
"shell": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
{
|
||||
"board_id": 9,
|
||||
"magic": "PX4FWv2",
|
||||
"description": "Firmware for the MindPx-V2 board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "MindPx-v2",
|
||||
"version": "2.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
115
Makefile
115
Makefile
@ -1,6 +1,6 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 - 2016 PX4 Development Team. All rights reserved.
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
@ -109,9 +109,8 @@ endif
|
||||
# describe how to build a cmake config
|
||||
define cmake-build
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi
|
||||
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(PWD)/build_$@); fi
|
||||
+@Tools/check_submodules.sh
|
||||
+@(echo "PX4 CONFIG: $@" && cd $(PWD)/build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
|
||||
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then git submodule update --init --recursive --force && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1); fi
|
||||
+$(PX4_MAKE) -C $(PWD)/build_$@ $(PX4_MAKE_ARGS) $(ARGS)
|
||||
endef
|
||||
|
||||
# create empty targets to avoid msgs for targets passed to cmake
|
||||
@ -121,12 +120,6 @@ $(1):
|
||||
.PHONY: $(1)
|
||||
endef
|
||||
|
||||
define colorecho
|
||||
@tput setaf 6
|
||||
@echo $1
|
||||
@tput sgr0
|
||||
endef
|
||||
|
||||
# ADD CONFIGS HERE
|
||||
# --------------------------------------------------------------------
|
||||
# Do not put any spaces between function arguments.
|
||||
@ -146,8 +139,8 @@ px4-stm32f4discovery_default:
|
||||
px4fmu-v2_ekf2:
|
||||
$(call cmake-build,nuttx_px4fmu-v2_ekf2)
|
||||
|
||||
mindpx-v2_default:
|
||||
$(call cmake-build,nuttx_mindpx-v2_default)
|
||||
px4fmu-v2_lpe:
|
||||
$(call cmake-build,nuttx_px4fmu-v2_lpe)
|
||||
|
||||
posix_sitl_default:
|
||||
$(call cmake-build,$@)
|
||||
@ -158,50 +151,26 @@ posix_sitl_lpe:
|
||||
posix_sitl_ekf2:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_sitl_replay:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_sitl_broadcast:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
ros_sitl_default:
|
||||
@echo "This target is deprecated. Use make 'posix_sitl_default gazebo' instead."
|
||||
$(call cmake-build,$@)
|
||||
|
||||
qurt_eagle_travis:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
qurt_eagle_release:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_eagle_release:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
qurt_eagle_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_eagle_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
eagle_default: posix_eagle_default qurt_eagle_default
|
||||
|
||||
qurt_eagle_legacy_driver_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_eagle_legacy_driver_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
qurt_excelsior_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_excelsior_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
excelsior_default: posix_excelsior_default qurt_excelsior_default
|
||||
|
||||
posix_rpi2_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_rpi2_release:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix: posix_sitl_default
|
||||
|
||||
broadcast: posix_sitl_broadcast
|
||||
|
||||
sitl_deprecation:
|
||||
@echo "Deprecated. Use 'make posix_sitl_default jmavsim' or"
|
||||
@echo "'make posix_sitl_default gazebo' if Gazebo is preferred."
|
||||
@ -212,67 +181,33 @@ run_sitl_ros: sitl_deprecation
|
||||
|
||||
# Other targets
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
.PHONY: uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean
|
||||
.NOTPARALLEL: uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean
|
||||
|
||||
uavcan_firmware:
|
||||
ifeq ($(VECTORCONTROL),1)
|
||||
$(call colorecho,"Downloading and building Vector control (FOC) firmware for the S2740VC and PX4ESC 1.6")
|
||||
@(rm -rf vectorcontrol && git clone --quiet --depth 1 https://github.com/thiemar/vectorcontrol.git && cd vectorcontrol && BOARD=s2740vc_1_0 make --silent --no-print-directory && BOARD=px4esc_1_6 make --silent --no-print-directory && ../Tools/uavcan_copy.sh)
|
||||
endif
|
||||
|
||||
check: check_px4fmu-v1_default check_px4fmu-v2_default check_px4fmu-v4_default_and_uavcan check_mindpx-v2_default check_px4-stm32f4discovery_default check_posix_sitl_default check_unittest check_format
|
||||
|
||||
check_format:
|
||||
$(call colorecho,"Checking formatting with astyle")
|
||||
@./Tools/fix_code_style.sh
|
||||
@./Tools/check_code_style.sh
|
||||
|
||||
check_%:
|
||||
@echo
|
||||
$(call colorecho,"Building" $(subst check_,,$@))
|
||||
@$(MAKE) --no-print-directory $(subst check_,,$@)
|
||||
@echo
|
||||
|
||||
check_px4fmu-v4_default: uavcan_firmware
|
||||
check_px4fmu-v4_default_and_uavcan: check_px4fmu-v4_default
|
||||
@echo
|
||||
ifeq ($(VECTORCONTROL),1)
|
||||
@echo "Cleaning up vectorcontrol firmware"
|
||||
@rm -rf vectorcontrol
|
||||
@rm -rf ROMFS/px4fmu_common/uavcan
|
||||
endif
|
||||
|
||||
unittest: posix_sitl_default
|
||||
@(cd unittests && cmake -G$(PX4_CMAKE_GENERATOR) && $(PX4_MAKE) $(PX4_MAKE_ARGS) && ctest -j2 --output-on-failure)
|
||||
|
||||
package_firmware:
|
||||
@zip --junk-paths Firmware.zip `find . -name \*.px4`
|
||||
|
||||
clean:
|
||||
@rm -rf build_*/
|
||||
@(cd NuttX/nuttx && make clean)
|
||||
|
||||
submodulesclean:
|
||||
@git submodule sync
|
||||
@git submodule deinit -f .
|
||||
@git submodule update --init --recursive --force
|
||||
|
||||
distclean: submodulesclean
|
||||
@git clean -ff -x -d
|
||||
@(cd NuttX && git clean -d -f -x)
|
||||
@(cd src/modules/uavcan/libuavcan && git clean -d -f -x)
|
||||
@(git submodule sync)
|
||||
|
||||
# targets handled by cmake
|
||||
cmake_targets = test upload package package_source debug debug_tui debug_ddd debug_io debug_io_tui debug_io_ddd check_weak \
|
||||
run_cmake_config config gazebo gazebo_gdb gazebo_lldb jmavsim replay \
|
||||
jmavsim_gdb jmavsim_lldb gazebo_gdb_iris gazebo_lldb_tailsitter gazebo_iris gazebo_iris_opt_flow gazebo_tailsitter \
|
||||
gazebo_gdb_standard_vtol gazebo_lldb_standard_vtol gazebo_standard_vtol gazebo_plane
|
||||
run_cmake_config config gazebo gazebo_gdb gazebo_lldb jmavsim \
|
||||
jmavsim_gdb jmavsim_lldb gazebo_gdb_iris gazebo_lldb_tailsitter gazebo_iris gazebo_tailsitter
|
||||
$(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ))))
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
CONFIGS:=$(shell ls cmake/configs | sed -e "s~.*/~~" | sed -e "s~\..*~~")
|
||||
|
||||
# Future:
|
||||
#$(CONFIGS):
|
||||
## @cd Build/$@ && cmake ../.. -DCONFIG=$@
|
||||
# @cd Build/$@ && make
|
||||
#
|
||||
#clean-all:
|
||||
# @rm -rf Build/*
|
||||
#
|
||||
#help:
|
||||
# @echo
|
||||
# @echo "Type 'make ' and hit the tab key twice to see a list of the available"
|
||||
|
||||
2
NuttX
2
NuttX
@ -1 +1 @@
|
||||
Subproject commit f0f4bdc872d324f64e9d93d6f8989d3c1dfa2633
|
||||
Subproject commit 3009fb230ec8232c4c4fd7798fd70ea9632692ec
|
||||
34
README.md
34
README.md
@ -1,30 +1,41 @@
|
||||
## PX4 Pro Drone Autopilot ##
|
||||
## PX4 Flight Core and PX4 Middleware ##
|
||||
|
||||
[](https://travis-ci.org/PX4/Firmware) [](https://scan.coverity.com/projects/3966?tab=overview)
|
||||
|
||||
[](https://gitter.im/PX4/Firmware?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
This repository holds the [PX4 Pro](http://px4.io) flight control solution for drones, with the main applications located in the src/modules directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
|
||||
This repository contains the [PX4 Flight Core](http://px4.io), with the main applications located in the src/modules directory. It also contains the PX4 Drone Platform, which contains drivers and middleware to run drones.
|
||||
|
||||
* Official Website: http://px4.io
|
||||
* License: BSD 3-clause (see [LICENSE.md](https://github.com/PX4/Firmware/blob/master/LICENSE.md))
|
||||
* Supported airframes (more experimental are supported):
|
||||
* [Multicopters](http://px4.io/portfolio_category/multicopter/)
|
||||
* [Fixed wing](http://px4.io/portfolio_category/plane/)
|
||||
* [VTOL](http://px4.io/portfolio_category/vtol/)
|
||||
* [Multicopters](http://px4.io/platforms/multicopters/start)
|
||||
* [Fixed wing](http://px4.io/platforms/planes/start)
|
||||
* [VTOL](http://px4.io/platforms/vtol/start)
|
||||
* Binaries (always up-to-date from master):
|
||||
* [Downloads](http://px4.io/firmware/downloads)
|
||||
* Releases
|
||||
* [Downloads](https://github.com/PX4/Firmware/releases)
|
||||
* Forum / Mailing list: [Google Groups](http://groups.google.com/group/px4users)
|
||||
|
||||
### Users ###
|
||||
|
||||
Please refer to the [user documentation](http://px4.io) and [user forum](http://discuss.px4.io) for flying drones with the PX4 flight stack.
|
||||
Please refer to the [user documentation](https://pixhawk.org/users/start) for flying drones with the PX4 flight stack.
|
||||
|
||||
### Developers ###
|
||||
|
||||
* [Developer Forum / Mailing list](http://groups.google.com/group/px4users)
|
||||
* [Guide for Contributions](https://github.com/PX4/Firmware/blob/master/CONTRIBUTING.md)
|
||||
* [Developer guide](http://dev.px4.io)
|
||||
Contributing guide:
|
||||
* [CONTRIBUTING.md](https://github.com/PX4/Firmware/blob/master/CONTRIBUTING.md)
|
||||
* [PX4 Contribution Guide](http://px4.io/dev/contributing)
|
||||
|
||||
Software in the Loop guide:
|
||||
Use software in the loop [to get started with the codebase](https://pixhawk.org/dev/simulation/native_sitl).
|
||||
|
||||
Developer guide:
|
||||
http://dev.px4.io
|
||||
|
||||
Testing guide:
|
||||
http://px4.io/dev/unit_tests
|
||||
|
||||
This repository contains code supporting these boards:
|
||||
* [Snapdragon Flight](http://dev.px4.io/hardware-snapdragon.html)
|
||||
@ -33,3 +44,8 @@ This repository contains code supporting these boards:
|
||||
* FMUv4.x (Pixhawk X and [Pixracer](http://dev.px4.io/hardware-pixracer.html))
|
||||
* AeroCore (v1 and v2)
|
||||
* STM32F4Discovery (basic support) [Tutorial](https://pixhawk.org/modules/stm32f4discovery)
|
||||
|
||||
## NuttShell (NSH) ##
|
||||
|
||||
NSH usage documentation:
|
||||
http://px4.io/users/serial_connection
|
||||
|
||||
@ -20,8 +20,7 @@ then
|
||||
param set FW_AIRSPD_MAX 20
|
||||
param set FW_AIRSPD_MIN 12
|
||||
param set FW_AIRSPD_TRIM 14
|
||||
param set FW_R_TC 0.3
|
||||
param set FW_P_TC 0.3
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.74
|
||||
param set FW_L1_PERIOD 16
|
||||
param set FW_LND_ANG 15
|
||||
@ -38,8 +37,9 @@ then
|
||||
param set FW_RR_I 0.1
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.3
|
||||
param set RWTO_TKOFF 1
|
||||
fi
|
||||
|
||||
param set RWTO_TKOFF 1
|
||||
|
||||
set HIL yes
|
||||
set MIXER AERT
|
||||
|
||||
@ -14,8 +14,7 @@ then
|
||||
param set FW_AIRSPD_MIN 12
|
||||
param set FW_AIRSPD_TRIM 25
|
||||
param set FW_AIRSPD_MAX 40
|
||||
param set FW_R_TC 0.3
|
||||
param set FW_P_TC 0.3
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.74
|
||||
param set FW_L1_PERIOD 15
|
||||
param set FW_PR_FF 0.8
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Steadidrone MAVRIK
|
||||
#
|
||||
# @type Octo Coax Wide
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@uaventure.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_PITCH_P 4.0
|
||||
param set MC_PITCHRATE_P 0.24
|
||||
param set MC_PITCHRATE_I 0.09
|
||||
param set MC_PITCHRATE_D 0.013
|
||||
param set MC_PITCHRATE_MAX 180.0
|
||||
|
||||
param set MC_ROLL_P 4.0
|
||||
param set MC_ROLLRATE_P 0.16
|
||||
param set MC_ROLLRATE_I 0.07
|
||||
param set MC_ROLLRATE_D 0.009
|
||||
param set MC_ROLLRATE_MAX 180.0
|
||||
|
||||
param set MC_YAW_P 3.0
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.5
|
||||
|
||||
param set MPC_HOLD_MAX_XY 0.25
|
||||
param set MPC_THR_MIN 0.15
|
||||
param set MPC_Z_VEL_MAX 2.0
|
||||
|
||||
param set BAT_N_CELLS 4
|
||||
fi
|
||||
|
||||
set MIXER octo_cox_w
|
||||
|
||||
set PWM_OUT 12345678
|
||||
@ -1,44 +1,19 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Caipiroshka Duo Tailsitter
|
||||
# @name Duorotor Tailsitter
|
||||
#
|
||||
# @type VTOL Duo Tailsitter
|
||||
#
|
||||
# @output MAIN1 motor left
|
||||
# @output MAIN2 motor right
|
||||
# @output MAIN5 elevon left
|
||||
# @output MAIN6 elevon right
|
||||
# @type VTOL Tailsitter
|
||||
#
|
||||
# @maintainer Roman Bapst <roman@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 6.0
|
||||
param set MC_ROLLRATE_P 0.12
|
||||
param set MC_ROLLRATE_I 0.002
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_ROLLRATE_FF 0.0
|
||||
param set MC_PITCH_P 4.5
|
||||
param set MC_PITCHRATE_P 0.3
|
||||
param set MC_PITCHRATE_I 0.002
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_PITCHRATE_FF 0.0
|
||||
param set MC_YAW_P 3.8
|
||||
param set MC_YAW_FF 0.5
|
||||
param set MC_YAWRATE_P 0.22
|
||||
param set MC_YAWRATE_I 0.02
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
|
||||
param set VT_MOT_COUNT 2
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
param set MAV_TYPE 19
|
||||
fi
|
||||
|
||||
set MIXER caipirinha_vtol
|
||||
|
||||
set PWM_OUT 1234
|
||||
set PWM_OUT 12
|
||||
set PWM_MAX 2000
|
||||
set PWM_RATE 400
|
||||
param set VT_MOT_COUNT 2
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
|
||||
@ -14,12 +14,12 @@ then
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.17
|
||||
param set MC_ROLLRATE_I 0.002
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_ROLLRATE_D 0.004
|
||||
param set MC_ROLLRATE_FF 0.0
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.14
|
||||
param set MC_PITCHRATE_I 0.002
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_PITCHRATE_FF 0.0
|
||||
param set MC_YAW_P 3.8
|
||||
param set MC_YAW_FF 0.5
|
||||
@ -31,17 +31,21 @@ then
|
||||
param set VT_TILT_MC 0.08
|
||||
param set VT_TILT_TRANS 0.5
|
||||
param set VT_TILT_FW 0.9
|
||||
|
||||
param set VT_MOT_COUNT 6
|
||||
param set VT_FW_MOT_OFFID 34
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 1
|
||||
fi
|
||||
|
||||
set MIXER firefly6
|
||||
set PWM_OUT 12345678
|
||||
set PWM_RATE 400
|
||||
|
||||
set MIXER_AUX firefly6
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1000
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
|
||||
set MAV_TYPE 21
|
||||
|
||||
param set VT_MOT_COUNT 6
|
||||
param set VT_FW_MOT_OFFID 34
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 1
|
||||
|
||||
@ -2,24 +2,20 @@
|
||||
#
|
||||
# @name Quadrotor X Tailsitter
|
||||
#
|
||||
# @type VTOL Quad Tailsitter
|
||||
# @type VTOL Tailsitter
|
||||
#
|
||||
# @maintainer Roman Bapst <roman@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
param set VT_ELEV_MC_LOCK 1
|
||||
fi
|
||||
|
||||
set MIXER quad_x_vtol
|
||||
|
||||
set PWM_OUT 1234
|
||||
set PWM_MAX 2000
|
||||
set PWM_RATE 400
|
||||
set MAV_TYPE 20
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
param set VT_ELEV_MC_LOCK 1
|
||||
|
||||
@ -2,24 +2,20 @@
|
||||
#
|
||||
# @name Quadrotor + Tailsitter
|
||||
#
|
||||
# @type VTOL Quad Tailsitter
|
||||
# @type VTOL Tailsitter
|
||||
#
|
||||
# @maintainer Roman Bapst <roman@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
param set VT_ELEV_MC_LOCK 1
|
||||
fi
|
||||
|
||||
set MIXER quad_+_vtol
|
||||
|
||||
set PWM_OUT 1234
|
||||
set PWM_MAX 2000
|
||||
set PWM_RATE 400
|
||||
set MAV_TYPE 20
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
param set VT_ELEV_MC_LOCK 1
|
||||
|
||||
@ -14,18 +14,16 @@ then
|
||||
param set VT_TYPE 2
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_TRANS_THR 0.75
|
||||
param set VT_ARSP_TRANS 12
|
||||
param set VT_ARSP_BLEND 6
|
||||
|
||||
param set MC_ROLL_P 6.0
|
||||
param set MC_ROLLRATE_P 0.17
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.15
|
||||
param set MC_ROLLRATE_I 0.002
|
||||
param set MC_ROLLRATE_D 0.004
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_ROLLRATE_FF 0.0
|
||||
param set MC_PITCH_P 6.0
|
||||
param set MC_PITCHRATE_P 0.19
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.12
|
||||
param set MC_PITCHRATE_I 0.002
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_PITCHRATE_FF 0.0
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAW_FF 0.5
|
||||
@ -33,28 +31,20 @@ then
|
||||
param set MC_YAWRATE_I 0.02
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
|
||||
param set FW_PR_FF 0.5
|
||||
param set FW_PR_I 0.02
|
||||
param set FW_PR_IMAX 0.4
|
||||
param set FW_PR_P 0.08
|
||||
param set FW_RR_FF 0.6
|
||||
param set FW_RR_I 0.01
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.05
|
||||
param set FW_THR_CRUISE 0.75
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 2
|
||||
fi
|
||||
|
||||
set MIXER vtol_quad_x
|
||||
set PWM_OUT 1234
|
||||
set PWM_RATE 400
|
||||
set PWM_OUT 12345678
|
||||
|
||||
set MIXER_AUX vtol_AAERT
|
||||
set PWM_ACHDIS 5
|
||||
set PWM_AUX_DISARMED 950
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1000
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
|
||||
set MAV_TYPE 22
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 2
|
||||
|
||||
@ -31,18 +31,20 @@ then
|
||||
param set MC_YAWRATE_I 0.02
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 2
|
||||
fi
|
||||
|
||||
set MIXER vtol_quad_x
|
||||
set PWM_OUT 1234
|
||||
set PWM_RATE 400
|
||||
set PWM_OUT 12345678
|
||||
|
||||
set MIXER_AUX vtol_delta
|
||||
set PWM_ACHDIS 3
|
||||
set PWM_AUX_DISARMED 950
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1000
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
|
||||
set MAV_TYPE 22
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 2
|
||||
|
||||
@ -31,18 +31,21 @@ then
|
||||
param set MC_YAWRATE_I 0.02
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 2
|
||||
|
||||
fi
|
||||
|
||||
set MIXER vtol_quad_x
|
||||
set PWM_OUT 1234
|
||||
set PWM_RATE 400
|
||||
set PWM_OUT 12345678
|
||||
|
||||
set MIXER_AUX vtol_AAVVT
|
||||
set PWM_ACHDIS 5
|
||||
set PWM_AUX_DISARMED 950
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1000
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
|
||||
set MAV_TYPE 22
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 2
|
||||
|
||||
@ -1,68 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name QuadRanger
|
||||
#
|
||||
# @type Standard VTOL
|
||||
#
|
||||
# @maintainer Sander Smeets <sander@droneslab.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set VT_TYPE 2
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_TRANS_THR 0.75
|
||||
|
||||
param set PWM_AUX_REV1 1
|
||||
param set PWM_AUX_REV2 1
|
||||
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.15
|
||||
param set MC_ROLLRATE_I 0.1
|
||||
param set MC_ROLLRATE_D 0.004
|
||||
param set MC_ROLLRATE_FF 0.0
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.15
|
||||
param set MC_PITCHRATE_I 0.1
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_PITCHRATE_FF 0.0
|
||||
param set MC_YAW_P 3.5
|
||||
param set MC_YAW_FF 0.7
|
||||
param set MC_YAWRATE_P 0.6
|
||||
param set MC_YAWRATE_I 0.04
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
|
||||
param set MPC_ACC_HOR_MAX 2.0
|
||||
param set MPC_Z_VEL_MAX 1.5
|
||||
param set MPC_TKO_SPEED 1.5
|
||||
param set MPC_LAND_SPEED 0.8
|
||||
|
||||
param set FW_THR_CRUISE 65.0
|
||||
param set FW_PR_P 0.08
|
||||
param set FW_PR_FF 0.5
|
||||
param set FW_RR_P 0.05
|
||||
param set FW_RR_FF 0.6
|
||||
|
||||
param set MIS_YAW_TMT 10
|
||||
|
||||
param set VT_ARSP_TRANS 15.0
|
||||
param set VT_ARSP_BLEND 8.0
|
||||
param set VT_B_TRANS_DUR 4.0
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 2
|
||||
fi
|
||||
|
||||
set MIXER vtol_quad_x
|
||||
set PWM_OUT 1234
|
||||
set PWM_RATE 400
|
||||
|
||||
set MIXER_AUX vtol_AAERT
|
||||
set PWM_ACHDIS 5
|
||||
set PWM_AUX_DISARMED 950
|
||||
|
||||
set MAV_TYPE 22
|
||||
@ -1,88 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Sparkle Tech Ranger VTOL
|
||||
#
|
||||
# @type Standard VTOL
|
||||
#
|
||||
# @maintainer Andreas Antener <andreas@uaventure.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set VT_TYPE 2
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1180
|
||||
param set MAV_TYPE 22
|
||||
param set VT_ARSP_TRANS 15.0
|
||||
param set VT_B_TRANS_DUR 4.0
|
||||
param set VT_TRANS_MIN_TM 5.0
|
||||
param set VT_TRANS_THR 0.6
|
||||
param set VT_TRANS_TIMEOUT 30.0
|
||||
|
||||
param set FW_AIRSPD_MAX 22.0
|
||||
param set FW_AIRSPD_MIN 14.0
|
||||
param set FW_AIRSPD_TRIM 16.0
|
||||
param set FW_L1_PERIOD 25.0
|
||||
param set FW_PR_P 0.060
|
||||
param set FW_P_RMAX_NEG 40.0
|
||||
param set FW_P_RMAX_POS 40.0
|
||||
param set FW_RR_FF 0.4
|
||||
param set FW_RR_P 0.04
|
||||
param set FW_R_RMAX 40.0
|
||||
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_PITCHRATE_I 0.0
|
||||
param set MC_PITCHRATE_MAX 60.0
|
||||
param set MC_PITCHRATE_P 0.21
|
||||
param set MC_PITCH_P 4.0
|
||||
param set MC_ROLLRATE_D 0.004
|
||||
param set MC_ROLLRATE_I 0.002
|
||||
param set MC_ROLLRATE_MAX 60.0
|
||||
param set MC_ROLLRATE_P 0.24
|
||||
param set MC_ROLL_P 4.0
|
||||
param set MC_YAWRATE_I 0.02
|
||||
param set MC_YAWRATE_MAX 40.0
|
||||
param set MC_YAWRATE_P 0.18
|
||||
param set MC_YAWRAUTO_MAX 40.0
|
||||
|
||||
param set MIS_TAKEOFF_ALT 2.5
|
||||
param set MIS_YAW_TMT 20.0
|
||||
|
||||
param set MPC_ACC_HOR_MAX 1.0
|
||||
param set MPC_HOLD_MAX_XY 0.5
|
||||
param set MPC_HOLD_MAX_Z 0.5
|
||||
param set MPC_LAND_SPEED 1.0
|
||||
param set MPC_MANTHR_MIN 0.05
|
||||
param set MPC_MAN_Y_MAX 120.0
|
||||
param set MPC_THR_MIN 0.07
|
||||
param set MPC_TILTMAX_AIR 35.0
|
||||
param set MPC_TILTMAX_LND 20.0
|
||||
param set MPC_TKO_SPEED 1.0
|
||||
param set MPC_XY_FF 0.1
|
||||
param set MPC_XY_P 0.3
|
||||
param set MPC_XY_VEL_MAX 3.0
|
||||
param set MPC_XY_VEL_P 0.05
|
||||
param set MPC_Z_FF 0.3
|
||||
param set MPC_Z_P 0.5
|
||||
param set MPC_Z_VEL_MAX 1.0
|
||||
param set MPC_Z_VEL_P 0.1
|
||||
|
||||
param set NAV_ACC_RAD 3.0
|
||||
|
||||
param set PWM_AUX_REV1 1
|
||||
param set PWM_AUX_REV2 1
|
||||
param set PWM_AUX_REV3 1
|
||||
param set PWM_AUX_REV4 1
|
||||
fi
|
||||
|
||||
set MIXER vtol_quad_x
|
||||
set PWM_OUT 1234
|
||||
set PWM_RATE 400
|
||||
|
||||
set MIXER_AUX vtol_AAERT
|
||||
set PWM_ACHDIS 5
|
||||
set PWM_AUX_DISARMED 950
|
||||
|
||||
set MAV_TYPE 22
|
||||
@ -1,12 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Passthrough mode for Snapdragon
|
||||
#
|
||||
# @type custom
|
||||
#
|
||||
# @maintainer Julian Oes <julian@oes.ch>
|
||||
#
|
||||
# This startup can be used on Pixhawk/Pixfalcon/Pixracer for the
|
||||
# passthrough of RC input and PWM output.
|
||||
|
||||
set VEHICLE_TYPE passthrough
|
||||
@ -2,7 +2,7 @@
|
||||
#
|
||||
# @name Applied Aeronautics Albatross
|
||||
#
|
||||
# @type Plane A-Tail
|
||||
# @type Standard Plane
|
||||
#
|
||||
# @output MAIN1 aileron right
|
||||
# @output MAIN2 aileron left
|
||||
|
||||
@ -24,8 +24,7 @@ then
|
||||
param set FW_AIRSPD_MAX 15
|
||||
param set FW_AIRSPD_MIN 10
|
||||
param set FW_AIRSPD_TRIM 13
|
||||
param set FW_R_TC 0.3
|
||||
param set FW_P_TC 0.3
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.74
|
||||
param set FW_L1_PERIOD 16
|
||||
param set FW_LND_ANG 15
|
||||
|
||||
@ -24,8 +24,7 @@ then
|
||||
param set FW_AIRSPD_MIN 13
|
||||
param set FW_AIRSPD_TRIM 15
|
||||
param set FW_AIRSPD_MAX 25
|
||||
param set FW_R_TC 0.3
|
||||
param set FW_P_TC 0.3
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.75
|
||||
param set FW_L1_PERIOD 15
|
||||
param set FW_PR_FF 0.2
|
||||
|
||||
@ -24,8 +24,7 @@ then
|
||||
param set FW_AIRSPD_MIN 15
|
||||
param set FW_AIRSPD_TRIM 20
|
||||
param set FW_AIRSPD_MAX 40
|
||||
param set FW_R_TC 0.3
|
||||
param set FW_P_TC 0.3
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.74
|
||||
param set FW_L1_PERIOD 16
|
||||
param set FW_LND_ANG 15
|
||||
|
||||
@ -25,8 +25,7 @@ then
|
||||
param set FW_AIRSPD_MAX 15
|
||||
param set FW_AIRSPD_MIN 10
|
||||
param set FW_AIRSPD_TRIM 13
|
||||
param set FW_R_TC 0.3
|
||||
param set FW_P_TC 0.3
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.74
|
||||
param set FW_L1_PERIOD 16
|
||||
param set FW_LND_ANG 15
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Sparkle Tech Pigeon
|
||||
#
|
||||
# @url http://www.sparkletech.hk/
|
||||
#
|
||||
# @type Flying Wing
|
||||
#
|
||||
# @output MAIN1 left aileron
|
||||
# @output MAIN2 right aileron
|
||||
# @output MAIN4 throttle
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set FW_AIRSPD_MIN 15
|
||||
param set FW_AIRSPD_TRIM 20
|
||||
param set FW_AIRSPD_MAX 27
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.75
|
||||
param set FW_L1_PERIOD 15
|
||||
param set FW_PR_FF 0.35
|
||||
param set FW_PR_IMAX 0.2
|
||||
param set FW_PR_P 0.05
|
||||
param set FW_P_LIM_MAX 45
|
||||
param set FW_P_LIM_MIN -45
|
||||
param set FW_P_ROLLFF 1
|
||||
param set FW_P_TC 0.3
|
||||
param set FW_RR_FF 0.3
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.03
|
||||
param set FW_R_LIM 40
|
||||
param set FW_R_RMAX 50
|
||||
param set FW_R_TC 0.3
|
||||
|
||||
# Bottom of bay and nominal zero-pitch attitude differ
|
||||
# the payload bay is pitched up about 7 degrees
|
||||
param set SENS_BOARD_Y_OFF 11.9
|
||||
|
||||
param set FW_L1_PERIOD 20.0
|
||||
fi
|
||||
|
||||
set MIXER phantom
|
||||
|
||||
# Provide ESC a constant 1000 us pulse
|
||||
set PWM_OUT 4
|
||||
set PWM_DISARMED 1000
|
||||
@ -14,8 +14,7 @@ then
|
||||
param set FW_AIRSPD_MAX 20
|
||||
param set FW_AIRSPD_MIN 12
|
||||
param set FW_AIRSPD_TRIM 16
|
||||
param set FW_R_TC 0.3
|
||||
param set FW_P_TC 0.3
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.74
|
||||
param set FW_L1_PERIOD 16
|
||||
param set FW_LND_ANG 15
|
||||
|
||||
@ -15,22 +15,22 @@ sh /etc/init.d/4001_quad_x
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 6.0
|
||||
param set MC_ROLLRATE_P 0.14
|
||||
param set MC_ROLLRATE_I 0.23
|
||||
param set MC_ROLLRATE_D 0.0025
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.05
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.002
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.235
|
||||
param set MC_PITCHRATE_I 0.17
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_YAW_P 4
|
||||
param set MC_YAWRATE_P 0.3
|
||||
param set MC_YAWRATE_I 0.2
|
||||
param set MC_PITCHRATE_P 0.08
|
||||
param set MC_PITCHRATE_I 0.1
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.5
|
||||
param set PWM_MIN 1075
|
||||
param set PWM_MIN 980
|
||||
param set MPC_THR_MIN 0.06
|
||||
param set MPC_MANTHR_MIN 0.06
|
||||
param set CBRK_IO_SAFETY 22027
|
||||
param set ATT_BIAS_MAX 0.0
|
||||
param set MC_ROLLRATE_MAX 360.0
|
||||
param set MC_PITCHRATE_MAX 360.0
|
||||
param set MC_YAWRATE_MAX 200.0
|
||||
fi
|
||||
|
||||
@ -30,3 +30,9 @@ then
|
||||
# DJI ESCs do not support calibration and need a higher min
|
||||
param set PWM_MIN 1230
|
||||
fi
|
||||
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1075
|
||||
then
|
||||
param set PWM_MIN 1230
|
||||
fi
|
||||
|
||||
@ -18,11 +18,11 @@ then
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.15
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_ROLLRATE_D 0.01
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.15
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_PITCHRATE_D 0.01
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.3
|
||||
param set MC_YAWRATE_I 0.1
|
||||
@ -30,3 +30,9 @@ then
|
||||
# DJI ESCs do not support calibration and need a higher min
|
||||
param set PWM_MIN 1230
|
||||
fi
|
||||
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1075
|
||||
then
|
||||
param set PWM_MIN 1230
|
||||
fi
|
||||
|
||||
@ -14,11 +14,11 @@ then
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.16
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_ROLLRATE_D 0.01
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.16
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_PITCHRATE_D 0.01
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.3
|
||||
param set MC_YAWRATE_I 0.1
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name 3DR Solo
|
||||
# @name Generic Quadrotor X config
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Reaper 500 Quad
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Blankered
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.14
|
||||
param set MC_ROLLRATE_I 0.1
|
||||
param set MC_ROLLRATE_D 0.004
|
||||
param set MC_PITCH_P 6.0
|
||||
param set MC_PITCHRATE_P 0.14
|
||||
param set MC_PITCHRATE_I 0.09
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_YAW_P 4
|
||||
|
||||
param set NAV_ACC_RAD 2.0
|
||||
param set RTL_RETURN_ALT 30.0
|
||||
param set RTL_DESCEND_ALT 10.0
|
||||
fi
|
||||
|
||||
set MIXER quad_h
|
||||
|
||||
set PWM_RATE 50
|
||||
set PWM_OUT 1234
|
||||
set PWM_MIN 1100
|
||||
set PWM_MAX 1900
|
||||
set PWM_DISARMED 1500
|
||||
|
||||
set MIXER_AUX pass
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
set PWM_AUX_DISARMED 950
|
||||
@ -1,45 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Generic 250 Racer
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Mark Whitehorn <kd0aij@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 8.0
|
||||
param set MC_ROLLRATE_P 0.19
|
||||
param set MC_ROLLRATE_I 0.1
|
||||
param set MC_ROLLRATE_D 0.0055
|
||||
param set MC_PITCH_P 8.0
|
||||
param set MC_PITCHRATE_P 0.24
|
||||
param set MC_PITCHRATE_I 0.1
|
||||
param set MC_PITCHRATE_D 0.0065
|
||||
param set MC_YAW_P 4.0
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.5
|
||||
param set MC_ROLLRATE_MAX 720.0
|
||||
param set MC_PITCHRATE_MAX 720.0
|
||||
param set MC_YAWRATE_MAX 400.0
|
||||
param set MC_ACRO_R_MAX 360.0
|
||||
param set MC_ACRO_P_MAX 360.0
|
||||
|
||||
param set PWM_MIN 1075
|
||||
|
||||
param set MPC_THR_MIN 0.06
|
||||
param set MPC_MANTHR_MIN 0.06
|
||||
|
||||
param set ATT_BIAS_MAX 0.0
|
||||
|
||||
param set CBRK_IO_SAFETY 22027
|
||||
fi
|
||||
@ -1,23 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name DJI Matrice 100
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer James Goppert <james.goppert@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLLRATE_P 0.05
|
||||
param set MC_ROLLRATE_D 0.001
|
||||
param set MC_PITCHRATE_P 0.05
|
||||
param set MC_PITCHRATE_D 0.001
|
||||
param set BAT_N_CELLS 6
|
||||
fi
|
||||
@ -7,10 +7,9 @@ then
|
||||
#
|
||||
# Default parameters for FW
|
||||
#
|
||||
param set RTL_RETURN_ALT 100
|
||||
param set RTL_DESCEND_ALT 100
|
||||
param set RTL_LAND_DELAY -1
|
||||
|
||||
param set NAV_LAND_ALT 90
|
||||
param set NAV_RTL_ALT 100
|
||||
param set NAV_RTL_LAND_T -1
|
||||
param set NAV_ACC_RAD 50
|
||||
|
||||
param set PE_VELNE_NOISE 0.3
|
||||
|
||||
@ -103,12 +103,6 @@ then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
#MindPX has not aux mixer
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
if [ $MIXER_AUX != none -a $AUX_MODE != none ]
|
||||
then
|
||||
#
|
||||
@ -153,7 +147,6 @@ then
|
||||
set FAILSAFE_AUX none
|
||||
fi
|
||||
|
||||
# Set min / max for aux out and rates
|
||||
if [ $PWM_AUX_OUT != none ]
|
||||
then
|
||||
#
|
||||
@ -164,6 +157,13 @@ then
|
||||
pwm rate -c $PWM_AUX_OUT -r $PWM_AUX_RATE -d $OUTPUT_AUX_DEV
|
||||
fi
|
||||
|
||||
#
|
||||
# Set disarmed, min and max PWM_AUX values
|
||||
#
|
||||
if [ $PWM_AUX_DISARMED != none ]
|
||||
then
|
||||
pwm disarmed -c $PWM_AUX_OUT -p $PWM_AUX_DISARMED -d $OUTPUT_AUX_DEV
|
||||
fi
|
||||
if [ $PWM_AUX_MIN != none ]
|
||||
then
|
||||
pwm min -c $PWM_AUX_OUT -p $PWM_AUX_MIN -d $OUTPUT_AUX_DEV
|
||||
@ -174,23 +174,6 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set disarmed values for aux out
|
||||
|
||||
# Transitional support until all configs
|
||||
# are updated
|
||||
if [ $PWM_ACHDIS == none ]
|
||||
then
|
||||
set PWM_ACHDIS ${PWM_AUX_OUT}
|
||||
fi
|
||||
|
||||
#
|
||||
# Set disarmed, min and max PWM_AUX values
|
||||
#
|
||||
if [ $PWM_AUX_DISARMED != none -a $PWM_ACHDIS != none ]
|
||||
then
|
||||
pwm disarmed -c $PWM_ACHDIS -p $PWM_AUX_DISARMED -d $OUTPUT_AUX_DEV
|
||||
fi
|
||||
|
||||
if [ $FAILSAFE_AUX != none ]
|
||||
then
|
||||
pwm failsafe -d $OUTPUT_AUX_DEV $FAILSAFE
|
||||
@ -198,18 +181,5 @@ then
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
unset PWM_OUT
|
||||
unset PWM_RATE
|
||||
unset PWM_ACHDIS
|
||||
unset PWM_MIN
|
||||
unset PWM_MAX
|
||||
unset PWM_AUX_OUT
|
||||
unset PWM_AUX_RATE
|
||||
unset PWM_AUX_DISARMED
|
||||
unset PWM_AUX_MIN
|
||||
unset PWM_AUX_MAX
|
||||
unset FAILSAFE_AUX
|
||||
unset FAILSAFE
|
||||
unset OUTPUT_DEV
|
||||
unset OUTPUT_AUX_DEV
|
||||
|
||||
@ -18,4 +18,6 @@ fi
|
||||
|
||||
if px4io limit $PX4IO_LIMIT
|
||||
then
|
||||
else
|
||||
echo "[i] Set PX4IO update rate to $PX4IO_LIMIT Hz failed!"
|
||||
fi
|
||||
|
||||
18
ROMFS/px4fmu_common/init.d/rc.logging
Normal file
18
ROMFS/px4fmu_common/init.d/rc.logging
Normal file
@ -0,0 +1,18 @@
|
||||
#!nsh
|
||||
#
|
||||
# Initialize logging services.
|
||||
#
|
||||
|
||||
if [ -d /fs/microsd ]
|
||||
then
|
||||
if ver hwcmp PX4FMU_V1
|
||||
then
|
||||
if sdlog2 start -r 40 -a -b 3 -t
|
||||
then
|
||||
fi
|
||||
else
|
||||
if sdlog2 start -r 100 -a -b 12 -t
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@ -4,31 +4,23 @@
|
||||
# att & pos estimator, att & pos control.
|
||||
#
|
||||
|
||||
|
||||
#---------------------------------------
|
||||
# Estimator group selction
|
||||
#
|
||||
# INAV
|
||||
if param compare SYS_MC_EST_GROUP 0
|
||||
# The system is defaulting to INAV_ENABLED = 1
|
||||
# but users can alternatively try the EKF-based
|
||||
# filter by setting INAV_ENABLED = 0
|
||||
if param compare INAV_ENABLED 1
|
||||
then
|
||||
attitude_estimator_q start
|
||||
position_estimator_inav start
|
||||
else
|
||||
if param compare LPE_ENABLED 1
|
||||
then
|
||||
attitude_estimator_q start
|
||||
local_position_estimator start
|
||||
else
|
||||
ekf2 start
|
||||
fi
|
||||
fi
|
||||
|
||||
# LPE
|
||||
if param compare SYS_MC_EST_GROUP 1
|
||||
then
|
||||
attitude_estimator_q start
|
||||
local_position_estimator start
|
||||
fi
|
||||
|
||||
# EKF
|
||||
if param compare SYS_MC_EST_GROUP 2
|
||||
then
|
||||
ekf2 start
|
||||
fi
|
||||
#---------------------------------------
|
||||
|
||||
if mc_att_control start
|
||||
then
|
||||
else
|
||||
|
||||
@ -15,8 +15,20 @@ then
|
||||
param set PWM_DISARMED 900
|
||||
param set PWM_MIN 1075
|
||||
param set PWM_MAX 1950
|
||||
fi
|
||||
|
||||
param set RTL_LAND_DELAY 0
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1000
|
||||
then
|
||||
param set PWM_MIN 1075
|
||||
fi
|
||||
if param compare PWM_MAX 2000
|
||||
then
|
||||
param set PWM_MAX 1950
|
||||
fi
|
||||
if param compare PWM_DISARMED 0
|
||||
then
|
||||
param set PWM_DISARMED 900
|
||||
fi
|
||||
|
||||
# set environment variables (!= parameters)
|
||||
@ -33,17 +45,3 @@ set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1500
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1000
|
||||
then
|
||||
param set PWM_MIN 1075
|
||||
fi
|
||||
if param compare PWM_MAX 2000
|
||||
then
|
||||
param set PWM_MAX 1950
|
||||
fi
|
||||
if param compare PWM_DISARMED 0
|
||||
then
|
||||
param set PWM_DISARMED 900
|
||||
fi
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!nsh
|
||||
#
|
||||
# Standard startup script for PX4FMU v1, v2, v3, v4 onboard sensor drivers.
|
||||
# Standard startup script for PX4FMU v1, v2, v3 onboard sensor drivers.
|
||||
#
|
||||
|
||||
if ver hwcmp PX4FMU_V1
|
||||
@ -9,11 +9,6 @@ then
|
||||
then
|
||||
fi
|
||||
else
|
||||
# Configure all I2C buses to 100 KHz as they
|
||||
# are all external or slow
|
||||
fmu i2c 1 100000
|
||||
fmu i2c 2 100000
|
||||
|
||||
if ms5611 -s start
|
||||
then
|
||||
fi
|
||||
@ -35,11 +30,6 @@ then
|
||||
then
|
||||
fi
|
||||
|
||||
# External I2C bus
|
||||
if lis3mdl -X start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal I2C bus
|
||||
if hmc5883 -C -T -I -R 4 start
|
||||
then
|
||||
@ -74,10 +64,6 @@ then
|
||||
then
|
||||
fi
|
||||
|
||||
if meas_airspeed start -b 2
|
||||
then
|
||||
fi
|
||||
|
||||
else
|
||||
# FMUv2
|
||||
if mpu6000 start
|
||||
@ -92,92 +78,61 @@ then
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
else
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
fi
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if lis3mdl -R 2 start
|
||||
then
|
||||
fi
|
||||
# Internal SPI bus is rotated 90 deg yaw
|
||||
if hmc5883 -C -T -S -R 2 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus is rotated 90 deg yaw
|
||||
if hmc5883 -C -T -S -R 2 start
|
||||
then
|
||||
fi
|
||||
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
|
||||
if mpu6000 -R 2 -T 20608 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
|
||||
if mpu6000 -R 2 -T 20608 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
||||
if mpu9250 -R 2 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V1
|
||||
then
|
||||
# FMUv1
|
||||
if mpu6000 start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
|
||||
# MAG selection
|
||||
if param compare SENS_EXT_MAG 2
|
||||
then
|
||||
if hmc5883 -C -I start
|
||||
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
||||
if mpu9250 -R 2 start
|
||||
then
|
||||
fi
|
||||
else
|
||||
# Use only external as primary
|
||||
if param compare SENS_EXT_MAG 1
|
||||
# FMUv1
|
||||
if mpu6000 start
|
||||
then
|
||||
if hmc5883 -C -X start
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
|
||||
# MAG selection
|
||||
if param compare SENS_EXT_MAG 2
|
||||
then
|
||||
if hmc5883 -C -I start
|
||||
then
|
||||
fi
|
||||
else
|
||||
# auto-detect the primary, prefer external
|
||||
if hmc5883 start
|
||||
# Use only external as primary
|
||||
if param compare SENS_EXT_MAG 1
|
||||
then
|
||||
if hmc5883 -C -X start
|
||||
then
|
||||
fi
|
||||
else
|
||||
# auto-detect the primary, prefer external
|
||||
if hmc5883 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
if mpu6500 start
|
||||
then
|
||||
fi
|
||||
|
||||
if lsm303d start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if lis3mdl -R 2 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if meas_airspeed start
|
||||
then
|
||||
else
|
||||
@ -190,10 +145,6 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if sf10a start
|
||||
then
|
||||
fi
|
||||
|
||||
# Wait 20 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire)
|
||||
usleep 20000
|
||||
if sensors start
|
||||
|
||||
@ -3,33 +3,10 @@
|
||||
# Standard apps for vtol:
|
||||
# att & pos estimator, att & pos control.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
#---------------------------------------
|
||||
# Estimator group selction
|
||||
#
|
||||
# INAV
|
||||
if param compare SYS_MC_EST_GROUP 0
|
||||
then
|
||||
attitude_estimator_q start
|
||||
position_estimator_inav start
|
||||
fi
|
||||
|
||||
# LPE
|
||||
if param compare SYS_MC_EST_GROUP 1
|
||||
then
|
||||
attitude_estimator_q start
|
||||
local_position_estimator start
|
||||
fi
|
||||
|
||||
# EKF
|
||||
if param compare SYS_MC_EST_GROUP 2
|
||||
then
|
||||
ekf2 start
|
||||
fi
|
||||
#---------------------------------------
|
||||
|
||||
attitude_estimator_q start
|
||||
#ekf_att_pos_estimator start
|
||||
position_estimator_inav start
|
||||
|
||||
vtol_att_control start
|
||||
mc_att_control start
|
||||
|
||||
@ -4,46 +4,42 @@ set VEHICLE_TYPE vtol
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
#
|
||||
#Default controller parameters for MC
|
||||
#
|
||||
param set MC_ROLL_P 6.0
|
||||
param set MC_ROLLRATE_P 0.1
|
||||
param set MC_ROLLRATE_I 0.0
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_PITCH_P 6.0
|
||||
param set MC_PITCHRATE_P 0.2
|
||||
param set MC_PITCHRATE_I 0.0
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_YAW_P 4
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.0
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.3
|
||||
|
||||
#
|
||||
# Default parameters for FW
|
||||
#
|
||||
param set FW_PR_FF 0.3
|
||||
param set FW_PR_I 0.000
|
||||
param set FW_PR_IMAX 0.2
|
||||
param set FW_PR_P 0.02
|
||||
param set FW_RR_FF 0.3
|
||||
param set FW_RR_I 0.00
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.02
|
||||
|
||||
param set PE_VELNE_NOISE 0.5
|
||||
param set PE_VELD_NOISE 0.3
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.25
|
||||
param set PE_ABIAS_PNOISE 0.0001
|
||||
|
||||
#
|
||||
# Default parameters for mission and position handling
|
||||
#
|
||||
param set NAV_ACC_RAD 3
|
||||
param set MPC_TKO_SPEED 1.0
|
||||
param set MPC_LAND_SPEED 0.7
|
||||
param set MPC_Z_VEL_MAX 1.5
|
||||
param set MPC_XY_VEL_MAX 4.0
|
||||
param set MIS_YAW_TMT 10
|
||||
param set MPC_ACC_HOR_MAX 2.0
|
||||
param set RTL_LAND_DELAY 0
|
||||
fi
|
||||
|
||||
# set environment variables (!= parameters)
|
||||
set PWM_RATE 400
|
||||
# tell the mixer to use parameters for these instead
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1000
|
||||
then
|
||||
param set PWM_MIN 1075
|
||||
fi
|
||||
if param compare PWM_MAX 2000
|
||||
then
|
||||
param set PWM_MAX 1950
|
||||
fi
|
||||
if param compare PWM_DISARMED 0
|
||||
then
|
||||
param set PWM_DISARMED 900
|
||||
fi
|
||||
set PWM_DISARMED 900
|
||||
set PWM_MIN 1000
|
||||
set PWM_MAX 2000
|
||||
|
||||
@ -15,6 +15,8 @@ sercon
|
||||
#
|
||||
set MODE autostart
|
||||
|
||||
set FRC /fs/microsd/etc/rc.txt
|
||||
set FCONFIG /fs/microsd/etc/config.txt
|
||||
set TUNE_ERR ML<<CP4CP4CP4CP4CP4
|
||||
set LOG_FILE /fs/microsd/bootlog.txt
|
||||
|
||||
@ -24,6 +26,7 @@ set LOG_FILE /fs/microsd/bootlog.txt
|
||||
# REBOOTWORK this needs to start after the flight control loop
|
||||
if mount -t vfat /dev/mmcsd0 /fs/microsd
|
||||
then
|
||||
echo "[i] microSD mounted: /fs/microsd"
|
||||
# Start playing the startup tune
|
||||
tone_alarm start
|
||||
else
|
||||
@ -47,7 +50,6 @@ fi
|
||||
# Look for an init script on the microSD card.
|
||||
# Disable autostart if the script found.
|
||||
#
|
||||
set FRC /fs/microsd/etc/rc.txt
|
||||
if [ -f $FRC ]
|
||||
then
|
||||
echo "[i] Executing script: $FRC"
|
||||
@ -76,12 +78,78 @@ then
|
||||
param select $PARAM_FILE
|
||||
if param load
|
||||
then
|
||||
echo "[param] Loaded: $PARAM_FILE"
|
||||
else
|
||||
echo "[param] FAILED loading $PARAM_FILE"
|
||||
if param reset
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Compare existing params and save defaults
|
||||
# this only needs to be in for 1-2 releases
|
||||
if param compare RC_MAP_THROTTLE 0
|
||||
then
|
||||
# So this is a default setup,
|
||||
# now lets find out if channel 3
|
||||
# is calibrated
|
||||
if param compare RC3_MIN 1000
|
||||
then
|
||||
# This is default, do nothing
|
||||
else
|
||||
# Set old default
|
||||
param set RC_MAP_THROTTLE 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Compare existing params and save defaults
|
||||
# this only needs to be in for 1-2 releases
|
||||
if param compare RC_MAP_ROLL 0
|
||||
then
|
||||
# So this is a default setup,
|
||||
# now lets find out if channel 1
|
||||
# is calibrated
|
||||
if param compare RC1_MIN 1000
|
||||
then
|
||||
# This is default, do nothing
|
||||
else
|
||||
# Set old default
|
||||
param set RC_MAP_ROLL 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Compare existing params and save defaults
|
||||
# this only needs to be in for 1-2 releases
|
||||
if param compare RC_MAP_PITCH 0
|
||||
then
|
||||
# So this is a default setup,
|
||||
# now lets find out if channel 2
|
||||
# is calibrated
|
||||
if param compare RC2_MIN 1000
|
||||
then
|
||||
# This is default, do nothing
|
||||
else
|
||||
# Set old default
|
||||
param set RC_MAP_PITCH 2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Compare existing params and save defaults
|
||||
# this only needs to be in for 1-2 releases
|
||||
if param compare RC_MAP_YAW 0
|
||||
then
|
||||
# So this is a default setup,
|
||||
# now lets find out if channel 4
|
||||
# is calibrated
|
||||
if param compare RC4_MIN 1000
|
||||
then
|
||||
# This is default, do nothing
|
||||
else
|
||||
# Set old default
|
||||
param set RC_MAP_YAW 4
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Start system state indicator
|
||||
#
|
||||
@ -99,18 +167,6 @@ then
|
||||
#then
|
||||
#fi
|
||||
|
||||
#
|
||||
# Set AUTOCNF flag to use it in AUTOSTART scripts
|
||||
#
|
||||
if param compare SYS_AUTOCONFIG 1
|
||||
then
|
||||
# Wipe out params except RC*
|
||||
param reset_nostart RC*
|
||||
set AUTOCNF yes
|
||||
else
|
||||
set AUTOCNF no
|
||||
fi
|
||||
|
||||
#
|
||||
# Set default values
|
||||
#
|
||||
@ -126,7 +182,6 @@ then
|
||||
set PWM_MAX none
|
||||
set PWM_AUX_OUT none
|
||||
set PWM_AUX_RATE none
|
||||
set PWM_ACHDIS none
|
||||
set PWM_AUX_DISARMED none
|
||||
set PWM_AUX_MIN none
|
||||
set PWM_AUX_MAX none
|
||||
@ -137,8 +192,22 @@ then
|
||||
set MAVLINK_F default
|
||||
set EXIT_ON_END no
|
||||
set MAV_TYPE none
|
||||
set LOAD_DAPPS yes
|
||||
set GPS yes
|
||||
set GPS_FAKE no
|
||||
set FAILSAFE none
|
||||
set USE_IO yes
|
||||
|
||||
#
|
||||
# Set AUTOCNF flag to use it in AUTOSTART scripts
|
||||
#
|
||||
if param compare SYS_AUTOCONFIG 1
|
||||
then
|
||||
# Wipe out params except RC*
|
||||
param reset_nostart RC*
|
||||
set AUTOCNF yes
|
||||
else
|
||||
set AUTOCNF no
|
||||
fi
|
||||
|
||||
#
|
||||
# Set USE_IO flag
|
||||
@ -148,26 +217,13 @@ then
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
set USE_IO no
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
set USE_IO no
|
||||
else
|
||||
set USE_IO yes
|
||||
fi
|
||||
else
|
||||
set USE_IO no
|
||||
fi
|
||||
|
||||
# should set to 0.8 for mindpx-v2 borad.
|
||||
if param compare INAV_LIDAR_ERR 0.5
|
||||
then
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
param set INAV_LIDAR_ERR 0.8
|
||||
param save
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Set parameters and env variables for selected AUTOSTART
|
||||
#
|
||||
@ -189,10 +245,9 @@ then
|
||||
#
|
||||
# Override parameters from user configuration file
|
||||
#
|
||||
set FCONFIG /fs/microsd/etc/config.txt
|
||||
if [ -f $FCONFIG ]
|
||||
then
|
||||
echo "[i] Custom: $FCONFIG"
|
||||
echo "[i] Custom config: $FCONFIG"
|
||||
sh $FCONFIG
|
||||
fi
|
||||
unset FCONFIG
|
||||
@ -227,6 +282,8 @@ then
|
||||
|
||||
set IO_PRESENT yes
|
||||
else
|
||||
echo "PX4IO Trying to update" >> $LOG_FILE
|
||||
|
||||
tone_alarm MLL32CP8MB
|
||||
|
||||
if px4io start
|
||||
@ -251,11 +308,11 @@ then
|
||||
|
||||
set IO_PRESENT yes
|
||||
else
|
||||
echo "PX4IO update failed" >> $LOG_FILE
|
||||
echo "ERROR: PX4IO update failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
else
|
||||
echo "PX4IO update failed" >> $LOG_FILE
|
||||
echo "ERROR: PX4IO update failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@ -263,6 +320,7 @@ then
|
||||
|
||||
if [ $IO_PRESENT == no ]
|
||||
then
|
||||
echo "[i] ERROR: PX4IO not found"
|
||||
echo "ERROR: PX4IO not found" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
@ -285,6 +343,7 @@ then
|
||||
then
|
||||
# Need IO for output but it not present, disable output
|
||||
set OUTPUT_MODE none
|
||||
echo "[i] ERROR: PX4IO not found, disabling output"
|
||||
|
||||
# Avoid using ttyS0 for MAVLink on FMUv1
|
||||
if ver hwcmp PX4FMU_V1
|
||||
@ -301,15 +360,13 @@ then
|
||||
if [ $HIL == yes ]
|
||||
then
|
||||
set OUTPUT_MODE hil
|
||||
set GPS no
|
||||
if ver hwcmp PX4FMU_V1
|
||||
then
|
||||
set FMU_MODE serial
|
||||
fi
|
||||
unset HIL
|
||||
else
|
||||
unset HIL
|
||||
gps start
|
||||
fi
|
||||
unset HIL
|
||||
|
||||
# waypoint storage
|
||||
# REBOOTWORK this needs to start in parallel
|
||||
@ -321,14 +378,22 @@ then
|
||||
# Sensors System (start before Commander so Preflight checks are properly run)
|
||||
#
|
||||
sh /etc/init.d/rc.sensors
|
||||
|
||||
if [ $GPS == yes ]
|
||||
then
|
||||
if [ $GPS_FAKE == yes ]
|
||||
then
|
||||
echo "[i] Faking GPS"
|
||||
gps start -f
|
||||
else
|
||||
gps start
|
||||
fi
|
||||
fi
|
||||
unset GPS
|
||||
unset GPS_FAKE
|
||||
|
||||
# Needs to be this early for in-air-restarts
|
||||
if [ $OUTPUT_MODE == hil ]
|
||||
then
|
||||
commander start -hil
|
||||
else
|
||||
commander start
|
||||
fi
|
||||
commander start
|
||||
|
||||
#
|
||||
# Start primary output
|
||||
@ -361,7 +426,7 @@ then
|
||||
then
|
||||
sh /etc/init.d/rc.io
|
||||
else
|
||||
echo "PX4IO start failed" >> $LOG_FILE
|
||||
echo "ERROR: PX4IO start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@ -370,8 +435,10 @@ then
|
||||
then
|
||||
if fmu mode_$FMU_MODE
|
||||
then
|
||||
echo "[i] FMU mode_$FMU_MODE started"
|
||||
else
|
||||
echo "FMU start failed" >> $LOG_FILE
|
||||
echo "[i] ERROR: FMU mode_$FMU_MODE start failed"
|
||||
echo "ERROR: FMU start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
|
||||
@ -402,7 +469,9 @@ then
|
||||
|
||||
if mkblctrl $MKBLCTRL_ARG
|
||||
then
|
||||
echo "[i] MK started"
|
||||
else
|
||||
echo "[i] ERROR: MK start failed"
|
||||
echo "ERROR: MK start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
@ -414,8 +483,10 @@ then
|
||||
then
|
||||
if pwm_out_sim mode_port2_pwm8
|
||||
then
|
||||
echo "[i] PWM SIM output started"
|
||||
else
|
||||
echo "PWM SIM start failed" >> $LOG_FILE
|
||||
echo "[i] ERROR: PWM SIM output start failed"
|
||||
echo "ERROR: PWM SIM output start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@ -429,9 +500,11 @@ then
|
||||
then
|
||||
if px4io start
|
||||
then
|
||||
echo "[i] PX4IO started"
|
||||
sh /etc/init.d/rc.io
|
||||
else
|
||||
echo "PX4IO start failed" >> $LOG_FILE
|
||||
echo "[i] ERROR: PX4IO start failed"
|
||||
echo "ERROR: PX4IO start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@ -440,8 +513,10 @@ then
|
||||
then
|
||||
if fmu mode_$FMU_MODE
|
||||
then
|
||||
echo "[i] FMU mode_$FMU_MODE started"
|
||||
else
|
||||
echo "FMU mode_$FMU_MODE start failed" >> $LOG_FILE
|
||||
echo "[i] ERROR: FMU mode_$FMU_MODE start failed"
|
||||
echo "ERROR: FMU mode_$FMU_MODE start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
|
||||
@ -475,9 +550,9 @@ then
|
||||
# Avoid using ttyS1 for MAVLink on FMUv4
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
set MAVLINK_F "-r 1200 -d /dev/ttyS1"
|
||||
set MAVLINK_F "-r 1200 -d /dev/ttyS2"
|
||||
# Start MAVLink on Wifi (ESP8266 port)
|
||||
mavlink start -r 20000 -m config -b 921600 -d /dev/ttyS0
|
||||
mavlink start -r 800000 -b 921600 -d /dev/ttyS0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@ -488,15 +563,10 @@ then
|
||||
#
|
||||
# MAVLink onboard / TELEM2
|
||||
#
|
||||
if ver hwcmp PX4FMU_V1
|
||||
if ver hwcmp PX4FMU_V2
|
||||
then
|
||||
else
|
||||
# XXX We need a better way for runtime eval of shell variables,
|
||||
# but this works for now
|
||||
if param compare SYS_COMPANION 10
|
||||
then
|
||||
frsky_telemetry start -d /dev/ttyS2
|
||||
fi
|
||||
if param compare SYS_COMPANION 921600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 921600 -m onboard -r 80000 -x
|
||||
@ -513,14 +583,6 @@ then
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -m magic -r 5000 -x
|
||||
fi
|
||||
if param compare SYS_COMPANION 357600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -r 1000
|
||||
fi
|
||||
if param compare SYS_COMPANION 1921600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 921600 -r 20000
|
||||
fi
|
||||
# Sensors on the PWM interface bank
|
||||
# clear pins 5 and 6
|
||||
if param compare SENS_EN_LL40LS 1
|
||||
@ -536,107 +598,15 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Transitional support: Disable safety on all Pixracer boards
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
if param set CBRK_IO_SAFETY 22027
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Starting stuff according to UAVCAN_ENABLE value
|
||||
# UAVCAN
|
||||
#
|
||||
if param greater UAVCAN_ENABLE 0
|
||||
then
|
||||
if uavcan start
|
||||
then
|
||||
else
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
if param greater UAVCAN_ENABLE 1
|
||||
then
|
||||
if uavcan start fw
|
||||
then
|
||||
else
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Optional drivers
|
||||
#
|
||||
|
||||
# Sensors on the PWM interface bank
|
||||
if param compare SENS_EN_LL40LS 1
|
||||
then
|
||||
if pwm_input start
|
||||
then
|
||||
if ll40ls start pwm
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# sf0x lidar sensor
|
||||
if param compare SENS_EN_SF0X 1
|
||||
then
|
||||
sf0x start
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
frsky_telemetry start -d /dev/ttyS6
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V2
|
||||
then
|
||||
# Check for flow sensor - as it is a background task, launch it last
|
||||
px4flow start &
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
#mindxp also need flow
|
||||
px4flow start &
|
||||
fi
|
||||
|
||||
# Start USB shell if no microSD present, MAVLink else
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
# Try to get an USB console
|
||||
nshterm /dev/ttyACM0 &
|
||||
else
|
||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||
fi
|
||||
|
||||
sh /etc/init.d/rc.uavcan
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
if [ -d /fs/microsd ]
|
||||
then
|
||||
if ver hwcmp PX4FMU_V1
|
||||
then
|
||||
if sdlog2 start -r 30 -a -b 2 -t
|
||||
then
|
||||
fi
|
||||
else
|
||||
# check if we should increase logging rate for ekf2 replay message logging
|
||||
if param greater EKF2_REC_RPL 0
|
||||
then
|
||||
if sdlog2 start -r 500 -e -b 20 -t
|
||||
then
|
||||
fi
|
||||
else
|
||||
if sdlog2 start -r 100 -a -b 12 -t
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
sh /etc/init.d/rc.logging
|
||||
|
||||
#
|
||||
# Start up ARDrone Motor interface
|
||||
@ -651,7 +621,7 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == fw ]
|
||||
then
|
||||
echo "FIXED WING"
|
||||
echo "[i] FIXED WING"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
@ -671,7 +641,10 @@ then
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Start standard fixedwing apps
|
||||
sh /etc/init.d/rc.fw_apps
|
||||
if [ $LOAD_DAPPS == yes ]
|
||||
then
|
||||
sh /etc/init.d/rc.fw_apps
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
@ -679,7 +652,7 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == mc ]
|
||||
then
|
||||
echo "MULTICOPTER"
|
||||
echo "[i] MULTICOPTER"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
@ -697,10 +670,6 @@ then
|
||||
then
|
||||
set MAV_TYPE 2
|
||||
fi
|
||||
if [ $MIXER == quad_h ]
|
||||
then
|
||||
set MAV_TYPE 2
|
||||
fi
|
||||
if [ $MIXER == tri_y_yaw- -o $MIXER == tri_y_yaw+ ]
|
||||
then
|
||||
set MAV_TYPE 15
|
||||
@ -717,7 +686,7 @@ then
|
||||
then
|
||||
set MAV_TYPE 14
|
||||
fi
|
||||
if [ $MIXER == octo_cox -o $MIXER == octo_cox_w ]
|
||||
if [ $MIXER == octo_cox ]
|
||||
then
|
||||
set MAV_TYPE 14
|
||||
fi
|
||||
@ -736,7 +705,10 @@ then
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Start standard multicopter apps
|
||||
sh /etc/init.d/rc.mc_apps
|
||||
if [ $LOAD_DAPPS == yes ]
|
||||
then
|
||||
sh /etc/init.d/rc.mc_apps
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
@ -744,11 +716,11 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == vtol ]
|
||||
then
|
||||
echo "VTOL"
|
||||
echo "[init] Vehicle type: VTOL"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
echo "VTOL mixer undefined"
|
||||
echo "Default mixer for vtol not defined"
|
||||
fi
|
||||
|
||||
if [ $MAV_TYPE == none ]
|
||||
@ -781,7 +753,10 @@ then
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Start standard vtol apps
|
||||
sh /etc/init.d/rc.vtol_apps
|
||||
if [ $LOAD_DAPPS == yes ]
|
||||
then
|
||||
sh /etc/init.d/rc.vtol_apps
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
@ -796,51 +771,14 @@ then
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Start standard rover apps
|
||||
sh /etc/init.d/rc.axialracing_ax10_apps
|
||||
if [ $LOAD_DAPPS == yes ]
|
||||
then
|
||||
sh /etc/init.d/rc.axialracing_ax10_apps
|
||||
fi
|
||||
|
||||
param set MAV_TYPE 10
|
||||
fi
|
||||
|
||||
#
|
||||
# For snapdragon, we need a passthrough mode
|
||||
# Do not run any mavlink instances since we need the serial port for
|
||||
# communication with Snapdragon.
|
||||
#
|
||||
if [ $VEHICLE_TYPE == passthrough ]
|
||||
then
|
||||
mavlink stop-all
|
||||
commander stop
|
||||
|
||||
# Stop multicopter attitude controller if it is running, the controls come
|
||||
# from Snapdragon.
|
||||
if mc_att_control stop
|
||||
then
|
||||
fi
|
||||
|
||||
# Start snapdragon interface on serial port.
|
||||
if ver hwcmp PX4FMU_V2
|
||||
then
|
||||
# On Pixfalcon use the standard telemetry port (Telem 1).
|
||||
snapdragon_rc_pwm start -d /dev/ttyS1
|
||||
px4io start
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
# On Pixracer use Telem 2 port (TL2).
|
||||
snapdragon_rc_pwm start -d /dev/ttyS2
|
||||
fmu mode_pwm4
|
||||
fi
|
||||
|
||||
pwm failsafe -c 1234 -p 900
|
||||
pwm disarmed -c 1234 -p 900
|
||||
|
||||
# Arm straightaway.
|
||||
pwm arm
|
||||
# Use 400 Hz PWM on all channels.
|
||||
pwm rate -a -r 400
|
||||
fi
|
||||
|
||||
unset MIXER
|
||||
unset MAV_TYPE
|
||||
unset OUTPUT_MODE
|
||||
@ -856,6 +794,7 @@ then
|
||||
if [ $VEHICLE_TYPE == none ]
|
||||
then
|
||||
echo "[i] No autostart ID found"
|
||||
|
||||
fi
|
||||
|
||||
# Start any custom addons
|
||||
@ -870,6 +809,7 @@ then
|
||||
# Run no SD alarm
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
echo "[i] No microSD card found"
|
||||
# Play SOS
|
||||
tone_alarm error
|
||||
fi
|
||||
@ -884,9 +824,35 @@ unset TUNE_ERR
|
||||
# Boot is complete, inform MAVLink app(s) that the system is now fully up and running
|
||||
mavlink boot_complete
|
||||
|
||||
# Sensors on the PWM interface bank
|
||||
if param compare SENS_EN_LL40LS 1
|
||||
then
|
||||
if pwm_input start
|
||||
then
|
||||
if ll40ls start pwm
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V2
|
||||
then
|
||||
# Check for flow sensor - as it is a background task, launch it last
|
||||
px4flow start &
|
||||
fi
|
||||
|
||||
# Start USB shell if no microSD present, MAVLink else
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
# Try to get an USB console
|
||||
nshterm /dev/ttyACM0 &
|
||||
else
|
||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||
fi
|
||||
|
||||
if [ $EXIT_ON_END == yes ]
|
||||
then
|
||||
echo "NSH EXIT"
|
||||
echo "Exit from nsh"
|
||||
exit
|
||||
fi
|
||||
unset EXIT_ON_END
|
||||
|
||||
@ -62,3 +62,24 @@ range. Inputs below zero are treated as zero.
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
|
||||
Gimbal / flaps / payload mixer for last four channels,
|
||||
using the payload control group
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 0 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 1 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 2 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 3 10000 10000 0 -10000 10000
|
||||
|
||||
@ -58,3 +58,23 @@ range. Inputs below zero are treated as zero.
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
|
||||
Gimbal / flaps / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -62,3 +62,23 @@ endpoints to suit.
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
|
||||
Gimbal / flaps / payload mixer for last four channels,
|
||||
using the payload control group
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 0 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 1 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 2 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 3 10000 10000 0 -10000 10000
|
||||
|
||||
0
ROMFS/px4fmu_common/mixers/FX79.main.mix
Normal file → Executable file
0
ROMFS/px4fmu_common/mixers/FX79.main.mix
Normal file → Executable file
@ -49,3 +49,22 @@ range. Inputs below zero are treated as zero.
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
Gimbal / flaps / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -51,3 +51,23 @@ range. Inputs below zero are treated as zero.
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
|
||||
Gimbal / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
0
ROMFS/px4fmu_common/mixers/Viper.main.mix
Normal file → Executable file
0
ROMFS/px4fmu_common/mixers/Viper.main.mix
Normal file → Executable file
@ -47,3 +47,22 @@ range. Inputs below zero are treated as zero.
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
Gimbal / flaps / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -1,39 +1,16 @@
|
||||
Caipirinha tailsitter mixer
|
||||
============================
|
||||
|
||||
This file defines a mixer for the TBS Caipirinha tailsitter edition. This vehicle
|
||||
has two motors in total, one attached to each wing. It also has two elevons which
|
||||
are located in the slipstream of the propellers. This mixer generates 4 PWM outputs
|
||||
on the main PWM ouput port, two at 400Hz for the motors, and two at 50Hz for the
|
||||
elevon servos. Channels 1-4 are configured to run at 400Hz, while channels 5-8 run
|
||||
at the default rate of 50Hz. Note that channels 3 and 4 are assigned but not used.
|
||||
|
||||
Motor mixer
|
||||
------------
|
||||
Channel 1 connects to the right (starboard) motor.
|
||||
Channel 2 connects to the left (port) motor.
|
||||
|
||||
#!nsh
|
||||
# Caipirinha vtol mixer for PX4FMU
|
||||
#
|
||||
#===========================
|
||||
R: 2- 10000 10000 10000 0
|
||||
|
||||
Zero mixer (2x)
|
||||
---------------
|
||||
Channels 3,4 are unused.
|
||||
|
||||
Z:
|
||||
|
||||
Z:
|
||||
|
||||
Elevons mixer
|
||||
--------------
|
||||
Channel 5 connects to the right (starboard) elevon.
|
||||
Channel 6 connects to the left (port) elevon.
|
||||
#mixer for the elevons
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 10000 10000 0 -10000 10000
|
||||
S: 1 1 10000 10000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 7500 7500 0 -10000 10000
|
||||
S: 1 0 -10000 -10000 0 -10000 10000
|
||||
S: 1 1 10000 10000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 7500 7500 0 -10000 10000
|
||||
S: 1 0 -10000 -10000 0 -10000 10000
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 10000 10000 0 -10000 10000
|
||||
S: 1 1 -10000 -10000 0 -10000 10000
|
||||
|
||||
@ -47,3 +47,24 @@ range. Inputs below zero are treated as zero.
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
|
||||
Gimbal / flaps / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
# Octo coaxial with wide arms
|
||||
|
||||
R: 8cw 10000 10000 10000 0
|
||||
@ -46,3 +46,22 @@ range. Inputs below zero are treated as zero.
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
Gimbal / flaps / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
Mixer for SITL plane, using the VTOL airframe for now
|
||||
=========================================================
|
||||
|
||||
Z:
|
||||
|
||||
Z:
|
||||
|
||||
Z:
|
||||
|
||||
Z:
|
||||
|
||||
# mixer for the elevons
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 5000 5000 0 -10000 10000
|
||||
S: 0 1 -5000 -5000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 5000 5000 0 -10000 10000
|
||||
S: 0 1 5000 5000 0 -10000 10000
|
||||
|
||||
# mixer for the pusher/puller throttle
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
@ -6,13 +6,22 @@ are mixed 100%.
|
||||
|
||||
R: 4+ 10000 10000 10000 0
|
||||
|
||||
Gimbal / payload mixer for last two channels
|
||||
|
||||
Gimbal / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 6 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -6,13 +6,21 @@ are mixed 100%.
|
||||
|
||||
R: 4h 10000 10000 10000 0
|
||||
|
||||
Gimbal / payload mixer for last two channels
|
||||
Gimbal / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 6 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
Multirotor mixer for TEST
|
||||
===========================
|
||||
|
||||
This file defines a single mixer for a quadrotor with a wide configuration. All controls are mixed 100%.
|
||||
|
||||
R: 4w 10000 10000 10000 0
|
||||
|
||||
Gimbal / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
@ -6,13 +6,21 @@ are mixed 100%.
|
||||
|
||||
R: 4v 10000 10000 10000 0
|
||||
|
||||
Gimbal / payload mixer for last two channels
|
||||
Gimbal / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 6 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -5,13 +5,21 @@ This file defines a single mixer for a quadrotor with a wide configuration. All
|
||||
|
||||
R: 4w 10000 10000 10000 0
|
||||
|
||||
Gimbal / payload mixer for last two channels
|
||||
Gimbal / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 6 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -1,7 +1,26 @@
|
||||
Multirotor mixer for PX4FMU
|
||||
===========================
|
||||
|
||||
This file defines a single mixer for a quadrotor in the X configuration. All controls
|
||||
are mixed 100%.
|
||||
|
||||
R: 4x 10000 10000 10000 0
|
||||
|
||||
Gimbal / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 6 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -5,17 +5,21 @@ This file defines a single mixer for a quadrotor in SK450 DeadCat configuration.
|
||||
|
||||
R: 4dc 10000 10000 10000 0
|
||||
|
||||
Gimbal / payload mixer for last three channels
|
||||
Gimbal / payload mixer for last four channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 6 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 7 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
Mixer for standard vtol plane (SITL) with motor x configuration
|
||||
=========================================================
|
||||
|
||||
This file defines a single mixer for a standard vtol plane (SITL gazebo) with motors in X configuration.
|
||||
The plane has two ailerons and one elevator. The ailerons and elevator are treated as elevons
|
||||
in order to make the standard vtol simulation compatible with the tailsitter simulation.
|
||||
|
||||
R: 4x 10000 10000 10000 0
|
||||
|
||||
# mixer for the elevons
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 5000 5000 0 -10000 10000
|
||||
S: 1 1 -5000 -5000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 5000 5000 0 -10000 10000
|
||||
S: 1 1 5000 5000 0 -10000 10000
|
||||
|
||||
# mixer for the pusher/puller throttle
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 3 0 20000 -10000 -10000 10000
|
||||
@ -1,296 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
################################################################################################
|
||||
# @File MissionCheck.py
|
||||
# Automated mission loading, execution and monitoring
|
||||
# for Continuous Integration
|
||||
#
|
||||
# @author Sander Smeets <sander@droneslab.com>
|
||||
#
|
||||
# Code partly based on DroneKit (c) Copyright 2015-2016, 3D Robotics.
|
||||
################################################################################################
|
||||
|
||||
|
||||
################################################################################################
|
||||
# Settings
|
||||
################################################################################################
|
||||
|
||||
connection_string = '127.0.0.1:14540'
|
||||
|
||||
import_mission_filename = 'VTOLmission.txt'
|
||||
max_execution_time = 250
|
||||
alt_acceptance_radius = 10
|
||||
|
||||
################################################################################################
|
||||
# Init
|
||||
################################################################################################
|
||||
|
||||
# Import DroneKit-Python
|
||||
from dronekit import connect, Command
|
||||
from pymavlink import mavutil
|
||||
import time, sys, argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-c", "--connect", help="connection string")
|
||||
parser.add_argument("-f", "--filename", help="mission filename")
|
||||
parser.add_argument("-t", "--timeout", help="execution timeout", type=float)
|
||||
parser.add_argument("-a", "--altrad", help="altitude acceptance radius", type=float)
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.connect:
|
||||
connection_string = args.connect
|
||||
if args.filename:
|
||||
import_mission_filename = args.filename
|
||||
if args.timeout:
|
||||
max_execution_time = args.timeout
|
||||
if args.altrad:
|
||||
alt_acceptance_radius = args.altrad
|
||||
|
||||
|
||||
|
||||
mission_failed = False
|
||||
MAV_MODE_AUTO = 4
|
||||
|
||||
# start time counter
|
||||
start_time = time.time()
|
||||
elapsed_time = time.time() - start_time
|
||||
|
||||
|
||||
|
||||
# Connect to the Vehicle
|
||||
print "Connecting"
|
||||
vehicle = connect(connection_string, wait_ready=True)
|
||||
|
||||
while not vehicle.system_status.state == "STANDBY" or vehicle.gps_0.fix_type < 3:
|
||||
if time.time() - start_time > 20:
|
||||
print "FAILED: SITL did not reach standby with GPS fix within 20 seconds"
|
||||
sys.exit(98)
|
||||
print "Waiting for vehicle to initialise... %s " % vehicle.system_status.state
|
||||
time.sleep(1)
|
||||
|
||||
# Display basic vehicle state
|
||||
print " Type: %s" % vehicle._vehicle_type
|
||||
print " Armed?: %s" % vehicle.armed
|
||||
print " System status: %s" % vehicle.system_status.state
|
||||
print " GPS: %s" % vehicle.gps_0
|
||||
print " Alt: %s" % vehicle.location.global_relative_frame.alt
|
||||
|
||||
|
||||
################################################################################################
|
||||
# Functions
|
||||
################################################################################################
|
||||
|
||||
|
||||
def readmission(aFileName):
|
||||
"""
|
||||
Load a mission from a file into a list. The mission definition is in the Waypoint file
|
||||
format (http://qgroundcontrol.org/mavlink/waypoint_protocol#waypoint_file_format).
|
||||
This function is used by upload_mission().
|
||||
"""
|
||||
cmds = vehicle.commands
|
||||
missionlist=[]
|
||||
with open(aFileName) as f:
|
||||
for i, line in enumerate(f):
|
||||
if i==0:
|
||||
if not line.startswith('QGC WPL 110'):
|
||||
raise Exception('File is not supported WP version')
|
||||
else:
|
||||
linearray=line.split('\t')
|
||||
ln_index=int(linearray[0])
|
||||
ln_currentwp=int(linearray[1])
|
||||
ln_frame=int(linearray[2])
|
||||
ln_command=int(linearray[3])
|
||||
ln_param1=float(linearray[4])
|
||||
ln_param2=float(linearray[5])
|
||||
ln_param3=float(linearray[6])
|
||||
ln_param4=float(linearray[7])
|
||||
ln_param5=float(linearray[8])
|
||||
ln_param6=float(linearray[9])
|
||||
ln_param7=float(linearray[10])
|
||||
ln_autocontinue=int(linearray[11].strip())
|
||||
cmd = Command( 0, 0, 0, ln_frame, ln_command, ln_currentwp, ln_autocontinue, ln_param1, ln_param2, ln_param3, ln_param4, ln_param5, ln_param6, ln_param7)
|
||||
missionlist.append(cmd)
|
||||
return missionlist
|
||||
|
||||
|
||||
def upload_mission(aFileName):
|
||||
"""
|
||||
Upload a mission from a file.
|
||||
"""
|
||||
#Read mission from file
|
||||
missionlist = readmission(aFileName)
|
||||
|
||||
#Clear existing mission from vehicle
|
||||
cmds = vehicle.commands
|
||||
cmds.clear()
|
||||
#Add new mission to vehicle
|
||||
for command in missionlist:
|
||||
cmds.add(command)
|
||||
print ' Uploaded mission with %s items' % len(missionlist)
|
||||
vehicle.commands.upload()
|
||||
return missionlist
|
||||
|
||||
|
||||
def download_mission():
|
||||
"""
|
||||
Downloads the current mission and returns it in a list.
|
||||
It is used in save_mission() to get the file information to save.
|
||||
"""
|
||||
print " Download mission from vehicle"
|
||||
missionlist=[]
|
||||
cmds = vehicle.commands
|
||||
cmds.download()
|
||||
cmds.wait_ready()
|
||||
for cmd in cmds:
|
||||
missionlist.append(cmd)
|
||||
return missionlist
|
||||
|
||||
def save_mission(aFileName):
|
||||
"""
|
||||
Save a mission in the Waypoint file format
|
||||
(http://qgroundcontrol.org/mavlink/waypoint_protocol#waypoint_file_format).
|
||||
"""
|
||||
print "\nSave mission from Vehicle to file: %s" % export_mission_filename
|
||||
#Download mission from vehicle
|
||||
missionlist = download_mission()
|
||||
#Add file-format information
|
||||
output='QGC WPL 110\n'
|
||||
#Add home location as 0th waypoint
|
||||
home = vehicle.home_location
|
||||
output+="%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (0,1,0,16,0,0,0,0,home.lat,home.lon,home.alt,1)
|
||||
#Add commands
|
||||
for cmd in missionlist:
|
||||
commandline="%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (cmd.seq,cmd.current,cmd.frame,cmd.command,cmd.param1,cmd.param2,cmd.param3,cmd.param4,cmd.x,cmd.y,cmd.z,cmd.autocontinue)
|
||||
output+=commandline
|
||||
with open(aFileName, 'w') as file_:
|
||||
print " Write mission to file"
|
||||
file_.write(output)
|
||||
|
||||
|
||||
def printfile(aFileName):
|
||||
"""
|
||||
Print a mission file to demonstrate "round trip"
|
||||
"""
|
||||
print "\nMission file: %s" % aFileName
|
||||
with open(aFileName) as f:
|
||||
for line in f:
|
||||
print ' %s' % line.strip()
|
||||
|
||||
|
||||
################################################################################################
|
||||
# Listeners
|
||||
################################################################################################
|
||||
|
||||
current_sequence = -1
|
||||
current_sequence_changed = False
|
||||
current_landed_state = -1
|
||||
home_position_set = False
|
||||
|
||||
#Create a message listener for mission sequence number
|
||||
@vehicle.on_message('MISSION_CURRENT')
|
||||
def listener(self, name, mission_current):
|
||||
global current_sequence, current_sequence_changed
|
||||
if (current_sequence <> mission_current.seq):
|
||||
current_sequence = mission_current.seq;
|
||||
current_sequence_changed = True
|
||||
print 'current mission sequence: %s' % mission_current.seq
|
||||
|
||||
#Create a message listener for mission sequence number
|
||||
@vehicle.on_message('EXTENDED_SYS_STATE')
|
||||
def listener(self, name, extended_sys_state):
|
||||
global current_landed_state
|
||||
if (current_landed_state <> extended_sys_state.landed_state):
|
||||
current_landed_state = extended_sys_state.landed_state;
|
||||
|
||||
#Create a message listener for home position fix
|
||||
@vehicle.on_message('HOME_POSITION')
|
||||
def listener(self, name, home_position):
|
||||
global home_position_set
|
||||
home_position_set = True
|
||||
|
||||
|
||||
|
||||
################################################################################################
|
||||
# Start mission test
|
||||
################################################################################################
|
||||
|
||||
|
||||
while not home_position_set:
|
||||
if time.time() - start_time > 30:
|
||||
print "FAILED: getting home position 30 seconds"
|
||||
sys.exit(98)
|
||||
print "Waiting for home position..."
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
#Upload mission from file
|
||||
missionlist = upload_mission(import_mission_filename)
|
||||
time.sleep(2)
|
||||
|
||||
# set mission mode the hard way
|
||||
vehicle._master.mav.command_long_send(vehicle._master.target_system, vehicle._master.target_component,
|
||||
mavutil.mavlink.MAV_CMD_DO_SET_MODE, 0,
|
||||
MAV_MODE_AUTO,
|
||||
0, 0, 0, 0, 0, 0)
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
# Arm vehicle
|
||||
vehicle.armed = True
|
||||
|
||||
while not vehicle.system_status.state == "ACTIVE":
|
||||
if time.time() - start_time > 30:
|
||||
print "FAILED: vehicle did not arm within 30 seconds"
|
||||
sys.exit(98)
|
||||
print "Waiting for vehicle to arm..."
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
|
||||
# Wait for completion of mission items
|
||||
while (current_sequence < len(missionlist)-1 and elapsed_time < max_execution_time):
|
||||
time.sleep(.2)
|
||||
if current_sequence > 0 and current_sequence_changed:
|
||||
|
||||
if missionlist[current_sequence-1].z - alt_acceptance_radius > vehicle.location.global_relative_frame.alt or missionlist[current_sequence-1].z + alt_acceptance_radius < vehicle.location.global_relative_frame.alt:
|
||||
print "waypoint %s out of bounds altitude %s gps altitude: %s" % (current_sequence, missionlist[current_sequence-1].z, vehicle.location.global_relative_frame.alt)
|
||||
mission_failed = True
|
||||
current_sequence_changed = False
|
||||
elapsed_time = time.time() - start_time
|
||||
|
||||
if elapsed_time < max_execution_time:
|
||||
print "Mission items have been executed"
|
||||
|
||||
# wait for the vehicle to have landed
|
||||
while (current_landed_state != 1 and elapsed_time < max_execution_time):
|
||||
time.sleep(1)
|
||||
elapsed_time = time.time() - start_time
|
||||
|
||||
if elapsed_time < max_execution_time:
|
||||
print "Vehicle has landed"
|
||||
|
||||
# Disarm vehicle
|
||||
vehicle.armed = False
|
||||
|
||||
# count elapsed time
|
||||
elapsed_time = time.time() - start_time
|
||||
|
||||
# Close vehicle object before exiting script
|
||||
vehicle.close()
|
||||
time.sleep(2)
|
||||
|
||||
# Validate time constraint
|
||||
if elapsed_time <= max_execution_time and not mission_failed:
|
||||
print "Mission succesful time elapsed %s" % elapsed_time
|
||||
sys.exit(0)
|
||||
|
||||
if elapsed_time > max_execution_time:
|
||||
print "Mission FAILED to execute within %s seconds" % max_execution_time
|
||||
sys.exit(99)
|
||||
|
||||
if mission_failed:
|
||||
print "Mission FAILED out of bounds"
|
||||
sys.exit(100)
|
||||
|
||||
print "Mission FAILED something strange happened"
|
||||
sys.exit(101)
|
||||
@ -1,9 +0,0 @@
|
||||
QGC WPL 110
|
||||
0 1 0 16 0 0 0 0 47.3979949951 8.54559612274 25.0 1
|
||||
1 0 2 3000 4.0 0.0 0.0 0.0 47.3980331421 8.54578971863 25.0 1
|
||||
2 0 3 16 0.0 0.0 -0.0 0.0 47.399269104 8.54557228088 25.0 1
|
||||
3 0 3 16 0.0 0.0 -0.0 0.0 47.3992652893 8.54230213165 25.0 1
|
||||
4 0 3 16 0.0 0.0 -0.0 0.0 47.3974761963 8.54239082336 25.0 1
|
||||
5 0 3 16 0.0 0.0 -0.0 0.0 47.3976669312 8.54509449005 25.0 1
|
||||
6 0 2 3000 3.0 0.0 0.0 0.0 47.3977851868 8.54526233673 25.0 1
|
||||
7 0 3 21 25.0 0.0 -0.0 0.0 47.3979797363 8.54460906982 25.0 1
|
||||
@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$#" < 2 ]]; then
|
||||
echo "usage: adb_upload.sh SRC1 [SRC2 ...] DEST"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Wait for device..."
|
||||
adb wait-for-device
|
||||
echo "Uploading..."
|
||||
|
||||
# Get last argument
|
||||
for last; do true; done
|
||||
|
||||
# Go through source files and push them one by one.
|
||||
i=0
|
||||
for arg
|
||||
do
|
||||
if [[ $((i+1)) == "$#" ]]; then
|
||||
break
|
||||
fi
|
||||
# echo "Pushing $arg to $last"
|
||||
adb push $arg $last
|
||||
((i+=1))
|
||||
done
|
||||
@ -6,7 +6,7 @@ then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [[ $cmake_ver == *" 2.8"* ]] || [[ $cmake_ver == *" 2.9"* ]] || [[ $cmake_ver == *" 3.0"* ]] || [[ $cmake_ver == *" 3.1"* ]]
|
||||
if [[ $cmake_ver == *"2.8"* ]] || [[ $cmake_ver == *"2.9"* ]] || [[ $cmake_ver == *"3.0"* ]] || [[ $cmake_ver == *"3.1"* ]]
|
||||
then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
@ -25,15 +25,17 @@ for fn in $(find src/examples \
|
||||
src/modules/uORB \
|
||||
src/modules/bottle_drop \
|
||||
src/modules/dataman \
|
||||
src/modules/fixedwing_backside \
|
||||
src/modules/segway \
|
||||
src/modules/local_position_estimator \
|
||||
src/modules/unit_test \
|
||||
src/modules/systemlib \
|
||||
src/lib/controllib \
|
||||
src/modules/controllib \
|
||||
-path './Build' -prune -o \
|
||||
-path './mavlink' -prune -o \
|
||||
-path './NuttX' -prune -o \
|
||||
-path './src/lib/eigen' -prune -o \
|
||||
-path './src/lib/mathlib/CMSIS' -prune -o \
|
||||
-path './src/modules/uavcan/libuavcan' -prune -o \
|
||||
-path './src/modules/attitude_estimator_ekf/codegen' -prune -o \
|
||||
-path './src/modules/ekf_att_pos_estimator' -prune -o \
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
[ -n "$GIT_SUBMODULES_ARE_EVIL" ] && {
|
||||
# GIT_SUBMODULES_ARE_EVIL is set, meaning user doesn't want submodules
|
||||
echo "Skipping submodules. NUTTX_SRC is set to $NUTTX_SRC"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
GITSTATUS=$(git status)
|
||||
|
||||
function check_git_submodule {
|
||||
|
||||
# The .git exists in a submodule if init and update have been done.
|
||||
if [ -f $1"/.git" ] || [ -d $1"/.git" ];
|
||||
then
|
||||
SUBMODULE_STATUS=$(git submodule summary "$1")
|
||||
STATUSRETVAL=$(echo $SUBMODULE_STATUS | grep -A20 -i "$1")
|
||||
if ! [[ -z "$STATUSRETVAL" ]];
|
||||
then
|
||||
echo -e "\033[31mChecked $1 submodule, ACTION REQUIRED:\033[0m"
|
||||
echo ""
|
||||
echo -e "Different commits:"
|
||||
echo -e "$SUBMODULE_STATUS"
|
||||
echo ""
|
||||
echo ""
|
||||
echo -e " *******************************************************************************"
|
||||
echo -e " * \033[31mIF YOU DID NOT CHANGE THIS FILE (OR YOU DON'T KNOW WHAT A SUBMODULE IS):\033[0m *"
|
||||
echo -e " * \033[31mHit 'u' and <ENTER> to update ALL submodules and resolve this.\033[0m *"
|
||||
echo -e " * (performs \033[94mgit submodule sync --recursive\033[0m *"
|
||||
echo -e " * and \033[94mgit submodule update --init --recursive\033[0m ) *"
|
||||
echo -e " *******************************************************************************"
|
||||
echo ""
|
||||
echo ""
|
||||
echo -e " Only for EXPERTS:"
|
||||
echo -e " $1 submodule is not in the recommended version."
|
||||
echo -e " Hit 'y' and <ENTER> to continue the build with this version. Hit <ENTER> to resolve manually."
|
||||
echo -e " Use \033[94mgit add $1 && git commit -m 'Updated $1'\033[0m to choose this version (careful!)"
|
||||
echo ""
|
||||
read user_cmd
|
||||
if [ "$user_cmd" == "y" ]
|
||||
then
|
||||
echo "Continuing build with manually overridden submodule.."
|
||||
else
|
||||
if [ "$user_cmd" == "u" ]
|
||||
then
|
||||
git submodule sync --recursive
|
||||
git submodule update --init --recursive
|
||||
echo "Submodule fixed, continuing build.."
|
||||
else
|
||||
echo "Build aborted."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "REINITIALIZING GIT SUBMODULES"
|
||||
echo "no git repo found in $1/.git"
|
||||
git submodule sync --recursive;
|
||||
git submodule update --init --recursive $1;
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
check_git_submodule NuttX
|
||||
check_git_submodule Tools/gencpp
|
||||
check_git_submodule Tools/genmsg
|
||||
check_git_submodule Tools/jMAVSim
|
||||
check_git_submodule Tools/sitl_gazebo
|
||||
check_git_submodule cmake/cmake_hexagon
|
||||
check_git_submodule mavlink/include/mavlink/v1.0
|
||||
check_git_submodule src/lib/DriverFramework
|
||||
check_git_submodule src/lib/DriverFramework/cmake/cmake_hexagon
|
||||
check_git_submodule src/lib/DriverFramework/dspal
|
||||
check_git_submodule src/lib/ecl
|
||||
check_git_submodule src/lib/matrix
|
||||
check_git_submodule src/modules/uavcan/libuavcan
|
||||
check_git_submodule unittests/googletest
|
||||
check_git_submodule src/drivers/gps/devices
|
||||
|
||||
exit 0
|
||||
|
||||
@ -9,10 +9,6 @@ if [ "$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $# -eq 0 ]] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
astyle \
|
||||
--options=$DIR/astylerc \
|
||||
|
||||
@ -106,7 +106,6 @@ print("""
|
||||
* Tool for listening to topics when running flight stack on linux.
|
||||
*/
|
||||
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <px4_middleware.h>
|
||||
#include <px4_app.h>
|
||||
#include <px4_config.h>
|
||||
@ -126,14 +125,6 @@ print("""
|
||||
#define PRId64 "lld"
|
||||
#endif
|
||||
|
||||
static bool check_timeout(const hrt_abstime& time) {
|
||||
if (hrt_elapsed_time(&time) > 2*1000*1000) {
|
||||
printf("Waited for 2 seconds without a message. Giving up.\\n");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
""")
|
||||
for m in messages:
|
||||
print("#include <uORB/topics/%s.h>" % m)
|
||||
@ -145,12 +136,12 @@ extern "C" __EXPORT int listener_main(int argc, char *argv[]);
|
||||
int listener_main(int argc, char *argv[]) {
|
||||
int sub = -1;
|
||||
orb_id_t ID;
|
||||
if(argc < 2) {
|
||||
printf("need at least two arguments: topic name. [optional number of messages to print]\\n");
|
||||
if(argc < 3) {
|
||||
printf("need at least two arguments: topic name, number of messages to print\\n");
|
||||
return 1;
|
||||
}
|
||||
""")
|
||||
print("\tunsigned num_msgs = (argc > 2) ? atoi(argv[2]) : 1;")
|
||||
print("\tunsigned num_msgs = atoi(argv[2]);")
|
||||
print("\tif (strncmp(argv[1],\"%s\",50) == 0) {" % messages[0])
|
||||
print("\t\tsub = orb_subscribe(ORB_ID(%s));" % messages[0])
|
||||
print("\t\tID = ORB_ID(%s);" % messages[0])
|
||||
@ -163,15 +154,11 @@ for index,m in enumerate(messages[1:]):
|
||||
print("\t\tstruct %s_s container;" % m)
|
||||
print("\t\tmemset(&container, 0, sizeof(container));")
|
||||
print("\t\tbool updated;")
|
||||
print("\t\tunsigned i = 0;")
|
||||
print("\t\thrt_abstime start_time = hrt_absolute_time();")
|
||||
print("\t\twhile(i < num_msgs) {")
|
||||
print("\t\tfor (unsigned i = 0; i < num_msgs; i++) {")
|
||||
print("\t\t\torb_check(sub,&updated);")
|
||||
print("\t\t\tif (i == 0) { updated = true; } else { usleep(500); }")
|
||||
print("\t\t\tupdated = true;")
|
||||
print("\t\t\tif (updated) {")
|
||||
print("\t\t\tstart_time = hrt_absolute_time();")
|
||||
print("\t\t\ti++;")
|
||||
print("\t\t\tprintf(\"\\nTOPIC: %s #%%d\\n\", i);" % m)
|
||||
print("\t\tprintf(\"\\nTOPIC: %s #%%d\\n\", i);" % m)
|
||||
print("\t\t\torb_copy(ID,sub,&container);")
|
||||
for item in message_elements[index+1]:
|
||||
if item[0] == "float":
|
||||
@ -203,21 +190,11 @@ for index,m in enumerate(messages[1:]):
|
||||
elif item[0] == "int32":
|
||||
print("\t\t\tprintf(\"%s: %%d\\n\",container.%s);" % (item[1], item[1]))
|
||||
elif item[0] == "uint32":
|
||||
print("\t\t\tprintf(\"%s: %%u\\n\",container.%s);" % (item[1], item[1]))
|
||||
elif item[0] == "int16":
|
||||
print("\t\t\tprintf(\"%s: %%d\\n\",(int)container.%s);" % (item[1], item[1]))
|
||||
elif item[0] == "uint16":
|
||||
print("\t\t\tprintf(\"%s: %%u\\n\",(unsigned)container.%s);" % (item[1], item[1]))
|
||||
elif item[0] == "int8":
|
||||
print("\t\t\tprintf(\"%s: %%d\\n\",(int)container.%s);" % (item[1], item[1]))
|
||||
print("\t\t\tprintf(\"%s: %%d\\n\",container.%s);" % (item[1], item[1]))
|
||||
elif item[0] == "uint8":
|
||||
print("\t\t\tprintf(\"%s: %%u\\n\",(unsigned)container.%s);" % (item[1], item[1]))
|
||||
print("\t\t\tprintf(\"%s: %%u\\n\",container.%s);" % (item[1], item[1]))
|
||||
elif item[0] == "bool":
|
||||
print("\t\t\tprintf(\"%s: %%s\\n\",container.%s ? \"True\" : \"False\");" % (item[1], item[1]))
|
||||
print("\t\t\t} else {")
|
||||
print("\t\t\t\tif (check_timeout(start_time)) {")
|
||||
print("\t\t\t\t\tbreak;")
|
||||
print("\t\t\t\t}")
|
||||
print("\t\t\t}")
|
||||
print("\t\t}")
|
||||
print("\t} else {")
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 9155c8f955e05c969bcd932b705b98d98845f228
|
||||
Subproject commit 0876a46d53954db34775151f73db024bcfc656a0
|
||||
@ -752,7 +752,7 @@ class MAVLink_gps_raw_int_message(MAVLink_message):
|
||||
'''
|
||||
The global position, as returned by the Global Positioning
|
||||
System (GPS). This is NOT the global position
|
||||
estimate of the system, but rather a RAW sensor value. See
|
||||
estimate of the sytem, but rather a RAW sensor value. See
|
||||
message GLOBAL_POSITION for the global position estimate.
|
||||
Coordinate frame is right-handed, Z-axis up (GPS frame).
|
||||
'''
|
||||
@ -2812,7 +2812,7 @@ class MAVLink(object):
|
||||
'''
|
||||
The global position, as returned by the Global Positioning System
|
||||
(GPS). This is NOT the global position
|
||||
estimate of the system, but rather a RAW sensor value.
|
||||
estimate of the sytem, but rather a RAW sensor value.
|
||||
See message GLOBAL_POSITION for the global position
|
||||
estimate. Coordinate frame is right-handed, Z-axis up
|
||||
(GPS frame).
|
||||
@ -2837,7 +2837,7 @@ class MAVLink(object):
|
||||
'''
|
||||
The global position, as returned by the Global Positioning System
|
||||
(GPS). This is NOT the global position
|
||||
estimate of the system, but rather a RAW sensor value.
|
||||
estimate of the sytem, but rather a RAW sensor value.
|
||||
See message GLOBAL_POSITION for the global position
|
||||
estimate. Coordinate frame is right-handed, Z-axis up
|
||||
(GPS frame).
|
||||
|
||||
@ -22,67 +22,35 @@ class XMLOutput():
|
||||
xml_parameters = ET.Element("airframes")
|
||||
xml_version = ET.SubElement(xml_parameters, "version")
|
||||
xml_version.text = "1"
|
||||
xml_version = ET.SubElement(xml_parameters, "airframe_version_major")
|
||||
xml_version.text = "1"
|
||||
xml_version = ET.SubElement(xml_parameters, "airframe_version_minor")
|
||||
xml_version.text = "1"
|
||||
last_param_name = ""
|
||||
board_specific_param_set = False
|
||||
for group in groups:
|
||||
xml_group = ET.SubElement(xml_parameters, "airframe_group")
|
||||
xml_group.attrib["name"] = group.GetName()
|
||||
if (group.GetName() == "Standard Plane"):
|
||||
xml_group.attrib["image"] = "Plane"
|
||||
xml_group.attrib["image"] = "AirframeStandardPlane.png"
|
||||
elif (group.GetName() == "Flying Wing"):
|
||||
xml_group.attrib["image"] = "FlyingWing"
|
||||
xml_group.attrib["image"] = "AirframeFlyingWing.png"
|
||||
elif (group.GetName() == "Quadrotor x"):
|
||||
xml_group.attrib["image"] = "QuadRotorX"
|
||||
xml_group.attrib["image"] = "AirframeQuadRotorX.png"
|
||||
elif (group.GetName() == "Quadrotor +"):
|
||||
xml_group.attrib["image"] = "QuadRotorPlus"
|
||||
xml_group.attrib["image"] = "AirframeQuadRotorPlus.png"
|
||||
elif (group.GetName() == "Hexarotor x"):
|
||||
xml_group.attrib["image"] = "HexaRotorX"
|
||||
xml_group.attrib["image"] = "AirframeHexaRotorX.png"
|
||||
elif (group.GetName() == "Hexarotor +"):
|
||||
xml_group.attrib["image"] = "HexaRotorPlus"
|
||||
xml_group.attrib["image"] = "AirframeHexaRotorPlus.png"
|
||||
elif (group.GetName() == "Octorotor +"):
|
||||
xml_group.attrib["image"] = "OctoRotorPlus"
|
||||
xml_group.attrib["image"] = "AirframeOctoRotorPlus.png"
|
||||
elif (group.GetName() == "Octorotor x"):
|
||||
xml_group.attrib["image"] = "OctoRotorX"
|
||||
elif (group.GetName() == "Octorotor Coaxial"):
|
||||
xml_group.attrib["image"] = "OctoRotorXCoaxial"
|
||||
elif (group.GetName() == "Octo Coax Wide"):
|
||||
xml_group.attrib["image"] = "OctoRotorXCoaxial"
|
||||
xml_group.attrib["image"] = "AirframeOctoRotorX.png"
|
||||
elif (group.GetName() == "Quadrotor Wide"):
|
||||
xml_group.attrib["image"] = "QuadRotorWide"
|
||||
xml_group.attrib["image"] = "AirframeQuadRotorH.png"
|
||||
elif (group.GetName() == "Quadrotor H"):
|
||||
xml_group.attrib["image"] = "QuadRotorH"
|
||||
xml_group.attrib["image"] = "AirframeQuadRotorH.png"
|
||||
elif (group.GetName() == "Simulation"):
|
||||
xml_group.attrib["image"] = "AirframeSimulation"
|
||||
elif (group.GetName() == "Plane A-Tail"):
|
||||
xml_group.attrib["image"] = "PlaneATail"
|
||||
elif (group.GetName() == "VTOL Duo Tailsitter"):
|
||||
xml_group.attrib["image"] = "VTOLDuoRotorTailSitter"
|
||||
elif (group.GetName() == "Standard VTOL"):
|
||||
xml_group.attrib["image"] = "VTOLPlane"
|
||||
elif (group.GetName() == "VTOL Quad Tailsitter"):
|
||||
xml_group.attrib["image"] = "VTOLQuadRotorTailSitter"
|
||||
elif (group.GetName() == "VTOL Tiltrotor"):
|
||||
xml_group.attrib["image"] = "VTOLTiltRotor"
|
||||
elif (group.GetName() == "Coaxial Helicopter"):
|
||||
xml_group.attrib["image"] = "HelicopterCoaxial"
|
||||
elif (group.GetName() == "Hexarotor Coaxial"):
|
||||
xml_group.attrib["image"] = "Y6A"
|
||||
elif (group.GetName() == "Y6B"):
|
||||
xml_group.attrib["image"] = "Y6B"
|
||||
elif (group.GetName() == "Tricopter Y-"):
|
||||
xml_group.attrib["image"] = "YMinus"
|
||||
elif (group.GetName() == "Tricopter Y+"):
|
||||
xml_group.attrib["image"] = "YPlus"
|
||||
elif (group.GetName() == "Rover"):
|
||||
xml_group.attrib["image"] = "Rover"
|
||||
elif (group.GetName() == "Boat"):
|
||||
xml_group.attrib["image"] = "Boat"
|
||||
xml_group.attrib["image"] = "AirframeSimulation.png"
|
||||
else:
|
||||
xml_group.attrib["image"] = "AirframeUnknown"
|
||||
xml_group.attrib["image"] = ""
|
||||
for param in group.GetParams():
|
||||
if (last_param_name == param.GetName() and not board_specific_param_set) or last_param_name != param.GetName():
|
||||
xml_param = ET.SubElement(xml_group, "airframe")
|
||||
|
||||
@ -51,7 +51,6 @@ class Parameter(object):
|
||||
|
||||
def __init__(self, name, type, default = ""):
|
||||
self.fields = {}
|
||||
self.values = {}
|
||||
self.name = name
|
||||
self.type = type
|
||||
self.default = default
|
||||
@ -71,12 +70,6 @@ class Parameter(object):
|
||||
"""
|
||||
self.fields[code] = value
|
||||
|
||||
def SetEnumValue(self, code, value):
|
||||
"""
|
||||
Set named enum value
|
||||
"""
|
||||
self.values[code] = value
|
||||
|
||||
def GetFieldCodes(self):
|
||||
"""
|
||||
Return list of existing field codes in convenient order
|
||||
@ -94,26 +87,7 @@ class Parameter(object):
|
||||
if not fv:
|
||||
# required because python 3 sorted does not accept None
|
||||
return ""
|
||||
return fv
|
||||
|
||||
def GetEnumCodes(self):
|
||||
"""
|
||||
Return list of existing value codes in convenient order
|
||||
"""
|
||||
keys = self.values.keys()
|
||||
#keys = sorted(keys)
|
||||
#keys = sorted(keys, key=lambda x: self.priority.get(x, 0), reverse=True)
|
||||
return keys
|
||||
|
||||
def GetEnumValue(self, code):
|
||||
"""
|
||||
Return value of the given enum code or None if not found.
|
||||
"""
|
||||
fv = self.values.get(code)
|
||||
if not fv:
|
||||
# required because python 3 sorted does not accept None
|
||||
return ""
|
||||
return fv
|
||||
return self.fields.get(code)
|
||||
|
||||
class SourceParser(object):
|
||||
"""
|
||||
@ -133,7 +107,7 @@ class SourceParser(object):
|
||||
re_remove_dots = re.compile(r'\.+$')
|
||||
re_remove_carriage_return = re.compile('\n+')
|
||||
|
||||
valid_tags = set(["group", "board", "min", "max", "unit", "decimal", "increment", "reboot_required", "value", "boolean"])
|
||||
valid_tags = set(["group", "board", "min", "max", "unit", "decimal"])
|
||||
|
||||
# Order of parameter groups
|
||||
priority = {
|
||||
@ -144,7 +118,7 @@ class SourceParser(object):
|
||||
def __init__(self):
|
||||
self.param_groups = {}
|
||||
|
||||
def Parse(self, scope, contents):
|
||||
def Parse(self, contents):
|
||||
"""
|
||||
Incrementally parse program contents and append all found parameters
|
||||
to the list.
|
||||
@ -163,7 +137,6 @@ class SourceParser(object):
|
||||
short_desc = None
|
||||
long_desc = None
|
||||
tags = {}
|
||||
def_values = {}
|
||||
elif state is not None and state != "comment-processed":
|
||||
m = self.re_comment_end.search(line)
|
||||
if m:
|
||||
@ -183,12 +156,7 @@ class SourceParser(object):
|
||||
m = self.re_comment_tag.match(comment_content)
|
||||
if m:
|
||||
tag, desc = m.group(1, 2)
|
||||
if (tag == "value"):
|
||||
# Take the meta info string and split the code and description
|
||||
metainfo = desc.split(" ", 1)
|
||||
def_values[metainfo[0]] = metainfo[1]
|
||||
else:
|
||||
tags[tag] = desc
|
||||
tags[tag] = desc
|
||||
current_tag = tag
|
||||
state = "wait-tag-end"
|
||||
elif state == "wait-short":
|
||||
@ -223,7 +191,6 @@ class SourceParser(object):
|
||||
defval = ""
|
||||
# Non-empty line outside the comment
|
||||
m = self.re_px4_param_default_definition.match(line)
|
||||
# Default value handling
|
||||
if m:
|
||||
name_m, defval_m = m.group(1,2)
|
||||
default_var[name_m] = defval_m
|
||||
@ -241,7 +208,6 @@ class SourceParser(object):
|
||||
if defval != "" and self.re_is_a_number.match(defval):
|
||||
defval = self.re_cut_type_specifier.sub('', defval)
|
||||
param = Parameter(name, tp, defval)
|
||||
param.SetField("scope", scope)
|
||||
param.SetField("short_desc", name)
|
||||
# If comment was found before the parameter declaration,
|
||||
# inject its data into the newly created parameter.
|
||||
@ -260,8 +226,6 @@ class SourceParser(object):
|
||||
return False
|
||||
else:
|
||||
param.SetField(tag, tags[tag])
|
||||
for def_value in def_values:
|
||||
param.SetEnumValue(def_value, def_values[def_value])
|
||||
# Store the parameter
|
||||
if group not in self.param_groups:
|
||||
self.param_groups[group] = ParameterGroup(group)
|
||||
@ -314,13 +278,6 @@ class SourceParser(object):
|
||||
if default != "" and float(default) > float(max):
|
||||
sys.stderr.write("Default value is larger than max: {0} default:{1} max:{2}\n".format(name, default, max))
|
||||
return False
|
||||
for code in param.GetEnumCodes():
|
||||
if not self.IsNumber(code):
|
||||
sys.stderr.write("Min value not number: {0} {1}\n".format(name, code))
|
||||
return False
|
||||
if param.GetEnumValue(code) == "":
|
||||
sys.stderr.write("Description for enum value is empty: {0} {1}\n".format(name, code))
|
||||
return False
|
||||
return True
|
||||
|
||||
def GetParamGroups(self):
|
||||
|
||||
@ -33,8 +33,6 @@ class SourceScanner(object):
|
||||
Scans provided file and passes its contents to the parser using
|
||||
parser.Parse method.
|
||||
"""
|
||||
prefix = ".." + os.path.sep + "src" + os.path.sep
|
||||
scope = re.sub(prefix, '', os.path.dirname(os.path.relpath(path)))
|
||||
with codecs.open(path, 'r', 'utf-8') as f:
|
||||
try:
|
||||
contents = f.read()
|
||||
@ -42,4 +40,4 @@ class SourceScanner(object):
|
||||
contents = ''
|
||||
print('Failed reading file: %s, skipping content.' % path)
|
||||
pass
|
||||
return parser.Parse(scope, contents)
|
||||
return parser.Parse(contents)
|
||||
|
||||
@ -22,10 +22,6 @@ class XMLOutput():
|
||||
xml_parameters = ET.Element("parameters")
|
||||
xml_version = ET.SubElement(xml_parameters, "version")
|
||||
xml_version.text = "3"
|
||||
xml_version = ET.SubElement(xml_parameters, "parameter_version_major")
|
||||
xml_version.text = "1"
|
||||
xml_version = ET.SubElement(xml_parameters, "parameter_version_minor")
|
||||
xml_version.text = "9"
|
||||
importtree = ET.parse(inject_xml_file_name)
|
||||
injectgroups = importtree.getroot().findall("group")
|
||||
for igroup in injectgroups:
|
||||
@ -56,13 +52,6 @@ class XMLOutput():
|
||||
xml_field.text = value
|
||||
if last_param_name != param.GetName():
|
||||
board_specific_param_set = False
|
||||
|
||||
if len(param.GetEnumCodes()) > 0:
|
||||
xml_values = ET.SubElement(xml_param, "values")
|
||||
for code in param.GetEnumCodes():
|
||||
xml_value = ET.SubElement(xml_values, "value")
|
||||
xml_value.attrib["code"] = code;
|
||||
xml_value.text = param.GetEnumValue(code)
|
||||
indent(xml_parameters)
|
||||
self.xml_document = ET.ElementTree(xml_parameters)
|
||||
|
||||
|
||||
@ -1,95 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
import xml.etree.ElementTree as ET
|
||||
import os
|
||||
import re
|
||||
import codecs
|
||||
|
||||
class Scope(object):
|
||||
"""
|
||||
Single parameter group
|
||||
"""
|
||||
re_deep_lines = re.compile(r'.*\/.*\/')
|
||||
def __init__(self, ):
|
||||
self.scope = set()
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return self.scope.__str__()
|
||||
|
||||
def Add(self, scope):
|
||||
"""
|
||||
Add Scope to set
|
||||
"""
|
||||
self.scope.add(scope)
|
||||
|
||||
def Has(self, scope):
|
||||
"""
|
||||
Check for existance
|
||||
"""
|
||||
if len(self.scope) == 0:
|
||||
return True
|
||||
# Anything in the form xxxxx/yyyyy/zzzzz....
|
||||
# is treated as xxxxx/yyyyy
|
||||
while (self.re_deep_lines.match(scope)):
|
||||
scope = os.path.dirname(scope)
|
||||
return scope in self.scope
|
||||
|
||||
|
||||
|
||||
class CMakeParser(object):
|
||||
"""
|
||||
Parses provided data and stores all found paths in scope.
|
||||
"""
|
||||
re_split_lines = re.compile(r'[\r\n]+')
|
||||
re_comment = re.compile(r'^\#')
|
||||
re_start = re.compile(r'set\s*\(\s*config_module_list')
|
||||
re_end = re.compile(r'\)\s*')
|
||||
|
||||
def Parse(self, scope, contents):
|
||||
"""
|
||||
Incrementally parse cmake file contents and append all found path scope
|
||||
to scope.
|
||||
"""
|
||||
# This code is essentially a comment-parsing grammar. "state"
|
||||
# represents parser state. It contains human-readable state
|
||||
# names.
|
||||
state = None
|
||||
for line in self.re_split_lines.split(contents):
|
||||
line = line.strip()
|
||||
# Ignore empty lines
|
||||
if line == "":
|
||||
continue
|
||||
if self.re_comment.match(line):
|
||||
continue
|
||||
elif self.re_start.match(line):
|
||||
state = "gather"
|
||||
continue
|
||||
elif state is not None and state == "gather":
|
||||
if self.re_end.match(line):
|
||||
return True
|
||||
scope.Add(line)
|
||||
return False
|
||||
|
||||
|
||||
if len(os.sys.argv) < 2:
|
||||
if len(os.sys.argv) != 2:
|
||||
print("Error in %s" % os.sys.argv[0])
|
||||
print("Usage: %s <parameters.xml> [cmake-file-scoping] " % os.sys.argv[0])
|
||||
print("Usage: %s <parameters.xml>" % os.sys.argv[0])
|
||||
raise SystemExit
|
||||
|
||||
|
||||
scope = Scope()
|
||||
if len(os.sys.argv) == 3:
|
||||
with codecs.open(os.sys.argv[2], 'r', 'utf-8') as f:
|
||||
try:
|
||||
contents = f.read()
|
||||
f.close()
|
||||
parser = CMakeParser()
|
||||
parser.Parse(scope, contents)
|
||||
except:
|
||||
contents = ''
|
||||
print('Failed reading file: %s, skipping scoping.' % os.sys.argv[2])
|
||||
pass
|
||||
|
||||
fp_header = open("px4_parameters.h", "w")
|
||||
fp_src = open("px4_parameters.c", "w")
|
||||
|
||||
@ -113,19 +30,14 @@ end_name = ""
|
||||
|
||||
for group in root:
|
||||
if group.tag == "group" and "no_code_generation" not in group.attrib:
|
||||
section = """
|
||||
header += """
|
||||
/*****************************************************************
|
||||
* %s
|
||||
****************************************************************/""" % group.attrib["name"]
|
||||
for param in group:
|
||||
scope_ = param.find('scope').text
|
||||
if not scope.Has(scope_):
|
||||
continue
|
||||
if not start_name:
|
||||
start_name = param.attrib["name"]
|
||||
end_name = param.attrib["name"]
|
||||
header += section
|
||||
section =""
|
||||
header += """
|
||||
const struct param_info_s __param__%s;""" % param.attrib["name"]
|
||||
header += """
|
||||
@ -151,14 +63,12 @@ struct px4_parameters_t px4_parameters = {
|
||||
i=0
|
||||
for group in root:
|
||||
if group.tag == "group" and "no_code_generation" not in group.attrib:
|
||||
section = """
|
||||
|
||||
src += """
|
||||
/*****************************************************************
|
||||
* %s
|
||||
****************************************************************/""" % group.attrib["name"]
|
||||
for param in group:
|
||||
scope_ = param.find('scope').text
|
||||
if not scope.Has(scope_):
|
||||
continue
|
||||
if not start_name:
|
||||
start_name = param.attrib["name"]
|
||||
end_name = param.attrib["name"]
|
||||
@ -168,8 +78,6 @@ for group in root:
|
||||
elif (param.attrib["type"] == "INT32"):
|
||||
val_str = ".val.i = "
|
||||
i+=1
|
||||
src += section
|
||||
section =""
|
||||
src += """
|
||||
{
|
||||
"%s",
|
||||
@ -189,5 +97,4 @@ __END_DECLS
|
||||
|
||||
fp_header.write(header)
|
||||
fp_src.write(src)
|
||||
fp_header.close()
|
||||
fp_src.close()
|
||||
|
||||
|
||||
@ -108,7 +108,6 @@ if args.parameter_xml != None:
|
||||
bytes = f.read()
|
||||
desc['parameter_xml_size'] = len(bytes)
|
||||
desc['parameter_xml'] = base64.b64encode(zlib.compress(bytes,9)).decode('utf-8')
|
||||
desc['mav_autopilot'] = 12 # 12 = MAV_AUTOPILOT_PX4
|
||||
if args.airframe_xml != None:
|
||||
f = open(args.airframe_xml, "rb")
|
||||
bytes = f.read()
|
||||
|
||||
@ -71,7 +71,6 @@ def main():
|
||||
const="",
|
||||
metavar="BOARD",
|
||||
help="Board to create airframes xml for")
|
||||
parser.add_argument("-v", "--verbose", help="verbose output")
|
||||
args = parser.parse_args()
|
||||
|
||||
# Check for valid command
|
||||
@ -85,7 +84,7 @@ def main():
|
||||
parser = srcparser.SourceParser()
|
||||
|
||||
# Scan directories, and parse the files
|
||||
if args.verbose: print("Scanning source path " + args.airframes_path)
|
||||
print("Scanning source path " + args.airframes_path)
|
||||
if not scanner.ScanDir(args.airframes_path, parser):
|
||||
sys.exit(1)
|
||||
# We can't validate yet
|
||||
@ -95,16 +94,16 @@ def main():
|
||||
|
||||
# Output to XML file
|
||||
if args.xml:
|
||||
if args.verbose: print("Creating XML file " + args.xml)
|
||||
print("Creating XML file " + args.xml)
|
||||
out = xmlout.XMLOutput(param_groups, args.board)
|
||||
out.Save(args.xml)
|
||||
|
||||
if args.start_script:
|
||||
if args.verbose: print("Creating start script " + args.start_script)
|
||||
print("Creating start script " + args.start_script)
|
||||
out = rcout.RCOutput(param_groups, args.board)
|
||||
out.Save(args.start_script)
|
||||
|
||||
if (args.verbose): print("All done!")
|
||||
print("All done!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -107,7 +107,6 @@ def main():
|
||||
metavar="SUMMARY",
|
||||
default="Automagically updated parameter documentation from code.",
|
||||
help="DokuWiki page edit summary")
|
||||
parser.add_argument("-v", "--verbose", help="verbose output")
|
||||
args = parser.parse_args()
|
||||
|
||||
# Check for valid command
|
||||
@ -121,7 +120,7 @@ def main():
|
||||
parser = srcparser.SourceParser()
|
||||
|
||||
# Scan directories, and parse the files
|
||||
if (args.verbose): print("Scanning source path " + args.src_path)
|
||||
print("Scanning source path " + args.src_path)
|
||||
if not scanner.ScanDir(args.src_path, parser):
|
||||
sys.exit(1)
|
||||
if not parser.Validate():
|
||||
@ -130,7 +129,7 @@ def main():
|
||||
|
||||
# Output to XML file
|
||||
if args.xml:
|
||||
if args.verbose: print("Creating XML file " + args.xml)
|
||||
print("Creating XML file " + args.xml)
|
||||
out = xmlout.XMLOutput(param_groups, args.board, os.path.join(args.src_path, args.inject_xml))
|
||||
out.Save(args.xml)
|
||||
|
||||
@ -148,7 +147,7 @@ def main():
|
||||
else:
|
||||
print("Error: You need to specify DokuWiki XML-RPC username and password!")
|
||||
|
||||
#print("All done!")
|
||||
print("All done!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (C) 2014-2015 PX4 Development Team. All rights reserved.
|
||||
# Copyright (C) 2014 PX4 Development Team. All rights reserved.
|
||||
# Author: Julian Oes <joes@student.ethz.ch>
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
@ -36,53 +37,48 @@
|
||||
"""
|
||||
px_romfs_pruner.py:
|
||||
Delete all comments and newlines before ROMFS is converted to an image
|
||||
|
||||
@author: Julian Oes <julian@oes.ch>
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
import argparse
|
||||
import re
|
||||
import argparse, re
|
||||
import os
|
||||
|
||||
|
||||
def main():
|
||||
# Parse commandline arguments
|
||||
parser = argparse.ArgumentParser(description="ROMFS pruner.")
|
||||
parser.add_argument('--folder', action="store",
|
||||
help="ROMFS scratch folder.")
|
||||
args = parser.parse_args()
|
||||
|
||||
#print("Pruning ROMFS files.")
|
||||
# Parse commandline arguments
|
||||
parser = argparse.ArgumentParser(description="ROMFS pruner.")
|
||||
parser.add_argument('--folder', action="store", help="ROMFS scratch folder.")
|
||||
args = parser.parse_args()
|
||||
|
||||
# go through
|
||||
for (root, dirs, files) in os.walk(args.folder):
|
||||
for file in files:
|
||||
# only prune text files
|
||||
if ".zip" in file or ".bin" in file or ".swp" in file \
|
||||
or ".data" in file or ".DS_Store" in file \
|
||||
or file.startswith("."):
|
||||
continue
|
||||
print("Pruning ROMFS files.")
|
||||
|
||||
file_path = os.path.join(root, file)
|
||||
# go through
|
||||
for (root, dirs, files) in os.walk(args.folder):
|
||||
for file in files:
|
||||
# only prune text files
|
||||
if ".zip" in file or ".bin" in file or ".swp" in file or ".data" in file or ".DS_Store" in file:
|
||||
continue
|
||||
|
||||
# read file line by line
|
||||
pruned_content = ""
|
||||
with open(file_path, "rU") as f:
|
||||
for line in f:
|
||||
# handle mixer files differently than startup files
|
||||
if file_path.endswith(".mix"):
|
||||
if line.startswith(("Z:", "M:", "R: ", "O:", "S:")):
|
||||
pruned_content += line
|
||||
else:
|
||||
if not line.isspace() \
|
||||
and not line.strip().startswith("#"):
|
||||
pruned_content += line
|
||||
# overwrite old scratch file
|
||||
with open(file_path, "wb") as f:
|
||||
pruned_content = re.sub("\r\n", "\n", pruned_content)
|
||||
f.write(pruned_content.encode("ascii", errors='strict'))
|
||||
file_path = os.path.join(root, file)
|
||||
|
||||
# read file line by line
|
||||
pruned_content = ""
|
||||
with open(file_path, "rU") as f:
|
||||
for line in f:
|
||||
|
||||
# handle mixer files differently than startup files
|
||||
if file_path.endswith(".mix"):
|
||||
if line.startswith(("Z:", "M:", "R: ", "O:", "S:")):
|
||||
pruned_content += line
|
||||
else:
|
||||
if not line.isspace() and not line.strip().startswith("#"):
|
||||
pruned_content += line
|
||||
# overwrite old scratch file
|
||||
with open(file_path, "wb") as f:
|
||||
pruned_content = re.sub("\r\n", "\n", pruned_content)
|
||||
f.write(pruned_content.encode("ascii", errors='strict'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
||||
@ -449,9 +449,8 @@ class uploader(object):
|
||||
if self.board_type != fw.property('board_id'):
|
||||
msg = "Firmware not suitable for this board (board_type=%u board_id=%u)" % (
|
||||
self.board_type, fw.property('board_id'))
|
||||
print("WARNING: %s" % msg)
|
||||
if args.force:
|
||||
print("FORCED WRITE, FLASHING ANYWAY!")
|
||||
print("WARNING: %s" % msg)
|
||||
else:
|
||||
raise IOError(msg)
|
||||
if self.fw_maxsize < fw.property('image_size'):
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
make px4fmu-v2_default
|
||||
cp build_px4fmu-v2_default/parameters.xml ../qgroundcontrol/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
|
||||
cp build_px4fmu-v2_default/airframes.xml ../qgroundcontrol/src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml
|
||||
@ -1,187 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# __geotagging__
|
||||
# Tag the images recorded during a flight with geo location extracted from
|
||||
# a PX4 log file.
|
||||
#
|
||||
# This file accepts *.jpg format images and reads position information
|
||||
# from a *.px4log file
|
||||
#
|
||||
# Example Syntax:
|
||||
# python geotagging.py --logfile=log001.px4log --input=images/
|
||||
# --output=imagesWithTag/
|
||||
#
|
||||
# Author: Andreas Bircher, Wingtra, http://wingtra.com, in 2016
|
||||
#
|
||||
|
||||
import glob
|
||||
import os
|
||||
import pyexiv2
|
||||
import fractions
|
||||
from PIL import Image
|
||||
from PIL.ExifTags import TAGS
|
||||
import sys
|
||||
from shutil import copyfile
|
||||
from optparse import OptionParser
|
||||
from numpy import genfromtxt
|
||||
import shutil
|
||||
import csv
|
||||
|
||||
class TriggerList( object ):
|
||||
def __init__( self ):
|
||||
self.CAMT_seq = []
|
||||
self.CAMT_timestamp = []
|
||||
self.GPOS_Lat = []
|
||||
self.GPOS_Lon = []
|
||||
self.GPOS_Alt = []
|
||||
|
||||
class ImageList( object ):
|
||||
def __init__( self ):
|
||||
self.jpg = []
|
||||
self.raw = []
|
||||
|
||||
def to_degree(value, loc):
|
||||
if value < 0:
|
||||
loc_value = loc[0]
|
||||
elif value > 0:
|
||||
loc_value = loc[1]
|
||||
else:
|
||||
loc_value = ""
|
||||
absolute_value = abs(value)
|
||||
deg = int(absolute_value)
|
||||
t1 = (absolute_value-deg)*60
|
||||
min = int(t1)
|
||||
sec = round((t1 - min)* 60, 5)
|
||||
return (deg, min, sec, loc_value)
|
||||
|
||||
def SetGpsLocation(file_name, lat, lng, alt):
|
||||
"""
|
||||
Adding GPS tag
|
||||
|
||||
"""
|
||||
lat_deg = to_degree(lat, ["S", "N"])
|
||||
lng_deg = to_degree(lng, ["W", "E"])
|
||||
|
||||
exiv_lat = (pyexiv2.Rational(lat_deg[0] * 60 + lat_deg[1], 60), pyexiv2.Rational(lat_deg[2] * 100, 6000), pyexiv2.Rational(0, 1))
|
||||
exiv_lng = (pyexiv2.Rational(lng_deg[0] * 60 + lng_deg[1], 60), pyexiv2.Rational(lng_deg[2] * 100, 6000), pyexiv2.Rational(0, 1))
|
||||
|
||||
exiv_image = pyexiv2.ImageMetadata(file_name)
|
||||
exiv_image.read()
|
||||
|
||||
exiv_image["Exif.GPSInfo.GPSLatitude"] = exiv_lat
|
||||
exiv_image["Exif.GPSInfo.GPSLatitudeRef"] = lat_deg[3]
|
||||
exiv_image["Exif.GPSInfo.GPSLongitude"] = exiv_lng
|
||||
exiv_image["Exif.GPSInfo.GPSLongitudeRef"] = lng_deg[3]
|
||||
exiv_image["Exif.GPSInfo.GPSAltitude"] = pyexiv2.Rational(alt, 1)
|
||||
exiv_image["Exif.GPSInfo.GPSAltitudeRef"] = '0'
|
||||
exiv_image["Exif.Image.GPSTag"] = 654
|
||||
exiv_image["Exif.GPSInfo.GPSMapDatum"] = "WGS-84"
|
||||
exiv_image["Exif.GPSInfo.GPSVersionID"] = '2 0 0 0'
|
||||
|
||||
exiv_image.write(True)
|
||||
|
||||
def LoadPX4log(px4_log_file):
|
||||
"""
|
||||
load px4 log file and extract trigger locations
|
||||
"""
|
||||
os.system('python sdlog2_dump.py ' + px4_log_file + ' -f log.csv')
|
||||
f = open('log.csv', 'rb')
|
||||
reader = csv.reader(f)
|
||||
headers = reader.next()
|
||||
line = {}
|
||||
for h in headers:
|
||||
line[h] = []
|
||||
|
||||
for row in reader:
|
||||
for h, v in zip(headers, row):
|
||||
line[h].append(v)
|
||||
|
||||
trigger_list = TriggerList()
|
||||
for seq in range(0, len(line['CAMT_seq']) - 1):
|
||||
if line['CAMT_seq'][seq] != line['CAMT_seq'][seq + 1]:
|
||||
trigger_list.CAMT_seq.append(line['CAMT_seq'][seq + 1])
|
||||
trigger_list.CAMT_timestamp.append(line['CAMT_timestamp'][seq + 1])
|
||||
trigger_list.GPOS_Lat.append(line['GPOS_Lat'][seq + 1])
|
||||
trigger_list.GPOS_Lon.append(line['GPOS_Lon'][seq + 1])
|
||||
trigger_list.GPOS_Alt.append(line['GPOS_Alt'][seq + 1])
|
||||
return trigger_list
|
||||
|
||||
def LoadImageList(input_folder):
|
||||
"""
|
||||
load the image list
|
||||
"""
|
||||
image_list = ImageList()
|
||||
for jpg_image in glob.glob(input_folder + "/*.jpg"):
|
||||
image_list.jpg.append(jpg_image)
|
||||
for jpg_image in glob.glob(input_folder + "/*.JPG"):
|
||||
image_list.jpg.append(jpg_image)
|
||||
for raw_image in glob.glob(input_folder + "/*.RC"):
|
||||
image_list.raw.append(raw_image)
|
||||
if len(image_list.jpg) != len(image_list.raw) and len(image_list.jpg) * len(image_list.raw) != 0:
|
||||
print("Unequal number of jpg and raw images")
|
||||
if len(image_list.jpg) == 0 and len(image_list.raw) == 0:
|
||||
print("No images found")
|
||||
image_list.jpg = sorted(image_list.jpg)
|
||||
image_list.raw = sorted(image_list.raw)
|
||||
return image_list
|
||||
|
||||
def FilterTrigger(trigger_list, image_list):
|
||||
"""
|
||||
filter triggers to allow exact matching with recorded images
|
||||
"""
|
||||
if len(image_list.jpg) != len(trigger_list.CAMT_seq) and len(image_list.raw) != len(trigger_list.CAMT_seq):
|
||||
# filter trigger list to match the number of pics
|
||||
print("No trigger filter implemented yet.")
|
||||
|
||||
return trigger_list
|
||||
|
||||
def TagImages(trigger_list, image_list, output_folder):
|
||||
"""
|
||||
load px4 log file and extract trigger locations
|
||||
"""
|
||||
for image in range(len(image_list.jpg)):
|
||||
base_path, filename = os.path.split(image_list.jpg[image])
|
||||
copyfile(image_list.jpg[image], output_folder + "/" + filename)
|
||||
SetGpsLocation(output_folder + "/" + filename, float(trigger_list.GPOS_Lat[image]), float(trigger_list.GPOS_Lon[image]), float(trigger_list.GPOS_Alt[image]))
|
||||
for image in range(len(image_list.raw)):
|
||||
base_path, filename = os.path.split(image_list.raw[image])
|
||||
copyfile(image_list.raw[image], output_folder + "/" + filename)
|
||||
SetGpsLocation(output_folder + "/" + filename, float(trigger_list.GPOS_Lat[image]), float(trigger_list.GPOS_Lon[image]), float(trigger_list.GPOS_Alt[image]))
|
||||
|
||||
def main():
|
||||
"""
|
||||
Main method
|
||||
"""
|
||||
parser = OptionParser()
|
||||
parser.add_option("-l", "--logfile", dest = "LogFile",
|
||||
help = "PX4 log file containing recorded positions",
|
||||
metavar = "string")
|
||||
parser.add_option("-i", "--input", dest = "InputFolder",
|
||||
help = "Input folder containing untagged images in alphabetical order",
|
||||
type = "string")
|
||||
parser.add_option("-o", "--output", dest = "OutputFolder",
|
||||
help = "Output folder to contain tagged images",
|
||||
type = "string")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
if not options.LogFile:
|
||||
print "please type python " \
|
||||
"geotagging.py --logfile=[filename] --intput=[folder] [--output=[folder]]"
|
||||
elif not options.InputFolder:
|
||||
print "please type python " \
|
||||
"geotagging.py --logfile=[filename] --intput=[folder] [--output=[folder]]s"
|
||||
else:
|
||||
trigger_list = LoadPX4log(options.LogFile)
|
||||
image_list = LoadImageList(options.InputFolder)
|
||||
|
||||
if not options.OutputFolder:
|
||||
options.OutputFolder = "imagesWithTag"
|
||||
if not os.path.exists(options.OutputFolder):
|
||||
os.makedirs(options.OutputFolder)
|
||||
|
||||
trigger_list = FilterTrigger(trigger_list, image_list)
|
||||
|
||||
TagImages(trigger_list, image_list, options.OutputFolder)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@ -48,7 +48,6 @@ class SDLog2Parser:
|
||||
"i": ("i", None),
|
||||
"I": ("I", None),
|
||||
"f": ("f", None),
|
||||
"d": ("d", None),
|
||||
"n": ("4s", None),
|
||||
"N": ("16s", None),
|
||||
"Z": ("64s", None),
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 9353834b2f89d08beaa055fc97321e1871bc2b3a
|
||||
Subproject commit 6af47249caefa3ddb6de2c31ae061aff1858fd0e
|
||||
@ -14,10 +14,6 @@ echo program: $program
|
||||
echo model: $model
|
||||
echo build_path: $build_path
|
||||
|
||||
mkdir -p $build_path/src/firmware/posix/rootfs/fs/microsd
|
||||
mkdir -p $build_path/src/firmware/posix/rootfs/eeprom
|
||||
touch $build_path/src/firmware/posix/rootfs/eeprom/parameters
|
||||
|
||||
if [ "$chroot" == "1" ]
|
||||
then
|
||||
chroot_enabled=-c
|
||||
@ -33,7 +29,7 @@ then
|
||||
model="iris"
|
||||
fi
|
||||
|
||||
if [ "$#" -lt 5 ]
|
||||
if [ "$#" != 5 ]
|
||||
then
|
||||
echo usage: sitl_run.sh rc_script debugger program model build_path
|
||||
echo ""
|
||||
@ -52,7 +48,6 @@ fi
|
||||
|
||||
set -e
|
||||
|
||||
cd $build_path/..
|
||||
cp Tools/posix_lldbinit $build_path/src/firmware/posix/.lldbinit
|
||||
cp Tools/posix.gdbinit $build_path/src/firmware/posix/.gdbinit
|
||||
|
||||
@ -61,11 +56,9 @@ SIM_PID=0
|
||||
if [ "$program" == "jmavsim" ] && [ "$no_sim" == "" ]
|
||||
then
|
||||
cd Tools/jMAVSim
|
||||
ant create_run_jar copy_res
|
||||
cd out/production
|
||||
java -Djava.ext.dirs= -jar jmavsim_run.jar -udp 127.0.0.1:14560 &
|
||||
ant
|
||||
java -Djava.ext.dirs= -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator -udp 127.0.0.1:14560 &
|
||||
SIM_PID=`echo $!`
|
||||
cd ../..
|
||||
elif [ "$program" == "gazebo" ] && [ "$no_sim" == "" ]
|
||||
then
|
||||
if [ -x "$(command -v gazebo)" ]
|
||||
@ -81,7 +74,6 @@ then
|
||||
cd Tools/sitl_gazebo/Build
|
||||
cmake -Wno-dev ..
|
||||
make -j4
|
||||
make sdf
|
||||
gzserver --verbose ../worlds/${model}.world &
|
||||
SIM_PID=`echo $!`
|
||||
gzclient --verbose &
|
||||
@ -90,24 +82,11 @@ then
|
||||
echo "You need to have gazebo simulator installed!"
|
||||
exit 1
|
||||
fi
|
||||
elif [ "$program" == "replay" ] && [ "$no_sim" == "" ]
|
||||
then
|
||||
echo "Replaying logfile: $logfile"
|
||||
# This is not a simulator, but a log file to replay
|
||||
|
||||
# Check if we need to creat a param file to allow user to change parameters
|
||||
if ! [ -f "${build_path}/src/firmware/posix/rootfs/replay_params.txt" ]
|
||||
then
|
||||
touch ${build_path}/src/firmware/posix/rootfs/replay_params.txt
|
||||
fi
|
||||
fi
|
||||
|
||||
cd $build_path/src/firmware/posix
|
||||
|
||||
if [ "$logfile" != "" ]
|
||||
then
|
||||
cp $logfile rootfs/replay.px4log
|
||||
fi
|
||||
mkdir -p rootfs/fs/microsd
|
||||
mkdir -p rootfs/eeprom
|
||||
touch rootfs/eeprom/parameters
|
||||
|
||||
# Do not exit on failure now from here on because we want the complete cleanup
|
||||
set +e
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
|
||||
EXEDIR=`pwd`
|
||||
BASEDIR=$(dirname $0)
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit 77d487dc076a8519f81a335a5e4a2040799790de
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user