mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-20 03:20:36 +08:00
Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 401d35677f | |||
| b8517eb428 | |||
| 630740d54f | |||
| 8531cde567 | |||
| c0316f3db1 | |||
| 71e743009a | |||
| b2ff9e37c4 | |||
| bd2551d5f7 | |||
| 7df8610cbd | |||
| 24c98ef14e | |||
| 5e6aebc8fa | |||
| 1dbbe90e06 | |||
| f890dee5aa | |||
| 1418b45942 | |||
| e66aab8e3a | |||
| 9c7970bd7d | |||
| d18491b76e | |||
| 40a7c5a55d | |||
| 57ac8c19ff | |||
| acc1aeb571 | |||
| 814a6fadc6 | |||
| 041b0d379a | |||
| 7c058b21ac | |||
| e7d45575ad | |||
| 0255f881c6 | |||
| bed182f6ab | |||
| 78be95ebc1 | |||
| 341d00e806 | |||
| fe3ae3c79b | |||
| 8fc749f19b | |||
| 1e6d911ab9 | |||
| 364d323ddf | |||
| 47358a446f | |||
| a494b45078 | |||
| 7dfcfd5f2b | |||
| e11fbbf312 | |||
| 65f8b81fda | |||
| 13c993dda4 | |||
| 61f98262cf | |||
| 5ace8d993d | |||
| a8e5084897 | |||
| 7eebb22a9c | |||
| 3bdbb6eacf | |||
| 20a829e691 | |||
| 045a598a97 | |||
| d188f8012f | |||
| 4635827f01 | |||
| 162b7b87e9 | |||
| acf01c5e88 | |||
| f892492a17 | |||
| 2a68adfd35 | |||
| f56efaf149 | |||
| 8595c734e6 | |||
| 0b50c6c003 | |||
| 9e143e3d4c | |||
| 965e0e5226 | |||
| e55f1bc66d |
-28
@@ -2,10 +2,8 @@
|
||||
!ROMFS/*/*.d
|
||||
!ROMFS/*/*/*.d
|
||||
!ROMFS/*/*/*/*.d
|
||||
*.px4log
|
||||
*.dSYM
|
||||
*.o
|
||||
*.gch
|
||||
*.pyc
|
||||
*~
|
||||
.*.swp
|
||||
@@ -19,15 +17,10 @@
|
||||
.~lock.*
|
||||
Archives/*
|
||||
Build/*
|
||||
Testing/
|
||||
build/*
|
||||
build_*/
|
||||
core
|
||||
cscope.out
|
||||
cscope.in.out
|
||||
cscope.po.out
|
||||
Firmware.sublime-workspace
|
||||
user.sublime*
|
||||
Images/*.bin
|
||||
Images/*.px4
|
||||
mavlink/include/mavlink/v0.9/
|
||||
@@ -55,25 +48,4 @@ unittests/build
|
||||
.vagrant
|
||||
*.pretty
|
||||
xcode
|
||||
src/platforms/posix/px4_messages/
|
||||
src/platforms/posix-arm/px4_messages/
|
||||
src/platforms/qurt/px4_messages/
|
||||
ROMFS/*/*/rc.autostart
|
||||
rootfs/
|
||||
*.autosave
|
||||
CMakeLists.txt.user
|
||||
GPATH
|
||||
GRTAGS
|
||||
GTAGS
|
||||
*.creator
|
||||
*.creator.user
|
||||
*.files
|
||||
*.includes
|
||||
|
||||
# uavcan firmware
|
||||
ROMFS/px4fmu_common/uavcan/
|
||||
vectorcontrol/
|
||||
|
||||
|
||||
# CLion ignores
|
||||
.idea
|
||||
|
||||
+11
-33
@@ -1,43 +1,21 @@
|
||||
[submodule "mavlink/include/mavlink/v1.0"]
|
||||
path = mavlink/include/mavlink/v1.0
|
||||
url = https://github.com/mavlink/c_library_v1.git
|
||||
[submodule "mavlink/include/mavlink/v2.0"]
|
||||
path = mavlink/include/mavlink/v2.0
|
||||
url = https://github.com/mavlink/c_library_v2.git
|
||||
url = git://github.com/mavlink/c_library.git
|
||||
[submodule "NuttX"]
|
||||
path = NuttX
|
||||
url = https://github.com/PX4/NuttX.git
|
||||
[submodule "src/modules/uavcan/libuavcan"]
|
||||
path = src/modules/uavcan/libuavcan
|
||||
url = https://github.com/UAVCAN/libuavcan.git
|
||||
url = git://github.com/PX4/NuttX.git
|
||||
[submodule "libuavcan"]
|
||||
path = src/lib/uavcan
|
||||
url = git://github.com/UAVCAN/libuavcan.git
|
||||
[submodule "Tools/genmsg"]
|
||||
path = Tools/genmsg
|
||||
url = https://github.com/ros/genmsg.git
|
||||
[submodule "Tools/gencpp"]
|
||||
path = Tools/gencpp
|
||||
url = https://github.com/ros/gencpp.git
|
||||
[submodule "Tools/jMAVSim"]
|
||||
path = Tools/jMAVSim
|
||||
url = https://github.com/PX4/jMAVSim.git
|
||||
[submodule "Tools/sitl_gazebo"]
|
||||
path = Tools/sitl_gazebo
|
||||
url = https://github.com/PX4/sitl_gazebo.git
|
||||
[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
|
||||
[submodule "src/lib/DriverFramework"]
|
||||
path = src/lib/DriverFramework
|
||||
url = https://github.com/PX4/DriverFramework.git
|
||||
[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
|
||||
[submodule "unittests/gtest"]
|
||||
path = unittests/gtest
|
||||
url = https://github.com/sjwilks/gtest.git
|
||||
[submodule "src/lib/eigen"]
|
||||
path = src/lib/eigen
|
||||
url = https://github.com/PX4/eigen.git
|
||||
|
||||
+78
-106
@@ -3,54 +3,51 @@
|
||||
|
||||
language: cpp
|
||||
|
||||
git:
|
||||
depth: 1000
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- os: linux
|
||||
sudo: required
|
||||
env: GCC_VER=4.9 DOCKER_REPO="px4io/px4-dev-base:2016-10-20"
|
||||
services:
|
||||
- docker
|
||||
- os: osx
|
||||
sudo: true
|
||||
osx_image: xcode8
|
||||
env: CCACHE_CPP2=1
|
||||
# use travis-ci docker based infrastructure
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
ccache: true
|
||||
pip: true
|
||||
directories:
|
||||
- $HOME/.pip/cache/
|
||||
- $HOME/Library/Caches/pip
|
||||
- $HOME/.ccache
|
||||
|
||||
before_install:
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
cd ${TRAVIS_BUILD_DIR}
|
||||
&& git fetch --unshallow && git fetch --all --tags
|
||||
&& docker pull ${DOCKER_REPO}
|
||||
;
|
||||
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||
sudo -H easy_install pip
|
||||
&& sudo -H pip install empy
|
||||
&& wget https://s3.amazonaws.com/px4-travis/toolchain/macos/ccache
|
||||
&& sudo mv ccache /usr/local/bin
|
||||
&& chmod +x /usr/local/bin/ccache
|
||||
&& mkdir -p ~/bin
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/c++
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/cc
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/clang
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/clang++
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/g++
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/gcc
|
||||
&& export PATH=~/bin:$PATH
|
||||
&& wget https://s3.amazonaws.com/px4-travis/toolchain/macos/ninja
|
||||
&& sudo mv ninja /usr/local/bin
|
||||
&& chmod +x /usr/local/bin/ninja
|
||||
;
|
||||
fi
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- build-essential
|
||||
- ccache
|
||||
- cmake
|
||||
- g++-4.8
|
||||
- gcc-4.8
|
||||
- genromfs
|
||||
- libc6-i386
|
||||
- libncurses5-dev
|
||||
- python-argparse
|
||||
- python-empy
|
||||
- python-serial
|
||||
- s3cmd
|
||||
- texinfo
|
||||
- zlib1g-dev
|
||||
|
||||
before_script:
|
||||
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
|
||||
# General toolchain dependencies
|
||||
- pushd .
|
||||
- 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
|
||||
# setup ccache
|
||||
- mkdir -p ~/bin
|
||||
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-g++
|
||||
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-gcc
|
||||
- ln -s /usr/bin/ccache ~/bin/g++-4.8
|
||||
- ln -s /usr/bin/ccache ~/bin/gcc-4.8
|
||||
- export PATH=~/bin:$PATH
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -59,68 +56,49 @@ env:
|
||||
# AWS SECRET: $PX4_AWS_SECRET
|
||||
- secure: "h6oajlW68dWIr+wZhO58Dv6e68dZHrBLVA6lPXZmheFQBW6Xam1HuLGA0LOW6cL9TnrAsOZ8g4goB58eMQnMEijFZKi3mhRwZhd/Xjq/ZGJOWBUrLoQHZUw2dQk5ja5vmUlKEoQnFZjDuMjx8KfX5ZMNy8A3yssWZtJYHD8c+bk="
|
||||
- PX4_AWS_BUCKET=px4-travis
|
||||
- GIT_SUBMODULES_ARE_EVIL=1
|
||||
|
||||
script:
|
||||
- ccache -M 1GB; ccache -z
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
docker run --rm -v `pwd`:`pwd`:rw -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -e CI=true -e GIT_SUBMODULES_ARE_EVIL=1 -w=`pwd` --user=$UID -it ${DOCKER_REPO} /bin/bash -c "make check_qgc_firmware VECTORCONTROL=0";
|
||||
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||
make tests;
|
||||
fi
|
||||
- ccache -z
|
||||
- arm-none-eabi-gcc --version
|
||||
- echo 'Running Tests..' && echo -en 'travis_fold:start:script.1\\r'
|
||||
- make tests
|
||||
- cat src/modules/systemlib/mixer/mixer_multirotor.generated.h
|
||||
- echo -en 'travis_fold:end:script.1\\r'
|
||||
- echo 'Building NuttX..' && echo -en 'travis_fold:start:script.2\\r'
|
||||
- make archives
|
||||
- ccache -s
|
||||
- echo -en 'travis_fold:end:script.2\\r'
|
||||
- echo 'Building Firmware..' && echo -en 'travis_fold:start:script.3\\r'
|
||||
- make -j4
|
||||
- ccache -s
|
||||
- echo -en 'travis_fold:end:script.3\\r'
|
||||
- zip Firmware.zip Images/*.px4
|
||||
|
||||
after_success:
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
make package_firmware && mkdir s3deploy-archive && cp Firmware.zip s3deploy-archive/
|
||||
&& find . -type f -name 'nuttx-*-default.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
|
||||
&& mkdir s3deploy-branch && mv *_default.px4 build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml s3deploy-branch/;
|
||||
fi
|
||||
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "$GCC_VER" == "4.9" ]]; then
|
||||
export PX4_S3_DEPLOY=1;
|
||||
fi
|
||||
after_script:
|
||||
- git clone git://github.com/PX4/CI-Tools.git
|
||||
- ./CI-Tools/s3cmd-configure
|
||||
# upload newest build for this branch with s3 index
|
||||
- ./CI-Tools/s3cmd-put Images/px4*.px4 CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/
|
||||
# archive newest build by date with s3 index
|
||||
- ./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/
|
||||
# upload top level index.html and timestamp.html
|
||||
- ./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:"
|
||||
- echo https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip
|
||||
|
||||
deploy:
|
||||
# deploy *.px4 to S3 px4-travis/Firmware/$TRAVIS_BRANCH
|
||||
- provider: s3
|
||||
access_key_id: $PX4_AWS_KEY
|
||||
secret_access_key:
|
||||
secure: $PX4_AWS_SECRET
|
||||
bucket: px4-travis
|
||||
local_dir: s3deploy-branch
|
||||
upload-dir: Firmware/$TRAVIS_BRANCH
|
||||
acl: public_read
|
||||
skip_cleanup: true
|
||||
on:
|
||||
all_branches: true
|
||||
condition: $PX4_S3_DEPLOY = 1
|
||||
|
||||
# deploy Firmware.zip to S3 px4-travis/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID
|
||||
- provider: s3
|
||||
access_key_id: $PX4_AWS_KEY
|
||||
secret_access_key:
|
||||
secure: $PX4_AWS_SECRET
|
||||
bucket: px4-travis
|
||||
local_dir: s3deploy-archive
|
||||
upload-dir: archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID
|
||||
acl: public_read
|
||||
skip_cleanup: true
|
||||
on:
|
||||
all_branches: true
|
||||
condition: $PX4_S3_DEPLOY = 1
|
||||
|
||||
# on tags deploy Firmware.zip to Github releases
|
||||
- provider: releases
|
||||
api_key:
|
||||
secure: cdHWLRBxA5UlYpOS0Sp891QK7PFmMgQ5ZWs1aPt+sw0rIrowyWMHCwXNBEdUqaExHYNYgXCUDI0EzNgfB7ZcR63Qv1MQeoyamV4jsxlyAqDqmxNtWO82S6RhHGeMLk26VgFKzynVcEk1IYlQP2nqzMQLdu+jTrngERuAIrCdRuc=
|
||||
file: "Firmware.zip"
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
all_branches: true
|
||||
repo: PX4/Firmware
|
||||
condition: $GCC_VER = 4.9
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: cdHWLRBxA5UlYpOS0Sp891QK7PFmMgQ5ZWs1aPt+sw0rIrowyWMHCwXNBEdUqaExHYNYgXCUDI0EzNgfB7ZcR63Qv1MQeoyamV4jsxlyAqDqmxNtWO82S6RhHGeMLk26VgFKzynVcEk1IYlQP2nqzMQLdu+jTrngERuAIrCdRuc=
|
||||
file: "Firmware.zip"
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
all_branches: true
|
||||
repo: PX4/Firmware
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
@@ -128,9 +106,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:
|
||||
rooms:
|
||||
- secure: "QKw73Zel/s3JAbe/7XyO9tPnJwiiGFpYzSjdR8lG3tYFjRdXZnhxG4c+G7bkgkaPTS4Hult33VXE3kcEqOI7+C+eRwRlZhDfL0knQbXVCxjcLjzmUFdoPOwurlgZDw66PFWCi5tZcLKSRo3u4U8ibT4WKi3jm9sDSyOcfBAucMU="
|
||||
on_pull_requests: false
|
||||
on_success: never # options: [always|never|change] default: always
|
||||
on_failure: never # options: [always|never|change] default: always
|
||||
|
||||
+311
-455
@@ -1,475 +1,331 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
cmake_minimum_required(VERSION 2.8.3)
|
||||
project(px4)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
add_definitions(-D__PX4_ROS)
|
||||
add_definitions(-D__EXPORT=)
|
||||
add_definitions(-DMAVLINK_DIALECT=common)
|
||||
|
||||
#=============================================================================
|
||||
# CMAKE CODING STANDARD FOR PX4
|
||||
#
|
||||
# Structure
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# * Common functions should be included in px_base.cmake.
|
||||
#
|
||||
# * OS/ board specific fucntions should be include in
|
||||
# px_impl_${OS}.cmake or px4_impl_${OS}_${BOARD}.cmake.
|
||||
#
|
||||
# Formatting
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# * Use hard indents to match the px4 source code.
|
||||
#
|
||||
# * All function and script arguments are upper case.
|
||||
#
|
||||
# * All local variables are lower case.
|
||||
#
|
||||
# * All cmake functions are lowercase.
|
||||
#
|
||||
# * For else, endif, endfunction, etc, never put the name of the statement
|
||||
#
|
||||
# Instead of the very confusing:
|
||||
# if (${var} STREQUAL "1") <-- condition now becomes if name
|
||||
# # do somthing
|
||||
# elseif (${var} STREQUAL "2") <-- another condition
|
||||
# # do somthing
|
||||
# else (${var} STREQUAL "1") <-- tag is referring to name of if
|
||||
# # do somthing
|
||||
# endif (${var} STREQUAL "1") <-- tag is referring to name of if
|
||||
#
|
||||
# Do this:
|
||||
# if (${var} STREQUAL "1") <-- condition now becomes if name
|
||||
# # do somthing
|
||||
# elseif (${var} STREQUAL "2") <-- another condition
|
||||
# # do somthing
|
||||
# else () <-- leave blank
|
||||
# # do somthing
|
||||
# endif () <-- leave blank
|
||||
#
|
||||
# Functions/Macros
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# * Use px4_parse_function_args to parse functions and check for required
|
||||
# arguments. Unless there is only one argument in the function and it is clear.
|
||||
#
|
||||
# * Never use macros. They allow overwriting global variables and this
|
||||
# makes variable declarations hard to locate.
|
||||
#
|
||||
# * 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
|
||||
# scope may use global variables, but this makes it difficult to
|
||||
# resuse functions.
|
||||
#
|
||||
# Included CMake Files
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# * All variables in config files must have the prefix "config_".
|
||||
#
|
||||
# * Never set global variables in an included cmake file,
|
||||
# you may only define functions. This excludes config and Toolchain files.
|
||||
# This makes it clear to the user when variables are being set or targets
|
||||
# are being created.
|
||||
#
|
||||
# * Setting a global variable in a CMakeLists.txt file is ok, because
|
||||
# each CMakeLists.txt file has scope in the current directory and all
|
||||
# subdirecties, so it is not truly global.
|
||||
#
|
||||
# * All toolchain files should be included in the cmake
|
||||
# directory and named Toolchain-"name".cmake.
|
||||
#
|
||||
# Misc
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# * If referencing a string variable, don't put it in quotes.
|
||||
# Don't do "${OS}" STREQUAL "posix",
|
||||
# instead type ${OS} STREQUAL "posix". This will throw an
|
||||
# error when ${OS} is not defined instead of silently
|
||||
# evaluating to false.
|
||||
#
|
||||
#=============================================================================
|
||||
## Find catkin macros and libraries
|
||||
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
|
||||
## is used, also find other catkin packages
|
||||
find_package(catkin REQUIRED COMPONENTS
|
||||
roscpp
|
||||
rospy
|
||||
std_msgs
|
||||
geometry_msgs
|
||||
message_generation
|
||||
cmake_modules
|
||||
gazebo_msgs
|
||||
sensor_msgs
|
||||
mav_msgs
|
||||
libmavconn
|
||||
tf
|
||||
)
|
||||
find_package(Eigen REQUIRED)
|
||||
|
||||
# Warning: Changing this modifies CMake's internal workings
|
||||
# and leads to wrong toolchain detection
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
## System dependencies are found with CMake's conventions
|
||||
# find_package(Boost REQUIRED COMPONENTS system)
|
||||
|
||||
set(PX4_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(PX4_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
execute_process(
|
||||
COMMAND Tools/check_submodules.sh
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
## Uncomment this if the package has a setup.py. This macro ensures
|
||||
## modules and global scripts declared therein get installed
|
||||
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
|
||||
# catkin_python_setup()
|
||||
|
||||
# Use clang
|
||||
#SET (CMAKE_C_COMPILER /usr/bin/clang-3.6)
|
||||
#SET (CMAKE_CXX_COMPILER /usr/bin/clang++-3.6)
|
||||
################################################
|
||||
## Declare ROS messages, services and actions ##
|
||||
################################################
|
||||
|
||||
#=============================================================================
|
||||
# parameters
|
||||
#
|
||||
## To declare and build messages, services or actions from within this
|
||||
## package, follow these steps:
|
||||
## * Let MSG_DEP_SET be the set of packages whose message types you use in
|
||||
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
|
||||
## * In the file package.xml:
|
||||
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
|
||||
## * If MSG_DEP_SET isn't empty the following dependencies might have been
|
||||
## pulled in transitively but can be declared for certainty nonetheless:
|
||||
## * add a build_depend tag for "message_generation"
|
||||
## * add a run_depend tag for "message_runtime"
|
||||
## * In this file (CMakeLists.txt):
|
||||
## * add "message_generation" and every package in MSG_DEP_SET to
|
||||
## find_package(catkin REQUIRED COMPONENTS ...)
|
||||
## * add "message_runtime" and every package in MSG_DEP_SET to
|
||||
## catkin_package(CATKIN_DEPENDS ...)
|
||||
## * uncomment the add_*_files sections below as needed
|
||||
## and list every .msg/.srv/.action file to be processed
|
||||
## * uncomment the generate_messages entry below
|
||||
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
|
||||
|
||||
set(CMAKE_BUILD_TYPE "" CACHE STRING "build type")
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
STRINGS ";Debug;Release;RelWithDebInfo;MinSizeRel")
|
||||
set(CONFIG "posix_sitl_default" CACHE STRING "desired configuration")
|
||||
file(GLOB_RECURSE configs RELATIVE cmake/configs "cmake/configs/*.cmake")
|
||||
set_property(CACHE CONFIG PROPERTY STRINGS ${configs})
|
||||
set(THREADS "4" CACHE STRING
|
||||
"number of threads to use for external build processes")
|
||||
set(DEBUG_PORT "/dev/ttyACM0" CACHE STRING "debugging port")
|
||||
set(EXTERNAL_MODULES_LOCATION "" CACHE STRING "External modules source location")
|
||||
## Generate messages in the 'msg' folder
|
||||
add_message_files(
|
||||
FILES
|
||||
rc_channels.msg
|
||||
vehicle_attitude.msg
|
||||
vehicle_attitude_setpoint.msg
|
||||
manual_control_setpoint.msg
|
||||
actuator_controls.msg
|
||||
actuator_controls_0.msg
|
||||
actuator_controls_virtual_mc.msg
|
||||
vehicle_rates_setpoint.msg
|
||||
mc_virtual_rates_setpoint.msg
|
||||
vehicle_attitude.msg
|
||||
vehicle_control_mode.msg
|
||||
actuator_armed.msg
|
||||
parameter_update.msg
|
||||
vehicle_status.msg
|
||||
vehicle_local_position.msg
|
||||
position_setpoint.msg
|
||||
position_setpoint_triplet.msg
|
||||
vehicle_local_position_setpoint.msg
|
||||
vehicle_global_velocity_setpoint.msg
|
||||
offboard_control_mode.msg
|
||||
vehicle_force_setpoint.msg
|
||||
)
|
||||
|
||||
#=============================================================================
|
||||
# configuration
|
||||
#
|
||||
# must come before project to set toolchain
|
||||
## Generate services in the 'srv' folder
|
||||
# add_service_files(
|
||||
# FILES
|
||||
# Service1.srv
|
||||
# Service2.srv
|
||||
# )
|
||||
|
||||
string(REPLACE "_" ";" config_args ${CONFIG})
|
||||
list(GET config_args 0 OS)
|
||||
list(GET config_args 1 BOARD)
|
||||
list(GET config_args 2 LABEL)
|
||||
set(target_name "${OS}-${BOARD}-${LABEL}")
|
||||
## Generate actions in the 'action' folder
|
||||
# add_action_files(
|
||||
# FILES
|
||||
# Action1.action
|
||||
# Action2.action
|
||||
# )
|
||||
|
||||
message(STATUS "${target_name}")
|
||||
## Generate added messages and services with any dependencies listed here
|
||||
generate_messages(
|
||||
DEPENDENCIES
|
||||
std_msgs
|
||||
gazebo_msgs
|
||||
)
|
||||
|
||||
# Define GNU standard installation directories
|
||||
include(GNUInstallDirs)
|
||||
###################################
|
||||
## catkin specific configuration ##
|
||||
###################################
|
||||
## The catkin_package macro generates cmake config files for your package
|
||||
## Declare things to be passed to dependent projects
|
||||
## INCLUDE_DIRS: uncomment this if you package contains header files
|
||||
## LIBRARIES: libraries you create in this project that dependent projects also need
|
||||
## CATKIN_DEPENDS: catkin_packages dependent projects also need
|
||||
## DEPENDS: system dependencies of this project that dependent projects also need
|
||||
catkin_package(
|
||||
INCLUDE_DIRS src/include
|
||||
LIBRARIES px4
|
||||
CATKIN_DEPENDS message_runtime roscpp rospy std_msgs libmavconn
|
||||
DEPENDS system_lib
|
||||
)
|
||||
|
||||
# Add support for external project building
|
||||
include(ExternalProject)
|
||||
###########
|
||||
## Build ##
|
||||
###########
|
||||
|
||||
# Setup install paths
|
||||
if(NOT CMAKE_INSTALL_PREFIX)
|
||||
if (${OS} STREQUAL "posix")
|
||||
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Install path prefix" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
|
||||
## Specify additional locations of header files
|
||||
## Your package locations should be listed before other locations
|
||||
include_directories(
|
||||
${catkin_INCLUDE_DIRS}
|
||||
src/platforms
|
||||
src/platforms/ros/px4_messages
|
||||
src/include
|
||||
src/modules
|
||||
src/
|
||||
src/lib
|
||||
${EIGEN_INCLUDE_DIRS}
|
||||
integrationtests
|
||||
)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/cmake")
|
||||
message(STATUS "cmake module path: ${CMAKE_MODULE_PATH}")
|
||||
set(config_module "configs/${CONFIG}")
|
||||
include(${config_module})
|
||||
## generate multiplatform wrapper headers
|
||||
## note that the message header files are generated as in any ROS project with generate_messages()
|
||||
set(MULTIPLATFORM_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/ros/px4_messages)
|
||||
set(MULTIPLATFORM_TEMPLATE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/msg/templates/px4/ros)
|
||||
set(TOPICHEADER_TEMP_DIR ${CMAKE_BINARY_DIR}/topics_temporary)
|
||||
set(MULTIPLATFORM_PREFIX px4_)
|
||||
add_custom_target(multiplatform_message_headers ALL ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Tools/px_generate_uorb_topic_headers.py
|
||||
-d ${CMAKE_CURRENT_SOURCE_DIR}/msg -o ${MULTIPLATFORM_HEADER_DIR} -e ${MULTIPLATFORM_TEMPLATE_DIR}
|
||||
-t ${TOPICHEADER_TEMP_DIR} -p ${MULTIPLATFORM_PREFIX})
|
||||
|
||||
# cmake modules
|
||||
include(ExternalProject)
|
||||
## Declare a cpp library
|
||||
add_library(px4
|
||||
src/platforms/ros/px4_ros_impl.cpp
|
||||
src/platforms/ros/perf_counter.cpp
|
||||
src/platforms/ros/geo.cpp
|
||||
src/lib/mathlib/math/Limits.cpp
|
||||
src/modules/systemlib/circuit_breaker.cpp
|
||||
)
|
||||
add_dependencies(px4 ${PROJECT_NAME}_generate_messages_cpp multiplatform_message_headers)
|
||||
|
||||
# require px4 module interface
|
||||
set(px4_required_interface
|
||||
px4_os_prebuild_targets
|
||||
px4_os_add_flags
|
||||
)
|
||||
foreach(cmd ${px4_required_interface})
|
||||
if(NOT COMMAND ${cmd})
|
||||
message(FATAL_ERROR "${config_module} must implement ${cmd}")
|
||||
endif()
|
||||
endforeach()
|
||||
set(px4_required_config
|
||||
config_module_list
|
||||
)
|
||||
foreach(conf ${px4_required_config})
|
||||
if(NOT DEFINED ${conf})
|
||||
message(FATAL_ERROR "cmake/${config_module} must define ${conf}")
|
||||
endif()
|
||||
endforeach()
|
||||
target_link_libraries(px4
|
||||
${catkin_LIBRARIES}
|
||||
)
|
||||
|
||||
# List the DriverFramework drivers
|
||||
if(DEFINED config_df_driver_list)
|
||||
message("DF Drivers: ${config_df_driver_list}")
|
||||
## Declare a test publisher
|
||||
add_executable(publisher
|
||||
src/examples/publisher/publisher_main.cpp
|
||||
src/examples/publisher/publisher_example.cpp)
|
||||
add_dependencies(publisher ${PROJECT_NAME}_generate_messages_cpp multiplatform_message_headers)
|
||||
target_link_libraries(publisher
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## Declare a test subscriber
|
||||
add_executable(subscriber
|
||||
src/examples/subscriber/subscriber_main.cpp
|
||||
src/examples/subscriber/subscriber_example.cpp)
|
||||
add_dependencies(subscriber ${PROJECT_NAME}_generate_messages_cpp multiplatform_message_headers)
|
||||
target_link_libraries(subscriber
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## MC Attitude Control
|
||||
add_executable(mc_att_control
|
||||
src/modules/mc_att_control_multiplatform/mc_att_control_main.cpp
|
||||
src/modules/mc_att_control_multiplatform/mc_att_control.cpp
|
||||
src/modules/mc_att_control_multiplatform/mc_att_control_base.cpp)
|
||||
add_dependencies(mc_att_control ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(mc_att_control
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## MC Position Control
|
||||
add_executable(mc_pos_control
|
||||
src/modules/mc_pos_control_multiplatform/mc_pos_control_main.cpp
|
||||
src/modules/mc_pos_control_multiplatform/mc_pos_control.cpp)
|
||||
add_dependencies(mc_pos_control ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(mc_pos_control
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## Attitude Estimator dummy
|
||||
add_executable(attitude_estimator
|
||||
src/platforms/ros/nodes/attitude_estimator/attitude_estimator.cpp)
|
||||
add_dependencies(attitude_estimator ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(attitude_estimator
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## Position Estimator dummy
|
||||
add_executable(position_estimator
|
||||
src/platforms/ros/nodes/position_estimator/position_estimator.cpp)
|
||||
add_dependencies(position_estimator ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(position_estimator
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## Manual input
|
||||
add_executable(manual_input
|
||||
src/platforms/ros/nodes/manual_input/manual_input.cpp)
|
||||
add_dependencies(manual_input ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(manual_input
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## Multicopter Mixer dummy
|
||||
add_executable(mc_mixer
|
||||
src/platforms/ros/nodes/mc_mixer/mc_mixer.cpp)
|
||||
add_dependencies(mc_mixer ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(mc_mixer
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## Commander dummy
|
||||
add_executable(commander
|
||||
src/platforms/ros/nodes/commander/commander.cpp)
|
||||
add_dependencies(commander ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(commander
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## Mavlink dummy
|
||||
add_executable(mavlink
|
||||
src/platforms/ros/nodes/mavlink/mavlink.cpp)
|
||||
add_dependencies(mavlink ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(mavlink
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## Offboard Position Setpoint Demo
|
||||
add_executable(demo_offboard_position_setpoints
|
||||
src/platforms/ros/nodes/demo_offboard_position_setpoints/demo_offboard_position_setpoints.cpp)
|
||||
add_dependencies(demo_offboard_position_setpoints ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(demo_offboard_position_setpoints
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
## Offboard Attitude Setpoint Demo
|
||||
add_executable(demo_offboard_attitude_setpoints
|
||||
src/platforms/ros/nodes/demo_offboard_attitude_setpoints/demo_offboard_attitude_setpoints.cpp)
|
||||
add_dependencies(demo_offboard_attitude_setpoints ${PROJECT_NAME}_generate_messages_cpp_cpp)
|
||||
target_link_libraries(demo_offboard_attitude_setpoints
|
||||
${catkin_LIBRARIES}
|
||||
px4
|
||||
)
|
||||
|
||||
#############
|
||||
## Install ##
|
||||
#############
|
||||
|
||||
# all install targets should use catkin DESTINATION variables
|
||||
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
|
||||
|
||||
## Mark executable scripts (Python etc.) for installation
|
||||
## in contrast to setup.py, you can choose the destination
|
||||
# install(PROGRAMS
|
||||
# scripts/my_python_script
|
||||
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
|
||||
# )
|
||||
|
||||
## Mark executables and/or libraries for installation
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
|
||||
)
|
||||
|
||||
## Mark cpp header files for installation
|
||||
# install(DIRECTORY include/${PROJECT_NAME}/
|
||||
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
|
||||
# FILES_MATCHING PATTERN "*.h"
|
||||
# PATTERN ".svn" EXCLUDE
|
||||
# )
|
||||
|
||||
## Mark other files for installation (e.g. launch and bag files, etc.)
|
||||
# install(FILES
|
||||
# # myfile1
|
||||
# # myfile2
|
||||
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
|
||||
# )
|
||||
|
||||
#############
|
||||
## Testing ##
|
||||
#############
|
||||
|
||||
## Add gtest based cpp test target and link libraries
|
||||
# catkin_add_gtest(${PROJECT_NAME}-test test/test_px4test.cpp)
|
||||
# if(TARGET ${PROJECT_NAME}-test)
|
||||
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
|
||||
# endif()
|
||||
|
||||
## Add folders to be run by python nosetests
|
||||
# catkin_add_nosetests(test)
|
||||
|
||||
if(CATKIN_ENABLE_TESTING)
|
||||
find_package(rostest REQUIRED)
|
||||
add_rostest(integrationtests/demo_tests/direct_tests.launch)
|
||||
add_rostest(integrationtests/demo_tests/mavros_tests.launch)
|
||||
endif()
|
||||
|
||||
# force static lib build
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
#=============================================================================
|
||||
# project definition
|
||||
#
|
||||
project(px4 CXX C ASM)
|
||||
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0)
|
||||
cmake_policy(SET CMP0045 NEW) # error on non-existent target in get prop
|
||||
cmake_policy(SET CMP0046 NEW) # no non-existent targets as dependencies
|
||||
cmake_policy(SET CMP0025 OLD) # still report AppleClang as Clang
|
||||
endif()
|
||||
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.1.0)
|
||||
cmake_policy(SET CMP0054 NEW) # don't dereference quoted variables
|
||||
endif()
|
||||
|
||||
set(version_major 1)
|
||||
set(version_minor 5)
|
||||
set(version_patch 0)
|
||||
set(version "${version_major}.${version_minor}.${version_patch}")
|
||||
set(package-contact "px4users@googlegroups.com")
|
||||
|
||||
#=============================================================================
|
||||
# find programs and packages
|
||||
#
|
||||
|
||||
# see if catkin was invoked to build this
|
||||
if (CATKIN_DEVEL_PREFIX)
|
||||
message(STATUS "catkin ENABLED")
|
||||
find_package(catkin REQUIRED)
|
||||
if (catkin_FOUND)
|
||||
catkin_package()
|
||||
else()
|
||||
message(FATAL_ERROR "catkin not found")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "catkin DISABLED")
|
||||
endif()
|
||||
|
||||
find_package(PythonInterp REQUIRED)
|
||||
|
||||
#=============================================================================
|
||||
# cmake modules
|
||||
#
|
||||
enable_testing()
|
||||
|
||||
#=============================================================================
|
||||
# generate compile command database
|
||||
#
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
#=============================================================================
|
||||
# check required toolchain variables
|
||||
#
|
||||
set(required_variables
|
||||
CMAKE_C_COMPILER_ID
|
||||
)
|
||||
foreach(var ${required_variables})
|
||||
if (NOT ${var})
|
||||
message(FATAL_ERROR "Toolchain/config must define ${var}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
#=============================================================================
|
||||
# git
|
||||
#
|
||||
px4_add_git_submodule(TARGET git_genmsg PATH "Tools/genmsg")
|
||||
px4_add_git_submodule(TARGET git_gencpp PATH "Tools/gencpp")
|
||||
px4_add_git_submodule(TARGET git_mavlink PATH "mavlink/include/mavlink/v1.0")
|
||||
px4_add_git_submodule(TARGET git_gtest PATH "unittests/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_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 ${PX4_SOURCE_DIR}
|
||||
COMMAND git submodule deinit -f .
|
||||
COMMAND rm -rf .git/modules/*
|
||||
)
|
||||
|
||||
#=============================================================================
|
||||
# misc targets
|
||||
#
|
||||
add_custom_target(check_format
|
||||
COMMAND Tools/check_code_style.sh
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(config
|
||||
COMMAND cmake-gui .
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
)
|
||||
|
||||
#=============================================================================
|
||||
# external libraries
|
||||
#
|
||||
px4_os_prebuild_targets(OUT prebuild_targets
|
||||
BOARD ${BOARD}
|
||||
THREADS ${THREADS})
|
||||
|
||||
#=============================================================================
|
||||
# build flags
|
||||
#
|
||||
px4_os_add_flags(
|
||||
BOARD ${BOARD}
|
||||
C_FLAGS c_flags
|
||||
CXX_FLAGS cxx_flags
|
||||
OPTIMIZATION_FLAGS optimization_flags
|
||||
EXE_LINKER_FLAGS exe_linker_flags
|
||||
INCLUDE_DIRS include_dirs
|
||||
LINK_DIRS link_dirs
|
||||
DEFINITIONS definitions)
|
||||
|
||||
px4_join(OUT CMAKE_EXE_LINKER_FLAGS LIST "${exe_linker_flags}" GLUE " ")
|
||||
px4_join(OUT CMAKE_C_FLAGS LIST "${c_flags};${optimization_flags}" GLUE " ")
|
||||
px4_join(OUT CMAKE_CXX_FLAGS LIST "${cxx_flags};${optimization_flags}" GLUE " ")
|
||||
|
||||
include_directories(${include_dirs})
|
||||
#message("INCLUDE_DIRS=${include_dirs}")
|
||||
link_directories(${link_dirs})
|
||||
add_definitions(${definitions})
|
||||
|
||||
#=============================================================================
|
||||
# source code generation
|
||||
#
|
||||
add_subdirectory(msg)
|
||||
px4_generate_messages(TARGET msg_gen
|
||||
MSG_FILES ${msg_files}
|
||||
OS ${OS}
|
||||
DEPENDS git_genmsg git_gencpp prebuild_targets
|
||||
)
|
||||
px4_generate_parameters_xml(OUT parameters.xml BOARD ${BOARD})
|
||||
px4_generate_airframes_xml(OUT airframes.xml BOARD ${BOARD})
|
||||
add_custom_target(xml_gen
|
||||
DEPENDS parameters.xml airframes.xml)
|
||||
|
||||
#=============================================================================
|
||||
# external projects
|
||||
#
|
||||
|
||||
set(ep_base ${PX4_BINARY_DIR}/external)
|
||||
set_property(DIRECTORY PROPERTY EP_BASE ${ep_base})
|
||||
|
||||
# add external project install folders to build
|
||||
link_directories(${ep_base}/Install/lib)
|
||||
include_directories(${ep_base}/Install/include)
|
||||
# add the directories so cmake won't warn
|
||||
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()
|
||||
|
||||
#=============================================================================
|
||||
# external modules
|
||||
#
|
||||
if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
|
||||
message(STATUS "External modules: ${EXTERNAL_MODULES_LOCATION}")
|
||||
add_subdirectory("${EXTERNAL_MODULES_LOCATION}/src" external_modules_src)
|
||||
|
||||
set(config_module_list_external_expanded)
|
||||
foreach(external_module ${config_module_list_external})
|
||||
list(APPEND config_module_list_external_expanded
|
||||
${EXTERNAL_MODULES_LOCATION}/src/${external_module})
|
||||
endforeach()
|
||||
set(config_module_list
|
||||
${config_module_list}
|
||||
${config_module_list_external_expanded}
|
||||
)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# 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} ${PX4_BINARY_DIR}/${EXT_MODULE_PREFIX})
|
||||
else()
|
||||
add_subdirectory(src/${module})
|
||||
endif()
|
||||
px4_mangle_name(${module} mangled_name)
|
||||
list(APPEND module_libraries ${mangled_name})
|
||||
#message(STATUS "adding module: ${module}")
|
||||
endforeach()
|
||||
|
||||
# Keep track of external shared libs required for modules
|
||||
set(module_external_libraries "${module_external_libraries}" CACHE INTERNAL "module_external_libraries")
|
||||
|
||||
add_subdirectory(src/firmware/${OS})
|
||||
|
||||
#add_dependencies(df_driver_framework nuttx_export_${CONFIG}.stamp)
|
||||
if (NOT "${OS}" STREQUAL "nuttx")
|
||||
endif()
|
||||
|
||||
if (config_io_board)
|
||||
add_subdirectory(src/modules/px4iofirmware)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# generate custom target to print for all executable and module cmake targets
|
||||
#
|
||||
if(all_posix_cmake_targets)
|
||||
list(SORT all_posix_cmake_targets)
|
||||
px4_join(OUT posix_cmake_target_list LIST ${all_posix_cmake_targets} GLUE "\\n")
|
||||
add_custom_target(list_cmake_targets
|
||||
COMMAND sh -c "printf \"${posix_cmake_target_list}\\n\""
|
||||
COMMENT "List of cmake targets that can be matched by PX4_NO_OPTIMIZATION:"
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# generate git version
|
||||
#
|
||||
px4_create_git_hash_header(HEADER ${PX4_BINARY_DIR}/build_git_version.h)
|
||||
|
||||
#=============================================================================
|
||||
# packaging
|
||||
#
|
||||
# Important to having packaging at end of cmake file.
|
||||
#
|
||||
execute_process(
|
||||
COMMAND git describe --always --tags
|
||||
OUTPUT_VARIABLE git_tag
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}-${CONFIG})
|
||||
set(CPACK_PACKAGE_VERSION ${version})
|
||||
set(CPACK_PACKAGE_CONTACT ${package-contact})
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
set(short-description "The px4 autopilot.")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${short-description})
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CONFIG}-${git_tag}")
|
||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${version}")
|
||||
set(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
|
||||
set(CPACK_SET_DESTDIR "OFF")
|
||||
if ("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
find_program(DPKG_PROGRAM dpkg)
|
||||
if (EXISTS ${DPKG_PROGRAM})
|
||||
list (APPEND CPACK_GENERATOR "DEB")
|
||||
endif()
|
||||
endif()
|
||||
include(CPack)
|
||||
|
||||
# vim: set noet fenc=utf-8 ff=unix ft=cmake :
|
||||
|
||||
+1
-1
@@ -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.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 74 KiB |
@@ -1,98 +0,0 @@
|
||||
[TOC]
|
||||
|
||||
# Introduction
|
||||
|
||||
The HIL architecture allows you to test the flight stack replacing the real physical vehicle and sensors with a simulator of vehicle dynamics and sensor outputs. The flight stack "is not aware" that it is not on a real vehicle. This is a powerful tool for develping and testing code rapidly in a benchtop environment.
|
||||
|
||||
The flight stack can be run anywhere that supports a network connection to the simulator (with sufficient bandwidth and latency to transport the sensor and actuator messages). This can be on a standard linux workstation, an on-target linux image, or the on-target DSP image. These modes can be selected based on the goals of the testing. Workstation is useful for rapid testing in a tool-rich environment. DSP image testing is the closest to the final implementation, so is useful for testing actual HW operation, other than the physical sensing and actuation.
|
||||
|
||||
## Px4 High-level HIL Architecture
|
||||
|
||||
A diagram of the setup described is shown here. Note that UDP port numbers are only displayed on the socket server and are left blank on the socket client.
|
||||
|
||||
(???NOTES: This diagram needs to be updated to use control inputs over UDP, either from QGC or from other)
|
||||
|
||||

|
||||
|
||||
## Requirements
|
||||
The simulator that is currently supported is jMAVSim. The setup described here requires PX4 and jMAVSim installed and running. qGroundControl (QGC) is also required because it is the supported method of providing manual control commands.
|
||||
|
||||
## Assumptions
|
||||
|
||||
# Compiling Code
|
||||
|
||||
## JMAVSim
|
||||
|
||||
### Platform Requirements
|
||||
Linux with java-1.7.x or greater
|
||||
|
||||
### Build Instructions
|
||||
In a clean directory
|
||||
```
|
||||
> git clone https://github.com/PX4/jMAVSim.git
|
||||
> cd jMAVSim
|
||||
> git submodule init
|
||||
> git submodule update
|
||||
> ant
|
||||
```
|
||||
|
||||
## qGroundControl
|
||||
|
||||
### Platform Requirements
|
||||
Windows 7
|
||||
Logitech Gamepad F310 joystick controller
|
||||
|
||||
### Download/Install Instructions
|
||||
Download QGC from http://qgroundcontrol.org/downloads and install using the windows executable.
|
||||
|
||||
|
||||
## PX4
|
||||
|
||||
### Platform Requirements
|
||||
Linux or Eagle with a working IP interface (?? does this need further instructions?)
|
||||
|
||||
### Build Host Requirements
|
||||
(???Notes: Windows?)
|
||||
|
||||
### Download & Build Instructions
|
||||
|
||||
### Installing binaries on the Qualcomm Target
|
||||
|
||||
# Running PX4 in HIL Mode
|
||||
|
||||
## Starting PX4 on Qualcomm Eagle
|
||||
|
||||
```
|
||||
> adb shell
|
||||
# bash
|
||||
root@linaro-developer:/# cd ???
|
||||
root@linaro-developer:/# ./px4
|
||||
App name: px4
|
||||
Enter a command and its args:
|
||||
uorb start
|
||||
muorb start
|
||||
mavlink start -u 14556
|
||||
simulator start -p
|
||||
```
|
||||
|
||||
## Starting jMAVSim
|
||||
In the directory where jMAVSim is installed
|
||||
```
|
||||
java -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator -udp <IPADDR>:14560 -n 100
|
||||
```
|
||||
replacing <IPADDR> with the IP address of the machine running PX4 (Eagle). This can be found by running "ifconfig" on that machine.
|
||||
|
||||
## Starting qGroundControl
|
||||
Launch the qGroundControl application
|
||||
1. Set up the communication to the flight stack. In the menu File:Settings:CommLinks, select Add. Enter a Link Name of your choice. Select Link Type: UDP. Set the listening port to an unused port (example: 14561). Select Add. Enter the IP address and port of the PX4 Mavlink app, which is <IPADDR>:14556 with <IPADDR> being the IP address of the Eagle board. Select OK.
|
||||
1. Set up the joystick. Plug in the joystick to your Windows machine. In the menu File:Settings:CommLinks, check Enable Controllers. Select "Gamepad F310". Select "Manual". Set the axes/channel mapping to 0:Yaw, 1:Throttle, 2:unset, 3:Pitch, 4:Roll. Seletct "Inverted" for the throttle axis. Click "Calibrate range". Move the right joystick through its full range of motion. Move the left joystick full left then full right. Move the left joystick full forward (but not full backward). Click "end calibration."
|
||||
1. Connect to the flight stack. Click Analyze. Click the "Connect" button in the upper right, and select the connection that you created in the first step.
|
||||
|
||||
You should now be connected to the flight stack. You can see incoming Mavlink packets using the MAVLink Instpector (from Advanced:Tool Widgets)
|
||||
|
||||
|
||||
## Controlling PX4 flight in HIL Mode
|
||||
The joystick can now be used to fly the simulated vehicle. The jMAVSim world visualization gives a FPV view, and QGC can be used to display instruments such as artificial horizon and maps (if GPS simulation is enabled).
|
||||
|
||||
|
||||
# Debugging/FAQ
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,20 +33,7 @@
|
||||
{
|
||||
"tab_size": 8,
|
||||
"translate_tabs_to_spaces": false,
|
||||
"highlight_line": true,
|
||||
"AStyleFormatter":
|
||||
{
|
||||
"options_c":
|
||||
{
|
||||
"use_only_additional_options": true,
|
||||
"additional_options_file": "${project_path}/Tools/astylerc"
|
||||
},
|
||||
"options_c++":
|
||||
{
|
||||
"use_only_additional_options": true,
|
||||
"additional_options_file": "${project_path}/Tools/astylerc"
|
||||
}
|
||||
}
|
||||
"highlight_line": true
|
||||
},
|
||||
"build_systems":
|
||||
[
|
||||
@@ -63,20 +50,6 @@
|
||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"cmd": ["make upload px4fmu-v2_default -j8"],
|
||||
"shell": true
|
||||
},
|
||||
{
|
||||
"name": "PX4: make posix",
|
||||
"working_dir": "${project_path}",
|
||||
"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": 65,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the Intel Aero FC board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "AEROFCv1",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"board_id": 33,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the AUAV X2.1 board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "AUAV X2.1",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"board_id": 12,
|
||||
"magic": "Crazyflie",
|
||||
"description": "Firmware for the Crazyflie 2.0",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "CRAZYFLIE",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"board_id": 88,
|
||||
"magic": "MindPX",
|
||||
"description": "Firmware for the MindPXFMUv2 board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "MindPXFMUv2",
|
||||
"version": "2.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"board_id": 9,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the PX4FMUv3 board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "PX4FMUv3",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"board_id": 11,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the PX4FMUv4 board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "PX4FMUv4",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"board_id": 64,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the TAPv1 board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "TAPv1",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
+2
-2
@@ -3,7 +3,7 @@ to be made under the same license. Any exception to this general rule is listed
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2015 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2012-2014 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
|
||||
@@ -38,4 +38,4 @@ to be made under the same license. Any exception to this general rule is listed
|
||||
- PX4 middleware: BSD 3-clause
|
||||
- PX4 flight control stack: BSD 3-clause
|
||||
- NuttX operating system: BSD 3-clause
|
||||
- Exceptions: Currently only this [400 LOC file](https://github.com/PX4/Firmware/blob/master/src/lib/external_lgpl/tecs/tecs.cpp) remains LGPL, but will be replaced with a BSD implementation.
|
||||
- Exceptions: Currently only this [400 LOC file](https://github.com/PX4/Firmware/blob/master/src/lib/external_lgpl/tecs/tecs.cpp) remains LGPL, but will be replaced with a BSD implementation.
|
||||
@@ -1,6 +1,5 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 - 2016 PX4 Development Team. All rights reserved.
|
||||
# Copyright (c) 2012-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
|
||||
@@ -29,289 +28,349 @@
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# Enforce the presence of the GIT repository
|
||||
#
|
||||
# We depend on our submodules, so we have to prevent attempts to
|
||||
# compile without it being present.
|
||||
ifeq ($(wildcard .git),)
|
||||
$(error YOU HAVE TO USE GIT TO DOWNLOAD THIS REPOSITORY. ABORTING.)
|
||||
endif
|
||||
|
||||
CMAKE_VER := $(shell Tools/check_cmake.sh; echo $$?)
|
||||
ifneq ($(CMAKE_VER),0)
|
||||
$(warning Not a valid CMake version or CMake not installed.)
|
||||
$(warning On Ubuntu 16.04, install or upgrade via:)
|
||||
$(warning )
|
||||
$(warning 3rd party PPA:)
|
||||
$(warning sudo add-apt-repository ppa:george-edison55/cmake-3.x -y)
|
||||
$(warning sudo apt-get update)
|
||||
$(warning sudo apt-get install cmake)
|
||||
$(warning )
|
||||
$(warning Official website:)
|
||||
$(warning wget https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.sh)
|
||||
$(warning chmod +x cmake-3.4.3-Linux-x86_64.sh)
|
||||
$(warning sudo mkdir /opt/cmake-3.4.3)
|
||||
$(warning sudo ./cmake-3.4.3-Linux-x86_64.sh --prefix=/opt/cmake-3.4.3 --exclude-subdir)
|
||||
$(warning export PATH=/opt/cmake-3.4.3/bin:$$PATH)
|
||||
$(warning )
|
||||
$(error Fatal)
|
||||
endif
|
||||
|
||||
# Help
|
||||
# --------------------------------------------------------------------
|
||||
# Don't be afraid of this makefile, it is just passing
|
||||
# arguments to cmake to allow us to keep the wiki pages etc.
|
||||
# that describe how to build the px4 firmware
|
||||
# the same even when using cmake instead of make.
|
||||
# Top-level Makefile for building PX4 firmware images.
|
||||
#
|
||||
# Example usage:
|
||||
|
||||
#
|
||||
# make px4fmu-v2_default (builds)
|
||||
# make px4fmu-v2_default upload (builds and uploads)
|
||||
# make px4fmu-v2_default test (builds and tests)
|
||||
# Get path and tool configuration
|
||||
#
|
||||
# This tells cmake to build the nuttx px4fmu-v2 default config in the
|
||||
# directory build_nuttx_px4fmu-v2_default and then call make
|
||||
# in that directory with the target upload.
|
||||
export PX4_BASE := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))/
|
||||
include $(PX4_BASE)makefiles/setup.mk
|
||||
|
||||
# explicity set default build target
|
||||
all: posix_sitl_default
|
||||
|
||||
# Parsing
|
||||
# --------------------------------------------------------------------
|
||||
# assume 1st argument passed is the main target, the
|
||||
# rest are arguments to pass to the makefile generated
|
||||
# by cmake in the subdirectory
|
||||
FIRST_ARG := $(firstword $(MAKECMDGOALS))
|
||||
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
||||
j ?= 4
|
||||
|
||||
ifndef NO_NINJA_BUILD
|
||||
NINJA_BUILD := $(shell ninja --version 2>/dev/null)
|
||||
endif
|
||||
ifdef NINJA_BUILD
|
||||
PX4_CMAKE_GENERATOR ?= "Ninja"
|
||||
PX4_MAKE = ninja
|
||||
PX4_MAKE_ARGS =
|
||||
else
|
||||
|
||||
ifdef SYSTEMROOT
|
||||
# Windows
|
||||
PX4_CMAKE_GENERATOR ?= "MSYS Makefiles"
|
||||
else
|
||||
PX4_CMAKE_GENERATOR ?= "Unix Makefiles"
|
||||
endif
|
||||
PX4_MAKE = $(MAKE)
|
||||
PX4_MAKE_ARGS = -j$(j) --no-print-directory
|
||||
#
|
||||
# Get a version string provided by git
|
||||
# This assumes that git command is available and that
|
||||
# the directory holding this file also contains .git directory
|
||||
#
|
||||
GIT_DESC := $(shell git log -1 --pretty=format:%H)
|
||||
ifneq ($(words $(GIT_DESC)),1)
|
||||
GIT_DESC := "unknown_git_version"
|
||||
endif
|
||||
|
||||
# check if replay env variable is set & set build dir accordingly
|
||||
ifdef replay
|
||||
BUILD_DIR_SUFFIX := _replay
|
||||
else
|
||||
BUILD_DIR_SUFFIX :=
|
||||
GIT_DESC_SHORT := $(shell echo $(GIT_DESC) | cut -c1-16)
|
||||
|
||||
#
|
||||
# Canned firmware configurations that we (know how to) build.
|
||||
#
|
||||
KNOWN_CONFIGS := $(subst config_,,$(basename $(notdir $(wildcard $(PX4_MK_DIR)config_*.mk))))
|
||||
CONFIGS ?= $(KNOWN_CONFIGS)
|
||||
|
||||
#
|
||||
# Boards that we (know how to) build NuttX export kits for.
|
||||
#
|
||||
KNOWN_BOARDS := $(subst board_,,$(basename $(notdir $(wildcard $(PX4_MK_DIR)board_*.mk))))
|
||||
BOARDS ?= $(KNOWN_BOARDS)
|
||||
|
||||
#
|
||||
# Debugging
|
||||
#
|
||||
MQUIET = --no-print-directory
|
||||
#MQUIET = --print-directory
|
||||
|
||||
################################################################################
|
||||
# No user-serviceable parts below
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# If the user has listed a config as a target, strip it out and override CONFIGS.
|
||||
#
|
||||
FIRMWARE_GOAL = firmware
|
||||
EXPLICIT_CONFIGS := $(filter $(CONFIGS),$(MAKECMDGOALS))
|
||||
ifneq ($(EXPLICIT_CONFIGS),)
|
||||
CONFIGS := $(EXPLICIT_CONFIGS)
|
||||
.PHONY: $(EXPLICIT_CONFIGS)
|
||||
$(EXPLICIT_CONFIGS): all
|
||||
|
||||
#
|
||||
# If the user has asked to upload, they must have also specified exactly one
|
||||
# config.
|
||||
#
|
||||
ifneq ($(filter upload,$(MAKECMDGOALS)),)
|
||||
ifneq ($(words $(EXPLICIT_CONFIGS)),1)
|
||||
$(error In order to upload, exactly one board config must be specified)
|
||||
endif
|
||||
FIRMWARE_GOAL = upload
|
||||
.PHONY: upload
|
||||
upload:
|
||||
@:
|
||||
endif
|
||||
endif
|
||||
|
||||
# additional config parameters passed to cmake
|
||||
CMAKE_ARGS :=
|
||||
ifdef EXTERNAL_MODULES_LOCATION
|
||||
CMAKE_ARGS := -DEXTERNAL_MODULES_LOCATION:STRING=$(EXTERNAL_MODULES_LOCATION)
|
||||
endif
|
||||
#
|
||||
# Built products
|
||||
#
|
||||
DESIRED_FIRMWARES = $(foreach config,$(CONFIGS),$(IMAGE_DIR)$(config).px4)
|
||||
STAGED_FIRMWARES = $(foreach config,$(KNOWN_CONFIGS),$(IMAGE_DIR)$(config).px4)
|
||||
FIRMWARES = $(foreach config,$(KNOWN_CONFIGS),$(BUILD_DIR)$(config).build/firmware.px4)
|
||||
|
||||
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
all: $(DESIRED_FIRMWARES)
|
||||
|
||||
# Functions
|
||||
# --------------------------------------------------------------------
|
||||
# describe how to build a cmake config
|
||||
define cmake-build
|
||||
+@$(eval BUILD_DIR = $(SRC_DIR)/build_$@$(BUILD_DIR_SUFFIX))
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(BUILD_DIR)/Makefile ]; then rm -rf $(BUILD_DIR); fi
|
||||
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) $(CMAKE_ARGS) || (cd .. && rm -rf $(BUILD_DIR)); fi
|
||||
+@echo "PX4 CONFIG: $(BUILD_DIR)"
|
||||
+@$(PX4_MAKE) -C "$(BUILD_DIR)" $(PX4_MAKE_ARGS) $(ARGS)
|
||||
#
|
||||
# Copy FIRMWARES into the image directory.
|
||||
#
|
||||
# XXX copying the .bin files is a hack to work around the PX4IO uploader
|
||||
# not supporting .px4 files, and it should be deprecated onced that
|
||||
# is taken care of.
|
||||
#
|
||||
$(STAGED_FIRMWARES): $(IMAGE_DIR)%.px4: $(BUILD_DIR)%.build/firmware.px4
|
||||
@$(ECHO) %% Copying $@
|
||||
$(Q) $(COPY) $< $@
|
||||
$(Q) $(COPY) $(patsubst %.px4,%.bin,$<) $(patsubst %.px4,%.bin,$@)
|
||||
|
||||
#
|
||||
# Generate FIRMWARES.
|
||||
#
|
||||
.PHONY: $(FIRMWARES)
|
||||
$(BUILD_DIR)%.build/firmware.px4: config = $(patsubst $(BUILD_DIR)%.build/firmware.px4,%,$@)
|
||||
$(BUILD_DIR)%.build/firmware.px4: work_dir = $(BUILD_DIR)$(config).build/
|
||||
$(FIRMWARES): $(BUILD_DIR)%.build/firmware.px4: checkgitversion generateuorbtopicheaders checksubmodules
|
||||
@$(ECHO) %%%%
|
||||
@$(ECHO) %%%% Building $(config) in $(work_dir)
|
||||
@$(ECHO) %%%%
|
||||
$(Q) $(MKDIR) -p $(work_dir)
|
||||
$(Q) $(MAKE) -r -C $(work_dir) \
|
||||
-f $(PX4_MK_DIR)firmware.mk \
|
||||
CONFIG=$(config) \
|
||||
WORK_DIR=$(work_dir) \
|
||||
$(FIRMWARE_GOAL)
|
||||
|
||||
#
|
||||
# Make FMU firmwares depend on the corresponding IO firmware.
|
||||
#
|
||||
# This is a pretty vile hack, since it hard-codes knowledge of the FMU->IO dependency
|
||||
# and forces the _default config in all cases. There has to be a better way to do this...
|
||||
#
|
||||
FMU_VERSION = $(patsubst px4fmu-%,%,$(word 1, $(subst _, ,$(1))))
|
||||
define FMU_DEP
|
||||
$(BUILD_DIR)$(1).build/firmware.px4: $(IMAGE_DIR)px4io-$(call FMU_VERSION,$(1))_default.px4
|
||||
endef
|
||||
FMU_CONFIGS := $(filter px4fmu%,$(CONFIGS))
|
||||
$(foreach config,$(FMU_CONFIGS),$(eval $(call FMU_DEP,$(config))))
|
||||
|
||||
define cmake-build-other
|
||||
+@$(eval BUILD_DIR = $(SRC_DIR)/build_$@$(BUILD_DIR_SUFFIX))
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(BUILD_DIR)/Makefile ]; then rm -rf $(BUILD_DIR); fi
|
||||
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake $(2) -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(BUILD_DIR)); fi
|
||||
+@$(PX4_MAKE) -C "$(BUILD_DIR)" $(PX4_MAKE_ARGS) $(ARGS)
|
||||
endef
|
||||
#
|
||||
# Build the NuttX export archives.
|
||||
#
|
||||
# Note that there are no explicit dependencies extended from these
|
||||
# archives. If NuttX is updated, the user is expected to rebuild the
|
||||
# archives/build area manually. Likewise, when the 'archives' target is
|
||||
# invoked, all archives are always rebuilt.
|
||||
#
|
||||
# XXX Should support fetching/unpacking from a separate directory to permit
|
||||
# downloads of the prebuilt archives as well...
|
||||
#
|
||||
NUTTX_ARCHIVES = $(foreach board,$(BOARDS),$(ARCHIVE_DIR)$(board).export)
|
||||
.PHONY: archives
|
||||
archives: checksubmodules $(NUTTX_ARCHIVES)
|
||||
|
||||
define colorecho
|
||||
@tput setaf 6
|
||||
@echo $1
|
||||
@tput sgr0
|
||||
endef
|
||||
|
||||
# Get a list of all config targets.
|
||||
ALL_CONFIG_TARGETS := $(basename $(shell find "$(SRC_DIR)/cmake/configs" ! -name '*_common*' ! -name '*_sdflight_*' -name '*.cmake' -print | sed -e 's:^.*/::' | sort))
|
||||
# Strip off leading nuttx_
|
||||
NUTTX_CONFIG_TARGETS := $(patsubst nuttx_%,%,$(filter nuttx_%,$(ALL_CONFIG_TARGETS)))
|
||||
|
||||
# ADD CONFIGS HERE
|
||||
# --------------------------------------------------------------------
|
||||
# Do not put any spaces between function arguments.
|
||||
|
||||
# All targets.
|
||||
$(ALL_CONFIG_TARGETS):
|
||||
$(call cmake-build,$@)
|
||||
|
||||
# Abbreviated config targets.
|
||||
|
||||
# nuttx_ is left off by default; provide a rule to allow that.
|
||||
$(NUTTX_CONFIG_TARGETS):
|
||||
$(call cmake-build,nuttx_$@)
|
||||
|
||||
all_nuttx_targets: $(NUTTX_CONFIG_TARGETS)
|
||||
|
||||
posix: posix_sitl_default
|
||||
broadcast: posix_sitl_broadcast
|
||||
|
||||
# Multi- config targets.
|
||||
|
||||
eagle_default: posix_eagle_default qurt_eagle_default
|
||||
eagle_legacy_default: posix_eagle_legacy_driver_default qurt_eagle_legacy_driver_default
|
||||
excelsior_default: posix_excelsior_default qurt_excelsior_default
|
||||
|
||||
# Deprecated config targets.
|
||||
|
||||
ros_sitl_default:
|
||||
@echo "This target is deprecated. Use make 'posix_sitl_default gazebo' instead."
|
||||
|
||||
_sitl_deprecation:
|
||||
@echo "Deprecated. Use 'make posix_sitl_default jmavsim' or"
|
||||
@echo "'make posix_sitl_default gazebo' if Gazebo is preferred."
|
||||
|
||||
run_sitl_quad: _sitl_deprecation
|
||||
run_sitl_plane: _sitl_deprecation
|
||||
run_sitl_ros: _sitl_deprecation
|
||||
|
||||
# All targets with just dependencies but no recipe must either be marked as phony (or have the special @: as recipe).
|
||||
.PHONY: all posix broadcast eagle_default eagle_legacy_default excelsior_default run_sitl_quad run_sitl_plane run_sitl_ros all_nuttx_targets
|
||||
|
||||
# Other targets
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
.PHONY: uavcan_firmware check check_format format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
|
||||
# We cannot build these parallel; note that we also force -j1 for the
|
||||
# sub-make invocations.
|
||||
ifneq ($(filter archives,$(MAKECMDGOALS)),)
|
||||
.NOTPARALLEL:
|
||||
|
||||
# All targets with just dependencies but no recipe must either be marked as phony (or have the special @: as recipe).
|
||||
.PHONY: checks_defaults checks_bootloaders checks_tests checks_alts checks_uavcan checks_sitls checks_last quick_check tests extra_firmware
|
||||
|
||||
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_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
|
||||
J?=1
|
||||
|
||||
$(ARCHIVE_DIR)%.export: board = $(notdir $(basename $@))
|
||||
$(ARCHIVE_DIR)%.export: configuration = nsh
|
||||
$(NUTTX_ARCHIVES): $(ARCHIVE_DIR)%.export: $(NUTTX_SRC)
|
||||
@$(ECHO) %% Configuring NuttX for $(board)
|
||||
$(Q) (cd $(NUTTX_SRC) && $(RMDIR) nuttx-export)
|
||||
$(Q) $(MAKE) -r -j$(J) -C $(NUTTX_SRC) -r $(MQUIET) distclean
|
||||
$(Q) (cd $(NUTTX_SRC)/configs && $(COPYDIR) $(PX4_BASE)nuttx-configs/$(board) .)
|
||||
$(Q) (cd $(NUTTX_SRC)tools && ./configure.sh $(board)/$(configuration))
|
||||
@$(ECHO) %% Exporting NuttX for $(board)
|
||||
$(Q) $(MAKE) -r -j$(J) -C $(NUTTX_SRC) -r $(MQUIET) CONFIG_ARCH_BOARD=$(board) export
|
||||
$(Q) $(MKDIR) -p $(dir $@)
|
||||
$(Q) $(COPY) $(NUTTX_SRC)nuttx-export.zip $@
|
||||
$(Q) (cd $(NUTTX_SRC)/configs && $(RMDIR) $(board))
|
||||
|
||||
#
|
||||
# The user can run the NuttX 'menuconfig' tool for a single board configuration with
|
||||
# make BOARDS=<boardname> menuconfig
|
||||
#
|
||||
ifeq ($(MAKECMDGOALS),menuconfig)
|
||||
ifneq ($(words $(BOARDS)),1)
|
||||
$(error BOARDS must specify exactly one board for the menuconfig goal)
|
||||
endif
|
||||
BOARD = $(BOARDS)
|
||||
menuconfig: $(NUTTX_SRC)
|
||||
@$(ECHO) %% Configuring NuttX for $(BOARD)
|
||||
$(Q) (cd $(NUTTX_SRC) && $(RMDIR) nuttx-export)
|
||||
$(Q) $(MAKE) -r -j$(J) -C $(NUTTX_SRC) -r $(MQUIET) distclean
|
||||
$(Q) (cd $(NUTTX_SRC)/configs && $(COPYDIR) $(PX4_BASE)nuttx-configs/$(BOARD) .)
|
||||
$(Q) (cd $(NUTTX_SRC)tools && ./configure.sh $(BOARD)/nsh)
|
||||
@$(ECHO) %% Running menuconfig for $(BOARD)
|
||||
$(Q) $(MAKE) -r -j$(J) -C $(NUTTX_SRC) -r $(MQUIET) menuconfig
|
||||
@$(ECHO) %% Saving configuration file
|
||||
$(Q)$(COPY) $(NUTTX_SRC).config $(PX4_BASE)nuttx-configs/$(BOARD)/nsh/defconfig
|
||||
else
|
||||
menuconfig:
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) "The menuconfig goal must be invoked without any other goal being specified"
|
||||
@$(ECHO) ""
|
||||
endif
|
||||
|
||||
# All default targets that don't require a special build environment (currently built on semaphore-ci)
|
||||
check: check_px4fmu-v1_default \
|
||||
check_px4fmu-v2_default \
|
||||
check_px4fmu-v2_test \
|
||||
check_px4fmu-v4_default_and_uavcan \
|
||||
check_mindpx-v2_default \
|
||||
check_posix_sitl_default \
|
||||
check_tap-v1_default \
|
||||
check_aerofc-v1_default \
|
||||
check_px4-stm32f4discovery_default \
|
||||
check_crazyflie_default \
|
||||
check_tests \
|
||||
check_format
|
||||
$(NUTTX_SRC): checkgitversion checksubmodules
|
||||
|
||||
# quick_check builds a single nuttx and posix target, runs testing, and checks the style
|
||||
quick_check: check_posix_sitl_default check_px4fmu-v4_default check_tests check_format
|
||||
$(UAVCAN_DIR):
|
||||
$(Q) (./Tools/check_submodules.sh)
|
||||
|
||||
|
||||
ifeq ($(PX4_TARGET_OS),nuttx)
|
||||
# TODO
|
||||
# Move the above nuttx specific rules into $(PX4_BASE)makefiles/firmware_nuttx.mk
|
||||
endif
|
||||
ifeq ($(PX4_TARGET_OS),posix)
|
||||
include $(PX4_BASE)makefiles/firmware_posix.mk
|
||||
endif
|
||||
ifeq ($(PX4_TARGET_OS),posix-arm)
|
||||
include $(PX4_BASE)makefiles/firmware_posix.mk
|
||||
endif
|
||||
ifeq ($(PX4_TARGET_OS),qurt)
|
||||
include $(PX4_BASE)makefiles/firmware_qurt.mk
|
||||
endif
|
||||
|
||||
#
|
||||
# Versioning
|
||||
#
|
||||
|
||||
GIT_VER_FILE = $(PX4_VERSIONING_DIR).build_git_ver
|
||||
GIT_HEADER_FILE = $(PX4_VERSIONING_DIR)build_git_version.h
|
||||
|
||||
$(GIT_VER_FILE) :
|
||||
$(Q) if [ ! -f $(GIT_VER_FILE) ]; then \
|
||||
$(MKDIR) -p $(PX4_VERSIONING_DIR); \
|
||||
$(ECHO) "" > $(GIT_VER_FILE); \
|
||||
fi
|
||||
|
||||
.PHONY: checkgitversion
|
||||
checkgitversion: $(GIT_VER_FILE)
|
||||
$(Q) if [ "$(GIT_DESC)" != "$(shell cat $(GIT_VER_FILE))" ]; then \
|
||||
$(ECHO) "/* Auto Magically Generated file */" > $(GIT_HEADER_FILE); \
|
||||
$(ECHO) "/* Do not edit! */" >> $(GIT_HEADER_FILE); \
|
||||
$(ECHO) "#define PX4_GIT_VERSION_STR \"$(GIT_DESC)\"" >> $(GIT_HEADER_FILE); \
|
||||
$(ECHO) "#define PX4_GIT_VERSION_BINARY 0x$(GIT_DESC_SHORT)" >> $(GIT_HEADER_FILE); \
|
||||
$(ECHO) $(GIT_DESC) > $(GIT_VER_FILE); \
|
||||
fi
|
||||
|
||||
#
|
||||
# Submodule Checks
|
||||
#
|
||||
|
||||
.PHONY: checksubmodules
|
||||
checksubmodules:
|
||||
$(Q) ($(PX4_BASE)/Tools/check_submodules.sh)
|
||||
|
||||
.PHONY: updatesubmodules
|
||||
updatesubmodules:
|
||||
$(Q) (git submodule init)
|
||||
$(Q) (git submodule update)
|
||||
|
||||
MSG_DIR = $(PX4_BASE)msg
|
||||
UORB_TEMPLATE_DIR = $(PX4_BASE)msg/templates/uorb
|
||||
MULTIPLATFORM_TEMPLATE_DIR = $(PX4_BASE)msg/templates/px4/uorb
|
||||
TOPICS_DIR = $(PX4_BASE)src/modules/uORB/topics
|
||||
MULTIPLATFORM_HEADER_DIR = $(PX4_BASE)src/platforms/nuttx/px4_messages
|
||||
MULTIPLATFORM_PREFIX = px4_
|
||||
TOPICHEADER_TEMP_DIR = $(BUILD_DIR)topics_temporary
|
||||
MULTI_TOPICHEADER_TEMP_DIR = $(BUILD_DIR)multi_topics_temporary
|
||||
GENMSG_PYTHONPATH = $(PX4_BASE)Tools/genmsg/src
|
||||
GENCPP_PYTHONPATH = $(PX4_BASE)Tools/gencpp/src
|
||||
|
||||
.PHONY: generateuorbtopicheaders
|
||||
generateuorbtopicheaders: checksubmodules
|
||||
@$(ECHO) "Generating uORB topic headers"
|
||||
$(Q) (PYTHONPATH=$(GENMSG_PYTHONPATH):$(GENCPP_PYTHONPATH):$(PYTHONPATH) $(PYTHON) \
|
||||
$(PX4_BASE)Tools/px_generate_uorb_topic_headers.py \
|
||||
-d $(MSG_DIR) -o $(TOPICS_DIR) -e $(UORB_TEMPLATE_DIR) -t $(TOPICHEADER_TEMP_DIR))
|
||||
@$(ECHO) "Generating multiplatform uORB topic wrapper headers"
|
||||
$(Q) (PYTHONPATH=$(GENMSG_PYTHONPATH):$(GENCPP_PYTHONPATH):$(PYTHONPATH) $(PYTHON) \
|
||||
$(PX4_BASE)Tools/px_generate_uorb_topic_headers.py \
|
||||
-d $(MSG_DIR) -o $(MULTIPLATFORM_HEADER_DIR) -e $(MULTIPLATFORM_TEMPLATE_DIR) -t $(MULTI_TOPICHEADER_TEMP_DIR) -p $(MULTIPLATFORM_PREFIX))
|
||||
|
||||
#
|
||||
# Testing targets
|
||||
#
|
||||
testbuild:
|
||||
$(Q) (cd $(PX4_BASE) && $(MAKE) distclean && $(MAKE) archives && $(MAKE) -j8)
|
||||
$(Q) (zip -r Firmware.zip $(PX4_BASE)/Images)
|
||||
|
||||
#
|
||||
# Unittest targets. Builds and runs the host-level
|
||||
# unit tests.
|
||||
.PHONY: tests
|
||||
tests: generateuorbtopicheaders
|
||||
$(Q) (mkdir -p $(PX4_BASE)/unittests/build && cd $(PX4_BASE)/unittests/build && cmake .. && $(MAKE) unittests)
|
||||
|
||||
.PHONY: format check_format
|
||||
check_format:
|
||||
$(call colorecho,"Checking formatting with astyle")
|
||||
@./Tools/check_code_style_all.sh
|
||||
@git diff --check
|
||||
|
||||
format:
|
||||
$(call colorecho,"Formatting with astyle")
|
||||
@./Tools/check_code_style_all.sh --fix
|
||||
|
||||
check_%:
|
||||
@echo
|
||||
$(call colorecho,"Building" $(subst check_,,$@))
|
||||
@$(MAKE) --no-print-directory $(subst check_,,$@)
|
||||
@echo
|
||||
|
||||
unittest: posix_sitl_default
|
||||
$(call cmake-build-other,unittest, ../unittests)
|
||||
@(cd build_unittest && ctest -j2 --output-on-failure)
|
||||
|
||||
run_tests_posix: posix_sitl_default
|
||||
@(cd build_posix_sitl_default/ && ctest -V)
|
||||
|
||||
tests: check_unittest run_tests_posix
|
||||
|
||||
# QGroundControl flashable firmware (currently built by travis-ci)
|
||||
qgc_firmware: \
|
||||
check_px4fmu-v1_default \
|
||||
check_px4fmu-v2_default \
|
||||
check_px4fmu-v3_default \
|
||||
check_px4fmu-v4_default_and_uavcan \
|
||||
check_mindpx-v2_default \
|
||||
check_tap-v1_default \
|
||||
check_format
|
||||
|
||||
package_firmware:
|
||||
@zip --junk-paths Firmware.zip `find . -name \*.px4`
|
||||
$(Q) (./Tools/check_code_style.sh | sort -n)
|
||||
|
||||
#
|
||||
# Cleanup targets. 'clean' should remove all built products and force
|
||||
# a complete re-compilation, 'distclean' should remove everything
|
||||
# that's generated leaving only files that are in source control.
|
||||
#
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@rm -rf build_*/
|
||||
-@$(MAKE) -C NuttX/nuttx clean
|
||||
@echo > /dev/null
|
||||
$(Q) $(RMDIR) $(BUILD_DIR)*.build
|
||||
$(Q) $(RMDIR) $(PX4_VERSIONING_DIR)
|
||||
$(Q) $(REMOVE) $(IMAGE_DIR)*.px4
|
||||
$(Q) $(RMDIR) $(TOPICHEADER_TEMP_DIR)
|
||||
$(Q) $(RMDIR) $(MULTI_TOPICHEADER_TEMP_DIR)
|
||||
|
||||
submodulesclean:
|
||||
@git submodule sync --recursive
|
||||
@git submodule deinit -f .
|
||||
@git submodule update --init --recursive --force
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
@echo > /dev/null
|
||||
$(Q) $(REMOVE) $(ARCHIVE_DIR)*.export
|
||||
$(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean
|
||||
$(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete)
|
||||
|
||||
distclean: submodulesclean clean
|
||||
@git clean -ff -x -d -e ".project" -e ".cproject" -e ".idea"
|
||||
|
||||
# All other targets are handled by PX4_MAKE. Add a rule here to avoid printing an error.
|
||||
%:
|
||||
$(if $(filter $(FIRST_ARG),$@), \
|
||||
$(error "$@ cannot be the first argument. Use '$(MAKE) help|list_config_targets' to get a list of all possible [configuration] targets."),@#)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
CONFIGS:=$(shell ls cmake/configs | sed -e "s~.*/~~" | sed -e "s~\..*~~")
|
||||
|
||||
#help:
|
||||
# @echo
|
||||
# @echo "Type 'make ' and hit the tab key twice to see a list of the available"
|
||||
# @echo "build configurations."
|
||||
# @echo
|
||||
|
||||
empty :=
|
||||
space := $(empty) $(empty)
|
||||
|
||||
# Print a list of non-config targets (based on http://stackoverflow.com/a/26339924/1487069)
|
||||
#
|
||||
# Print some help text
|
||||
#
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "Usage: $(MAKE) <target>"
|
||||
@echo "Where <target> is one of:"
|
||||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | \
|
||||
awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | \
|
||||
egrep -v -e '^[^[:alnum:]]' -e '^($(subst $(space),|,$(ALL_CONFIG_TARGETS) $(NUTTX_CONFIG_TARGETS)))$$' -e '_default$$' -e '^(posix|eagle|Makefile)'
|
||||
@echo
|
||||
@echo "Or, $(MAKE) <config_target> [<make_target(s)>]"
|
||||
@echo "Use '$(MAKE) list_config_targets' for a list of configuration targets."
|
||||
|
||||
# Print a list of all config targets.
|
||||
list_config_targets:
|
||||
@for targ in $(patsubst nuttx_%,[nuttx_]%,$(ALL_CONFIG_TARGETS)); do echo $$targ; done
|
||||
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) " PX4 firmware builder"
|
||||
@$(ECHO) " ===================="
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) " Available targets:"
|
||||
@$(ECHO) " ------------------"
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) " archives"
|
||||
@$(ECHO) " Build the NuttX RTOS archives that are used by the firmware build."
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) " all"
|
||||
@$(ECHO) " Build all firmware configs: $(CONFIGS)"
|
||||
@$(ECHO) " A limited set of configs can be built with CONFIGS=<list-of-configs>"
|
||||
@$(ECHO) ""
|
||||
@for config in $(CONFIGS); do \
|
||||
$(ECHO) " $$config"; \
|
||||
$(ECHO) " Build just the $$config firmware configuration."; \
|
||||
$(ECHO) ""; \
|
||||
done
|
||||
@$(ECHO) " clean"
|
||||
@$(ECHO) " Remove all firmware build pieces."
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) " distclean"
|
||||
@$(ECHO) " Remove all compilation products, including NuttX RTOS archives."
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) " upload"
|
||||
@$(ECHO) " When exactly one config is being built, add this target to upload the"
|
||||
@$(ECHO) " firmware to the board when the build is complete. Not supported for"
|
||||
@$(ECHO) " all configurations."
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) " testbuild"
|
||||
@$(ECHO) " Perform a complete clean build of the entire tree."
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) " Common options:"
|
||||
@$(ECHO) " ---------------"
|
||||
@$(ECHO) ""
|
||||
@$(ECHO) " V=1"
|
||||
@$(ECHO) " If V is set, more verbose output is printed during the build. This can"
|
||||
@$(ECHO) " help when diagnosing issues with the build or toolchain."
|
||||
@$(ECHO) ""
|
||||
|
||||
+1
-1
Submodule NuttX updated: af5d2b058c...8891d035df
@@ -1,65 +1,43 @@
|
||||
## PX4 Pro Drone Autopilot ##
|
||||
## PX4 Flight Core and PX4 Middleware ##
|
||||
|
||||
[](https://github.com/PX4/Firmware/releases) [](https://zenodo.org/badge/latestdoi/22634/PX4/Firmware) [](https://travis-ci.org/PX4/Firmware) [](https://scan.coverity.com/projects/3966?tab=overview)
|
||||
[](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, 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, [LICENSE.md](https://github.com/PX4/Firmware/blob/master/LICENSE.md))
|
||||
* Supported airframes (more experimental types than listed here are supported):
|
||||
* [Multicopters](http://px4.io/portfolio_category/multicopter/)
|
||||
* [Fixed wing](http://px4.io/portfolio_category/plane/)
|
||||
* [VTOL](http://px4.io/portfolio_category/vtol/)
|
||||
* Releases: [Downloads](https://github.com/PX4/Firmware/releases)
|
||||
* Official Website: http://px4.io
|
||||
* License: BSD 3-clause (see LICENSE.md)
|
||||
* Supported airframes (more experimental are supported):
|
||||
* [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)
|
||||
* Mailing list: [Google Groups](http://groups.google.com/group/px4users)
|
||||
|
||||
### Users ###
|
||||
|
||||
Please refer to the [user documentation](http://px4.io/user-guide/) 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](http://discuss.px4.io)
|
||||
* [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)
|
||||
|
||||
## Maintenance Team
|
||||
Developer guide:
|
||||
http://px4.io/dev/
|
||||
|
||||
* Project / Founder - [Lorenz Meier](http://github.com/LorenzMeier)
|
||||
* Dev Call - [Mark Whitehorn](http://github.com/kd0aij), [Ramon Roche](http://github.com/mrpollo)
|
||||
* Communication Architecture - [Beat Kueng](http://github.com/bkueng), [Julian Oes](http://github.com/JulianOes)
|
||||
* UI / UX - [Gus Grubba](http://github.com/dogmaphobic)
|
||||
* Multicopter Flight Control - [Dennis Mannhart](http://github.com/Stifael), [Matthias Grob](http://github.com/MaEtUgR)
|
||||
* VTOL Flight Control - [Roman Bapst](http://github.com/tumbili), [Andreas Antener](http://github.com/AndreasAntener), [Sander Smeets](http://github.com/sanderux)
|
||||
* Fixed Wing Flight Control - [Daniel Agar](http://github.com/dagar), [Paul Riseborough](http://github.com/priseborough)
|
||||
* Racers - [Mark Whitehorn](http://github.com/kd0aij)
|
||||
* OS / drivers - [David Sidrane](http://github.com/david_s5)
|
||||
* UAVCAN / Industrial - [Pavel Kirienko](http://github.com/pavel-kirienko)
|
||||
* State Estimation - [James Goppert](http://github.com/jgoppert), [Paul Riseborough](http://github.com/priseborough)
|
||||
* VIO - Christoph Tobler
|
||||
* Obstacle Avoidance - [Vilhjalmur Vilhjalmsson](http://github.com/vilhjalmur89)
|
||||
* Snapdragon - [Mark Charlebois](http://github.com/mcharleb)
|
||||
* Intel Aero - [Lucas de Marchi](http://github.com/lucasdemarchi), [Simone Guscetti](http://github.com/simonegu)
|
||||
* Raspberry Pi / Navio - [Beat Kueng](http://github.com/bkueng)
|
||||
* Parrot Bebop - [Michael Schaeuble](http://github.com/eyeam3)
|
||||
|
||||
## Supported Hardware
|
||||
Testing guide:
|
||||
http://px4.io/dev/unit_tests
|
||||
|
||||
This repository contains code supporting these boards:
|
||||
* [Snapdragon Flight](http://dev.px4.io/hardware-snapdragon.html)
|
||||
* Intel Aero
|
||||
* Raspberry PI with Navio 2
|
||||
* [Parrot Bebop](http://dev.px4.io/starting-building.html#parrot-bebop)
|
||||
* FMUv1.x
|
||||
* FMUv2.x ([Pixhawk](http://dev.px4.io/hardware-pixhawk.html) and [Pixfalcon](http://dev.px4.io/hardware-pixfalcon.html))
|
||||
* FMUv3.x ([Pixhawk 2](http://dev.px4.io/hardware-pixhawk.html))
|
||||
* FMUv4.x (Pixhawk 3 Pro and [Pixracer](http://dev.px4.io/hardware-pixracer.html))
|
||||
* FMUv5.x (ARM Cortex M7, future Pixhawk)
|
||||
* FMUv2.x
|
||||
* AeroCore (v1 and v2)
|
||||
* STM32F4Discovery (basic support) [Tutorial](https://pixhawk.org/modules/stm32f4discovery)
|
||||
* MindPX V2.8 [Tutorial] (http://www.mindpx.net/assets/accessories/UserGuide_MindPX.pdf)
|
||||
* MindRacer V1.2 [Tutorial] (http://mindpx.net/assets/accessories/mindracer_user_guide_v1.2.pdf)
|
||||
|
||||
## Project Milestones
|
||||
|
||||
The PX4 software and Pixhawk hardware (which has been designed for it) has been created in 2011 by Lorenz Meier.
|
||||
## 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,10 @@ 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
|
||||
|
||||
# Enable gamepad / joystick support
|
||||
param set COM_RC_IN_MODE 2
|
||||
|
||||
set HIL yes
|
||||
set MIXER AERT
|
||||
|
||||
@@ -28,3 +28,11 @@ fi
|
||||
set MIXER quad_w
|
||||
|
||||
set PWM_OUT 1234
|
||||
set PWM_MIN 1200
|
||||
|
||||
set MIXER_AUX pass
|
||||
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
|
||||
|
||||
@@ -13,11 +13,11 @@ if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# TODO tune roll/pitch separately
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.15
|
||||
param set MC_ROLLRATE_P 0.13
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.004
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.15
|
||||
param set MC_PITCHRATE_P 0.13
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_YAW_P 2.5
|
||||
@@ -25,10 +25,13 @@ then
|
||||
param set MC_YAWRATE_I 0.25
|
||||
param set MC_YAWRATE_D 0.0
|
||||
|
||||
param set BAT_V_DIV 12.27559
|
||||
param set BAT_A_PER_V 15.39103
|
||||
param set BAT_V_SCALING 0.00989
|
||||
param set BAT_C_SCALING 0.0124
|
||||
fi
|
||||
|
||||
set MIXER quad_w
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
set PWM_MIN 1200
|
||||
set PWM_MAX 1950
|
||||
|
||||
@@ -30,4 +30,7 @@ fi
|
||||
|
||||
set MIXER quad_w
|
||||
|
||||
set PWM_MIN 1210
|
||||
set PWM_MAX 2100
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name HobbyKing SK450 DeadCat modification
|
||||
#
|
||||
# @type Quadrotor Wide
|
||||
#
|
||||
# @maintainer Anton Matosov <anton.matosov@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 6.0
|
||||
param set MC_ROLLRATE_P 0.08
|
||||
param set MC_ROLLRATE_I 0.03
|
||||
param set MC_ROLLRATE_D 0.0015
|
||||
|
||||
param set MC_PITCH_P 6.0
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_I 0.03
|
||||
param set MC_PITCHRATE_D 0.0015
|
||||
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.1
|
||||
param set MC_YAWRATE_I 0.07
|
||||
param set MC_YAWRATE_D 0.0
|
||||
fi
|
||||
|
||||
set MIXER sk450_deadcat
|
||||
|
||||
set PWM_OUT 1234
|
||||
set PWM_MIN 1050
|
||||
|
||||
set PWM_AUX_OUT 1234
|
||||
# set PWM_AUX_MIN 900
|
||||
# set PWM_AUX_MAX 2100
|
||||
set PWM_AUX_RATE 100
|
||||
|
||||
gimbal start
|
||||
@@ -11,4 +11,7 @@ sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
set MIXER quad_x
|
||||
|
||||
# Enable gamepad / joystick support
|
||||
param set COM_RC_IN_MODE 2
|
||||
|
||||
set HIL yes
|
||||
|
||||
@@ -1,23 +1,31 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name 3DR DIY Quad
|
||||
# @name 3DR Iris DIY Quad
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# TODO tune roll/pitch separately
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.14
|
||||
param set MC_ROLLRATE_P 0.08
|
||||
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_P 0.16
|
||||
param set MC_PITCHRATE_I 0.09
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_YAW_P 4
|
||||
fi
|
||||
|
||||
set MIXER quad_x
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
set PWM_MIN 1100
|
||||
set PWM_MAX 1950
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name H4 680mm with Z1 Tiny2 Gimbal
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Leon Mueller <thedevleon>
|
||||
#
|
||||
|
||||
sh /etc/init.d/4002_quad_x_mount
|
||||
|
||||
# The Z1 Tiny2 can handle up to 400Hz
|
||||
# and works with min 1020us, middle 1520us, max 2020us
|
||||
# see http://www.zhiyun-tech.com/uploadfile/datedown/instruction/Tiny2_English_instructionV1.03.pdf
|
||||
# under Gimbal Connection Instruction
|
||||
|
||||
set PWM_AUX_RATE 400
|
||||
set PWM_AUX_DISARMED 1520
|
||||
set PWM_AUX_MIN 1020
|
||||
set PWM_AUX_MAX 2020
|
||||
|
||||
# Start FrSky telemetry on SERIAL4 (ttyS6, designated "SERIAL4/5" on the case)
|
||||
frsky_telemetry start -d /dev/ttyS6
|
||||
|
||||
# GPIO LED
|
||||
gpio_led start -p 6
|
||||
@@ -11,4 +11,7 @@ sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
set MIXER quad_+
|
||||
|
||||
# Enable gamepad / joystick support
|
||||
param set COM_RC_IN_MODE 2
|
||||
|
||||
set HIL yes
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name HIL Rascal 110 (Flightgear)
|
||||
#
|
||||
# @type Simulation
|
||||
#
|
||||
# @maintainer Thomas Gubler <thomas@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
set HIL yes
|
||||
|
||||
# Enable gamepad / joystick support
|
||||
param set COM_RC_IN_MODE 2
|
||||
|
||||
set MIXER AERT
|
||||
@@ -0,0 +1,43 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name HIL Malolo 1 (Flightgear)
|
||||
#
|
||||
# @type Simulation
|
||||
#
|
||||
# @maintainer Thomas Gubler <thomas@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set FW_AIRSPD_MIN 12
|
||||
param set FW_AIRSPD_TRIM 25
|
||||
param set FW_AIRSPD_MAX 40
|
||||
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
|
||||
param set FW_PR_I 0.05
|
||||
param set FW_PR_IMAX 0.2
|
||||
param set FW_PR_P 0.1
|
||||
param set FW_P_ROLLFF 0
|
||||
param set FW_RR_FF 0.6
|
||||
param set FW_RR_I 0.02
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.1
|
||||
param set FW_R_LIM 45
|
||||
param set FW_R_RMAX 0
|
||||
param set FW_YR_FF 0.0
|
||||
param set FW_YR_I 0
|
||||
param set FW_YR_IMAX 0.2
|
||||
param set FW_YR_P 0.0
|
||||
fi
|
||||
|
||||
set HIL yes
|
||||
|
||||
# Enable gamepad / joystick support
|
||||
param set COM_RC_IN_MODE 2
|
||||
|
||||
# Set the AERT mixer for HIL (even if the malolo is a flying wing)
|
||||
set MIXER AERT
|
||||
@@ -4,17 +4,6 @@
|
||||
#
|
||||
# @type Hexarotor Coaxial
|
||||
#
|
||||
# @output MAIN1 front right top, CW; angle:60; direction:CW
|
||||
# @output MAIN2 front right bottom, CCW; angle:60; direction:CCW
|
||||
# @output MAIN3 back top, CW; angle:180; direction:CW
|
||||
# @output MAIN4 back bottom, CCW; angle:180; direction:CCW
|
||||
# @output MAIN5 front left top, CW; angle:-60; direction:CW
|
||||
# @output MAIN6 front left bottom, CCW;angle:-60; direction:CCW
|
||||
#
|
||||
# @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 Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
|
||||
@@ -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 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Caipiroshka Duo Tailsitter
|
||||
#
|
||||
# @type VTOL Duo Tailsitter
|
||||
#
|
||||
# @output MAIN1 motor left
|
||||
# @output MAIN2 motor right
|
||||
# @output MAIN5 elevon left
|
||||
# @output MAIN6 elevon right
|
||||
#
|
||||
# @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
|
||||
@@ -1,69 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Fun Cub Quad VTOL
|
||||
# @type Standard VTOL
|
||||
# @maintainer Simon Wilks <simon@uaventure.com>
|
||||
# @output MAIN1 Front right motor: CCW
|
||||
# @output MAIN2 Back left motor: CCW
|
||||
# @output MAIN3 Front left motor: CW
|
||||
# @output MAIN4 Back right motor: CW
|
||||
# @output AUX1 Aileron 1
|
||||
# @output AUX2 Aileron 2
|
||||
# @output AUX3 Elevator
|
||||
# @output AUX4 Rudder
|
||||
# @output AUX5 Throttle
|
||||
#
|
||||
|
||||
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 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_ROLLRATE_I 0.002
|
||||
param set MC_ROLLRATE_D 0.004
|
||||
param set MC_ROLLRATE_FF 0.0
|
||||
param set MC_PITCH_P 6.0
|
||||
param set MC_PITCHRATE_P 0.19
|
||||
param set MC_PITCHRATE_I 0.002
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_PITCHRATE_FF 0.0
|
||||
param set MC_YAW_P 2.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 MC_YAWRATE_MAX 40
|
||||
param set MC_YAWRAUTO_MAX 40
|
||||
|
||||
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 MIXER_AUX vtol_AAERT
|
||||
set PWM_ACHDIS 5
|
||||
set PWM_AUX_DISARMED 950
|
||||
|
||||
set MAV_TYPE 22
|
||||
@@ -1,59 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Generic quad delta VTOL
|
||||
# @type Standard VTOL
|
||||
# @maintainer Simon Wilks <simon@uaventure.com>
|
||||
# @output MAIN1 Front right motor: CCW
|
||||
# @output MAIN2 Back left motor: CCW
|
||||
# @output MAIN3 Front left motor: CW
|
||||
# @output MAIN4 Back right motor: CW
|
||||
# @output AUX1 Right elevon
|
||||
# @output AUX2 Left elevon
|
||||
# @output AUX3 Motor
|
||||
#
|
||||
|
||||
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 MC_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.15
|
||||
param set MC_ROLLRATE_I 0.01
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_ROLLRATE_FF 0.0
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_PITCHRATE_P 0.15
|
||||
param set MC_PITCHRATE_I 0.01
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_PITCHRATE_FF 0.0
|
||||
param set MC_YAW_P 3.5
|
||||
param set MC_YAW_FF 0.5
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
param set MC_YAWRATE_MAX 20
|
||||
param set MC_YAWRAUTO_MAX 20
|
||||
|
||||
param set MPC_XY_P 0.8
|
||||
param set MPC_XY_VEL_P 0.1
|
||||
param set MPC_ACC_HOR_MAX 2.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_delta
|
||||
set PWM_ACHDIS 3
|
||||
set PWM_AUX_DISARMED 950
|
||||
|
||||
set MAV_TYPE 22
|
||||
@@ -1,70 +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 MC_YAWRATE_MAX 40.0
|
||||
param set MC_YAWRAUTO_MAX 40.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,89 +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_YAWRATE_MAX 40.0
|
||||
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,36 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name CruiseAder Claire
|
||||
#
|
||||
# @type VTOL Tiltrotor
|
||||
#
|
||||
# @maintainer Samay Siga <samay_s@icloud.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set VT_TYPE 1
|
||||
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 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 1
|
||||
fi
|
||||
|
||||
set MIXER claire
|
||||
set PWM_OUT 1234
|
||||
set PWM_RATE 400
|
||||
set PWM_MAX 2000
|
||||
|
||||
set MIXER_AUX claire
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_RATE 123
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
set PWM_AUX_DISARMED 1000
|
||||
|
||||
set MAV_TYPE 21
|
||||
@@ -1,59 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Esky (Big) Lama v4
|
||||
#
|
||||
# @type Coaxial Helicopter
|
||||
#
|
||||
# @output MAIN1 Left swashplate servomotor, pitch axis
|
||||
# @output MAIN2 Right swashplate servomotor, roll axis
|
||||
# @output MAIN3 Upper rotor (CCW)
|
||||
# @output MAIN4 Lower rotor (CW)
|
||||
#
|
||||
# @maintainer Emmanuel Roussel
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
set MIXER coax
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set NAV_ACC_RAD 2.0
|
||||
param set RTL_RETURN_ALT 30.0
|
||||
param set RTL_DESCEND_ALT 10.0
|
||||
|
||||
param set PWM_DISARMED 900
|
||||
param set PWM_MIN 1075
|
||||
param set PWM_MAX 1950
|
||||
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.17
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.005
|
||||
param set MC_ROLLRATE_FF 0
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_PITCHRATE_P 0.17
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.005
|
||||
param set MC_PITCHRATE_FF 0
|
||||
param set MC_YAW_P 2
|
||||
param set MC_YAW_FF 0.5
|
||||
param set MC_YAWRATE_P 0.1
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0
|
||||
fi
|
||||
|
||||
# use PWM parameters for throttle channel
|
||||
set PWM_OUT 34
|
||||
set PWM_RATE 400
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
|
||||
# This is the gimbal pass mixer
|
||||
set MIXER_AUX pass
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1500
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
@@ -1,50 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Blade 130X
|
||||
#
|
||||
# @type Helicopter
|
||||
#
|
||||
# @maintainer Bart Slinger <bartslinger@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
# Configure as helicopter (number 4 defined in commander_helper.cpp)
|
||||
set MAV_TYPE 4
|
||||
|
||||
set MIXER heli_120deg
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 5.0
|
||||
param set MC_ROLLRATE_P 0.0
|
||||
param set MC_ROLLRATE_I 0.0
|
||||
param set MC_ROLLRATE_D 0.0
|
||||
param set MC_ROLLRATE_FF 0.15
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_PITCHRATE_P 0.0
|
||||
param set MC_PITCHRATE_I 0.0
|
||||
param set MC_PITCHRATE_D 0.0
|
||||
param set MC_PITCHRATE_FF 0.15
|
||||
param set MC_YAW_P 3.0
|
||||
param set MC_YAWRATE_P 0.1
|
||||
param set MC_YAWRATE_I 0.0
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.0
|
||||
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,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
|
||||
@@ -6,8 +6,8 @@
|
||||
#
|
||||
# @output MAIN1 aileron
|
||||
# @output MAIN2 elevator
|
||||
# @output MAIN3 rudder
|
||||
# @output MAIN4 throttle
|
||||
# @output MAIN4 rudder
|
||||
# @output MAIN3 throttle
|
||||
# @output MAIN5 flaps
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
@@ -20,9 +20,3 @@
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
set MIXER AERT
|
||||
|
||||
# use PWM parameters for throttle channel
|
||||
set PWM_OUT 4
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
|
||||
@@ -20,9 +20,3 @@
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
set MIXER AETR
|
||||
|
||||
# use PWM parameters for throttle channel
|
||||
set PWM_OUT 3
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Bormatec Maja
|
||||
#
|
||||
# @type Standard Plane
|
||||
#
|
||||
# @output MAIN1 aileron
|
||||
# @output MAIN2 aileron
|
||||
# @output MAIN3 elevator
|
||||
# @output MAIN4 rudder
|
||||
# @output MAIN5 throttle
|
||||
# @output MAIN6 wheel
|
||||
# @output MAIN7 flaps
|
||||
#
|
||||
# @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 Andreas Antener <andreas@uaventure.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set FW_AIRSPD_MIN 10
|
||||
param set FW_AIRSPD_TRIM 15
|
||||
param set FW_AIRSPD_MAX 20
|
||||
|
||||
param set FW_MAN_P_MAX 55
|
||||
param set FW_MAN_R_MAX 55
|
||||
param set FW_R_LIM 55
|
||||
|
||||
param set FW_WR_FF 0.2
|
||||
param set FW_WR_I 0.2
|
||||
param set FW_WR_IMAX 0.8
|
||||
param set FW_WR_P 1
|
||||
param set FW_W_RMAX 0
|
||||
|
||||
# set disarmed value for the ESC
|
||||
param set PWM_DISARMED 1000
|
||||
fi
|
||||
|
||||
set MIXER AAERTWF
|
||||
|
||||
# use PWM parameters for throttle channel
|
||||
set PWM_OUT 5
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
@@ -1,51 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Applied Aeronautics Albatross
|
||||
#
|
||||
# @type Plane A-Tail
|
||||
#
|
||||
# @output MAIN1 aileron right
|
||||
# @output MAIN2 aileron left
|
||||
# @output MAIN3 v-tail right
|
||||
# @output MAIN4 v-tail left
|
||||
# @output MAIN5 throttle
|
||||
# @output MAIN6 wheel
|
||||
# @output MAIN7 flaps right
|
||||
# @output MAIN8 flaps left
|
||||
#
|
||||
# @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 Andreas Antener <andreas@uaventure.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set FW_AIRSPD_MIN 10
|
||||
param set FW_AIRSPD_TRIM 15
|
||||
param set FW_AIRSPD_MAX 20
|
||||
|
||||
param set FW_MAN_P_MAX 55
|
||||
param set FW_MAN_R_MAX 55
|
||||
param set FW_R_LIM 55
|
||||
|
||||
param set FW_WR_FF 0.2
|
||||
param set FW_WR_I 0.2
|
||||
param set FW_WR_IMAX 0.8
|
||||
param set FW_WR_P 1
|
||||
param set FW_W_RMAX 0
|
||||
|
||||
# set disarmed value for the ESC
|
||||
param set PWM_DISARMED 1000
|
||||
fi
|
||||
|
||||
set MIXER AAVVTWFF
|
||||
|
||||
# use PWM parameters for throttle channel
|
||||
set PWM_OUT 5
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
@@ -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
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
# @maintainer Simon Wilks <simon@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
@@ -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
|
||||
@@ -40,9 +39,6 @@ then
|
||||
param set FW_RR_P 0.04
|
||||
fi
|
||||
|
||||
# Configure this as plane
|
||||
set MAV_TYPE 1
|
||||
# Set mixer
|
||||
set MIXER wingwing
|
||||
# Provide ESC a constant 1000 us pulse
|
||||
set PWM_OUT 4
|
||||
|
||||
@@ -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
|
||||
@@ -11,44 +11,30 @@ sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set FW_AIRSPD_MAX 25
|
||||
param set FW_AIRSPD_MIN 12.5
|
||||
param set FW_AIRSPD_TRIM 16.5
|
||||
param set LNDFW_AIRSPD_MAX 6
|
||||
param set LNDFW_VELI_MAX 4
|
||||
param set LNDFW_VEL_XY_MAX 3
|
||||
param set LNDFW_VEL_Z_MAX 5
|
||||
param set FW_R_TC 0.4
|
||||
param set FW_P_TC 0.4
|
||||
param set FW_THR_CRUISE 0.55
|
||||
param set FW_L1_DAMPING 0.75
|
||||
param set FW_L1_PERIOD 15
|
||||
param set FW_AIRSPD_MAX 20
|
||||
param set FW_AIRSPD_MIN 12
|
||||
param set FW_AIRSPD_TRIM 16
|
||||
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
|
||||
param set FW_LND_FLALT 8
|
||||
param set FW_LND_FLALT 5
|
||||
param set FW_LND_HHDIST 15
|
||||
param set FW_LND_HVIRT 13
|
||||
param set FW_LND_TLALT 10
|
||||
param set FW_LND_TLALT 5
|
||||
param set FW_THR_LND_MAX 0
|
||||
param set FW_P_LIM_MAX 20
|
||||
param set FW_P_LIM_MIN -30
|
||||
param set FW_R_LIM 45
|
||||
param set FW_PR_FF 0.45
|
||||
param set FW_PR_FF 0.35
|
||||
param set FW_PR_IMAX 0.4
|
||||
param set FW_PR_P 0.005
|
||||
param set FW_RR_FF 0.45
|
||||
param set FW_PR_P 0.08
|
||||
param set FW_RR_FF 0.6
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.013
|
||||
param set FW_P_RMAX_NEG 70
|
||||
param set FW_P_RMAX_POS 70
|
||||
param set FW_R_RMAX 70
|
||||
param set FW_RR_P 0.04
|
||||
param set SYS_COMPANION 157600
|
||||
param set PWM_MAIN_REV0 1
|
||||
param set PWM_MAIN_REV1 1
|
||||
param set PWM_MAIN_REV2 1
|
||||
param set PWM_DISARMED 0
|
||||
param set PWM_MIN 900
|
||||
param set PWM_MAX 2100
|
||||
param set MIS_TAKEOFF_ALT 50
|
||||
param set NAV_LOITER_RAD 30
|
||||
fi
|
||||
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Lumenier QAV-R (raceblade) 5" arms
|
||||
#
|
||||
# @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_ROLL_P 8.0
|
||||
param set MC_ROLLRATE_P 0.08
|
||||
param set MC_ROLLRATE_I 0.16
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_PITCH_P 8.0
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_I 0.2
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.15
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.5
|
||||
param set MC_TPA_BREAK 0.7
|
||||
param set MC_TPA_SLOPE 1.0
|
||||
param set PWM_MIN 1075
|
||||
param set MPC_THR_MIN 0.06
|
||||
param set MPC_MANTHR_MIN 0.06
|
||||
fi
|
||||
@@ -1,21 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Generic Quadrotor X config with mount (e.g. gimbal)
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
#
|
||||
# @maintainer Leon Mueller <thedevleon>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
set MIXER quad_x
|
||||
set PWM_OUT 1234
|
||||
|
||||
set MIXER_AUX mount
|
||||
set PWM_AUX_OUT 123456
|
||||
set PWM_AUX_RATE 50
|
||||
|
||||
# Start mount driver
|
||||
vmount start
|
||||
@@ -29,7 +29,7 @@ then
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.8
|
||||
|
||||
param set BAT_V_DIV 34.32838
|
||||
param set BAT_V_SCALING 0.00838095238
|
||||
fi
|
||||
|
||||
set OUTPUT_MODE ardrone
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Lumenier QAV250
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output MAIN1 motor1 (front right: CCW)
|
||||
# @output MAIN2 motor2 (back left: CCW)
|
||||
# @output MAIN3 motor3 (front left: CW)
|
||||
# @output MAIN4 motor4 (back right: CW)
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
# @output AUX4 feed-through of RC FLAPS channel
|
||||
#
|
||||
# @maintainer Mark Whitehorn <kd0aij@gmail.com>
|
||||
#
|
||||
|
||||
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_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_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.5
|
||||
param set PWM_MIN 1075
|
||||
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_TPA_BREAK 0.5
|
||||
param set MC_TPA_SLOPE 1.0
|
||||
fi
|
||||
@@ -16,11 +16,11 @@ sh /etc/init.d/4001_quad_x
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.15
|
||||
param set MC_ROLLRATE_P 0.13
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.15
|
||||
param set MC_PITCHRATE_P 0.13
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_YAW_P 2.8
|
||||
@@ -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
|
||||
|
||||
@@ -15,14 +15,15 @@ sh /etc/init.d/4001_quad_x
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# TODO REVIEW
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.15
|
||||
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.15
|
||||
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
|
||||
@@ -30,3 +31,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,35 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Parrot Bebop Frame
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Michael Schaeuble
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
#
|
||||
# Load default params for this platform
|
||||
#
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# Set all params here, then disable autoconfig
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.109999999403953552
|
||||
param set MC_ROLLRATE_I 0.0
|
||||
param set MC_ROLLRATE_D 0.0006
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_I 0.0
|
||||
param set MC_PITCHRATE_D 0.000799999
|
||||
param set MC_YAW_P 1.049999
|
||||
param set MC_YAWRATE_P 0.05
|
||||
param set MC_YAWRATE_I 0.001
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.7
|
||||
fi
|
||||
|
||||
set OUTPUT_MODE bebop
|
||||
set USE_IO no
|
||||
set MIXER bebop
|
||||
@@ -1,88 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name 3DR Solo
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Andreas Antener <andreas@uaventure.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# tuning
|
||||
param set MC_PITCHRATE_P 0.11
|
||||
param set MC_ROLLRATE_P 0.11
|
||||
param set MPC_MANTHR_MIN 0.08
|
||||
param set MPC_XY_VEL_MAX 3.0
|
||||
param set MPC_Z_VEL_MAX 2.0
|
||||
|
||||
# INAV: higher GPS weights for better altitude control
|
||||
param set INAV_W_Z_BARO 0.3
|
||||
param set INAV_W_Z_GPS_P 0.8
|
||||
param set INAV_W_Z_GPS_V 0.8
|
||||
|
||||
# takeoff, land and RTL settings
|
||||
param set MIS_TAKEOFF_ALT 4.0
|
||||
param set COM_DISARM_LAND 1
|
||||
param set RTL_LAND_DELAY 1
|
||||
param set RTL_DESCEND_ALT 5.0
|
||||
param set RTL_RETURN_ALT 15.0
|
||||
param set MPC_TILTMAX_LND 8.0
|
||||
param set MPC_LAND_SPEED 0.4
|
||||
param set MPC_HOLD_MAX_Z 1.5
|
||||
param set MPC_TKO_JMPSPD 2.0
|
||||
param set MPC_TKO_SPEED 1.5
|
||||
|
||||
# setup
|
||||
# main board rotation: pitch 180
|
||||
param set SENS_BOARD_ROT 12
|
||||
# solo external mag rotation
|
||||
param set CAL_MAG0_ROT 30
|
||||
# no safety switch
|
||||
param set CBRK_IO_SAFETY 22027
|
||||
# battery voltage not available yet
|
||||
param set CBRK_SUPPLY_CHK 894281
|
||||
|
||||
# RC configuration
|
||||
param set RC_MAP_MODE_SW 5
|
||||
param set RC_MAP_PITCH 2
|
||||
param set RC_MAP_ROLL 1
|
||||
param set RC_MAP_THROTTLE 3
|
||||
param set RC_MAP_YAW 4
|
||||
|
||||
param set RC1_DZ 10
|
||||
param set RC1_MAX 1988
|
||||
param set RC1_MIN 1003
|
||||
param set RC1_REV 1
|
||||
param set RC1_TRIM 1499
|
||||
param set RC2_DZ 10
|
||||
param set RC2_MAX 1987
|
||||
param set RC2_MIN 1023
|
||||
param set RC2_REV -1
|
||||
param set RC2_TRIM 1499
|
||||
param set RC3_DZ 10
|
||||
param set RC3_MAX 1877
|
||||
param set RC3_MIN 1023
|
||||
param set RC3_REV 1
|
||||
param set RC3_TRIM 1023
|
||||
param set RC4_DZ 10
|
||||
param set RC4_MAX 1998
|
||||
param set RC4_MIN 1012
|
||||
param set RC4_REV 1
|
||||
param set RC4_TRIM 1500
|
||||
param set RC5_DZ 10
|
||||
param set RC5_MAX 2000
|
||||
param set RC5_MIN 1000
|
||||
param set RC5_REV 1
|
||||
param set RC5_TRIM 1500
|
||||
fi
|
||||
|
||||
set MIXER quad_x
|
||||
|
||||
set PWM_OUT 1234
|
||||
set MIXER_AUX none
|
||||
|
||||
# enable high-speed link on telem 1
|
||||
set MAVLINK_F "-d /dev/ttyS1 -b 921600 -r 80000 -m onboard -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,54 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Generic 250 Racer
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output MAIN1 motor1 (front right: CCW)
|
||||
# @output MAIN2 motor2 (back left: CCW)
|
||||
# @output MAIN3 motor3 (front left: CW)
|
||||
# @output MAIN4 motor4 (back right: CW)
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
# @output AUX4 feed-through of RC FLAPS 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.19
|
||||
param set MC_PITCHRATE_I 0.1
|
||||
param set MC_PITCHRATE_D 0.0055
|
||||
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 MC_TPA_BREAK 0.5
|
||||
param set MC_TPA_SLOPE 1.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,31 +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_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.05
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.001
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_PITCHRATE_P 0.05
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.001
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.0
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set BAT_N_CELLS 6
|
||||
param set PWM_MIN 1200
|
||||
fi
|
||||
@@ -1,43 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Intel Aero RTF
|
||||
#
|
||||
# @type Quadrotor x
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
#
|
||||
# Load default params for this platform
|
||||
#
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# Set all params here, then disable autoconfig
|
||||
param set MC_ROLL_P 8.0000
|
||||
param set MC_ROLLRATE_P 0.1300
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.0012
|
||||
param set MC_ROLLRATE_MAX 360
|
||||
param set MC_PITCH_P 8.0000
|
||||
param set MC_PITCHRATE_P 0.1300
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.0012
|
||||
param set MC_PITCHRATE_MAX 360
|
||||
param set MC_YAW_P 4.0
|
||||
param set MC_YAWRATE_P 0.119999997317790985
|
||||
param set MC_YAWRATE_I 0.050000000745058060
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.5
|
||||
param set MPC_XY_CRUISE 8
|
||||
|
||||
param set SYS_LOGGER 1
|
||||
fi
|
||||
|
||||
tap_esc start -d /dev/ttyS0 -n 4
|
||||
usleep 300000
|
||||
|
||||
set OUTPUT_MODE tap_esc
|
||||
set MIXER quad_x
|
||||
set USE_IO no
|
||||
|
||||
param set SYS_COMPANION 1500000
|
||||
set MAVLINK_COMPANION_DEVICE /dev/ttyS1
|
||||
@@ -1,42 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Crazyflie 2.0
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set COM_RC_IN_MODE 2
|
||||
param set BAT_N_CELLS 1
|
||||
param set BAT_CAPACITY 240
|
||||
param set BAT_SOURCE 1
|
||||
|
||||
param set PWM_DISARMED 0
|
||||
param set PWM_MIN 0
|
||||
param set PWM_MAX 255
|
||||
|
||||
param set SYS_COMPANION 20
|
||||
|
||||
param set MC_PITCHRATE_D 0.0015
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_P 0.045
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_ROLLRATE_D 0.0015
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_P 0.045
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_YAW_P 3.0
|
||||
|
||||
param set CBRK_SUPPLY_CHK 894281
|
||||
param set CBRK_USB_CHK 197848
|
||||
fi
|
||||
|
||||
set PWM_MIN none
|
||||
set PWM_MAX none
|
||||
set PWM_DISARMED none
|
||||
# Will run the motors at 328.125 kHz (recommended)
|
||||
set PWM_RATE 3921
|
||||
@@ -0,0 +1,19 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Duorotor Tailsitter
|
||||
#
|
||||
# @type VTOL Tailsitter
|
||||
#
|
||||
# @maintainer Roman Bapst <roman@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
set MIXER caipirinha_vtol
|
||||
|
||||
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
|
||||
+11
-8
@@ -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,20 @@ 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_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 1
|
||||
+5
-9
@@ -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
|
||||
+5
-9
@@ -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
|
||||
+13
-13
@@ -1,10 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Generic AAVVT v-tail plane airframe with Quad VTOL.
|
||||
# @name Generic AAERT tailplane airframe with Quad VTOL.
|
||||
#
|
||||
# @type Standard VTOL
|
||||
#
|
||||
# @maintainer Sander Smeets <sander@droneslab.com>
|
||||
# @maintainer Simon Wilks <simon@uaventure.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
@@ -31,20 +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 MC_YAWRATE_MAX 40
|
||||
param set MC_YAWRAUTO_MAX 40
|
||||
|
||||
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 MIXER_AUX vtol_AAERT
|
||||
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
|
||||
@@ -4,7 +4,7 @@
|
||||
# att & pos estimator, rover steering control
|
||||
#
|
||||
|
||||
ekf2 start
|
||||
ekf_att_pos_estimator start
|
||||
|
||||
# disabled the start of steering control app due to use of offboard mode only
|
||||
# rover_steering_control start
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Start the attitude and position estimator
|
||||
#
|
||||
ekf2 start
|
||||
ekf_att_pos_estimator start
|
||||
|
||||
#
|
||||
# Start attitude controller
|
||||
|
||||
@@ -7,16 +7,17 @@ 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
|
||||
|
||||
# FW uses L1 distance for acceptance radius
|
||||
# set a smaller NAV_ACC_RAD for vertical acceptance distance
|
||||
param set NAV_ACC_RAD 10
|
||||
|
||||
param set MIS_LTRMIN_ALT 25
|
||||
param set MIS_TAKEOFF_ALT 25
|
||||
param set PE_VELNE_NOISE 0.3
|
||||
param set PE_VELD_NOISE 0.35
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.0
|
||||
param set PE_GBIAS_PNOISE 0.000001
|
||||
param set PE_ABIAS_PNOISE 0.0002
|
||||
fi
|
||||
|
||||
# This is the gimbal pass mixer
|
||||
|
||||
@@ -43,17 +43,12 @@ then
|
||||
set OUTPUT_DEV /dev/uavcan/esc
|
||||
fi
|
||||
|
||||
if [ $OUTPUT_MODE == tap_esc ]
|
||||
then
|
||||
set OUTPUT_DEV /dev/tap_esc
|
||||
fi
|
||||
|
||||
if mixer load $OUTPUT_DEV $MIXER_FILE
|
||||
then
|
||||
echo "INFO [init] Mixer: $MIXER_FILE on $OUTPUT_DEV"
|
||||
echo "[i] Mixer: $MIXER_FILE on $OUTPUT_DEV"
|
||||
else
|
||||
echo "ERROR [init] Error loading mixer: $MIXER_FILE"
|
||||
echo "ERROR:[init] Could not load mixer: $MIXER_FILE" >> $LOG_FILE
|
||||
echo "[i] Error loading mixer: $MIXER_FILE"
|
||||
echo "ERROR: Could not load mixer: $MIXER_FILE" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
|
||||
@@ -61,8 +56,8 @@ then
|
||||
else
|
||||
if [ $MIXER != skip ]
|
||||
then
|
||||
echo "ERROR [init] Mixer not defined"
|
||||
echo "ERROR [init] Mixer not defined" >> $LOG_FILE
|
||||
echo "[i] Mixer not defined"
|
||||
echo "ERROR: Mixer not defined" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@@ -108,23 +103,7 @@ then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
#MindPX has not aux mixer
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
if [ $MIXER_AUX != none -a $AUX_MODE != none ]
|
||||
if [ $MIXER_AUX != none ]
|
||||
then
|
||||
#
|
||||
# Load aux mixer
|
||||
@@ -144,29 +123,18 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $MIXER_AUX_FILE != none ]
|
||||
if [ $MIXER_AUX_FILE != none -a $FMU_MODE == pwm ]
|
||||
then
|
||||
if fmu mode_$AUX_MODE
|
||||
if fmu mode_pwm
|
||||
then
|
||||
# Append aux mixer to main device
|
||||
if [ $OUTPUT_MODE == hil ]
|
||||
then
|
||||
if mixer append $OUTPUT_DEV $MIXER_AUX_FILE
|
||||
then
|
||||
echo "INFO [init] Mixer: $MIXER_AUX_FILE appended to $OUTPUT_DEV"
|
||||
else
|
||||
echo "ERROR [init] Error appending mixer: $MIXER_AUX_FILE"
|
||||
echo "ERROR [init] Could not append mixer: $MIXER_AUX_FILE" >> $LOG_FILE
|
||||
fi
|
||||
fi
|
||||
if [ -e $OUTPUT_AUX_DEV -a $OUTPUT_MODE != hil ]
|
||||
if [ -e $OUTPUT_AUX_DEV ]
|
||||
then
|
||||
if mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE
|
||||
then
|
||||
echo "INFO [init] Mixer: $MIXER_AUX_FILE on $OUTPUT_AUX_DEV"
|
||||
echo "[i] Mixer: $MIXER_AUX_FILE on $OUTPUT_AUX_DEV"
|
||||
else
|
||||
echo "ERROR [init] Error loading mixer: $MIXER_AUX_FILE"
|
||||
echo "ERROR [init] Could not load mixer: $MIXER_AUX_FILE" >> $LOG_FILE
|
||||
echo "[i] Error loading mixer: $MIXER_AUX_FILE"
|
||||
echo "ERROR: Could not load mixer: $MIXER_AUX_FILE" >> $LOG_FILE
|
||||
fi
|
||||
else
|
||||
set PWM_AUX_OUT none
|
||||
@@ -179,7 +147,6 @@ then
|
||||
set FAILSAFE_AUX none
|
||||
fi
|
||||
|
||||
# Set min / max for aux out and rates
|
||||
if [ $PWM_AUX_OUT != none ]
|
||||
then
|
||||
#
|
||||
@@ -190,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
|
||||
@@ -200,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
|
||||
@@ -224,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
|
||||
|
||||
@@ -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,35 +4,41 @@
|
||||
# att & pos estimator, att & pos control.
|
||||
#
|
||||
|
||||
|
||||
#---------------------------------------
|
||||
# Estimator group selction
|
||||
#
|
||||
# INAV (deprecated)
|
||||
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
|
||||
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
|
||||
param set SYS_MC_EST_GROUP 1
|
||||
param save
|
||||
# The system is defaulting to EKF_ATT_ENABLED = 1
|
||||
# and uses the older EKF filter. However users can
|
||||
# enable the new quaternion based complimentary
|
||||
# filter by setting EKF_ATT_ENABLED = 0.
|
||||
# Note that on FMUv1, the EKF att estimator is not
|
||||
# available and the Q estimator runs instead.
|
||||
if param compare EKF_ATT_ENABLED 1
|
||||
then
|
||||
attitude_estimator_ekf start
|
||||
else
|
||||
attitude_estimator_q start
|
||||
fi
|
||||
position_estimator_inav start
|
||||
else
|
||||
ekf_att_pos_estimator start
|
||||
fi
|
||||
|
||||
# LPE
|
||||
if param compare SYS_MC_EST_GROUP 1
|
||||
if mc_att_control start
|
||||
then
|
||||
attitude_estimator_q start
|
||||
local_position_estimator start
|
||||
else
|
||||
# try the multiplatform version
|
||||
mc_att_control_m start
|
||||
fi
|
||||
|
||||
# EKF
|
||||
if param compare SYS_MC_EST_GROUP 2
|
||||
if mc_pos_control start
|
||||
then
|
||||
ekf2 start
|
||||
else
|
||||
# try the multiplatform version
|
||||
mc_pos_control_m start
|
||||
fi
|
||||
#---------------------------------------
|
||||
|
||||
mc_att_control start
|
||||
|
||||
mc_pos_control start
|
||||
|
||||
#
|
||||
# Start Land Detector
|
||||
|
||||
@@ -4,19 +4,38 @@ set VEHICLE_TYPE mc
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set PE_VELNE_NOISE 0.5
|
||||
param set PE_VELD_NOISE 0.35
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.25
|
||||
param set PE_GBIAS_PNOISE 0.000001
|
||||
param set PE_ABIAS_PNOISE 0.0001
|
||||
|
||||
param set NAV_ACC_RAD 2.0
|
||||
param set RTL_RETURN_ALT 30.0
|
||||
param set RTL_DESCEND_ALT 10.0
|
||||
param set PWM_DISARMED 900
|
||||
param set PWM_MIN 1075
|
||||
param set PWM_MAX 1950
|
||||
param set PWM_RATE 400
|
||||
|
||||
param set RTL_LAND_DELAY 0
|
||||
fi
|
||||
|
||||
# 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)
|
||||
set PWM_RATE 400
|
||||
# tell the mixer to use parameters for these instead
|
||||
set PWM_RATE p:PWM_RATE
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
@@ -28,8 +47,3 @@ set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1500
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
|
||||
if param compare PWM_DISARMED 0
|
||||
then
|
||||
param set PWM_DISARMED 900
|
||||
fi
|
||||
|
||||
@@ -1,84 +1,16 @@
|
||||
#!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
|
||||
if ms5611 start
|
||||
then
|
||||
if ms5611 start
|
||||
then
|
||||
fi
|
||||
|
||||
else
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
# Aero FC uses separate driver
|
||||
else
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
# Crazyflie uses separate driver
|
||||
else
|
||||
# Configure all I2C buses to 100 KHz as they
|
||||
# are all external or slow
|
||||
fmu i2c 1 100000
|
||||
fmu i2c 2 100000
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
# We know there are sketchy boards out there
|
||||
# as chinese companies produce Pixracers without
|
||||
# fully understanding the critical parts of the
|
||||
# schematic and BOM, leading to sensor brownouts
|
||||
# on boot. Original Pixracers following the
|
||||
# open hardware design do not require this.
|
||||
fmu sensor_reset 50
|
||||
fi
|
||||
|
||||
# External SPI
|
||||
if ms5611 -S start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI
|
||||
if ms5611 -s start
|
||||
then
|
||||
fi
|
||||
|
||||
# Blacksheep telemetry
|
||||
if bst start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if adc start
|
||||
then
|
||||
fi
|
||||
|
||||
if ver hwcmp AUAV_X21
|
||||
then
|
||||
# I2C bus
|
||||
if hmc5883 -C -T start
|
||||
then
|
||||
fi
|
||||
|
||||
# I2C bus
|
||||
if lis3mdl 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_V2
|
||||
then
|
||||
# External I2C bus
|
||||
@@ -86,40 +18,21 @@ then
|
||||
then
|
||||
fi
|
||||
|
||||
# External I2C bus
|
||||
if lis3mdl -X start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal I2C bus
|
||||
if hmc5883 -C -T -I -R 4 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus ICM-20608-G
|
||||
if mpu6000 -T 20608 start
|
||||
then
|
||||
fi
|
||||
|
||||
# external MPU6K is rotated 180 degrees yaw
|
||||
if mpu6000 -S -R 4 start
|
||||
if mpu6000 -X -R 4 start
|
||||
then
|
||||
set BOARD_FMUV3 true
|
||||
else
|
||||
# Check for Pixhawk 2.1 board
|
||||
if mpu9250 -S -R 4 start
|
||||
then
|
||||
set BOARD_FMUV3 true
|
||||
else
|
||||
set BOARD_FMUV3 false
|
||||
fi
|
||||
set BOARD_FMUV3 false
|
||||
fi
|
||||
|
||||
if [ $BOARD_FMUV3 == true ]
|
||||
then
|
||||
# sensor heating is available, but we disable it for now
|
||||
param set SENS_EN_THERMAL 0
|
||||
|
||||
# external L3GD20H is rotated 180 degrees yaw
|
||||
if l3gd20 -X -R 4 start
|
||||
then
|
||||
@@ -133,30 +46,18 @@ then
|
||||
# internal MPU6000 is rotated 180 deg roll, 270 deg yaw
|
||||
if mpu6000 -R 14 start
|
||||
then
|
||||
else
|
||||
if mpu9250 -R 14 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if hmc5883 -C -T -S -R 8 start
|
||||
then
|
||||
fi
|
||||
|
||||
if meas_airspeed start -b 2
|
||||
then
|
||||
fi
|
||||
|
||||
else
|
||||
# FMUv2
|
||||
if mpu6000 start
|
||||
then
|
||||
fi
|
||||
|
||||
if mpu9250 start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
@@ -165,46 +66,7 @@ then
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
# 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 ICM-20608-G is rotated 90 deg yaw
|
||||
if mpu6000 -R 2 -T 20608 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Start either MPU9250 or BMI160. They are both connected to the same SPI bus and use the same
|
||||
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
||||
# will prevent the incorrect driver from a successful initialization.
|
||||
|
||||
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
||||
if mpu9250 -R 2 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus BMI160
|
||||
if bmi160 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V1
|
||||
then
|
||||
else
|
||||
# FMUv1
|
||||
if mpu6000 start
|
||||
then
|
||||
@@ -236,69 +98,6 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal I2C bus
|
||||
if hmc5883 -C -T -I -R 8 start
|
||||
then
|
||||
fi
|
||||
|
||||
if mpu6500 -R 8 start
|
||||
then
|
||||
fi
|
||||
|
||||
if lsm303d -R 10 start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 -R 14 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
# Onboard I2C
|
||||
if mpu9250 -R 12 start
|
||||
then
|
||||
fi
|
||||
|
||||
# I2C bypass of mpu
|
||||
if lps25h start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
if ms5611 start
|
||||
then
|
||||
fi
|
||||
|
||||
if mpu6500 -R 14 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal compass
|
||||
if hmc5883 -I -R 4 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Possible external compasses
|
||||
if hmc5883 -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if ist8310 -C -b 1 -R 8 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if meas_airspeed start
|
||||
then
|
||||
else
|
||||
@@ -311,12 +110,12 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if sf1xx start
|
||||
if ll40ls 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
|
||||
then
|
||||
fi
|
||||
#
|
||||
# Start sensors
|
||||
#
|
||||
sensors start
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
#!nsh
|
||||
#
|
||||
# UAVCAN initialization script.
|
||||
#
|
||||
|
||||
#
|
||||
# Mirriring the UAVCAN_ENABLE param value to an eponymous environment variable.
|
||||
# TODO there should be a smarter way.
|
||||
#
|
||||
set UAVCAN_ENABLE 0
|
||||
if param compare UAVCAN_ENABLE 1
|
||||
then
|
||||
set UAVCAN_ENABLE 1
|
||||
fi
|
||||
if param compare UAVCAN_ENABLE 2
|
||||
then
|
||||
set UAVCAN_ENABLE 2
|
||||
fi
|
||||
|
||||
echo "[i] UAVCAN_ENABLE is $UAVCAN_ENABLE"
|
||||
|
||||
#
|
||||
# Starting stuff according to UAVCAN_ENABLE value
|
||||
#
|
||||
if [ $UAVCAN_ENABLE -ge 1 ]
|
||||
then
|
||||
if uavcan start
|
||||
then
|
||||
echo "[i] UAVCAN started"
|
||||
else
|
||||
echo "[i] ERROR: Could not start UAVCAN"
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $UAVCAN_ENABLE -ge 2 ]
|
||||
then
|
||||
if uavcan start fw
|
||||
then
|
||||
echo "[i] UAVCAN servers started"
|
||||
else
|
||||
echo "[i] ERROR: Could not start UAVCAN servers"
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $UAVCAN_ENABLE -ge 1 ]
|
||||
then
|
||||
# First sensor publisher to initialize takes lowest instance ID
|
||||
# This delay ensures that UAVCAN-interfaced sensors will be allocated on lowest instance IDs
|
||||
sleep 8
|
||||
fi
|
||||
@@ -0,0 +1,9 @@
|
||||
#!nsh
|
||||
#
|
||||
# USB MAVLink start
|
||||
#
|
||||
|
||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||
|
||||
# Exit shell to make it available to MAVLink
|
||||
exit
|
||||
@@ -3,43 +3,13 @@
|
||||
# Standard apps for vtol:
|
||||
# att & pos estimator, att & pos control.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
#---------------------------------------
|
||||
# Estimator group selction
|
||||
#
|
||||
# INAV (deprecated)
|
||||
if param compare SYS_MC_EST_GROUP 0
|
||||
then
|
||||
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
|
||||
param set SYS_MC_EST_GROUP 1
|
||||
param save
|
||||
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
|
||||
mc_pos_control start
|
||||
fw_att_control start
|
||||
fw_pos_control_l1 start
|
||||
|
||||
#
|
||||
# Start Land Detector
|
||||
# Multicopter for now until we have something for VTOL
|
||||
#
|
||||
land_detector start vtol
|
||||
|
||||
@@ -4,31 +4,43 @@ 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 mission and position handling
|
||||
# Default parameters for FW
|
||||
#
|
||||
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
|
||||
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_GBIAS_PNOISE 0.000001
|
||||
param set PE_ABIAS_PNOISE 0.0001
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
+127
-388
@@ -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
|
||||
@@ -32,9 +35,9 @@ else
|
||||
then
|
||||
if mount -t vfat /dev/mmcsd0 /fs/microsd
|
||||
then
|
||||
echo "INFO [init] MicroSD card formatted"
|
||||
echo "[i] microSD card formatted"
|
||||
else
|
||||
echo "ERROR [init] Format failed"
|
||||
echo "[i] format failed"
|
||||
tone_alarm MNBG
|
||||
set LOG_FILE /dev/null
|
||||
fi
|
||||
@@ -47,10 +50,9 @@ 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 "INFO [init] Executing script: $FRC"
|
||||
echo "[i] Executing script: $FRC"
|
||||
sh $FRC
|
||||
set MODE custom
|
||||
fi
|
||||
@@ -58,6 +60,9 @@ unset FRC
|
||||
|
||||
if [ $MODE == autostart ]
|
||||
then
|
||||
# Try to get an USB console
|
||||
# REBOOTWORK this needs to start after the flight control loop
|
||||
nshterm /dev/ttyACM0 &
|
||||
|
||||
#
|
||||
# Start the ORB (first app to start)
|
||||
@@ -76,7 +81,9 @@ 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
|
||||
@@ -99,28 +106,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
|
||||
|
||||
#
|
||||
# Release 1.4.0 transitional support:
|
||||
# set to old default if unconfigured.
|
||||
# this preserves the previous behaviour
|
||||
#
|
||||
if param compare BAT_N_CELLS 0
|
||||
then
|
||||
param set BAT_N_CELLS 3
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Set default values
|
||||
#
|
||||
@@ -136,96 +121,59 @@ 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
|
||||
set FAILSAFE_AUX none
|
||||
set MK_MODE none
|
||||
set FMU_MODE pwm
|
||||
set AUX_MODE pwm
|
||||
set MAVLINK_F default
|
||||
set MAVLINK_COMPANION_DEVICE /dev/ttyS2
|
||||
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
|
||||
#
|
||||
if param compare SYS_USE_IO 1
|
||||
then
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
set USE_IO no
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
set USE_IO no
|
||||
fi
|
||||
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
set USE_IO no
|
||||
|
||||
if param compare SYS_AUTOSTART 0
|
||||
then
|
||||
param set SYS_AUTOSTART 4900
|
||||
set AUTOCNF yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
set USE_IO no
|
||||
fi
|
||||
set USE_IO yes
|
||||
else
|
||||
set USE_IO no
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
if param compare SYS_AUTOSTART 0
|
||||
then
|
||||
set AUTOCNF yes
|
||||
fi
|
||||
|
||||
# We don't allow changing AUTOSTART as it doesn't work in
|
||||
# other configurations
|
||||
param set SYS_AUTOSTART 4070
|
||||
fi
|
||||
|
||||
#
|
||||
# Set parameters and env variables for selected AUTOSTART
|
||||
#
|
||||
if param compare SYS_AUTOSTART 0
|
||||
then
|
||||
echo "[i] No autostart"
|
||||
else
|
||||
sh /etc/init.d/rc.autostart
|
||||
fi
|
||||
unset MODE
|
||||
|
||||
#
|
||||
# Wipe incompatible settings for boards not having two outputs
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
#
|
||||
# Override parameters from user configuration file
|
||||
#
|
||||
set FCONFIG /fs/microsd/etc/config.txt
|
||||
if [ -f $FCONFIG ]
|
||||
then
|
||||
echo "Custom: $FCONFIG"
|
||||
echo "[i] Custom config: $FCONFIG"
|
||||
sh $FCONFIG
|
||||
fi
|
||||
unset FCONFIG
|
||||
@@ -236,6 +184,7 @@ then
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set SYS_AUTOCONFIG 0
|
||||
param save
|
||||
fi
|
||||
unset AUTOCNF
|
||||
|
||||
@@ -246,19 +195,21 @@ then
|
||||
#
|
||||
# Check if PX4IO present and update firmware if needed
|
||||
#
|
||||
if [ -f /etc/extras/px4io-v2.bin ]
|
||||
if [ -f /etc/extras/px4io-v2_default.bin ]
|
||||
then
|
||||
set IO_FILE /etc/extras/px4io-v2.bin
|
||||
set IO_FILE /etc/extras/px4io-v2_default.bin
|
||||
else
|
||||
set IO_FILE /etc/extras/px4io-v1.bin
|
||||
set IO_FILE /etc/extras/px4io-v1_default.bin
|
||||
fi
|
||||
|
||||
if px4io checkcrc ${IO_FILE}
|
||||
then
|
||||
echo "[init] PX4IO CRC OK" >> $LOG_FILE
|
||||
echo "PX4IO CRC OK" >> $LOG_FILE
|
||||
|
||||
set IO_PRESENT yes
|
||||
else
|
||||
echo "PX4IO Trying to update" >> $LOG_FILE
|
||||
|
||||
tone_alarm MLL32CP8MB
|
||||
|
||||
if px4io start
|
||||
@@ -283,11 +234,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
|
||||
@@ -295,7 +246,8 @@ then
|
||||
|
||||
if [ $IO_PRESENT == no ]
|
||||
then
|
||||
echo "PX4IO not found" >> $LOG_FILE
|
||||
echo "[i] ERROR: PX4IO not found"
|
||||
echo "ERROR: PX4IO not found" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@@ -317,6 +269,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
|
||||
@@ -330,23 +283,16 @@ then
|
||||
set FMU_MODE gpio_serial
|
||||
fi
|
||||
|
||||
if [ $OUTPUT_MODE == tap_esc ]
|
||||
then
|
||||
set FMU_MODE rcin
|
||||
fi
|
||||
|
||||
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
|
||||
@@ -354,51 +300,37 @@ then
|
||||
then
|
||||
fi
|
||||
|
||||
#
|
||||
# UAVCAN
|
||||
#
|
||||
sh /etc/init.d/rc.uavcan
|
||||
|
||||
#
|
||||
# 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
|
||||
|
||||
#
|
||||
# Start CPU load monitor
|
||||
#
|
||||
load_mon start
|
||||
commander start
|
||||
|
||||
#
|
||||
# Start primary output
|
||||
#
|
||||
set TTYS1_BUSY no
|
||||
|
||||
#
|
||||
# Check if UAVCAN is enabled, default to it for ESCs
|
||||
#
|
||||
if param greater UAVCAN_ENABLE 2
|
||||
then
|
||||
set OUTPUT_MODE uavcan_esc
|
||||
fi
|
||||
|
||||
# Sensors on the PWM interface bank
|
||||
# clear pins 5 and 6
|
||||
if param compare SENS_EN_LL40LS 1
|
||||
then
|
||||
set FMU_MODE pwm4
|
||||
set AUX_MODE pwm4
|
||||
fi
|
||||
if param greater TRIG_MODE 0
|
||||
then
|
||||
set FMU_MODE pwm4
|
||||
set AUX_MODE pwm4
|
||||
camera_trigger start
|
||||
fi
|
||||
|
||||
# If OUTPUT_MODE == none then something is wrong with setup and we shouldn't try to enable output
|
||||
if [ $OUTPUT_MODE != none ]
|
||||
then
|
||||
@@ -406,8 +338,8 @@ then
|
||||
then
|
||||
if param compare UAVCAN_ENABLE 0
|
||||
then
|
||||
echo "OVERRIDING UAVCAN_ENABLE = 3" >> $LOG_FILE
|
||||
param set UAVCAN_ENABLE 3
|
||||
echo "[i] OVERRIDING UAVCAN_ENABLE = 1"
|
||||
param set UAVCAN_ENABLE 1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -417,7 +349,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
|
||||
@@ -426,8 +358,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
|
||||
|
||||
@@ -458,8 +392,10 @@ then
|
||||
|
||||
if mkblctrl $MKBLCTRL_ARG
|
||||
then
|
||||
echo "[i] MK started"
|
||||
else
|
||||
echo "MK start failed" >> $LOG_FILE
|
||||
echo "[i] ERROR: MK start failed"
|
||||
echo "ERROR: MK start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
unset MKBLCTRL_ARG
|
||||
@@ -468,9 +404,12 @@ then
|
||||
|
||||
if [ $OUTPUT_MODE == hil ]
|
||||
then
|
||||
if pwm_out_sim mode_pwm16
|
||||
if hil mode_port2_pwm8
|
||||
then
|
||||
echo "[i] HIL output started"
|
||||
else
|
||||
echo "[i] ERROR: HIL output start failed"
|
||||
echo "ERROR: HIL output start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@@ -484,9 +423,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
|
||||
@@ -495,8 +436,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
|
||||
|
||||
@@ -526,214 +469,39 @@ then
|
||||
# Exit from nsh to free port for mavlink
|
||||
set EXIT_ON_END yes
|
||||
else
|
||||
# Start MAVLink on default port: ttyS1
|
||||
set MAVLINK_F "-r 1200"
|
||||
# Avoid using ttyS1 for MAVLink on FMUv4
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
set MAVLINK_F "-r 1200 -d /dev/ttyS1"
|
||||
# Start MAVLink on Wifi (ESP8266 port)
|
||||
mavlink start -r 20000 -m config -b 921600 -d /dev/ttyS0
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
set MAVLINK_F "-r 1200 -d /dev/ttyS4"
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
# Avoid using either of the two available serials
|
||||
set MAVLINK_F none
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x$MAVLINK_F" == xnone ]
|
||||
then
|
||||
else
|
||||
mavlink start $MAVLINK_F
|
||||
fi
|
||||
mavlink start $MAVLINK_F
|
||||
unset MAVLINK_F
|
||||
|
||||
#
|
||||
# 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 $MAVLINK_COMPANION_DEVICE
|
||||
fi
|
||||
if param compare SYS_COMPANION 20
|
||||
then
|
||||
syslink start
|
||||
mavlink start -d /dev/bridge0 -b 57600 -m osd -r 40000
|
||||
fi
|
||||
if param compare SYS_COMPANION 921600
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 921600 -m onboard -r 80000 -x
|
||||
mavlink start -d /dev/ttyS2 -b 921600 -m onboard -r 80000 -x
|
||||
fi
|
||||
if param compare SYS_COMPANION 57600
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -m onboard -r 5000 -x
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -m onboard -r 5000 -x
|
||||
fi
|
||||
if param compare SYS_COMPANION 157600
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -m osd -r 1000
|
||||
fi
|
||||
if param compare SYS_COMPANION 257600
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -m magic -r 5000 -x
|
||||
fi
|
||||
if param compare SYS_COMPANION 319200
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 19200 -r 1000
|
||||
fi
|
||||
if param compare SYS_COMPANION 338400
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 38400 -r 1000
|
||||
fi
|
||||
if param compare SYS_COMPANION 357600
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -r 1000
|
||||
fi
|
||||
if param compare SYS_COMPANION 1921600
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 921600 -r 20000
|
||||
fi
|
||||
if param compare SYS_COMPANION 1500000
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 1500000 -m onboard -r 100000 -x
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -m osd -r 1000
|
||||
fi
|
||||
fi
|
||||
|
||||
unset MAVLINK_COMPANION_DEVICE
|
||||
|
||||
#
|
||||
# Starting stuff according to UAVCAN_ENABLE value
|
||||
#
|
||||
if param greater UAVCAN_ENABLE 0
|
||||
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
|
||||
|
||||
# lightware serial lidar sensor
|
||||
if param compare SENS_EN_SF0X 0
|
||||
then
|
||||
else
|
||||
sf0x start
|
||||
fi
|
||||
|
||||
# lightware i2c lidar sensor
|
||||
if param compare SENS_EN_SF1XX 0
|
||||
then
|
||||
else
|
||||
sf1xx start
|
||||
fi
|
||||
|
||||
# mb12xx sonar sensor
|
||||
if param compare SENS_EN_MB12XX 1
|
||||
then
|
||||
mb12xx start
|
||||
fi
|
||||
|
||||
# teraranger one tof sensor
|
||||
if param compare SENS_EN_TRONE 1
|
||||
then
|
||||
trone start
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
frsky_telemetry start -d /dev/ttyS6
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
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 PX4FMU_V4
|
||||
then
|
||||
# Check for flow sensor - as it is a background task, launch it last
|
||||
px4flow start &
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
px4flow start &
|
||||
fi
|
||||
|
||||
# Start MAVLink
|
||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
if ver hwcmp PX4FMU_V1
|
||||
then
|
||||
if sdlog2 start -r 30 -a -b 2 -t
|
||||
then
|
||||
fi
|
||||
else
|
||||
if param compare SYS_LOGGER 0
|
||||
then
|
||||
# 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 18 -t
|
||||
then
|
||||
fi
|
||||
else
|
||||
if sdlog2 start -r 100 -a -b 9 -t
|
||||
then
|
||||
fi
|
||||
fi
|
||||
else
|
||||
set LOGGER_ARGS ""
|
||||
if param compare SDLOG_MODE 1
|
||||
then
|
||||
set LOGGER_ARGS "-e"
|
||||
fi
|
||||
if param compare SDLOG_MODE 2
|
||||
then
|
||||
set LOGGER_ARGS "-f"
|
||||
fi
|
||||
|
||||
if logger start -b 12 -t $LOGGER_ARGS
|
||||
then
|
||||
fi
|
||||
unset LOGGER_ARGS
|
||||
fi
|
||||
fi
|
||||
sh /etc/init.d/rc.logging
|
||||
|
||||
#
|
||||
# Start up ARDrone Motor interface
|
||||
@@ -748,6 +516,8 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == fw ]
|
||||
then
|
||||
echo "[i] FIXED WING"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
# Set default mixer for fixed wing if not defined
|
||||
@@ -766,7 +536,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
|
||||
|
||||
#
|
||||
@@ -774,6 +547,8 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == mc ]
|
||||
then
|
||||
echo "[i] MULTICOPTER"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
echo "Mixer undefined"
|
||||
@@ -790,10 +565,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
|
||||
@@ -810,14 +581,10 @@ 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
|
||||
if [ $MIXER == coax ]
|
||||
then
|
||||
set MAV_TYPE 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Still no MAV_TYPE found
|
||||
@@ -833,7 +600,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
|
||||
|
||||
#
|
||||
@@ -841,9 +611,11 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == vtol ]
|
||||
then
|
||||
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 ]
|
||||
@@ -876,7 +648,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
|
||||
|
||||
#
|
||||
@@ -891,51 +666,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
|
||||
@@ -950,30 +688,25 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == none ]
|
||||
then
|
||||
echo "No autostart ID found"
|
||||
echo "[i] No autostart ID found"
|
||||
|
||||
fi
|
||||
|
||||
# Start any custom addons
|
||||
set FEXTRAS /fs/microsd/etc/extras.txt
|
||||
if [ -f $FEXTRAS ]
|
||||
then
|
||||
echo "Addons script: $FEXTRAS"
|
||||
echo "[i] Addons script: $FEXTRAS"
|
||||
sh $FEXTRAS
|
||||
fi
|
||||
unset FEXTRAS
|
||||
|
||||
if ver hwcmp CRAZYFLIE
|
||||
# Run no SD alarm
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
# CF2 shouldn't have an sd card
|
||||
else
|
||||
|
||||
# Run no SD alarm
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
# Play SOS
|
||||
tone_alarm error
|
||||
fi
|
||||
|
||||
echo "[i] No microSD card found"
|
||||
# Play SOS
|
||||
tone_alarm error
|
||||
fi
|
||||
|
||||
# End of autostart
|
||||
@@ -986,9 +719,15 @@ unset TUNE_ERR
|
||||
# Boot is complete, inform MAVLink app(s) that the system is now fully up and running
|
||||
mavlink boot_complete
|
||||
|
||||
if ver hwcmp PX4FMU_V2
|
||||
then
|
||||
# Check for flow sensor - as it is a background task, launch it last
|
||||
px4flow start &
|
||||
fi
|
||||
|
||||
if [ $EXIT_ON_END == yes ]
|
||||
then
|
||||
echo "NSH exit"
|
||||
echo "Exit from nsh"
|
||||
exit
|
||||
fi
|
||||
unset EXIT_ON_END
|
||||
|
||||
Binary file not shown.
@@ -1,96 +0,0 @@
|
||||
Aileron/rudder/elevator/throttle/wheel/flaps mixer for PX4FMU
|
||||
=======================================================
|
||||
|
||||
This file defines mixers suitable for controlling a fixed wing aircraft with
|
||||
aileron, rudder, elevator, throttle and steerable wheel controls using PX4FMU.
|
||||
The configuration assumes the aileron servo(s) are connected to PX4FMU servo
|
||||
output 0 and 1, the elevator to output 2, the rudder to output 3, the throttle
|
||||
to output 4 and the wheel to output 5.
|
||||
|
||||
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
|
||||
(roll), 1 (pitch), 2 (yaw) and 3 (thrust) 4 (flaps) 6 (flaperon).
|
||||
|
||||
Aileron mixer (roll + flaperon)
|
||||
---------------------------------
|
||||
|
||||
This mixer assumes that the aileron servos are set up correctly mechanically;
|
||||
depending on the actual configuration it may be necessary to reverse the scaling
|
||||
factors (to reverse the servo movement) and adjust the offset, scaling and
|
||||
endpoints to suit.
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
S: 0 6 -10000 -10000 0 -10000 10000
|
||||
|
||||
Elevator mixer
|
||||
------------
|
||||
Two scalers total (output, roll).
|
||||
|
||||
This mixer assumes that the elevator servo is set up correctly mechanically;
|
||||
depending on the actual configuration it may be necessary to reverse the scaling
|
||||
factors (to reverse the servo movement) and adjust the offset, scaling and
|
||||
endpoints to suit.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 1 -10000 -10000 0 -10000 10000
|
||||
|
||||
Rudder mixer
|
||||
------------
|
||||
Two scalers total (output, yaw).
|
||||
|
||||
This mixer assumes that the rudder servo is set up correctly mechanically;
|
||||
depending on the actual configuration it may be necessary to reverse the scaling
|
||||
factors (to reverse the servo movement) and adjust the offset, scaling and
|
||||
endpoints to suit.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
|
||||
Motor speed mixer
|
||||
-----------------
|
||||
Two scalers total (output, thrust).
|
||||
|
||||
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
|
||||
range. Inputs below zero are treated as zero.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
Wheel mixer
|
||||
------------
|
||||
Two scalers total (output, yaw).
|
||||
|
||||
This mixer assumes that the wheel servo is set up correctly mechanically;
|
||||
depending on the actual configuration it may be necessary to reverse the scaling
|
||||
factors (to reverse the servo movement) and adjust the offset, scaling and
|
||||
endpoints to suit.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
Flaps / gimbal / payload mixer for last three channels,
|
||||
using the payload control group
|
||||
-----------------------------------------------------
|
||||
|
||||
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: 2 0 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 2 10000 10000 0 -10000 10000
|
||||
@@ -1,84 +0,0 @@
|
||||
Aileron/v-tail/throttle/wheel/flaps mixer for PX4FMU
|
||||
=======================================================
|
||||
|
||||
This file defines mixers suitable for controlling a fixed wing aircraft with
|
||||
aileron, v-tail (rudder, elevator), throttle, steerable wheel and flaps
|
||||
using PX4FMU.
|
||||
The configuration assumes the aileron servos are connected to PX4FMU servo
|
||||
output 0 and 1, the tail servos to output 2 and 3, the throttle
|
||||
to output 4, the wheel to output 5 and the flaps to output 6 and 7.
|
||||
|
||||
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
|
||||
(roll), 1 (pitch), 2 (yaw) and 3 (thrust) 4 (flaps) 6 (flaperon).
|
||||
|
||||
Aileron mixer (roll + flaperon)
|
||||
---------------------------------
|
||||
|
||||
This mixer assumes that the aileron servos are set up correctly mechanically;
|
||||
depending on the actual configuration it may be necessary to reverse the scaling
|
||||
factors (to reverse the servo movement) and adjust the offset, scaling and
|
||||
endpoints to suit.
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
S: 0 6 -10000 -10000 0 -10000 10000
|
||||
|
||||
V-tail mixers
|
||||
-------------
|
||||
Three scalers total (output, roll, pitch).
|
||||
|
||||
On the assumption that the two tail servos are physically reversed, the pitch
|
||||
input is inverted between the two servos.
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 -7000 -7000 0 -10000 10000
|
||||
S: 0 1 -8000 -8000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 -7000 -7000 0 -10000 10000
|
||||
S: 0 1 8000 8000 0 -10000 10000
|
||||
|
||||
Motor speed mixer
|
||||
-----------------
|
||||
Two scalers total (output, thrust).
|
||||
|
||||
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
|
||||
range. Inputs below zero are treated as zero.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
Wheel mixer
|
||||
------------
|
||||
Two scalers total (output, yaw).
|
||||
|
||||
This mixer assumes that the wheel servo is set up correctly mechanically;
|
||||
depending on the actual configuration it may be necessary to reverse the scaling
|
||||
factors (to reverse the servo movement) and adjust the offset, scaling and
|
||||
endpoints to suit.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 -10000 -10000 0 -10000 10000
|
||||
|
||||
Flaps mixer
|
||||
------------
|
||||
Flap servos are physically reversed.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 0 5000 -10000 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 0 -5000 10000 -10000 10000
|
||||
|
||||
@@ -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
|
||||
|
||||
Regular → Executable
@@ -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
|
||||
|
||||
@@ -34,7 +34,7 @@ collection of mixers in order to achieve a specific pattern of actuator outputs.
|
||||
|
||||
The null mixer definition has the form:
|
||||
|
||||
Z:
|
||||
Z:
|
||||
|
||||
#### Simple Mixer ####
|
||||
|
||||
@@ -44,8 +44,8 @@ applying an output scaler.
|
||||
|
||||
A simple mixer definition begins with:
|
||||
|
||||
M: <control count>
|
||||
O: <-ve scale> <+ve scale> <offset> <lower limit> <upper limit>
|
||||
M: <control count>
|
||||
O: <-ve scale> <+ve scale> <offset> <lower limit> <upper limit>
|
||||
|
||||
If <control count> is zero, the sum is effectively zero and the mixer will
|
||||
output a fixed value that is <offset> constrained by <lower limit> and <upper
|
||||
@@ -59,7 +59,7 @@ offset of -0.5 is encoded as -5000.
|
||||
The definition continues with <control count> entries describing the control
|
||||
inputs and their scaling, in the form:
|
||||
|
||||
S: <group> <index> <-ve scale> <+ve scale> <offset> <lower limit> <upper limit>
|
||||
S: <group> <index> <-ve scale> <+ve scale> <offset> <lower limit> <upper limit>
|
||||
|
||||
The <group> value identifies the control group from which the scaler will read,
|
||||
and the <index> value an offset within that group. These values are specific to
|
||||
@@ -81,16 +81,16 @@ into a set of actuator outputs intended to drive motor speed controllers.
|
||||
|
||||
The mixer definition is a single line of the form:
|
||||
|
||||
R: <geometry> <roll scale> <pitch scale> <yaw scale> <deadband>
|
||||
R: <geometry> <roll scale> <pitch scale> <yaw scale> <deadband>
|
||||
|
||||
The supported geometries include:
|
||||
|
||||
* 4x - quadrotor in X configuration
|
||||
* 4+ - quadrotor in + configuration
|
||||
* 6x - hexcopter in X configuration
|
||||
* 6+ - hexcopter in + configuration
|
||||
* 8x - octocopter in X configuration
|
||||
* 8+ - octocopter in + configuration
|
||||
4x - quadrotor in X configuration
|
||||
4+ - quadrotor in + configuration
|
||||
6x - hexcopter in X configuration
|
||||
6+ - hexcopter in + configuration
|
||||
8x - octocopter in X configuration
|
||||
8+ - octocopter in + configuration
|
||||
|
||||
Each of the roll, pitch and yaw scale values determine scaling of the roll,
|
||||
pitch and yaw controls relative to the thrust control. Whilst the calculations
|
||||
@@ -102,4 +102,4 @@ thrust input ranges from 0.0 to 1.0. Output for each actuator is in the
|
||||
range -1.0 to 1.0.
|
||||
|
||||
In the case where an actuator saturates, all actuator values are rescaled so that
|
||||
the saturating actuator is limited to 1.0.
|
||||
the saturating actuator is limited to 1.0.
|
||||
@@ -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
|
||||
|
||||
Regular → Executable
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user