Compare commits

..

No commits in common. "v1.6.2" and "v1.5.2" have entirely different histories.

1486 changed files with 30673 additions and 142312 deletions

View File

@ -1,85 +0,0 @@
Checks: '*
,-cert-dcl50-cpp
,-cert-err34-c
,-cert-err58-cpp
,-cert-msc30-c
,-cert-msc50-cpp
,-clang-analyzer-core.CallAndMessage
,-clang-analyzer-core.NullDereference
,-clang-analyzer-core.UndefinedBinaryOperatorResult
,-clang-analyzer-core.uninitialized.Assign
,-clang-analyzer-core.VLASize
,-clang-analyzer-cplusplus.NewDeleteLeaks
,-clang-analyzer-deadcode.DeadStores
,-clang-analyzer-optin.cplusplus.VirtualCall
,-clang-analyzer-optin.performance.Padding
,-clang-analyzer-security.insecureAPI.strcpy
,-clang-analyzer-unix.cstring.BadSizeArg
,-clang-analyzer-unix.Malloc
,-clang-analyzer-unix.MallocSizeof
,-cppcoreguidelines-c-copy-assignment-signature
,-cppcoreguidelines-interfaces-global-init
,-cppcoreguidelines-no-malloc
,-cppcoreguidelines-pro-bounds-array-to-pointer-decay
,-cppcoreguidelines-pro-bounds-constant-array-index
,-cppcoreguidelines-pro-bounds-pointer-arithmetic
,-cppcoreguidelines-pro-type-const-cast
,-cppcoreguidelines-pro-type-cstyle-cast
,-cppcoreguidelines-pro-type-member-init
,-cppcoreguidelines-pro-type-reinterpret-cast
,-cppcoreguidelines-pro-type-union-access
,-cppcoreguidelines-pro-type-vararg
,-cppcoreguidelines-special-member-functions
,-google-build-using-namespace
,-google-explicit-constructor
,-google-global-names-in-headers
,-google-readability-casting
,-google-readability-namespace-comments
,-google-readability-todo
,-google-runtime-int
,-google-runtime-references
,-llvm-header-guard
,-llvm-include-order
,-llvm-namespace-comment
,-misc-incorrect-roundings
,-misc-macro-parentheses
,-misc-misplaced-widening-cast
,-misc-redundant-expression
,-misc-unconventional-assign-operator
,-misc-unused-parameters
,-modernize-deprecated-headers
,-modernize-loop-convert
,-modernize-use-auto
,-modernize-use-bool-literals
,-modernize-use-default-member-init
,-modernize-use-emplace
,-modernize-use-equals-default
,-modernize-use-equals-delete
,-modernize-use-override
,-modernize-use-using
,-performance-inefficient-string-concatenation
,-readability-avoid-const-params-in-decls
,-readability-else-after-return
,-readability-implicit-bool-cast
,-readability-inconsistent-declaration-parameter-name
,-readability-non-const-parameter
,-readability-redundant-declaration
,-readability-redundant-member-init
,-readability-simplify-boolean-expr
'
WarningsAsErrors: '*'
CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.BranchThreshold
value: '600'
- key: google-readability-function-size.LineThreshold
value: '4000'
- key: google-readability-function-size.StatementThreshold
value: '4000'
- key: readability-braces-around-statements.ShortStatementLines
value: '1'
- key: readability-function-size.LineThreshold
value: '4000'
- key: readability-function-size.StatementThreshold
value: '4000'

26
.gitignore vendored
View File

@ -20,9 +20,6 @@
Archives/*
Build/*
Testing/
Packages/*
s3deploy-branch/
s3deploy-archive/
build/*
build_*/
core
@ -31,6 +28,15 @@ cscope.in.out
cscope.po.out
Firmware.sublime-workspace
user.sublime*
Images/*.bin
Images/*.px4
mavlink/include/mavlink/v0.9/
/nuttx-configs/px4io-v2/src/.depend
/nuttx-configs/px4io-v2/src/Make.dep
/nuttx-configs/px4io-v2/src/libboard.a
/nuttx-configs/px4io-v1/src/.depend
/nuttx-configs/px4io-v1/src/Make.dep
/nuttx-configs/px4io-v1/src/libboard.a
/Documentation/doxy.log
/Documentation/html/
/Documentation/doxygen*objdb*tmp
@ -71,15 +77,7 @@ vectorcontrol/
# CLion ignores
.idea
cmake-build-*/
posix-configs/SITL/init/test/*_generated
parameters.md
airframes.md
airframes.xml
cppcheck-result.xml
cppcheck
scan-build
# gcov code coverage
coverage-html/
coverage.info

2
.gitmodules vendored
View File

@ -6,7 +6,7 @@
url = https://github.com/mavlink/c_library_v2.git
[submodule "NuttX"]
path = NuttX
url = https://github.com/PX4/PX4NuttX.git
url = https://github.com/PX4/NuttX.git
[submodule "src/modules/uavcan/libuavcan"]
path = src/modules/uavcan/libuavcan
url = https://github.com/UAVCAN/libuavcan.git

View File

@ -4,101 +4,123 @@
language: cpp
git:
depth: 2000
submodules: false
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
env: BUILD_TARGET=check_format
- os: linux
sudo: required
services:
- docker
env: BUILD_TARGET=tests
- os: linux
sudo: required
services:
- docker
env: BUILD_TARGET=clang-tidy
- os: linux
sudo: required
services:
- docker
env: BUILD_TARGET=scan-build
- os: linux
sudo: required
services:
- docker
env: BUILD_TARGET=cppcheck
- os: linux
sudo: required
services:
- docker
env: BUILD_TARGET=px4_metadata
- os: linux
dist: trusty
sudo: required
env: BUILD_TARGET=coverity_scan
- os: osx
sudo: true
osx_image: xcode8
env: CCACHE_CPP2=1
cache:
ccache: true
pip: true
directories:
- $HOME/.pip/cache/
- $HOME/Library/Caches/pip
before_install:
# install dependencies for the coverity build (target and branch), otherwise exit early
- if [[ "${TRAVIS_BRANCH}" = "coverity" ]]; then
if [[ "${BUILD_TARGET}" = "coverity_scan" ]]; then sudo apt-get install genromfs && pip install empy jinja2; else exit 0; fi;
- 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
env:
global:
# COVERITY KEY
- secure: "NyaJoCGjU0Xc90Y6bxVYWLgjrJX5HlZsm/SPxruZ6I7xkGo19fJIFzGegOHQFR32D4AiKjllfjTUNy+ncckWplind0QwxtF4/kxXrz9XBfiby6X8jLYXIekrB6Ay0mBLGbniDdh+lpWtcyop6Dmkt5bdJCJuKY2nv9ENnhhs07M="
# AWS KEY: $PX4_AWS_KEY
# AWS KEY: $PX4_AWS_KEY
- secure: "XknnZHWBbpHbN4f3fuAVwUztdLIu8ej4keC3aQSDofo3uw8AFEzojfsQsN9u77ShWSIV4iYJWh9C9ALkCx7TocJ+xYjiboo10YhM9lH/8u+EXjYWG6GHS8ua0wkir+cViSxoLNaMtmcb/rPTicJecAGANxLsIHyBAgTL3fkbLSA="
# AWS SECRET: $PX4_AWS_SECRET
# AWS SECRET: $PX4_AWS_SECRET
- secure: "h6oajlW68dWIr+wZhO58Dv6e68dZHrBLVA6lPXZmheFQBW6Xam1HuLGA0LOW6cL9TnrAsOZ8g4goB58eMQnMEijFZKi3mhRwZhd/Xjq/ZGJOWBUrLoQHZUw2dQk5ja5vmUlKEoQnFZjDuMjx8KfX5ZMNy8A3yssWZtJYHD8c+bk="
- PX4_AWS_BUCKET=px4-travis
- GIT_SUBMODULES_ARE_EVIL=1
script:
- if [[ "${BUILD_TARGET}" = "coverity_scan" ]]; then
echo "no script for coverity build";
elif [[ "${TRAVIS_BRANCH}" = "coverity" ]]; then
echo "exit early for coverity build" && exit 0;
elif [[ "${BUILD_TARGET}" = "check_format" ]]; then
./Tools/docker_run.sh 'make check_format';
elif [[ "${BUILD_TARGET}" = "tests" ]]; then
./Tools/docker_run.sh 'make tests';
elif [[ "${BUILD_TARGET}" = "px4_metadata" ]]; then
./Tools/docker_run.sh 'make px4_metadata';
elif [[ "${BUILD_TARGET}" = "clang-tidy" ]]; then
./Tools/docker_run.sh 'make clang-tidy-quiet';
- 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 -s
after_success:
# s3 upload airframe and parameter metadata
- if [[ "${BUILD_TARGET}" = "px4_metadata" && "${TRAVIS_PULL_REQUEST}" = "false" ]]; then
./Tools/docker_run.sh 'make s3put_metadata AWS_S3_BUCKET="px4-travis/Firmware/${TRAVIS_BRANCH}"';
- 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
# s3 upload clang scan-build output for master branch
- if [[ "${BUILD_TARGET}" = "scan-build" && "${TRAVIS_PULL_REQUEST}" = "false" ]]; then
./Tools/docker_run.sh 'make s3put_scan-build AWS_S3_BUCKET="px4-travis/Firmware/${TRAVIS_BRANCH}/scan-build"';
fi
# s3 upload cppcheck output for master branch
- if [[ "${BUILD_TARGET}" = "cppcheck" && "${TRAVIS_PULL_REQUEST}" = "false" ]]; then
./Tools/docker_run.sh 'make s3put_cppcheck AWS_S3_BUCKET="px4-travis/Firmware/${TRAVIS_BRANCH}/cppcheck"';
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "$GCC_VER" == "4.9" ]]; then
export PX4_S3_DEPLOY=1;
fi
addons:
coverity_scan:
project:
name: PX4/Firmware
notification_email: ci@px4.io
build_command: make posix_sitl_default
branch_pattern: coverity
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
notifications:
webhooks:

View File

@ -1,6 +1,6 @@
############################################################################
#
# Copyright (c) 2017 PX4 Development Team. All rights reserved.
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -55,6 +55,24 @@
#
# * 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
# ---------------------------------------------------------------------------
#
@ -83,7 +101,7 @@
#
# * Setting a global variable in a CMakeLists.txt file is ok, because
# each CMakeLists.txt file has scope in the current directory and all
# subdirectories, so it is not truly global.
# subdirecties, so it is not truly global.
#
# * All toolchain files should be included in the cmake
# directory and named Toolchain-"name".cmake.
@ -99,18 +117,9 @@
#
#=============================================================================
if ("${CMAKE_VERSION}" VERSION_LESS 3.1.0)
message("Not a valid CMake version")
message("On Ubuntu >= 16.04, install or upgrade via:")
message(" sudo apt-get install cmake")
message("")
message("Official website: https://cmake.org/download/")
message(FATAL_ERROR "Update CMake and try again" )
endif()
# Warning: Changing this modifies CMake's internal workings
# and leads to wrong toolchain detection
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(PX4_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(PX4_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
@ -120,107 +129,37 @@ execute_process(
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
# Use clang
#SET (CMAKE_C_COMPILER /usr/bin/clang-3.6)
#SET (CMAKE_CXX_COMPILER /usr/bin/clang++-3.6)
#=============================================================================
# parameters
#
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")
#=============================================================================
# configuration
#
# must come before project to set toolchain
set(CONFIG "posix_sitl_default" CACHE STRING "desired configuration")
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}")
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")
if (NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
get_filename_component(EXTERNAL_MODULES_LOCATION "${EXTERNAL_MODULES_LOCATION}" ABSOLUTE)
endif()
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})
include(common/coverage)
include(common/sanitizers)
# CMake build type
# Debug Release RelWithDebInfo MinSizeRel Coverage
if (NOT CMAKE_BUILD_TYPE)
if (${OS} STREQUAL "nuttx")
set(PX4_BUILD_TYPE "MinSizeRel")
elseif (${OS} STREQUAL "qurt")
set(PX4_BUILD_TYPE "MinSizeRel")
elseif (${OS} STREQUAL "bebop")
set(PX4_BUILD_TYPE "MinSizeRel")
else()
set(PX4_BUILD_TYPE "RelWithDebInfo")
endif()
set(CMAKE_BUILD_TYPE ${PX4_BUILD_TYPE} CACHE STRING "Build type" FORCE)
endif()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel;Coverage")
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
#=============================================================================
# git
#
include(common/px4_git)
execute_process(
COMMAND git describe --always --tags
OUTPUT_VARIABLE git_tag
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
execute_process(
COMMAND Tools/tag_to_version.py --root ${PX4_SOURCE_DIR}
OUTPUT_VARIABLE git_version
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "cmake/cmake_hexagon")
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_gazebo PATH "Tools/sitl_gazebo")
px4_add_git_submodule(TARGET git_gencpp PATH "Tools/gencpp")
px4_add_git_submodule(TARGET git_genmsg PATH "Tools/genmsg")
px4_add_git_submodule(TARGET git_gps_devices PATH "src/drivers/gps/devices")
px4_add_git_submodule(TARGET git_gtest PATH "unittests/gtest")
px4_add_git_submodule(TARGET git_jmavsim PATH "Tools/jMAVSim")
px4_add_git_submodule(TARGET git_matrix PATH "src/lib/matrix")
px4_add_git_submodule(TARGET git_mavlink PATH "mavlink/include/mavlink/v1.0")
px4_add_git_submodule(TARGET git_mavlink2 PATH "mavlink/include/mavlink/v2.0")
px4_add_git_submodule(TARGET git_nuttx PATH "NuttX")
px4_add_git_submodule(TARGET git_uavcan PATH "src/modules/uavcan/libuavcan")
px4_create_git_hash_header()
#=============================================================================
message(STATUS "PX4 VERSION: ${git_tag}")
message(STATUS "CONFIG: ${target_name}")
# The URL for the elf file for crash logging
if (DEFINED ENV{BUILD_URI})
set(BUILD_URI $ENV{BUILD_URI})
else()
set(BUILD_URI "localhost")
endif()
add_definitions(-DBUILD_URI=${BUILD_URI})
message(STATUS "${target_name}")
# Define GNU standard installation directories
include(GNUInstallDirs)
@ -229,52 +168,65 @@ include(GNUInstallDirs)
include(ExternalProject)
# Setup install paths
if (NOT CMAKE_INSTALL_PREFIX)
if(NOT CMAKE_INSTALL_PREFIX)
if (${OS} STREQUAL "posix")
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Install path prefix" FORCE)
endif()
endif()
if (CMAKE_INSTALL_PREFIX)
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
endif()
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
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})
# cmake modules
include(ExternalProject)
#=============================================================================
# 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})
if(NOT COMMAND ${cmd})
message(FATAL_ERROR "${config_module} must implement ${cmd}")
endif()
endforeach()
set(px4_required_config config_module_list)
set(px4_required_config
config_module_list
)
foreach(conf ${px4_required_config})
if (NOT DEFINED ${conf})
if(NOT DEFINED ${conf})
message(FATAL_ERROR "cmake/${config_module} must define ${conf}")
endif()
endforeach()
# List the DriverFramework drivers
if(DEFINED config_df_driver_list)
message("DF Drivers: ${config_df_driver_list}")
endif()
# force static lib build
set(BUILD_SHARED_LIBS OFF)
#=============================================================================
# ccache
#
option(CCACHE "Use ccache if available" OFF)
find_program(CCACHE_PROGRAM ccache)
if (CCACHE AND CCACHE_PROGRAM)
message(STATUS "Enabled ccache: ${CCACHE_PROGRAM}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()
#=============================================================================
# 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")
#=============================================================================
@ -290,16 +242,16 @@ if (CATKIN_DEVEL_PREFIX)
else()
message(FATAL_ERROR "catkin not found")
endif()
else()
message(STATUS "catkin DISABLED")
endif()
find_package(PythonInterp REQUIRED)
px4_find_python_module(jinja2 REQUIRED)
#=============================================================================
# cmake testing
# cmake modules
#
enable_testing()
include(CTest)
#=============================================================================
# generate compile command database
@ -309,37 +261,49 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#=============================================================================
# check required toolchain variables
#
# PX4 requires c++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# PX4 requires c99
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(required_variables CMAKE_C_COMPILER_ID CMAKE_CXX_COMPILER_ID)
set(required_variables
CMAKE_C_COMPILER_ID
)
foreach(var ${required_variables})
if (NOT ${var})
message(FATAL_ERROR "Toolchain/config must define ${var}")
endif()
endforeach()
# print full c compiler version
execute_process(COMMAND ${CMAKE_C_COMPILER} --version
OUTPUT_VARIABLE c_compiler_version
OUTPUT_STRIP_TRAILING_WHITESPACE
)
STRING(REGEX MATCH "[^\n]*" c_compiler_version_short ${c_compiler_version})
message(STATUS "C compiler: ${c_compiler_version_short}")
#=============================================================================
# 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")
# print full c++ compiler version
execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
OUTPUT_VARIABLE cxx_compiler_version
OUTPUT_STRIP_TRAILING_WHITESPACE
)
STRING(REGEX MATCH "[^\n]*" cxx_compiler_version_short ${cxx_compiler_version})
message(STATUS "C++ compiler: ${cxx_compiler_version_short}")
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
@ -371,42 +335,18 @@ link_directories(${link_dirs})
add_definitions(${definitions})
#=============================================================================
# message, parameter, and airframe generation
# source code generation
#
include(common/px4_metadata)
add_subdirectory(msg)
px4_generate_messages(TARGET msg_gen
MSG_FILES ${msg_files}
OS ${OS}
INCLUDES ${msg_include_paths}
DEPENDS git_genmsg git_gencpp prebuild_targets
)
px4_generate_parameters_xml(OUT parameters.xml
BOARD ${BOARD}
MODULES ${config_module_list}
OVERRIDES ${PARAM_DEFAULT_OVERRIDES})
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)
#=============================================================================
# DriverFramework
#
# List the DriverFramework drivers
if (DEFINED config_df_driver_list)
message("DF Drivers: ${config_df_driver_list}")
endif()
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()
add_custom_target(xml_gen
DEPENDS parameters.xml airframes.xml)
#=============================================================================
# external projects
@ -422,10 +362,20 @@ include_directories(${ep_base}/Install/include)
execute_process(COMMAND cmake -E make_directory ${ep_base}/Install/lib)
execute_process(COMMAND cmake -E make_directory ${ep_base}/Install/include)
#=============================================================================
# DriverFramework Drivers
#
set(df_driver_libs)
foreach(driver ${config_df_driver_list})
add_subdirectory(src/lib/DriverFramework/drivers/${driver})
list(APPEND df_driver_libs df_${driver})
message("Adding DF driver: ${driver}")
endforeach()
#=============================================================================
# external modules
#
if (NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
message(STATUS "External modules: ${EXTERNAL_MODULES_LOCATION}")
add_subdirectory("${EXTERNAL_MODULES_LOCATION}/src" external_modules_src)
@ -446,7 +396,7 @@ endif()
set(module_libraries)
foreach(module ${config_module_list})
string(REGEX MATCH "^[./]" external_module ${module})
if (external_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})
@ -455,6 +405,7 @@ foreach(module ${config_module_list})
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
@ -462,6 +413,10 @@ set(module_external_libraries "${module_external_libraries}" CACHE INTERNAL "mod
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()
@ -469,7 +424,7 @@ endif()
#=============================================================================
# generate custom target to print for all executable and module cmake targets
#
if (all_posix_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
@ -479,13 +434,24 @@ if (all_posix_cmake_targets)
)
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 ${git_version})
set(CPACK_PACKAGE_VERSION ${version})
set(CPACK_PACKAGE_CONTACT ${package-contact})
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
@ -494,9 +460,9 @@ 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}-${git_version}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${version}")
set(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
set(CPACK_PACKAGING_INSTALL_PREFIX "")
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
set(CPACK_SET_DESTDIR "OFF")
if ("${CMAKE_SYSTEM}" MATCHES "Linux")
find_program(DPKG_PROGRAM dpkg)

View File

@ -1,15 +0,0 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
##
## # The following are required to submit to the CDash dashboard:
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "PX4 Firmware")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PX4+Firmware")
set(CTEST_DROP_SITE_CDASH TRUE)

View File

@ -1,20 +1,12 @@
#!/bin/bash
#
# Author: Pavel Kirienko <pavel.kirienko@zubax.com>
#
# Poor man's sampling profiler for NuttX.
#
# Usage: Install flamegraph.pl in your PATH, configure your .gdbinit, run the script with proper arguments and go
# have a coffee. When you're back, you'll see the flamegraph. Note that frequent calls to GDB significantly
# interfere with normal operation of the target, which means that you can't profile real-time tasks with it.
# For best results, ensure that the PC is not overloaded, the USB host controller to which the debugger is
# connected is not congested. You should also allow the current user to set negative nice values.
#
# The FlameGraph script can be downloaded from https://github.com/brendangregg/FlameGraph. Thanks Mr. Gregg.
#
# Requirements: ARM GDB with Python support. You can get one by downloading the sources from
# https://launchpad.net/gcc-arm-embedded and building them with correct flags.
# Note that Python support is not required if no per-task sampling is needed.
# Requirements: ARM GDB with Python support
#
set -e
@ -41,7 +33,7 @@ which flamegraph.pl > /dev/null || die "Install flamegraph.pl first"
nsamples=0
sleeptime=0.1 # Doctors recommend 7-8 hours a day
taskname=
elf=
elf=$root/Build/px4fmu-v2_default.build/firmware.elf
append=0
fgfontsize=10
fgwidth=1900
@ -77,8 +69,6 @@ do
shift
done
[[ -z "$elf" ]] && die "Please specify the ELF file location, e.g.: build_px4fmu-v4_default/src/firmware/nuttx/firmware_nuttx"
#
# Temporary files
#
@ -247,8 +237,8 @@ for s, f in sorted(stacks.items(), key=lambda (s, f): s):
print('Total stack frames:', num_stack_frames, file=sys.stderr)
print('Top consumers (distribution of the stack tops):', file=sys.stderr)
for name,num in sorted(stack_tops.items(), key=lambda (name, num): num, reverse=True)[:300]:
print('% 7.3f%% ' % (100 * num / num_stack_frames), name, file=sys.stderr)
for name,num in sorted(stack_tops.items(), key=lambda (name, num): num, reverse=True)[:10]:
print('% 5.1f%% ' % (100 * num / num_stack_frames), name, file=sys.stderr)
EOF
cat $stacksfile | python /tmp/pmpn-folder.py > $foldfile

View File

@ -25,8 +25,7 @@
[
".settings",
"nuttx/arch/arm/src/board",
"nuttx/arch/arm/src/chip",
"build_*"
"nuttx/arch/arm/src/chip"
]
}
],

View File

@ -1,12 +0,0 @@
{
"board_id": 98,
"magic": "AeroCore2",
"description": "Firmware for the Gumstix AeroCore2 board",
"image": "",
"build_time": 0,
"summary": "AEROCORE2",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

@ -1,9 +1,9 @@
{
"board_id": 12,
"magic": "Crazyflie",
"description": "Firmware for the Crazyflie 2.0",
"image": "",
"build_time": 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,

View File

@ -1,12 +0,0 @@
{
"board_id": 27,
"magic": "ESC35v1",
"description": "Firmware for the ESC35V1 board",
"image": "",
"build_time": 0,
"summary": "ESC35v1",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

@ -1,12 +0,0 @@
{
"board_id": 22,
"magic": "CANNODEFWv1",
"description": "Firmware for the PX4CANNODE board",
"image": "",
"build_time": 0,
"summary": "PX4CANNODEv1",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

@ -1,12 +0,0 @@
{
"board_id": 25,
"magic": "ESCv1",
"description": "Firmware for the PX4ESCV1 board",
"image": "",
"build_time": 0,
"summary": "PX4ESCv1",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

@ -1,12 +0,0 @@
{
"board_id": 24,
"magic": "FLOWv1",
"description": "Firmware for the PX4FLowV1 board",
"image": "",
"build_time": 0,
"summary": "PX4FLOWv1",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

@ -1,9 +1,9 @@
{
"board_id": 9,
"magic": "PX4FWv1",
"description": "Firmware for the PX4FMUv3 board",
"image": "",
"build_time": 0,
"board_id": 9,
"magic": "PX4FWv1",
"description": "Firmware for the PX4FMUv3 board",
"image": "",
"build_time": 0,
"summary": "PX4FMUv3",
"version": "0.1",
"image_size": 0,

View File

@ -1,12 +0,0 @@
{
"board_id": 13,
"magic": "PX4FWv1",
"description": "Firmware for the PX4FMUv4PRO board, based on STM32F469",
"image": "",
"build_time": 0,
"summary": "PX4FMUv4PRO",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

@ -1,12 +0,0 @@
{
"board_id": 50,
"magic": "PX4FWv1",
"description": "Firmware for the PX4FMUv5 board",
"image": "",
"build_time": 0,
"summary": "PX4FMUv5",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

12
Images/px4iov2.prototype Normal file
View File

@ -0,0 +1,12 @@
{
"board_id": 10,
"magic": "PX4FWv2",
"description": "Firmware for the PX4IOv2 board",
"image": "",
"build_time": 0,
"summary": "PX4IOv2",
"version": "2.0",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

@ -1,12 +0,0 @@
{
"board_id": 90,
"magic": "PX4FWv1",
"description": "Firmware for the ST nucleo-144 with STM32FF767ZI-v1 board",
"image": "",
"build_time": 0,
"summary": "PX4NUCLEOF767ZIv1",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

@ -1,12 +0,0 @@
{
"board_id": 23,
"magic": "S2740VCblv1",
"description": "Firmware for the S2740VC board",
"image": "",
"build_time": 0,
"summary": "S2740VCv1",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

@ -1,12 +0,0 @@
{
"board_id": 26,
"magic": "ZUBAXGNSSFWv1",
"description": "Firmware for the ZUBAXGNSS board",
"image": "",
"build_time": 0,
"summary": "ZUBAXGNSSv1",
"version": "0.0",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

363
Makefile
View File

@ -1,6 +1,6 @@
############################################################################
#
# Copyright (c) 2015 - 2017 PX4 Development Team. All rights reserved.
# Copyright (c) 2015 - 2016 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
@ -39,6 +39,26 @@ 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
@ -68,37 +88,24 @@ FIRST_ARG := $(firstword $(MAKECMDGOALS))
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
j ?= 4
NINJA_BIN := ninja
ifndef NO_NINJA_BUILD
NINJA_BUILD := $(shell $(NINJA_BIN) --version 2>/dev/null)
ifndef NINJA_BUILD
NINJA_BIN := ninja-build
NINJA_BUILD := $(shell $(NINJA_BIN) --version 2>/dev/null)
endif
NINJA_BUILD := $(shell ninja --version 2>/dev/null)
endif
ifdef NINJA_BUILD
PX4_CMAKE_GENERATOR := Ninja
PX4_MAKE := $(NINJA_BIN)
ifdef VERBOSE
PX4_MAKE_ARGS := -v
else
PX4_MAKE_ARGS :=
endif
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
endif
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
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
endif
# check if replay env variable is set & set build dir accordingly
ifdef replay
@ -107,26 +114,13 @@ else
BUILD_DIR_SUFFIX :=
endif
# NuttX verbose output
ifdef VN
export PX4_NUTTX_BUILD_VERBOSE=1
export V=1
endif
# NuttX verbose patches output
ifdef VNP
export PX4_NUTTX_PATCHES_VERBOSE=1
endif
# additional config parameters passed to cmake
CMAKE_ARGS :=
ifdef EXTERNAL_MODULES_LOCATION
CMAKE_ARGS := -DEXTERNAL_MODULES_LOCATION:STRING=$(EXTERNAL_MODULES_LOCATION)
endif
ifdef PX4_CMAKE_BUILD_TYPE
CMAKE_ARGS += -DCMAKE_BUILD_TYPE=${PX4_CMAKE_BUILD_TYPE}
endif
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
# Functions
# --------------------------------------------------------------------
@ -134,14 +128,22 @@ endif
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 $(2) -G"$(PX4_CMAKE_GENERATOR)" -DCONFIG=$(1) $(CMAKE_ARGS) || (rm -rf $(BUILD_DIR)); fi
+@(cd $(BUILD_DIR) && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
+@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)
endef
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
define colorecho
+@tput setaf 6
+@echo $1
+@tput sgr0
@tput setaf 6
@echo $1
@tput sgr0
endef
# Get a list of all config targets.
@ -155,13 +157,13 @@ NUTTX_CONFIG_TARGETS := $(patsubst nuttx_%,%,$(filter nuttx_%,$(ALL_CONFIG_TARGE
# All targets.
$(ALL_CONFIG_TARGETS):
$(call cmake-build,$@,$(SRC_DIR))
$(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_$@,$(SRC_DIR))
$(call cmake-build,nuttx_$@)
all_nuttx_targets: $(NUTTX_CONFIG_TARGETS)
@ -169,69 +171,76 @@ 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 qurt_eagle_legacy
excelsior_default: posix_excelsior_default qurt_excelsior_default
excelsior_legacy_default: posix_excelsior_legacy qurt_excelsior_legacy
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_legacy_default excelsior_default all_nuttx_targets
.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: qgc_firmware px4fmu_firmware misc_qgc_extra_firmware alt_firmware checks_bootloaders sizes check quick_check
.PHONY: uavcan_firmware check check_format format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
.NOTPARALLEL:
# QGroundControl flashable NuttX firmware
qgc_firmware: px4fmu_firmware misc_qgc_extra_firmware sizes
# 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
# px4fmu NuttX firmware
px4fmu_firmware: \
check_px4fmu-v1_default \
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
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-v3_default \
check_px4fmu-v4_default \
check_px4fmu-v4pro_default \
check_px4fmu-v5_default \
sizes
misc_qgc_extra_firmware: \
check_aerocore2_default \
check_aerofc-v1_default \
check_auav-x21_default \
check_crazyflie_default \
check_px4fmu-v2_test \
check_px4fmu-v4_default_and_uavcan \
check_mindpx-v2_default \
check_px4fmu-v2_lpe \
check_posix_sitl_default \
check_tap-v1_default \
sizes
# Other NuttX firmware
alt_firmware: \
check_aerofc-v1_default \
check_px4-stm32f4discovery_default \
check_px4cannode-v1_default \
check_px4esc-v1_default \
check_px4nucleoF767ZI-v1_default \
check_s2740vc-v1_default \
sizes
checks_bootloaders: \
check_esc35-v1_bootloader \
check_px4cannode-v1_bootloader \
check_px4esc-v1_bootloader \
check_px4flow-v2_bootloader \
check_s2740vc-v1_bootloader \
# not fitting in flash check_zubaxgnss-v1_bootloader \
sizes
sizes:
@-find build_* -name firmware_nuttx -type f | xargs size 2> /dev/null || :
# All default targets that don't require a special build environment
check: check_posix_sitl_default px4fmu_firmware misc_qgc_extra_firmware alt_firmware checks_bootloaders tests check_format
check_crazyflie_default \
check_tests \
check_format
# quick_check builds a single nuttx and posix target, runs testing, and checks the style
quick_check: check_posix_sitl_default check_px4fmu-v3_default tests check_format
quick_check: check_posix_sitl_default check_px4fmu-v4_default check_tests 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
@ -239,163 +248,54 @@ check_%:
@$(MAKE) --no-print-directory $(subst check_,,$@)
@echo
# Documentation
# --------------------------------------------------------------------
.PHONY: parameters_metadata airframe_metadata px4_metadata
parameters_metadata: posix_sitl_default
@python $(SRC_DIR)/Tools/px_process_params.py -s $(SRC_DIR)/src --markdown
airframe_metadata:
@python ${SRC_DIR}/Tools/px_process_airframes.py -v -a ${SRC_DIR}/ROMFS/px4fmu_common/init.d --markdown
@python ${SRC_DIR}/Tools/px_process_airframes.py -v -a ${SRC_DIR}/ROMFS/px4fmu_common/init.d --xml
px4_metadata: parameters_metadata airframe_metadata
# S3 upload helpers
# --------------------------------------------------------------------
# s3cmd uses these ENV variables
# AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY
# AWS_S3_BUCKET
.PHONY: s3put_firmware s3put_qgc_firmware s3put_px4fmu_firmware s3put_misc_qgc_extra_firmware s3put_metadata s3put_scan-build s3put_cppcheck s3put_coverage
Firmware.zip:
@rm -rf Firmware.zip
@zip --junk-paths Firmware.zip `find . -name \*.px4`
s3put_firmware: Firmware.zip
$(SRC_DIR)/Tools/s3put.sh Firmware.zip
s3put_qgc_firmware: s3put_px4fmu_firmware s3put_misc_qgc_extra_firmware
s3put_px4fmu_firmware: px4fmu_firmware
@find $(SRC_DIR)/build_* -name "*.px4" -exec $(SRC_DIR)/Tools/s3put.sh "{}" \;
s3put_misc_qgc_extra_firmware: misc_qgc_extra_firmware
@find $(SRC_DIR)/build_* -name "*.px4" -exec $(SRC_DIR)/Tools/s3put.sh "{}" \;
s3put_metadata: px4_metadata
@$(SRC_DIR)/Tools/s3put.sh airframes.md
@$(SRC_DIR)/Tools/s3put.sh airframes.xml
@$(SRC_DIR)/Tools/s3put.sh build_posix_sitl_default/parameters.xml
@$(SRC_DIR)/Tools/s3put.sh parameters.md
s3put_scan-build: scan-build
@cd $(SRC_DIR) && ./Tools/s3put.sh `find build_scan-build -mindepth 1 -maxdepth 1 -type d`/
s3put_cppcheck: cppcheck
@cd $(SRC_DIR) && ./Tools/s3put.sh cppcheck/
s3put_coverage: tests_coverage
@cd $(SRC_DIR) && ./Tools/s3put.sh build_posix_sitl_default/coverage-html/
# Astyle
# --------------------------------------------------------------------
.PHONY: check_format format
check_format:
$(call colorecho,"Checking formatting with astyle")
@$(SRC_DIR)/Tools/check_code_style_all.sh
@git diff --check
format:
$(call colorecho,"Formatting with astyle")
@$(SRC_DIR)/Tools/check_code_style_all.sh --fix
# Testing
# --------------------------------------------------------------------
.PHONY: unittest run_tests_posix tests tests_coverage
unittest: posix_sitl_default
$(call cmake-build,unittest,$(SRC_DIR)/unittests)
$(call cmake-build-other,unittest, ../unittests)
@(cd build_unittest && ctest -j2 --output-on-failure)
run_tests_posix:
$(MAKE) --no-print-directory posix_sitl_default test_results
run_tests_posix: posix_sitl_default
@(cd build_posix_sitl_default/ && ctest -V)
tests: unittest run_tests_posix
tests: check_unittest run_tests_posix
tests_coverage:
@$(MAKE) --no-print-directory posix_sitl_default test_coverage_genhtml PX4_CMAKE_BUILD_TYPE=Coverage
@(PX4_CODE_COVERAGE=1 CCACHE_DISABLE=1 ${MAKE} tests)
@(lcov --directory . --capture --quiet --output-file coverage.info)
@(lcov --remove coverage.info '/usr/*' --quiet --output-file coverage.info)
#@(lcov --list coverage.info)
@(genhtml coverage.info --quiet --output-directory coverage-html)
coveralls_upload:
@cpp-coveralls --include src/ \
--exclude src/lib/DriverFramework \
--exclude src/lib/ecl \
--exclude src/lib/Matrix \
--exclude=src/modules/uavcan/libuavcan \
--exclude-pattern ".*/unittests/googletest/.*" \
--root . --build-root build_posix_sitl_default/ --follow-symlinks
# 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
codecov_upload:
@/bin/bash -c "bash <(curl -s https://codecov.io/bash)"
# static analyzers (scan-build, clang-tidy, cppcheck)
# --------------------------------------------------------------------
.PHONY: posix_sitl_default-clang scan-build clang-tidy clang-tidy-fix clang-tidy-quiet cppcheck
posix_sitl_default-clang:
@mkdir -p $(SRC_DIR)/build_posix_sitl_default-clang
@cd $(SRC_DIR)/build_posix_sitl_default-clang && cmake .. -GNinja -DCONFIG=posix_sitl_default -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
@cd $(SRC_DIR)/build_posix_sitl_default-clang && ninja
scan-build:
@export CCC_CC=clang
@export CCC_CXX=clang++
@mkdir -p $(SRC_DIR)/build_posix_sitl_default-scan-build
@cd $(SRC_DIR)/build_posix_sitl_default-scan-build && scan-build cmake .. -GNinja -DCONFIG=posix_sitl_default
@scan-build -o $(SRC_DIR)/build_scan-build cmake --build $(SRC_DIR)/build_posix_sitl_default-scan-build
clang-tidy: posix_sitl_default-clang
@cd build_posix_sitl_default-clang && run-clang-tidy-4.0.py -header-filter=".*\.hpp" -j$(j) -p .
# to automatically fix a single check at a time, eg modernize-redundant-void-arg
# % run-clang-tidy-4.0.py -fix -j4 -checks=-\*,modernize-redundant-void-arg -p .
clang-tidy-fix: posix_sitl_default-clang
@cd build_posix_sitl_default-clang && run-clang-tidy-4.0.py -header-filter=".*\.hpp" -j$(j) -fix -p .
# modified version of run-clang-tidy.py to return error codes and only output relevant results
clang-tidy-quiet: posix_sitl_default-clang
@cd build_posix_sitl_default-clang && $(SRC_DIR)/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j) -p .
# TODO: Fix cppcheck errors then try --enable=warning,performance,portability,style,unusedFunction or --enable=all
cppcheck: posix_sitl_default
@cppcheck -i$(SRC_DIR)/src/examples --std=c++11 --std=c99 --std=posix --project=build_posix_sitl_default/compile_commands.json --xml-version=2 2> cppcheck-result.xml
@cppcheck-htmlreport --source-encoding=ascii --file=cppcheck-result.xml --report-dir=cppcheck --source-dir=$(SRC_DIR)/src/
# Cleanup
# --------------------------------------------------------------------
.PHONY: clean submodulesclean distclean
package_firmware:
@zip --junk-paths Firmware.zip `find . -name \*.px4`
clean:
@rm -rf $(SRC_DIR)/build_*/
-@$(MAKE) --no-print-directory -C NuttX/nuttx clean
@rm -rf build_*/
-@$(MAKE) -C NuttX/nuttx clean
submodulesclean:
@git submodule foreach --quiet --recursive git clean -ff -x -d
@git submodule update --quiet --init --recursive --force || true
@git submodule sync --recursive
@git submodule deinit -f .
@git submodule update --init --recursive --force
submodulesupdate:
@git submodule update --quiet --init --recursive || true
@git submodule sync --recursive
@git submodule update --init --recursive
gazeboclean:
@rm -rf ~/.gazebo/*
distclean: submodulesclean gazeboclean
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:
@ -421,3 +321,4 @@ help:
# Print a list of all config targets.
list_config_targets:
@for targ in $(patsubst nuttx_%,[nuttx_]%,$(ALL_CONFIG_TARGETS)); do echo $$targ; done

2
NuttX

@ -1 +1 @@
Subproject commit 44ad7e224c1ef17911ab8b4101fd624ad9ee4177
Subproject commit af5d2b058c55431607aa5aa29fc1d1bbc7e51089

117
README.md
View File

@ -4,95 +4,62 @@
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](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](https://github.com/PX4/Firmware/tree/master/src/modules) directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
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.
* Official Website: http://px4.io (License: BSD 3-clause, [LICENSE.md](https://github.com/PX4/Firmware/blob/master/LICENSE.md))
* Supported airframes:
* [Multicopters](http://px4.io/portfolio_category/multicopter/)
* [Fixed wing](http://px4.io/portfolio_category/plane/)
* [VTOL](http://px4.io/portfolio_category/vtol/)
* many more experimental types (Rovers, Blimps, Boats, Submarines, etc)
* Releases: [Downloads](https://github.com/PX4/Firmware/releases)
* 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)
Please refer to the [user documentation](https://docs.px4.io/en/) and [user forum](http://discuss.px4.io) for flying drones with the PX4 flight stack.
### Users ###
### Weekly Dev Call
The PX4 Dev Team syncs up on a [weekly dev call](https://dev.px4.io/en/contribute/).
* [Wednesday 17:00 Central European Time, 11:00 Eastern Time, 08:00 Pacific Standard Time](https://www.google.com/calendar/embed?src=bGludXhmb3VuZGF0aW9uLm9yZ19nMjF0dmFtMjRtN3BtN2poZXYwMWJ2bHFoOEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t)
* [Uber conference (dial-in or web client)](https://www.uberconference.com/lf-dronecode)
* The agenda is announced in advance on the [PX4 Discuss](http://discuss.px4.io/c/weekly-dev-call)
* Issues and PRs may be labelled [devcall](https://github.com/PX4/Firmware/issues?q=is%3Aopen+is%3Aissue+label%3Adevcall) to flag them for discussion
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.
### Developers ###
* [Developer Guide](https://dev.px4.io/)
* [Build instructions](https://dev.px4.io/en/setup/building_px4.html)
* [Guide for Contributions](https://dev.px4.io/en/contribute/)
* [Developer Forum](http://discuss.px4.io)
* [Guide for Contributions](https://github.com/PX4/Firmware/blob/master/CONTRIBUTING.md)
* [Developer guide](http://dev.px4.io)
## Maintenance Team
* Project / Founder - [Lorenz Meier](https://github.com/LorenzMeier)
* [Dev Call](https://github.com/PX4/Firmware/labels/devcall) - [Ramon Roche](https://github.com/mrpollo)
* Communication Architecture
* [Beat Kueng](https://github.com/bkueng)
* [Julian Oes](https://github.com/JulianOes)
* UI / UX
* [Donald Gagne](https://github.com/DonLakeFlyer)
* [Gus Grubba](https://github.com/dogmaphobic)
* [Multicopter Flight Control](https://github.com/PX4/Firmware/labels/multicopter)
* [Dennis Mannhart](https://github.com/Stifael)
* [Matthias Grob](https://github.com/MaEtUgR)
* [VTOL Flight Control](https://github.com/PX4/Firmware/labels/vtol)
* [Daniel Agar](https://github.com/dagar)
* [Mathieu Bresciani](https://github.com/bresch)
* [Sander Smeets](https://github.com/sanderux)
* [Roman Bapst](https://github.com/tumbili)
* [Andreas Antener](https://github.com/AndreasAntener)
* [Fixed Wing Flight Control](https://github.com/PX4/Firmware/labels/fixedwing)
* [Daniel Agar](https://github.com/dagar)
* [Paul Riseborough](https://github.com/priseborough)
* Racers - [Matthias Grob](https://github.com/MaEtUgR)
* OS / drivers - [David Sidrane](https://github.com/davids5)
* [UAVCAN](https://github.com/PX4/Firmware/labels/uavcan) / Industrial - [Pavel Kirienko](https://github.com/pavel-kirienko)
* [State Estimation](https://github.com/PX4/Firmware/issues?q=is%3Aopen+is%3Aissue+label%3A%22state+estimation%22) - [James Goppert](https://github.com/jgoppert), [Paul Riseborough](https://github.com/priseborough)
* Vision based navigation
* [Christoph Tobler](https://github.com/ChristophTobler)
* [Mohammed Kabir](https://github.com/mhkabir)
* Obstacle Avoidance - [Vilhjalmur Vilhjalmsson](https://github.com/vilhjalmur89)
* [Snapdragon](https://github.com/PX4/Firmware/labels/snapdragon)
* [Christoph Tobler](https://github.com/ChristophTobler)
* [Mark Charlebois](https://github.com/mcharleb)
* [Intel Aero](https://github.com/PX4/Firmware/labels/intel%20aero)
* [Lucas De Marchi](https://github.com/lucasdemarchi)
* [José Roberto de Souza](https://github.com/zehortigoza)
* [Raspberry Pi / Navio](https://github.com/PX4/Firmware/labels/raspberry_pi) - [Beat Kueng](https://github.com/bkueng)
* [Parrot Bebop](https://github.com/PX4/Firmware/labels/bebop) - [Michael Schaeuble](https://github.com/eyeam3)
* [Airmind MindPX / MindRacer](https://github.com/PX4/Firmware/labels/mindpx) - [Henry Zhang](https://github.com/iZhangHui)
* 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
This repository contains code supporting these boards:
* [Snapdragon Flight](https://dev.px4.io/en/flight_controller/snapdragon_flight.html)
* [Intel Aero](https://dev.px4.io/en/flight_controller/intel_aero.html)
* [Raspberry PI with Navio 2](https://dev.px4.io/en/flight_controller/raspberry_pi.html)
* [Parrot Bebop 2](https://dev.px4.io/en/advanced/parrot_bebop.html)
* [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](https://dev.px4.io/en/flight_controller/pixhawk.html)
* Pixhawk Mini
* [Pixfalcon](https://dev.px4.io/en/flight_controller/pixfalcon.html)
* FMUv3.x [Pixhawk 2](https://pixhawk.org/modules/pixhawk2)
* FMUv4.x
* [Pixracer](https://dev.px4.io/en/flight_controller/pixracer.html)
* Pixhawk 3 Pro
* 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)
* AeroCore (v1 and v2)
* STM32F4Discovery (basic support) [Tutorial](https://pixhawk.org/modules/stm32f4discovery)
* Gumstix AeroCore (v1 and v2)
* [Airmind MindPX V2.8](http://www.mindpx.net/assets/accessories/UserGuide_MindPX.pdf)
* [Airmind MindRacer V1.2](http://mindpx.net/assets/accessories/mindracer_user_guide_v1.2.pdf)
* [Bitcraze Crazyflie 2.0](https://dev.px4.io/en/flight_controller/crazyflie2.html)
* 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](https://github.com/LorenzMeier).
The PX4 software and Pixhawk hardware (which has been designed for it) has been created in 2011 by Lorenz Meier.

View File

@ -4,18 +4,6 @@
#
# @type Quadrotor Wide
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 feed-through of RC AUX1 channel
# @output MAIN6 feed-through of RC AUX2 channel
#
# @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 Anton Babushkin <anton@px4.io>, Simon Wilks <simon@px4.io>
#

View File

@ -4,16 +4,6 @@
#
# @type Quadrotor Wide
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
#
# @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 Anton Babushkin <anton@px4.io>
#
@ -39,6 +29,6 @@ then
param set BAT_A_PER_V 15.39103
fi
set MIXER quad_dc
set MIXER quad_w
set PWM_OUT 1234

View File

@ -4,18 +4,6 @@
#
# @type Quadrotor Wide
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 feed-through of RC AUX1 channel
# @output MAIN6 feed-through of RC AUX2 channel
#
# @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 Thomas Gubler <thomas@px4.io>
#

View File

@ -4,18 +4,6 @@
#
# @type Quadrotor Wide
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 feed-through of RC AUX1 channel
# @output MAIN6 feed-through of RC AUX2 channel
#
# @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 Simon Wilks <simon@px4.io>
#
@ -41,9 +29,9 @@ then
param set MPC_XY_FF 0.2
param set MPC_XY_VEL_MAX 2
param set PWM_MIN 1080
fi
set MIXER quad_w
set PWM_OUT 1234
set PWM_MIN 1080

View File

@ -4,15 +4,6 @@
#
# @type Octorotor Coaxial
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 motor 5
# @output MAIN6 motor 6
# @output MAIN7 motor 7
# @output MAIN8 motor 8
#
# @maintainer Lorenz Meier <lorenz@px4.io>
#

View File

@ -4,15 +4,6 @@
#
# @type Octo Coax Wide
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 motor 5
# @output MAIN6 motor 6
# @output MAIN7 motor 7
# @output MAIN8 motor 8
#
# @maintainer Simon Wilks <simon@uaventure.com>
#
@ -40,7 +31,7 @@ then
param set MPC_HOLD_MAX_XY 0.25
param set MPC_THR_MIN 0.15
param set MPC_Z_VEL_MAX_DN 2.0
param set MPC_Z_VEL_MAX 2.0
param set BAT_N_CELLS 4
fi

View File

@ -4,10 +4,10 @@
#
# @type VTOL Duo Tailsitter
#
# @output MAIN1 motor right
# @output MAIN2 motor left
# @output MAIN5 elevon right
# @output MAIN6 elevon left
# @output MAIN1 motor left
# @output MAIN2 motor right
# @output MAIN5 elevon left
# @output MAIN6 elevon right
#
# @maintainer Roman Bapst <roman@px4.io>
#

View File

@ -1,18 +1,10 @@
#!nsh
#
# @name BirdsEyeView Aerobotics FireFly6
#
# @type VTOL Tiltrotor
# @maintainer Roman Bapst <roman@uaventure.com>
# @output MAIN1 Front right motor bottom
# @output MAIN2 Front right motor top
# @output MAIN3 Back motor bottom
# @output MAIN4 Back motor top
# @output MAIN5 Front left motor bottom
# @output MAIN6 Front left motor top
# @output AUX1 Tilt servo
# @output AUX2 Elevon 1
# @output AUX3 Elevon 2
# @output AUX4 Gear
#
# @maintainer Roman Bapst <roman@px4.io>
#
sh /etc/init.d/rc.vtol_defaults
@ -20,16 +12,16 @@ sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.19
param set MC_ROLLRATE_P 0.17
param set MC_ROLLRATE_I 0.002
param set MC_ROLLRATE_D 0.005
param set MC_ROLLRATE_D 0.003
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.004
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_FF 0.0
param set MC_YAW_P 4.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

View File

@ -4,15 +4,6 @@
#
# @type VTOL Quad Tailsitter
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 4
# @output MAIN4 motor 5
# @output MAIN5 elevon left
# @output MAIN6 elevon right
# @output MAIN7 canard surface
# @output MAIN8 rudder
#
# @maintainer Roman Bapst <roman@px4.io>
#

View File

@ -3,10 +3,10 @@
# @name Fun Cub Quad VTOL
# @type Standard VTOL
# @maintainer Simon Wilks <simon@uaventure.com>
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @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

View File

@ -3,10 +3,10 @@
# @name Generic quad delta VTOL
# @type Standard VTOL
# @maintainer Simon Wilks <simon@uaventure.com>
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @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
@ -36,7 +36,7 @@ then
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 50
param set MC_YAWRATE_MAX 20
param set MC_YAWRAUTO_MAX 20
param set MPC_XY_P 0.8

View File

@ -38,7 +38,7 @@ then
param set MC_YAWRAUTO_MAX 40.0
param set MPC_ACC_HOR_MAX 2.0
param set MPC_Z_VEL_MAX_DN 1.5
param set MPC_Z_VEL_MAX 1.5
param set MPC_TKO_SPEED 1.5
param set MPC_LAND_SPEED 0.8

View File

@ -67,6 +67,7 @@ then
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

View File

@ -1,79 +0,0 @@
#!nsh
#
# @name E-flite Convergence
# @type VTOL Tiltrotor
# @maintainer Andreas Antener <andreas@uaventure.com>
# @output MAIN1 Motor right
# @output MAIN2 Motor left
# @output MAIN3 Motor back
# @output MAIN4 empty
# @output MAIN5 Tilt servo right
# @output MAIN6 Tilt servo left
# @output MAIN7 Elevon right
# @output MAIN8 Elevon left
#
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set VT_MOT_COUNT 3
param set VT_FW_MOT_OFFID 3
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 1
param set VT_B_TRANS_DUR 1.0
param set VT_FW_DIFTHR_EN 1
param set VT_FW_DIFTHR_SC 0.17
param set VT_FW_PERM_STAB 0
param set VT_F_TRANS_DUR 1.2
param set VT_F_TR_OL_TM 4.0
param set VT_TILT_FW 1.0
param set VT_TILT_MC 0.0
param set VT_TILT_TRANS 0.45
param set VT_TRANS_MIN_TM 1.2
param set VT_TRANS_P2_DUR 1.3
param set FW_L1_PERIOD 17
param set FW_MAN_R_MAX 50.0
param set FW_ACRO_X_MAX 270
param set FW_ACRO_Y_MAX 270
param set FW_ACRO_Z_MAX 180
param set FW_PR_FF 0.5
param set FW_PR_P 0.08
param set FW_PSP_OFF 5.0
param set FW_P_LIM_MAX 30
param set FW_P_LIM_MIN -30
param set FW_P_RMAX_NEG 60
param set FW_P_RMAX_POS 60
param set FW_RR_FF 0.33
param set FW_RR_P 0.11
param set FW_YR_FF 0.3
param set FW_YR_P 0.05
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_P 0.15
param set MC_PITCH_P 6.0
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_P 0.15
param set MC_ROLL_P 6.0
param set MC_YAWRATE_MAX 120
param set MC_YAWRATE_P 0.27
param set MC_YAW_FF 0.35
param set MC_YAW_P 2.5
param set MC_YAWRATE_P 0.3
param set MPC_LAND_SPEED 1.2
param set MPC_TKO_SPEED 2.5
param set MPC_Z_VEL_MAX_UP 3.0
param set CBRK_AIRSPD_CHK 162128
param set FW_ARSP_MODE 2
param set SENS_BOARD_ROT 8
fi
set MIXER vtol_convergence
set PWM_OUT 1234
set PWM_RATE 400
set MAV_TYPE 21

View File

@ -1,114 +0,0 @@
#!nsh
#
# @name DeltaQuad
# @type Standard VTOL
# @maintainer Sander Smeets <sander@droneslab.com>
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @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 1
param set VT_DWN_PITCH_MAX 8
param set VT_FW_QC_P 55
param set VT_FW_QC_R 55
param set VT_TRANS_MIN_TM 8
param set VT_B_TRANS_DUR 5
param set VT_WV_LND_EN 1
param set VT_WV_LTR_EN 1
param set VT_FWD_THRUST_SC 2
param set VT_F_TRANS_DUR 1
param set VT_IDLE_PWM_MC 1025
param set FW_ARSP_MODE 2
param set FW_L1_PERIOD 25
param set FW_PR_FF 0.7
param set FW_PR_I 0.18
param set FW_PR_P 0.15
param set FW_P_TC 0.5
param set FW_PSP_OFF 5
param set FW_R_LIM 35
param set FW_RR_FF 0.9
param set FW_RR_I 0.08
param set FW_RR_P 0.18
param set FW_T_HRATE_FF 0.5
param set FW_T_CLMB_MAX 3
param set FW_T_SINK_MAX 3
param set FW_T_SINK_MIN 1
param set FW_T_VERT_ACC 6
param set FW_THR_CRUISE 0.68
param set FW_THR_SLEW_MAX 1
param set FW_MAN_P_MAX 30
param set FW_P_LIM_MAX 20
param set FW_P_LIM_MIN -25
param set FW_P_RMAX_NEG 45
param set FW_P_RMAX_POS 45
param set FW_R_RMAX 50
param set LNDMC_ALT_MAX 9999
param set LNDMC_XY_VEL_MAX 1
param set LNDMC_Z_VEL_MAX 0.7
param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.16
param set MC_ROLLRATE_I 0.01
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_FF 0.0
param set MC_ROLLRATE_MAX 80
param set MC_PITCH_P 6.5
param set MC_PITCHRATE_P 0.15
param set MC_PITCHRATE_I 0.05
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_FF 0.0
param set MC_PITCHRATE_MAX 80
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_XY_VEL_MAX 4
param set MPC_ACC_HOR_MAX 2.0
param set MPC_LAND_SPEED 1.5
param set MPC_MAN_R_MAX 30
param set MPC_TILTMAX_LND 35
param set MPC_Z_VEL_MAX 1.5
param set MPC_Z_VEL_MAX_UP 1.5
param set MPC_Z_VEL_MAX_DN 1.5
param set MPC_HOLD_MAX_XY 0.5
param set MPC_HOLD_MAX_Z 0.5
param set CBRK_AIRSPD_CHK 162128
param set CBRK_IO_SAFETY 22027
param set EKF2_GPS_POS_X -0.12
param set EKF2_IMU_POS_X -0.12
param set EKF2_TAU_VEL 0.5
param set SYS_COMPANION 57600
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

View File

@ -4,11 +4,6 @@
#
# @type Tricopter Y+
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 yaw servo
#
# @maintainer Trent Lukaczyk <aerialhedgehog@gmail.com>
#

View File

@ -4,11 +4,6 @@
#
# @type Tricopter Y-
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 yaw servo
#
# @maintainer Trent Lukaczyk <aerialhedgehog@gmail.com>
#

View File

@ -46,8 +46,14 @@ 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

View File

@ -5,11 +5,6 @@
# @type Helicopter
#
# @maintainer Bart Slinger <bartslinger@gmail.com>
# @output MAIN1 main motor
# @output MAIN2 front swashplate servo
# @output MAIN3 right swashplate servo
# @output MAIN4 left swashplate servo
# @output MAIN5 tail-rotor servo
#
sh /etc/init.d/rc.mc_defaults
@ -17,9 +12,9 @@ sh /etc/init.d/rc.mc_defaults
# Configure as helicopter (number 4 defined in commander_helper.cpp)
set MAV_TYPE 4
set MIXER blade130
set MIXER heli_120deg
#set PWM_OUT 1234
set PWM_OUT 1234
if [ $AUTOCNF == yes ]
then
@ -53,5 +48,3 @@ then
param set CBRK_IO_SAFETY 22027
fi
set HIL no

View File

@ -4,13 +4,6 @@
#
# @type custom
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
# @board px4fmu-v3 exclude
# @board px4fmu-v4pro exclude
# @board px4fmu-v5 exclude
# @board aerofc-v1 exclude
#
# @maintainer Julian Oes <julian@oes.ch>
#
# This startup can be used on Pixhawk/Pixfalcon/Pixracer for the

View File

@ -4,11 +4,6 @@
#
# @type Standard Plane
#
# @output MAIN1 aileron
# @output MAIN2 elevator
# @output MAIN3 rudder
# @output MAIN4 throttle
#
# @maintainer Lorenz Meier <lorenz@px4.io>
#

View File

@ -23,3 +23,6 @@ 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

View File

@ -45,3 +45,6 @@ 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

View File

@ -46,3 +46,6 @@ 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

View File

@ -51,5 +51,9 @@ then
param set NAV_LOITER_RAD 30
fi
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX
set MIXER caipi
set PWM_OUT 1234

View File

@ -4,17 +4,9 @@
#
# @type Quadrotor x
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 feed-through of RC AUX1 channel
# @output MAIN6 feed-through of RC AUX2 channel
#
# @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 Lorenz Meier <lorenz@px4.io>
#

View File

@ -4,8 +4,9 @@
#
# @type Quadrotor x
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
# @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>
#
@ -27,8 +28,8 @@ then
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_P 0.7
param set MC_TPA_RATE_P 0.3
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

View File

@ -5,18 +5,6 @@
# @type Quadrotor x
#
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 feed-through of RC AUX1 channel
# @output MAIN6 feed-through of RC AUX2 channel
#
# @output AUX1 Mount pitch
# @output AUX2 Mount roll
# @output AUX3 Mount yaw
# @output AUX4 Mount retract
#
# @maintainer Leon Mueller <thedevleon>
#
@ -29,3 +17,5 @@ set MIXER_AUX mount
set PWM_AUX_OUT 123456
set PWM_AUX_RATE 50
# Start mount driver
vmount start

View File

@ -4,13 +4,6 @@
#
# @type Quadrotor x
#
# @board px4fmu-v2 exclude
# @board px4fmu-v3 exclude
# @board px4fmu-v4 exclude
# @board px4fmu-v4pro exclude
# @board px4fmu-v5 exclude
# @board aerofc-v1 exclude
#
# @maintainer Lorenz Meier <lorenz@px4.io>
#

View File

@ -4,6 +4,16 @@
#
# @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>
#
@ -29,6 +39,6 @@ then
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_P 0.5
param set MC_TPA_RATE_P 0.5
param set MC_TPA_BREAK 0.5
param set MC_TPA_SLOPE 1.0
fi

View File

@ -4,6 +4,10 @@
#
# @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 Lorenz Meier <lorenz@px4.io>
#

View File

@ -4,6 +4,10 @@
#
# @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 Lorenz Meier <lorenz@px4.io>
#

View File

@ -25,5 +25,4 @@ then
param set MC_YAWRATE_D 0.0
fi
set MIXER quad_x_can
set OUTPUT_MODE uavcan_esc

View File

@ -4,14 +4,6 @@
#
# @type Quadrotor x
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
# @board px4fmu-v3 exclude
# @board px4fmu-v4 exclude
# @board px4fmu-v4pro exclude
# @board px4fmu-v5 exclude
# @board aerofc-v1 exclude
#
# @maintainer Michael Schaeuble
#

View File

@ -4,13 +4,6 @@
#
# @type Quadrotor x
#
# @board px4fmu-v2 exclude
# @board px4fmu-v3 exclude
# @board px4fmu-v4 exclude
# @board px4fmu-v4pro exclude
# @board px4fmu-v5 exclude
# @board aerofc-v1 exclude
#
# @maintainer Thomas Gubler <thomas@px4.io>
#
@ -30,5 +23,6 @@ then
param set MC_YAWRATE_P 0.2
param set MC_YAWRATE_I 0.1
param set MC_YAWRATE_D 0.0
param set PWM_MIN 1200
fi
set PWM_MIN 1200

View File

@ -4,13 +4,6 @@
#
# @type Quadrotor x
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
# @board px4fmu-v4 exclude
# @board px4fmu-v4pro exclude
# @board px4fmu-v5 exclude
# @board aerofc-v1 exclude
#
# @maintainer Andreas Antener <andreas@uaventure.com>
#
@ -23,7 +16,7 @@ then
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_DN 2.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

View File

@ -24,17 +24,19 @@ 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_MIN 1100
param set PWM_MAX 1900
param set PWM_AUX_DISARMED 950
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

View File

@ -4,6 +4,16 @@
#
# @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>
#
@ -29,8 +39,9 @@ then
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_P 0.5
param set MC_TPA_RATE_P 0.5
param set MC_TPA_BREAK 0.5
param set MC_TPA_SLOPE 1.0
param set PWM_MIN 1075

View File

@ -1,64 +0,0 @@
#!nsh
#
# @name Spedix S250AQ
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
#
# @type Quadrotor asymmetric
#
# @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 MAIN5 feed-through of RC AUX1 channel
# @output MAIN6 feed-through of RC AUX2 channel
#
# @maintainer Mark Whitehorn <kd0aij@gmail.com>
#
sh /etc/init.d/rc.mc_defaults
set MIXER quad_s250aq
set MAV_TYPE 2
set PWM_OUT 1234
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_D 0.3
param set MC_TPA_BREAK_I 1.0
param set MC_TPA_BREAK_P 0.3
param set MC_TPA_RATE_D 1.0
param set MC_TPA_RATE_I 0.0
param set MC_TPA_RATE_P 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

View File

@ -4,6 +4,10 @@
#
# @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>
#

View File

@ -2,13 +2,6 @@
#
# @name Intel Aero RTF
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
# @board px4fmu-v3 exclude
# @board px4fmu-v4 exclude
# @board px4fmu-v4pro exclude
# @board px4fmu-v5 exclude
#
# @type Quadrotor x
sh /etc/init.d/rc.mc_defaults
@ -19,21 +12,14 @@ sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ]
then
# Set all params here, then disable autoconfig
param set COM_DISARM_LAND 3
param set LNDMC_MAN_DWNTHR 0.2500
param set LNDMC_POS_UPTHR 0.5500
param set LNDMC_Z_VEL_MAX 2.0000
param set MC_ROLL_P 8.0000
param set MC_ROLLRATE_P 0.1300
param set MC_ROLLRATE_I 0.07
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.07
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
@ -41,28 +27,7 @@ then
param set MC_YAWRATE_I 0.050000000745058060
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.5
param set MPC_LAND_SPEED 0.7000
param set MPC_MANTHR_MIN 0.0400
param set MPC_THR_HOVER 0.5000
param set MPC_THR_MAX 0.9400
param set MPC_THR_MIN 0.1000
param set MPC_XY_CRUISE 8.0000
param set MPC_XY_P 1.5000
param set MPC_XY_VEL_P 0.1500
param set MPC_Z_P 1.5000
param set MPC_Z_VEL_I 0.1500
param set MPC_Z_VEL_MAX_DN 4.0000
param set MPC_Z_VEL_MAX_UP 5.0000
param set MPC_Z_VEL_P 0.8000
param set EKF2_GPS_POS_X -0.0600
param set EKF2_GPS_POS_Z -0.1000
param set EKF2_MIN_OBS_DT 50
param set EKF2_BARO_GATE 10.0
param set EKF2_BARO_NOISE 5.0
param set EKF2_ACC_NOISE 0.7
param set MPC_XY_CRUISE 8
param set SYS_LOGGER 1
fi
@ -74,5 +39,5 @@ set OUTPUT_MODE tap_esc
set MIXER quad_x
set USE_IO no
param set SYS_COMPANION 460800
param set SYS_COMPANION 1500000
set MAVLINK_COMPANION_DEVICE /dev/ttyS1

View File

@ -1,55 +0,0 @@
#!nsh
#
# @name ZMR250 Racer
#
# @type Quadrotor x
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
#
# @maintainer Anton Matosov <anton.matosov@gmail.com>
#
sh /etc/init.d/rc.mc_defaults
set MIXER zmr250
set PWM_OUT 1234
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 2.0
param set MC_ROLLRATE_P 0.05
param set MC_ROLLRATE_I 0.2
param set MC_ROLLRATE_D 0.0015
param set MC_ROLL_TC 0.18
param set MC_PITCH_P 2.0
param set MC_PITCHRATE_P 0.05
param set MC_PITCHRATE_I 0.2
param set MC_PITCHRATE_D 0.0015
param set MC_PITCH_TC 0.18
param set MC_YAW_P 1.0
param set MC_YAWRATE_P 0.15
param set MC_YAWRATE_I 0.2
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.5
param set MC_ACRO_R_MAX 1000.0
param set MC_ACRO_P_MAX 1000.0
param set MC_ACRO_Y_MAX 1000.0
param set MC_TPA_BREAK_P 0.5
param set MC_TPA_BREAK_D 0.7
param set MC_TPA_RATE_P 0.5
param set MC_TPA_RATE_D 0.5
param set PWM_MIN 1075
param set PWM_RATE 400
param set PWM_DISARMED 900
param set FAILSAFE 100
# param set NAV_RCL_ACT 6 # Lockdown
param set CBRK_IO_SAFETY 22027
fi

View File

@ -1,41 +0,0 @@
#!nsh
#
# @name NanoMind 110 Quad
#
# @type Quadrotor x
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
# @board px4fmu-v3 exclude
# @board px4fmu-v4 exclude
# @board px4fmu-v4pro exclude
# @board px4fmu-v5 exclude
# @board aerofc-v1 exclude
#
# @maintainer Henry Zhang <zhanghui629@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 BAT_N_CELLS 1
param set PWM_DISARMED 0
param set PWM_MIN 500
param set PWM_MAX 2200
fi

View File

@ -2,14 +2,6 @@
#
# @name Crazyflie 2.0
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
# @board px4fmu-v3 exclude
# @board px4fmu-v4 exclude
# @board px4fmu-v4pro exclude
# @board px4fmu-v5 exclude
# @board aerofc-v1 exclude
#
# @type Quadrotor x
#

View File

@ -4,15 +4,6 @@
#
# @type Rover
#
# @output MAIN1 pass-through of control group 0, channel 0
# @output MAIN2 pass-through of control group 0, channel 1
# @output MAIN3 pass-through of control group 0, channel 2
# @output MAIN4 pass-through of control group 0, channel 3
# @output MAIN5 pass-through of control group 0, channel 4
# @output MAIN6 pass-through of control group 0, channel 5
# @output MAIN7 pass-through of control group 0, channel 6
# @output MAIN8 pass-through of control group 0, channel 7
#
sh /etc/init.d/rc.axialracing_ax10_defaults

View File

@ -1,61 +0,0 @@
#!nsh
#
# @name Traxxas stampede vxl 2wd
#
# @url https://traxxas.com/products/models/electric/stampede-vxl-tsm
#
# @type Rover
#
# @output MAIN2 steering
# @output MAIN4 throttle
#
# @maintainer Marco Zorzi
#
sh /etc/init.d/rc.gnd_defaults
if [ $AUTOCNF == yes ]
then
param set BAT_N_CELLS 7
param set FW_AIRSPD_MIN 0
param set FW_AIRSPD_TRIM 1
param set FW_AIRSPD_MAX 3
param set NAV_ACC_RAD 0.5
param set MIS_LTRMIN_ALT 0.01
param set MIS_TAKEOFF_ALT 0.01
param set EKF2_GBIAS_INIT 0.01
param set EKF2_ANGERR_INIT 0.01
param set EKF2_MAG_TYPE 1
param set GND_WR_P 2
param set GND_WR_I 0.9674
param set GND_WR_IMAX 0.1
param set GND_WR_D 1.2
param set GND_SP_CTRL_MODE 1
param set GND_L1_DIST 10
param set GND_THR_IDLE 0
param set GND_THR_CRUISE 0
param set GND_THR_MAX 0.5
param set GND_THR_MIN 0
param set GND_SPEED_P 0.25
param set GND_SPEED_I 0.001
param set GND_SPEED_D 3
param set GND_SPEED_IMAX 0.125
param set GND_SPEED_THR_SC 1
fi
# Configure this as ugv
set MAV_TYPE 10
# Set mixer
set MIXER stampede
# Provide ESC a constant 1500 us pulse
set PWM_DISARMED 1500
set PWM_MAIN_REV2 1
set PWM_MAX 2000
set PWM_MIN 1000

View File

@ -4,18 +4,6 @@
#
# @type Quadrotor +
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 feed-through of RC AUX1 channel
# @output MAIN6 feed-through of RC AUX2 channel
#
# @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 Anton Babushkin <anton@px4.io>
#

View File

@ -4,13 +4,6 @@
#
# @type Hexarotor x
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 motor 5
# @output MAIN6 motor 6
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel

View File

@ -4,13 +4,6 @@
#
# @type Hexarotor +
#
# @output MAIN1 motor1
# @output MAIN2 motor2
# @output MAIN3 motor3
# @output MAIN4 motor4
# @output MAIN5 motor5
# @output MAIN6 motor6
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel

View File

@ -4,15 +4,6 @@
#
# @type Octorotor x
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 motor 5
# @output MAIN6 motor 6
# @output MAIN7 motor 7
# @output MAIN8 motor 8
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel

View File

@ -4,15 +4,6 @@
#
# @type Octorotor +
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 motor 5
# @output MAIN6 motor 6
# @output MAIN7 motor 7
# @output MAIN8 motor 8
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel

View File

@ -1,25 +1,27 @@
#!nsh
set VEHICLE_TYPE ugv
set VEHICLE_TYPE rover
# This section can be enabled once tuning parameters for this particular
# rover model are known. It allows to configure default gains via the GUI
if [ $AUTOCNF == yes ]
then
# PWM default value for "disarmed" mode
# this centers the steering and throttle, which means no motion
# for a rover
param set PWM_DISARMED 1500
# PWM range
param set PWM_MIN 1200
param set PWM_MAX 1800
fi
#if [ $AUTOCNF == yes ]
#then
# # param set MC_ROLL_P 7.0
#fi
# PWM Hz - 50 Hz is the normal rate in RC cars, higher rates
# may damage analog servos.
set PWM_RATE 50
# PWM default value for "disarmed" mode
# this centers the steering and throttle, which means no motion
# for a rover
set PWM_DISARMED 1500
# PWM range
set PWM_MIN 1200
set PWM_MAX 1800
# Enable servo output on pins 3 and 4 (steering and thrust)
# but also include 1+2 as they form together one output group
# and need to be set together.

View File

@ -3,14 +3,6 @@
# Standard apps for fixed wing
#
# LPE
if param compare SYS_MC_EST_GROUP 1
then
echo "ERROR [init] Estimator LPE not supported on fixed wing. Using EKF2"
param set SYS_MC_EST_GROUP 2
param save
fi
#
# Start the attitude and position estimator
#
@ -26,3 +18,7 @@ fw_pos_control_l1 start
# Start Land Detector
#
land_detector start fixedwing
#
# Misc apps
#

View File

@ -11,10 +11,10 @@ then
param set RTL_DESCEND_ALT 100
param set RTL_LAND_DELAY -1
# FW uses L1 distance for acceptance radius
# 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
fi
@ -23,3 +23,6 @@ fi
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

View File

@ -1,24 +0,0 @@
#!nsh
#
# Standard apps for unmanned ground vehicles (UGV)
#
#
# Start the attitude and position estimator
#
ekf2 start
#attitude_estimator_q start
#local_position_estimator start
#
# Start attitude controllers
#
gnd_att_control start
gnd_pos_control start
#
# Start Land Detector
#
land_detector start ugv

View File

@ -1,32 +0,0 @@
#!nsh
set VEHICLE_TYPE ugv
if [ $AUTOCNF == yes ]
then
#
# Default parameters for UGVs
#
param set NAV_DLL_ACT 0
param set NAV_ACC_RAD 2.0
# temporary
param set NAV_FW_ALT_RAD 1000
param set MIS_LTRMIN_ALT 0.01
param set MIS_TAKEOFF_ALT 0.01
fi
# Enable servo output on pins 3 and 4 (steering and thrust)
# but also include 1+2 as they form together one output group
# and need to be set together.
set PWM_OUT 1234
# PWM Hz - 50 Hz is the normal rate in RC cars, higher rates
# may damage analog servos.
set PWM_RATE 50
# This is the gimbal pass mixer
set MIXER_AUX pass
set PWM_AUX_RATE 50
set PWM_AUX_OUT 1234

View File

@ -2,12 +2,6 @@
#
# Script to configure control interface
#
#
# NOTE: environment variable references:
# If the dollar sign ('$') is followed by a left bracket ('{') then the
# variable name is terminated with the right bracket character ('}').
# Otherwise, the variable name goes to the end of the argument.
#
set SDCARD_MIXERS_PATH /fs/microsd/etc/mixers
@ -19,21 +13,21 @@ then
if [ $MIXER_AUX == none -a $USE_IO == yes ]
then
set MIXER_AUX ${MIXER}
set MIXER_AUX $MIXER.aux
fi
# Use the mixer file from the SD-card if it exists
if [ -f ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix ]
if [ -f $SDCARD_MIXERS_PATH/$MIXER.main.mix ]
then
set MIXER_FILE ${SDCARD_MIXERS_PATH}/${MIXER}.main.mix
set MIXER_FILE $SDCARD_MIXERS_PATH/$MIXER.main.mix
# Try out the old convention, for backward compatibility
else
if [ -f ${SDCARD_MIXERS_PATH}/${MIXER}.mix ]
if [ -f $SDCARD_MIXERS_PATH/$MIXER.mix ]
then
set MIXER_FILE ${SDCARD_MIXERS_PATH}/${MIXER}.mix
set MIXER_FILE $SDCARD_MIXERS_PATH/$MIXER.mix
else
set MIXER_FILE /etc/mixers/${MIXER}.main.mix
set MIXER_FILE /etc/mixers/$MIXER.main.mix
fi
fi
@ -54,22 +48,22 @@ then
set OUTPUT_DEV /dev/tap_esc
fi
if mixer load ${OUTPUT_DEV} ${MIXER_FILE}
if mixer load $OUTPUT_DEV $MIXER_FILE
then
echo "INFO [init] Mixer: ${MIXER_FILE} on ${OUTPUT_DEV}"
echo "INFO [init] Mixer: $MIXER_FILE on $OUTPUT_DEV"
else
echo "ERROR [init] Failed loading mixer: ${MIXER_FILE}"
echo "ERROR [init] Failed loading mixer: ${MIXER_FILE}" >> $LOG_FILE
tone_alarm ${TUNE_ERR}
echo "ERROR [init] Error loading mixer: $MIXER_FILE"
echo "ERROR:[init] Could not load mixer: $MIXER_FILE" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
unset MIXER_FILE
else
if [ $MIXER != skip ]
then
echo "ERROR [init] Mixer undefined"
echo "ERROR [init] Mixer undefined" >> $LOG_FILE
tone_alarm ${TUNE_ERR}
echo "ERROR [init] Mixer not defined"
echo "ERROR [init] Mixer not defined" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@ -82,7 +76,7 @@ then
#
if [ $PWM_RATE != none ]
then
pwm rate -c ${PWM_OUT} -r ${PWM_RATE}
pwm rate -c $PWM_OUT -r $PWM_RATE
fi
#
@ -90,21 +84,21 @@ then
#
if [ $PWM_DISARMED != none ]
then
pwm disarmed -c ${PWM_OUT} -p ${PWM_DISARMED}
pwm disarmed -c $PWM_OUT -p $PWM_DISARMED
fi
if [ $PWM_MIN != none ]
then
pwm min -c ${PWM_OUT} -p ${PWM_MIN}
pwm min -c $PWM_OUT -p $PWM_MIN
fi
if [ $PWM_MAX != none ]
then
pwm max -c ${PWM_OUT} -p ${PWM_MAX}
pwm max -c $PWM_OUT -p $PWM_MAX
fi
fi
if [ $FAILSAFE != none ]
then
pwm failsafe -d ${OUTPUT_DEV} ${FAILSAFE}
pwm failsafe -d $OUTPUT_DEV $FAILSAFE
fi
fi
@ -117,7 +111,7 @@ fi
#MindPX has not aux mixer
if ver hwcmp MINDPX_V2
then
set MIXER_AUX none
set MIXER_AUX none
fi
if ver hwcmp CRAZYFLIE
@ -130,11 +124,6 @@ then
set MIXER_AUX none
fi
if ver hwcmp PX4FMU_V5
then
set MIXER_AUX none
fi
if [ $MIXER_AUX != none -a $AUX_MODE != none ]
then
#
@ -144,40 +133,40 @@ then
set MIXER_AUX_FILE none
set OUTPUT_AUX_DEV /dev/pwm_output1
if [ -f ${SDCARD_MIXERS_PATH}/${MIXER_AUX}.aux.mix ]
if [ -f $SDCARD_MIXERS_PATH/$MIXER_AUX.aux.mix ]
then
set MIXER_AUX_FILE ${SDCARD_MIXERS_PATH}/${MIXER_AUX}.aux.mix
set MIXER_AUX_FILE $SDCARD_MIXERS_PATH/$MIXER_AUX.aux.mix
else
if [ -f /etc/mixers/${MIXER_AUX}.aux.mix ]
if [ -f /etc/mixers/$MIXER_AUX.aux.mix ]
then
set MIXER_AUX_FILE /etc/mixers/${MIXER_AUX}.aux.mix
set MIXER_AUX_FILE /etc/mixers/$MIXER_AUX.aux.mix
fi
fi
if [ $MIXER_AUX_FILE != none ]
then
if fmu mode_${AUX_MODE}
if fmu mode_$AUX_MODE
then
# Append aux mixer to main device
if [ $OUTPUT_MODE == hil ]
then
if mixer append ${OUTPUT_DEV} ${MIXER_AUX_FILE}
if mixer append $OUTPUT_DEV $MIXER_AUX_FILE
then
echo "INFO [init] Mixer: ${MIXER_AUX_FILE} appended to ${OUTPUT_DEV}"
echo "INFO [init] Mixer: $MIXER_AUX_FILE appended to $OUTPUT_DEV"
else
echo "ERROR [init] Failed appending mixer: ${MIXER_AUX_FILE}"
echo "ERROR [init] Failed appending mixer: ${MIXER_AUX_FILE}" >> $LOG_FILE
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 ]
then
if mixer load ${OUTPUT_AUX_DEV} ${MIXER_AUX_FILE}
if mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE
then
echo "INFO [init] Mixer: ${MIXER_AUX_FILE} on ${OUTPUT_AUX_DEV}"
echo "INFO [init] Mixer: $MIXER_AUX_FILE on $OUTPUT_AUX_DEV"
else
echo "ERROR [init] Failed loading mixer: ${MIXER_AUX_FILE}"
echo "ERROR [init] Failed loading mixer: ${MIXER_AUX_FILE}" >> $LOG_FILE
echo "ERROR [init] Error loading mixer: $MIXER_AUX_FILE"
echo "ERROR [init] Could not load mixer: $MIXER_AUX_FILE" >> $LOG_FILE
fi
else
set PWM_AUX_OUT none
@ -185,7 +174,7 @@ then
fi
else
echo "ERROR: Could not start: fmu mode_pwm" >> $LOG_FILE
tone_alarm ${TUNE_ERR}
tone_alarm $TUNE_ERR
set PWM_AUX_OUT none
set FAILSAFE_AUX none
fi
@ -198,16 +187,16 @@ then
#
if [ $PWM_AUX_RATE != none ]
then
pwm rate -e -c ${PWM_AUX_OUT} -r ${PWM_AUX_RATE} -d ${OUTPUT_AUX_DEV}
pwm rate -c $PWM_AUX_OUT -r $PWM_AUX_RATE -d $OUTPUT_AUX_DEV
fi
if [ $PWM_AUX_MIN != none ]
then
pwm min -e -c ${PWM_AUX_OUT} -p ${PWM_AUX_MIN} -d ${OUTPUT_AUX_DEV}
pwm min -c $PWM_AUX_OUT -p $PWM_AUX_MIN -d $OUTPUT_AUX_DEV
fi
if [ $PWM_AUX_MAX != none ]
then
pwm max -e -c ${PWM_AUX_OUT} -p ${PWM_AUX_MAX} -d ${OUTPUT_AUX_DEV}
pwm max -c $PWM_AUX_OUT -p $PWM_AUX_MAX -d $OUTPUT_AUX_DEV
fi
fi
@ -225,12 +214,12 @@ then
#
if [ $PWM_AUX_DISARMED != none -a $PWM_ACHDIS != none ]
then
pwm disarmed -e -c ${PWM_ACHDIS} -p ${PWM_AUX_DISARMED} -d ${OUTPUT_AUX_DEV}
pwm disarmed -c $PWM_ACHDIS -p $PWM_AUX_DISARMED -d $OUTPUT_AUX_DEV
fi
if [ $FAILSAFE_AUX != none ]
then
pwm failsafe -e -d ${OUTPUT_AUX_DEV} ${FAILSAFE}
pwm failsafe -d $OUTPUT_AUX_DEV $FAILSAFE
fi
fi

View File

@ -16,6 +16,6 @@ then
set PX4IO_LIMIT 200
fi
if px4io limit ${PX4IO_LIMIT}
if px4io limit $PX4IO_LIMIT
then
fi

View File

@ -11,8 +11,8 @@
# INAV (deprecated)
if param compare SYS_MC_EST_GROUP 0
then
echo "ERROR [init] Estimator INAV deprecated. Using EKF2"
param set SYS_MC_EST_GROUP 2
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
param set SYS_MC_EST_GROUP 1
param save
fi
@ -20,14 +20,12 @@ fi
if param compare SYS_MC_EST_GROUP 1
then
# Try to start LPE. If it fails, start EKF2 as a default
# Unfortunately we do not build it on px4fmu-v2 due to a limited flash.
# Unfortunately we do not build it on px4fmu-v2 duo to a limited flash.
if attitude_estimator_q start
then
local_position_estimator start
else
echo "ERROR [init] Estimator LPE not available. Using EKF2"
param set SYS_MC_EST_GROUP 2
param save
ekf2 start
fi
fi

View File

@ -7,6 +7,7 @@ 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 PWM_RATE 400
@ -14,7 +15,21 @@ then
param set RTL_LAND_DELAY 0
fi
# 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
# 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
if param compare PWM_DISARMED 0
then
param set PWM_DISARMED 900
fi

View File

@ -52,13 +52,8 @@ else
fi
fi
if ver hwcmp AEROFC_V1
if adc start
then
# Aero FC uses separate driver
else
if adc start
then
fi
fi
if ver hwcmp AUAV_X21
@ -73,11 +68,6 @@ then
then
fi
# Internal SPI bus ICM-20602-G is rotated 90 deg yaw
if mpu6000 -R 2 -T 20602 start
then
fi
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
if mpu6000 -R 2 -T 20608 start
then
@ -198,11 +188,6 @@ then
then
fi
# Internal SPI bus ICM-20602-G is rotated 90 deg yaw
if mpu6000 -R 2 -T 20602 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.
@ -216,30 +201,6 @@ then
if bmi160 start
then
fi
# Start either ICM2060X or BMI055. 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 BMI055_ACC
if bmi055 -A start
then
fi
# Internal SPI bus BMI055_GYR
if bmi055 -G start
then
fi
# expansion i2c used for BMM150 rotated by 90deg
if bmm150 -R 2 start
then
fi
# expansion i2c used for BMP280
if bmp280 -I start
then
fi
fi
if ver hwcmp PX4FMU_V1
@ -283,11 +244,11 @@ then
fi
# Internal I2C bus
if hmc5883 -C -T -I -R 12 start
if hmc5883 -C -T -I -R 8 start
then
fi
if mpu9250 -s -R 8 start
if mpu6500 -R 8 start
then
fi
@ -307,7 +268,7 @@ then
then
fi
# I2C bypass of mpu
# I2C bypass of mpu
if lps25h start
then
fi
@ -315,11 +276,16 @@ fi
if ver hwcmp AEROFC_V1
then
if ms5611 -T 0 start
if ms5611 start
then
fi
if mpu9250 -s -R 14 start
if mpu6500 -R 14 start
then
fi
# Internal compass
if hmc5883 -I -R 4 start
then
fi
@ -328,88 +294,9 @@ then
then
fi
if ist8310 -C -b 1 -R 4 start
if ist8310 -C -b 1 -R 8 start
then
fi
if aerofc_adc start
then
fi
if ll40ls start i2c
then
fi
fi
if ver hwcmp PX4FMU_V4PRO
then
# Internal SPI bus ICM-20608-G
if mpu6000 -R 2 -T 20608 start
then
fi
# Internal SPI bus ICM-20602
if mpu6000 -R 2 -T 20602 start
then
fi
# Internal SPI bus mpu9250
if mpu9250 -R 2 start
then
fi
# Internal SPI bus
if lis3mdl -R 0 start
then
fi
# Possible external compasses
if hmc5883 -C -T -X start
then
fi
fi
if ver hwcmp PX4FMU_V5
then
# Internal SPI bus ICM-20602
if mpu6000 -R 8 -s -T 20602 start
then
fi
# Internal SPI bus ICM-20689
if mpu6000 -R 8 -z -T 20689 start
then
fi
# Internal SPI bus BMI055 accel
if bmi055 -A -R 10 start
then
fi
# Internal SPI bus BMI055 gyro
if bmi055 -G -R 10 start
then
fi
# Possible external compasses
if hmc5883 -C -T -X start
then
fi
# Possible external airspeed sensor
if meas_airspeed start -b 2
then
fi
fi
if ver hwcmp AEROCORE2
then
l3gd20 -R 12 start
lsm303d start
fi
if meas_airspeed start
@ -424,6 +311,10 @@ else
fi
fi
if sf1xx 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

View File

@ -12,8 +12,8 @@
# INAV (deprecated)
if param compare SYS_MC_EST_GROUP 0
then
echo "ERROR [init] Estimator INAV deprecated. Using EKF2"
param set SYS_MC_EST_GROUP 2
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
param set SYS_MC_EST_GROUP 1
param save
fi
@ -21,14 +21,12 @@ fi
if param compare SYS_MC_EST_GROUP 1
then
# Try to start LPE. If it fails, start EKF2 as a default
# Unfortunately we do not build it on px4fmu-v2 due to a limited flash.
# Unfortunately we do not build it on px4fmu-v2 duo to a limited flash.
if attitude_estimator_q start
then
local_position_estimator start
else
echo "ERROR [init] Estimator LPE not available. Using EKF2"
param set SYS_MC_EST_GROUP 2
param save
ekf2 start
fi
fi

View File

@ -14,7 +14,7 @@ then
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_DN 1.5
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
@ -23,3 +23,12 @@ 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

View File

@ -1,49 +1,14 @@
#!nsh
# Un comment and use set +e to ignore and set -e to enable 'exit on error control'
#set +e
# Un comment the line below to help debug scripts by printing a trace of the script commands
#set -x
#
# PX4FMU startup script.
#
# NOTE: environment variable references:
# If the dollar sign ('$') is followed by a left bracket ('{') then the
# variable name is terminated with the right bracket character ('}').
# Otherwise, the variable name goes to the end of the argument.
# NOTE: COMMENT LINES ARE REMOVED BEFORE STORED IN ROMFS.
#
#
# NOTE: COMMENT LINES ARE REMOVED BEFORE STORED IN ROMFS.
#
# UART mapping on FMUv1/2/3/4:
#
# UART1 /dev/ttyS0 IO debug
# USART2 /dev/ttyS1 TELEM1 (flow control)
# USART3 /dev/ttyS2 TELEM2 (flow control)
# UART4
# UART7 CONSOLE
# UART8 SERIAL4
#
#
# UART mapping on FMUv5:
#
# UART1 /dev/ttyS0 GPS
# USART2 /dev/ttyS1 TELEM1 (flow control)
# USART3 /dev/ttyS2 TELEM2 (flow control)
# UART4 /dev/ttyS3 ?
# USART6 /dev/ttyS4 TELEM3 (flow control)
# UART7 /dev/ttyS5 ?
# UART8 /dev/ttyS6 CONSOLE
#
# Mount the procfs.
#
mount -t procfs /proc
#
# Start CDC/ACM serial driver
#
if sercon
then
fi
sercon
#
# Default to auto-start mode.
@ -59,19 +24,8 @@ 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"
if hardfault_log check
then
tone_alarm error
if hardfault_log commit
then
hardfault_log reset
tone_alarm stop
fi
else
# Start playing the startup tune
tone_alarm start
fi
# Start playing the startup tune
tone_alarm start
else
tone_alarm MBAGP
if mkfatfs /dev/mmcsd0
@ -96,7 +50,7 @@ fi
set FRC /fs/microsd/etc/rc.txt
if [ -f $FRC ]
then
echo "INFO [init] Executing script: ${FRC}"
echo "INFO [init] Executing script: $FRC"
sh $FRC
set MODE custom
fi
@ -150,8 +104,8 @@ then
#
if param compare SYS_AUTOCONFIG 1
then
# Wipe out params except RC* and total flight time
param reset_nostart RC* LND_FLIGHT_T_*
# Wipe out params except RC*
param reset_nostart RC*
set AUTOCNF yes
else
set AUTOCNF no
@ -176,16 +130,16 @@ then
set MIXER_AUX none
set OUTPUT_MODE none
set PWM_OUT none
set PWM_RATE p:PWM_RATE
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX
set PWM_RATE none
set PWM_DISARMED none
set PWM_MIN none
set PWM_MAX none
set PWM_AUX_OUT none
set PWM_AUX_RATE none
set PWM_ACHDIS none
set PWM_AUX_DISARMED p:PWM_AUX_DISARMED
set PWM_AUX_MIN p:PWM_AUX_MIN
set PWM_AUX_MAX p:PWM_AUX_MAX
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
@ -196,7 +150,6 @@ then
set MAV_TYPE none
set FAILSAFE none
set USE_IO yes
set LOGGER_BUF 16
#
# Set USE_IO flag
@ -208,12 +161,6 @@ then
set USE_IO no
fi
if ver hwcmp PX4FMU_V5
then
set USE_IO no
set MAVLINK_COMPANION_DEVICE /dev/ttyS3
fi
if ver hwcmp MINDPX_V2
then
set USE_IO no
@ -234,11 +181,6 @@ then
then
set USE_IO no
fi
if ver hwcmp AEROCORE2
then
set USE_IO no
fi
else
set USE_IO no
fi
@ -260,25 +202,11 @@ then
#
if param compare SYS_AUTOSTART 0
then
ekf2 start
else
sh /etc/init.d/rc.autostart
fi
unset MODE
#
# If mount (gimbal) control is enabled and output mode is AUX, set the aux
# mixer to mount (override the airframe-specific MIXER_AUX setting)
#
if param compare MNT_MODE_IN -1
then
else
if param compare MNT_MODE_OUT 0
then
set MIXER_AUX mount
fi
fi
#
# Wipe incompatible settings for boards not having two outputs
if ver hwcmp PX4FMU_V4
@ -286,11 +214,6 @@ then
set MIXER_AUX none
fi
if ver hwcmp PX4FMU_V5
then
set MIXER_AUX none
fi
if ver hwcmp AEROFC_V1
then
set MIXER_AUX none
@ -302,7 +225,7 @@ then
set FCONFIG /fs/microsd/etc/config.txt
if [ -f $FCONFIG ]
then
echo "Custom: ${FCONFIG}"
echo "Custom: $FCONFIG"
sh $FCONFIG
fi
unset FCONFIG
@ -312,11 +235,6 @@ then
#
if [ $AUTOCNF == yes ]
then
# Disable safety switch by default on Pixracer
if ver hwcmp PX4FMU_V4
then
param set CBRK_IO_SAFETY 22027
fi
param set SYS_AUTOCONFIG 0
fi
unset AUTOCNF
@ -357,8 +275,8 @@ then
if px4io forceupdate 14662 ${IO_FILE}
then
usleep 10000
if px4io checkcrc ${IO_FILE}
usleep 500000
if px4io checkcrc $IO_FILE
then
echo "PX4IO CRC OK after updating" >> $LOG_FILE
tone_alarm MLL8CDE
@ -366,11 +284,11 @@ then
set IO_PRESENT yes
else
echo "PX4IO update failed" >> $LOG_FILE
tone_alarm ${TUNE_ERR}
tone_alarm $TUNE_ERR
fi
else
echo "PX4IO update failed" >> $LOG_FILE
tone_alarm ${TUNE_ERR}
tone_alarm $TUNE_ERR
fi
fi
unset IO_FILE
@ -378,7 +296,7 @@ then
if [ $IO_PRESENT == no ]
then
echo "PX4IO not found" >> $LOG_FILE
tone_alarm ${TUNE_ERR}
tone_alarm $TUNE_ERR
fi
fi
@ -424,36 +342,22 @@ then
then
set FMU_MODE serial
fi
unset HIL
else
unset HIL
gps start
fi
set DATAMAN_OPT ""
if ver hwcmp AEROFC_V1
then
set DATAMAN_OPT -i
fi
if ver hwcmp AEROCORE2
then
set DATAMAN_OPT "-f /fs/mtd_dataman"
fi
# waypoint storage
# REBOOTWORK this needs to start in parallel
if dataman start $DATAMAN_OPT
if dataman start
then
fi
unset DATAMAN_OPT
#
# Sensors System (start before Commander so Preflight checks are properly run)
#
if [ $HIL == yes ]
then
sensors start -hil
else
sh /etc/init.d/rc.sensors
fi
unset HIL
sh /etc/init.d/rc.sensors
# Needs to be this early for in-air-restarts
if [ $OUTPUT_MODE == hil ]
@ -463,10 +367,6 @@ then
commander start
fi
if send_event start_listening
then
fi
#
# Start CPU load monitor
#
@ -486,28 +386,17 @@ then
fi
# Sensors on the PWM interface bank
# clear pins 5 and 6
if param compare SENS_EN_LL40LS 1
then
# clear pins 5 and 6
set FMU_MODE pwm4
set AUX_MODE pwm4
fi
if param greater TRIG_MODE 0
then
# We ONLY support trigger on pins 5 and 6 when simultanously using AUX for actuator output
if param compare TRIG_PINS 56
then
# clear pins 5 and 6
set FMU_MODE pwm4
set AUX_MODE pwm4
else
set FMU_MODE none
set AUX_MODE none
fi
set FMU_MODE pwm4
set AUX_MODE pwm4
camera_trigger start
param set CAM_FBACK_MODE 1
camera_feedback start
fi
# If OUTPUT_MODE == none then something is wrong with setup and we shouldn't try to enable output
@ -604,10 +493,10 @@ then
else
if [ $OUTPUT_MODE != fmu -a $OUTPUT_MODE != ardrone ]
then
if fmu mode_${FMU_MODE}
if fmu mode_$FMU_MODE
then
else
echo "FMU mode_${FMU_MODE} start failed" >> $LOG_FILE
echo "FMU mode_$FMU_MODE start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
@ -662,7 +551,7 @@ then
if [ "x$MAVLINK_F" == xnone ]
then
else
mavlink start ${MAVLINK_F}
mavlink start $MAVLINK_F
fi
unset MAVLINK_F
@ -676,7 +565,7 @@ then
# but this works for now
if param compare SYS_COMPANION 10
then
frsky_telemetry start -d ${MAVLINK_COMPANION_DEVICE}
frsky_telemetry start -d $MAVLINK_COMPANION_DEVICE
fi
if param compare SYS_COMPANION 20
then
@ -685,52 +574,39 @@ then
fi
if param compare SYS_COMPANION 921600
then
mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 921600 -m onboard -r 80000 -x
mavlink start -d $MAVLINK_COMPANION_DEVICE -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
fi
if param compare SYS_COMPANION 460800
then
mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 460800 -m onboard -r 5000 -x
mavlink start -d $MAVLINK_COMPANION_DEVICE -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
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
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
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
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 3115200
then
mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 115200 -r 1000
fi
if param compare SYS_COMPANION 419200
then
iridiumsbd start -d /dev/ttyS2
mavlink start -d /dev/iridium -b 19200 -m iridium -r 10
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
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 10000 -x
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 1500000 -m onboard -r 100000 -x
fi
fi
@ -741,12 +617,10 @@ then
#
if param greater UAVCAN_ENABLE 0
then
if uavcan start
if uavcan start fw
then
set LOGGER_BUF 7
uavcan start fw
else
tone_alarm ${TUNE_ERR}
tone_alarm $TUNE_ERR
fi
fi
@ -765,46 +639,30 @@ then
fi
fi
# Lidar-Lite on I2C
if param compare SENS_EN_LL40LS 2
then
if ll40ls start i2c
then
fi
fi
# lightware serial lidar sensor
if param compare SENS_EN_SF0X 0
then
else
if sf0x start
then
fi
sf0x start
fi
# lightware i2c lidar sensor
if param compare SENS_EN_SF1XX 0
then
else
if sf1xx start
then
fi
sf1xx start
fi
# mb12xx sonar sensor
if param compare SENS_EN_MB12XX 1
then
if mb12xx start
then
fi
mb12xx start
fi
# teraranger one tof sensor
if param compare SENS_EN_TRONE 1
then
if trone start
then
fi
trone start
fi
if ver hwcmp PX4FMU_V4
@ -834,12 +692,8 @@ then
px4flow start &
fi
if ver hwcmp AEROFC_V1
then
else
# Start MAVLink
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
fi
# Start MAVLink
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
#
# Logging
@ -865,14 +719,6 @@ then
fi
else
set LOGGER_ARGS ""
#
# Adjust FMUv5 logging settings
#
if ver hwcmp PX4FMU_V5
then
set LOGGER_BUF 64
param set SDLOG_MODE 3
fi
if param compare SDLOG_MODE 1
then
set LOGGER_ARGS "-e"
@ -881,18 +727,10 @@ then
then
set LOGGER_ARGS "-f"
fi
if param compare SDLOG_MODE 3
then
set LOGGER_ARGS "-f"
fi
if ver hwcmp AEROFC_V1
then
set LOGGER_ARGS "-m mavlink"
fi
if logger start -b ${LOGGER_BUF} -t ${LOGGER_ARGS}
if logger start -b 12 -t $LOGGER_ARGS
then
fi
unset LOGGER_BUF
unset LOGGER_ARGS
fi
fi
@ -922,7 +760,7 @@ then
set MAV_TYPE 1
fi
param set MAV_TYPE ${MAV_TYPE}
param set MAV_TYPE $MAV_TYPE
# Load mixer and configure outputs
sh /etc/init.d/rc.interface
@ -948,7 +786,7 @@ then
then
set MAV_TYPE 2
fi
if [ $MIXER == quad_w -o $MIXER == quad_dc ]
if [ $MIXER == quad_w -o $MIXER == sk450_deadcat ]
then
set MAV_TYPE 2
fi
@ -988,7 +826,7 @@ then
echo "Unknown MAV_TYPE"
param set MAV_TYPE 2
else
param set MAV_TYPE ${MAV_TYPE}
param set MAV_TYPE $MAV_TYPE
fi
# Load mixer and configure outputs
@ -1031,7 +869,7 @@ then
echo "Unknown MAV_TYPE"
param set MAV_TYPE 19
else
param set MAV_TYPE ${MAV_TYPE}
param set MAV_TYPE $MAV_TYPE
fi
# Load mixer and configure outputs
@ -1042,29 +880,20 @@ then
fi
#
# UGV setup
# Rover setup
#
if [ $VEHICLE_TYPE == ugv ]
if [ $VEHICLE_TYPE == rover ]
then
if [ $MIXER == none ]
then
# Set default mixer for UGV if not defined
set MIXER stampede
fi
if [ $MAV_TYPE == none ]
then
# Use MAV_TYPE = 10 (UGV) if not defined
set MAV_TYPE 10
fi
param set MAV_TYPE ${MAV_TYPE}
# 10 is MAV_TYPE_GROUND_ROVER
set MAV_TYPE 10
# Load mixer and configure outputs
sh /etc/init.d/rc.interface
# Start standard UGV apps
sh /etc/init.d/rc.gnd_apps
# Start standard rover apps
sh /etc/init.d/rc.axialracing_ax10_apps
param set MAV_TYPE 10
fi
#
@ -1128,7 +957,7 @@ then
set FEXTRAS /fs/microsd/etc/extras.txt
if [ -f $FEXTRAS ]
then
echo "Addons script: ${FEXTRAS}"
echo "Addons script: $FEXTRAS"
sh $FEXTRAS
fi
unset FEXTRAS
@ -1138,57 +967,15 @@ then
# CF2 shouldn't have an sd card
else
if ver hwcmp AEROCORE2
# Run no SD alarm
if [ $LOG_FILE == /dev/null ]
then
# AEROCORE2 shouldn't have an sd card
else
# Run no SD alarm
if [ $LOG_FILE == /dev/null ]
then
# Play SOS
tone_alarm error
fi
# Play SOS
tone_alarm error
fi
fi
#
# Check if we should start a thermal calibration
# TODO move further up and don't start unnecessary services if we are calibrating
#
set TEMP_CALIB_ARGS ""
if param compare SYS_CAL_GYRO 1
then
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -g"
param set SYS_CAL_GYRO 0
fi
if param compare SYS_CAL_ACCEL 1
then
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -a"
param set SYS_CAL_ACCEL 0
fi
if param compare SYS_CAL_BARO 1
then
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -b"
param set SYS_CAL_BARO 0
fi
if [ "x$TEMP_CALIB_ARGS" != "x" ]
then
send_event temperature_calibration ${TEMP_CALIB_ARGS}
fi
unset TEMP_CALIB_ARGS
# vmount to control mounts such as gimbals, disabled by default.
if param compare MNT_MODE_IN -1
then
else
if vmount start
then
fi
fi
# End of autostart
fi

View File

@ -1,13 +1,3 @@
#
# @board px4fmu-v1 exclude
# @board px4fmu-v2 exclude
# @board px4fmu-v3 exclude
# @board px4fmu-v4 exclude
# @board px4fmu-v4pro exclude
# @board px4fmu-v5 exclude
# @board aerofc-v1 exclude
#
Multirotor mixer for Parrot Bebop
=================================

View File

@ -1,16 +0,0 @@
Helicopter Cyclic-Collective-Pitch Mixing (CCPM) for PX4FMU
Blade 130x helicopter has longer servo arms left and right. The front servo arm is shortest and has normalized length 10000.
==================================================
H: 3
T: 0 3000 6000 8000 10000
P: 500 1500 2500 3500 4500
# Swash plate servos:
S: 0 10000 10000 0 -8000 8000
S: 140 13054 10000 0 -8000 8000
S: 220 13054 10000 0 -8000 8000
# Tail servo:
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000

View File

@ -24,12 +24,12 @@ The scaling factor for roll inputs is adjusted to implement differential travel
for the elevons.
M: 2
O: 10000 10000 0 -10000 10000
O: 10000 10000 3000 -10000 10000
S: 0 0 8000 8000 0 -10000 10000
S: 0 1 9000 9000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
O: 10000 10000 -3000 -10000 10000
S: 0 0 8000 8000 0 -10000 10000
S: 0 1 -9000 -9000 0 -10000 10000

View File

@ -1,5 +1,5 @@
Coaxial helicopter mixer
- Two servomotors act on the swashplate (90 degree angle on the swashplate, decoupled effect on roll and pitch).
- Two servomotors act on the swashplate (90° angle on the swashplate, decoupled effect on roll and pitch).
- No collective pitch.
- One motor per rotor.
===========================

View File

@ -0,0 +1,54 @@
Helicopter 120 degree Cyclic-Collective-Pitch Mixing (CCPM) for PX4FMU
Blade 130x helicopter has longer servo arms left and right. The front servo arm is shorter.
Therefore it is not required to use the 0.866 factor.
==================================================
Output 0 - Left Servo Mixer
-----------------
Left Servo = Collective (Thurst - 3) - 0.5 * Elevator (Pitch - 1) + Aileron (Roll - 0)
M: 3
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 1 -10000 -10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
Output 1 - Front Servo Mixer
----------------
Rear Servo = Collective (Thrust - 3) + Elevator (Pitch - 1)
M: 2
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 1 10000 10000 0 -10000 10000
Output 2 - Right Servo Mixer
----------------
Right Servo = Collective (Thurst - 3) - 0.5 * Elevator (Pitch - 1) - Aileron (Roll - 0)
M: 3
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 1 -10000 -10000 0 -10000 10000
S: 0 0 -10000 -10000 0 -10000 10000
Output 3 - Tail Servo Mixer
----------------
Tail Servo = Yaw (control index = 2)
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
Output 4 - Motor speed mixer
-----------------
This would be the motor speed control output from governor power demand- not sure what index to use here?
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000

View File

@ -4,20 +4,24 @@
# pitch
M: 1
O: 10000 10000 0 -10000 10000
S: 2 1 10000 10000 0 -10000 10000
S: 2 0 10000 10000 0 -10000 10000
# roll
M: 1
O: 10000 10000 0 -10000 10000
S: 2 0 10000 10000 0 -10000 10000
S: 2 1 10000 10000 0 -10000 10000
# yaw
M: 1
O: 10000 10000 0 -10000 10000
S: 2 2 10000 10000 0 -10000 10000
# Shutter/retract
# mode
M: 1
O: 10000 10000 0 -10000 10000
S: 2 3 10000 10000 0 -10000 10000
# retracts
M: 1
O: 10000 10000 0 -10000 10000
S: 2 4 10000 10000 0 -10000 10000

View File

@ -1 +0,0 @@
R: 4x 10000 10000 10000 1300

View File

@ -1,6 +0,0 @@
Multirotor mixer
===========================
This file defines a single mixer for a quadrotor in DC wide arms configuration. All controls are mixed 100%.
R: 4dc 10000 10000 10000 0

View File

@ -1,7 +0,0 @@
R: 4s 10000 10000 10000 0
M: 1
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 6 10000 10000 0 -10000 10000

View File

@ -1 +0,0 @@
R: 4x 10000 10000 10000 0

View File

@ -0,0 +1,38 @@
Gimbal / payload mixer for PX4FMU
===========================
Configuration with 2 gimbals:
- 2 axes inline GoPro gimbal (pitch, roll)
- 2 axes FPV gimbal (pitch, yaw), physically attached GoPro gimbal's roll stabilization
-----------------------------------------------------
# gimbal roll
M: 1
O: 10000 10000 0 -10000 10000
S: 2 0 -11500 -10000 900 -10000 10000
# gimbal pitch
M: 1
O: 10000 10000 0 -10000 10000
S: 2 1 12000 12000 2000 -10000 10000
# FPV gimbal yaw (not implemented, yet)
M: 1
O: 10000 10000 0 -10000 10000
S: 2 2 10000 10000 0 -10000 10000
# FPV gimbal pitch
M: 1
O: 10000 10000 0 -10000 10000
S: 2 1 -12000 -12000 -3000 -10000 10000
# reserved, not used
M: 1
O: 10000 10000 0 -10000 10000
S: 2 4 10000 10000 0 -10000 10000
# parachute
M: 1
O: 10000 10000 0 -10000 10000
S: 2 7 10000 10000 0 -10000 10000

View File

@ -0,0 +1,21 @@
Multirotor mixer for PX4IO
===========================
This file defines a single mixer for a quadrotor in SK450 DeadCat configuration. All controls are mixed 100%.
R: 4dc 10000 10000 10000 0
Gimbal / payload mixer for last three channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 7 10000 10000 0 -10000 10000

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