Compare commits

..

No commits in common. "v1.3.2" and "v1.0.0beta2" have entirely different histories.

1450 changed files with 54896 additions and 120193 deletions

1
.ackrc
View File

@ -1 +0,0 @@
--ignore-dir=Documentation

21
.gitignore vendored
View File

@ -2,7 +2,6 @@
!ROMFS/*/*.d
!ROMFS/*/*/*.d
!ROMFS/*/*/*/*.d
*.px4log
*.dSYM
*.o
*.pyc
@ -18,15 +17,10 @@
.~lock.*
Archives/*
Build/*
Testing/
build/*
build_*/
core
cscope.out
cscope.in.out
cscope.po.out
Firmware.sublime-workspace
user.sublime*
Images/*.bin
Images/*.px4
mavlink/include/mavlink/v0.9/
@ -58,18 +52,3 @@ src/platforms/posix/px4_messages/
src/platforms/posix-arm/px4_messages/
src/platforms/qurt/px4_messages/
ROMFS/*/*/rc.autostart
rootfs/
*.autosave
CMakeLists.txt.user
GPATH
GRTAGS
GTAGS
*.config
*.creator
*.creator.user
*.files
*.includes
# uavcan firmware
ROMFS/px4fmu_common/uavcan/
vectorcontrol/

38
.gitmodules vendored
View File

@ -4,8 +4,8 @@
[submodule "NuttX"]
path = NuttX
url = git://github.com/PX4/NuttX.git
[submodule "src/modules/uavcan/libuavcan"]
path = src/modules/uavcan/libuavcan
[submodule "libuavcan"]
path = src/lib/uavcan
url = git://github.com/UAVCAN/libuavcan.git
[submodule "Tools/genmsg"]
path = Tools/genmsg
@ -13,31 +13,9 @@
[submodule "Tools/gencpp"]
path = Tools/gencpp
url = https://github.com/ros/gencpp.git
[submodule "Tools/jMAVSim"]
path = Tools/jMAVSim
url = https://github.com/PX4/jMAVSim.git
[submodule "Tools/sitl_gazebo"]
path = Tools/sitl_gazebo
url = https://github.com/PX4/sitl_gazebo.git
[submodule "unittests/googletest"]
path = unittests/googletest
url = https://github.com/google/googletest.git
ignore = untracked
[submodule "src/lib/matrix"]
path = src/lib/matrix
url = https://github.com/PX4/Matrix.git
[submodule "src/lib/DriverFramework"]
path = src/lib/DriverFramework
url = https://github.com/PX4/DriverFramework.git
[submodule "src/lib/ecl"]
path = src/lib/ecl
url = https://github.com/PX4/ecl.git
[submodule "cmake/cmake_hexagon"]
path = cmake/cmake_hexagon
url = https://github.com/ATLFlight/cmake_hexagon
[submodule "src/drivers/gps/devices"]
path = src/drivers/gps/devices
url = https://github.com/PX4/GpsDrivers.git
[submodule "mavlink/include/mavlink/v2.0"]
path = mavlink/include/mavlink/v2.0
url = git://github.com/mavlink/c_library.git
[submodule "unittests/gtest"]
path = unittests/gtest
url = https://github.com/sjwilks/gtest.git
[submodule "src/lib/eigen"]
path = src/lib/eigen
url = https://github.com/PX4/eigen.git

View File

@ -3,18 +3,8 @@
language: cpp
matrix:
fast_finish: true
include:
- os: linux
sudo: false
env: GCC_VER=4.8
- os: linux
sudo: false
env: GCC_VER=4.9
- os: osx
osx_image: xcode7
sudo: true
# use travis-ci docker based infrastructure
sudo: false
cache:
directories:
@ -23,74 +13,45 @@ cache:
addons:
apt:
sources:
- kubuntu-backports
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
packages:
- build-essential
- ccache
- clang-3.5
- cmake
- g++-4.9
- gcc-4.9
- clang-3.5
- g++-4.8
- gcc-4.8
- genromfs
- libc6-i386
- libncurses5-dev
- ninja-build
- python-argparse
- python-empy
- python-serial
- s3cmd
- texinfo
- zlib1g-dev
before_install:
- cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --all --tags
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
pushd .
&& cd ~ && mkdir gcc && cd gcc
&& if [ "$GCC_VER" = "4.8" ]; then GCC_URL="https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2" ; fi
&& if [ "$GCC_VER" = "4.9" ]; then GCC_URL="https://launchpad.net/gcc-arm-embedded/4.9/4.9-2014-q4-major/+download/gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2" ; fi
&& wget -O gcc.tar.bz2 ${GCC_URL}
&& tar -jxf gcc.tar.bz2 --strip 1
&& exportline="export PATH=$HOME/gcc/bin:\$PATH"
&& if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
&& . ~/.profile
&& popd
&& git clone git://github.com/PX4/CI-Tools.git
&& ./CI-Tools/s3cmd-configure
&& mkdir -p ~/bin
&& wget -O ~/bin/astyle https://github.com/PX4/astyle/releases/download/2.05.1/astyle-linux && chmod +x ~/bin/astyle
&& astyle --version
&& if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
;
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew tap PX4/homebrew-px4
&& brew update; brew update
&& brew install cmake ninja
&& brew install genromfs
&& sudo easy_install pip
&& sudo pip install empy
;
fi
before_script:
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
# General toolchain dependencies
- pushd .
- cd ~
- wget https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2
- tar -jxf gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2
- exportline="export PATH=$HOME/gcc-arm-none-eabi-4_8-2014q3/bin:\$PATH"
- if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
- . ~/.profile
- popd
# setup ccache
- mkdir -p ~/bin
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-g++
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-gcc
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-size
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-objcopy
- ln -s /usr/bin/ccache ~/bin/clang++
- ln -s /usr/bin/ccache ~/bin/clang++-3.4
- ln -s /usr/bin/ccache ~/bin/clang++-3.5
- ln -s /usr/bin/ccache ~/bin/clang
- ln -s /usr/bin/ccache ~/bin/clang-3.4
- ln -s /usr/bin/ccache ~/bin/clang-3.5
- ln -s /usr/bin/ccache ~/bin/g++-4.8
- ln -s /usr/bin/ccache ~/bin/gcc-4.8
- export PATH=~/bin:$PATH
env:
global:
- NINJA_BUILD=1
# AWS KEY: $PX4_AWS_KEY
- secure: "XknnZHWBbpHbN4f3fuAVwUztdLIu8ej4keC3aQSDofo3uw8AFEzojfsQsN9u77ShWSIV4iYJWh9C9ALkCx7TocJ+xYjiboo10YhM9lH/8u+EXjYWG6GHS8ua0wkir+cViSxoLNaMtmcb/rPTicJecAGANxLsIHyBAgTL3fkbLSA="
# AWS SECRET: $PX4_AWS_SECRET
@ -98,27 +59,41 @@ env:
- PX4_AWS_BUCKET=px4-travis
script:
- git submodule update --quiet --init --recursive
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
arm-none-eabi-gcc --version && make check VECTORCONTROL=1;
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
make check_posix_sitl_default;
fi
- ccache -z
- arm-none-eabi-gcc --version
- echo 'Building POSIX Firmware..' && echo -en 'travis_fold:start:script.1\\r'
- make posix -j4
- ccache -s
- echo -en 'travis_fold:end:script.1\\r'
- echo 'Running Tests..' && echo -en 'travis_fold:start:script.2\\r'
- make tests
- cat src/modules/systemlib/mixer/mixer_multirotor.generated.h
- echo -en 'travis_fold:end:script.2\\r'
- echo 'Building NuttX..' && echo -en 'travis_fold:start:script.3\\r'
- make archives
- ccache -s
- echo -en 'travis_fold:end:script.3\\r'
- echo 'Building NuttX Firmware..' && echo -en 'travis_fold:start:script.4\\r'
- make -j4
- make size
- ccache -s
- echo -en 'travis_fold:end:script.4\\r'
- zip Firmware.zip Images/*.px4
after_success:
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${GCC_VER}" = "4.8" ]]; then
make package_firmware
&& find . -name \*.px4 -exec cp "{}" . \;
&& find . -maxdepth 1 -mindepth 1 -type f -name 'nuttx-*-default.px4' | sed 's/.\/nuttx-//' | sed 's/-default.px4//' | xargs -I{} mv nuttx-{}-default.px4 {}_default.px4
&& ./CI-Tools/s3cmd-put `find . -maxdepth 1 -mindepth 1 -type f -name '*_default.px4'` build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/
&& ./CI-Tools/s3cmd-put Firmware.zip archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/
&& ./CI-Tools/s3cmd-put CI-Tools/directory/index.html archives/Firmware/$TRAVIS_BRANCH/
&& ./CI-Tools/s3cmd-put CI-Tools/index.html index.html
&& ./CI-Tools/s3cmd-put CI-Tools/timestamp.html timestamp.html
&& echo ""
&& echo "Binaries have been posted to:" https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip
;
fi
after_script:
- git clone git://github.com/PX4/CI-Tools.git
- ./CI-Tools/s3cmd-configure
# upload newest build for this branch with s3 index
- ./CI-Tools/s3cmd-put Images/px4*.px4 CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/
# archive newest build by date with s3 index
- ./CI-Tools/s3cmd-put Firmware.zip archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/
- ./CI-Tools/s3cmd-put CI-Tools/directory/index.html archives/Firmware/$TRAVIS_BRANCH/
# upload top level index.html and timestamp.html
- ./CI-Tools/s3cmd-put CI-Tools/index.html index.html
- ./CI-Tools/s3cmd-put CI-Tools/timestamp.html timestamp.html
- echo ""
- echo "Binaries have been posted to:"
- echo https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip
deploy:
provider: releases
@ -130,7 +105,6 @@ deploy:
tags: true
all_branches: true
repo: PX4/Firmware
condition: $GCC_VER = 4.8
notifications:
webhooks:
@ -138,7 +112,3 @@ notifications:
- https://webhooks.gitter.im/e/2b9c4a4cb2211f8befba
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
slack:
secure: "QKw73Zel/s3JAbe/7XyO9tPnJwiiGFpYzSjdR8lG3tYFjRdXZnhxG4c+G7bkgkaPTS4Hult33VXE3kcEqOI7+C+eRwRlZhDfL0knQbXVCxjcLjzmUFdoPOwurlgZDw66PFWCi5tZcLKSRo3u4U8ibT4WKi3jm9sDSyOcfBAucMU="
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always

View File

@ -1,382 +1,332 @@
############################################################################
#
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
cmake_minimum_required(VERSION 2.8.3)
project(px4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_definitions(-D__PX4_ROS)
add_definitions(-D__EXPORT=)
add_definitions(-DMAVLINK_DIALECT=common)
#=============================================================================
# CMAKE CODING STANDARD FOR PX4
#
# Structure
# ---------------------------------------------------------------------------
#
# * Common functions should be included in px_base.cmake.
#
# * OS/ board specific fucntions should be include in
# px_impl_${OS}.cmake or px4_impl_${OS}_${BOARD}.cmake.
#
# Formatting
# ---------------------------------------------------------------------------
#
# * Use hard indents to match the px4 source code.
#
# * All function and script arguments are upper case.
#
# * All local variables are lower case.
#
# * All cmake functions are lowercase.
#
# * For else, endif, endfunction, etc, never put the name of the statement
#
# Instead of the very confusing:
# if (${var} STREQUAL "1") <-- condition now becomes if name
# # do somthing
# elseif (${var} STREQUAL "2") <-- another condition
# # do somthing
# else (${var} STREQUAL "1") <-- tag is referring to name of if
# # do somthing
# endif (${var} STREQUAL "1") <-- tag is referring to name of if
#
# Do this:
# if (${var} STREQUAL "1") <-- condition now becomes if name
# # do somthing
# elseif (${var} STREQUAL "2") <-- another condition
# # do somthing
# else () <-- leave blank
# # do somthing
# endif () <-- leave blank
#
# Functions/Macros
# ---------------------------------------------------------------------------
#
# * Use px4_parse_function_args to parse functions and check for required
# arguments. Unless there is only one argument in the function and it is clear.
#
# * Never use macros. They allow overwriting global variables and this
# makes variable declarations hard to locate.
#
# * If a target from add_custom_* is set in a function, explicitly pass it
# as an output argument so that the target name is clear to the user.
#
# * Avoid use of global variables in functions. Functions in a nested
# scope may use global variables, but this makes it difficult to
# resuse functions.
#
# Included CMake Files
# ---------------------------------------------------------------------------
#
# * All variables in config files must have the prefix "config_".
#
# * Never set global variables in an included cmake file,
# you may only define functions. This excludes config and Toolchain files.
# This makes it clear to the user when variables are being set or targets
# are being created.
#
# * Setting a global variable in a CMakeLists.txt file is ok, because
# each CMakeLists.txt file has scope in the current directory and all
# subdirecties, so it is not truly global.
#
# * All toolchain files should be included in the cmake
# directory and named Toolchain-"name".cmake.
#
# Misc
# ---------------------------------------------------------------------------
#
# * If referencing a string variable, don't put it in quotes.
# Don't do "${OS}" STREQUAL "posix",
# instead type ${OS} STREQUAL "posix". This will throw an
# error when ${OS} is not defined instead of silently
# evaluating to false.
#
#=============================================================================
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
geometry_msgs
message_generation
cmake_modules
gazebo_msgs
sensor_msgs
mav_msgs
libmavconn
tf
)
find_package(Eigen REQUIRED)
# Warning: Changing this modifies CMake's internal workings
# and leads to wrong toolchain detection
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
# Use clang
#SET (CMAKE_C_COMPILER /usr/bin/clang-3.6)
#SET (CMAKE_CXX_COMPILER /usr/bin/clang++-3.6)
#=============================================================================
# parameters
#
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
set(CMAKE_BUILD_TYPE "" CACHE STRING "build type")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS ";Debug;Release;RelWithDebInfo;MinSizeRel")
set(CONFIG "nuttx_px4fmu-v2_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")
################################################
## Declare ROS messages, services and actions ##
################################################
#=============================================================================
# configuration
#
# must come before project to set toolchain
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependencies might have been
## pulled in transitively but can be declared for certainty nonetheless:
## * add a build_depend tag for "message_generation"
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
string(REPLACE "_" ";" config_args ${CONFIG})
list(GET config_args 0 OS)
list(GET config_args 1 BOARD)
list(GET config_args 2 LABEL)
set(target_name "${OS}-${BOARD}-${LABEL}")
## Generate messages in the 'msg' folder
add_message_files(
FILES
rc_channels.msg
vehicle_attitude.msg
vehicle_attitude_setpoint.msg
manual_control_setpoint.msg
actuator_controls.msg
actuator_controls_0.msg
actuator_controls_virtual_mc.msg
vehicle_rates_setpoint.msg
mc_virtual_rates_setpoint.msg
vehicle_attitude.msg
vehicle_control_mode.msg
actuator_armed.msg
parameter_update.msg
vehicle_status.msg
vehicle_local_position.msg
position_setpoint.msg
position_setpoint_triplet.msg
vehicle_local_position_setpoint.msg
vehicle_global_velocity_setpoint.msg
offboard_control_mode.msg
vehicle_force_setpoint.msg
distance_sensor.msg
)
message(STATUS "${target_name}")
## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )
# switch to ros CMake file if building ros
if (${OS} STREQUAL "ros")
include("cmake/ros-CMakeLists.txt")
else() # otherwise use the rest of this file
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set(config_module "configs/${CONFIG}")
include(${config_module})
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
gazebo_msgs
)
# cmake modules
include(ExternalProject)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS src/include
LIBRARIES px4
CATKIN_DEPENDS message_runtime roscpp rospy std_msgs libmavconn
DEPENDS system_lib
)
# require px4 module interface
set(px4_required_interface
px4_os_prebuild_targets
px4_os_add_flags
)
foreach(cmd ${px4_required_interface})
if(NOT COMMAND ${cmd})
message(FATAL_ERROR "${config_module} must implement ${cmd}")
endif()
endforeach()
set(px4_required_config
config_module_list
)
foreach(conf ${px4_required_config})
if(NOT DEFINED ${conf})
message(FATAL_ERROR "cmake/${config_module} must define ${conf}")
endif()
endforeach()
###########
## Build ##
###########
# List the DriverFramework drivers
if(DEFINED config_df_driver_list)
message("DF Drivers: ${config_df_driver_list}")
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
${catkin_INCLUDE_DIRS}
src/platforms
src/platforms/ros/px4_messages
src/include
src/modules
src/
src/lib
${EIGEN_INCLUDE_DIRS}
integrationtests
)
## generate multiplatform wrapper headers
## note that the message header files are generated as in any ROS project with generate_messages()
set(MULTIPLATFORM_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/ros/px4_messages)
set(MULTIPLATFORM_TEMPLATE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/msg/templates/px4/ros)
set(TOPICHEADER_TEMP_DIR ${CMAKE_BINARY_DIR}/topics_temporary)
set(MULTIPLATFORM_PREFIX px4_)
add_custom_target(multiplatform_message_headers ALL ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Tools/px_generate_uorb_topic_headers.py
-d ${CMAKE_CURRENT_SOURCE_DIR}/msg -o ${MULTIPLATFORM_HEADER_DIR} -e ${MULTIPLATFORM_TEMPLATE_DIR}
-t ${TOPICHEADER_TEMP_DIR} -p ${MULTIPLATFORM_PREFIX})
## Declare a cpp library
add_library(px4
src/platforms/ros/px4_ros_impl.cpp
src/platforms/ros/perf_counter.cpp
src/platforms/ros/geo.cpp
src/lib/mathlib/math/Limits.cpp
src/modules/systemlib/circuit_breaker.cpp
)
add_dependencies(px4 ${PROJECT_NAME}_generate_messages_cpp multiplatform_message_headers)
target_link_libraries(px4
${catkin_LIBRARIES}
)
## Declare a test publisher
add_executable(publisher
src/examples/publisher/publisher_main.cpp
src/examples/publisher/publisher_example.cpp)
add_dependencies(publisher ${PROJECT_NAME}_generate_messages_cpp multiplatform_message_headers)
target_link_libraries(publisher
${catkin_LIBRARIES}
px4
)
## Declare a test subscriber
add_executable(subscriber
src/examples/subscriber/subscriber_main.cpp
src/examples/subscriber/subscriber_example.cpp)
add_dependencies(subscriber ${PROJECT_NAME}_generate_messages_cpp multiplatform_message_headers)
target_link_libraries(subscriber
${catkin_LIBRARIES}
px4
)
## MC Attitude Control
add_executable(mc_att_control
src/modules/mc_att_control_multiplatform/mc_att_control_main.cpp
src/modules/mc_att_control_multiplatform/mc_att_control.cpp
src/modules/mc_att_control_multiplatform/mc_att_control_base.cpp)
add_dependencies(mc_att_control ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(mc_att_control
${catkin_LIBRARIES}
px4
)
## MC Position Control
add_executable(mc_pos_control
src/modules/mc_pos_control_multiplatform/mc_pos_control_main.cpp
src/modules/mc_pos_control_multiplatform/mc_pos_control.cpp)
add_dependencies(mc_pos_control ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(mc_pos_control
${catkin_LIBRARIES}
px4
)
## Attitude Estimator dummy
add_executable(attitude_estimator
src/platforms/ros/nodes/attitude_estimator/attitude_estimator.cpp)
add_dependencies(attitude_estimator ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(attitude_estimator
${catkin_LIBRARIES}
px4
)
## Position Estimator dummy
add_executable(position_estimator
src/platforms/ros/nodes/position_estimator/position_estimator.cpp)
add_dependencies(position_estimator ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(position_estimator
${catkin_LIBRARIES}
px4
)
## Manual input
add_executable(manual_input
src/platforms/ros/nodes/manual_input/manual_input.cpp)
add_dependencies(manual_input ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(manual_input
${catkin_LIBRARIES}
px4
)
## Multicopter Mixer dummy
add_executable(mc_mixer
src/platforms/ros/nodes/mc_mixer/mc_mixer.cpp)
add_dependencies(mc_mixer ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(mc_mixer
${catkin_LIBRARIES}
px4
)
## Commander dummy
add_executable(commander
src/platforms/ros/nodes/commander/commander.cpp)
add_dependencies(commander ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(commander
${catkin_LIBRARIES}
px4
)
## Mavlink dummy
add_executable(mavlink
src/platforms/ros/nodes/mavlink/mavlink.cpp)
add_dependencies(mavlink ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(mavlink
${catkin_LIBRARIES}
px4
)
## Offboard Position Setpoint Demo
add_executable(demo_offboard_position_setpoints
src/platforms/ros/nodes/demo_offboard_position_setpoints/demo_offboard_position_setpoints.cpp)
add_dependencies(demo_offboard_position_setpoints ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(demo_offboard_position_setpoints
${catkin_LIBRARIES}
px4
)
## Offboard Attitude Setpoint Demo
add_executable(demo_offboard_attitude_setpoints
src/platforms/ros/nodes/demo_offboard_attitude_setpoints/demo_offboard_attitude_setpoints.cpp)
add_dependencies(demo_offboard_attitude_setpoints ${PROJECT_NAME}_generate_messages_cpp_cpp)
target_link_libraries(demo_offboard_attitude_setpoints
${catkin_LIBRARIES}
px4
)
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark executables and/or libraries for installation
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_px4test.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest(integrationtests/demo_tests/direct_tests.launch)
add_rostest(integrationtests/demo_tests/mavros_tests.launch)
endif()
#=============================================================================
# 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 0)
set(version_patch 1)
set(version "${version_major}.${version_minor}.${version_patch}")
set(package-contact "px4users@googlegroups.com")
#=============================================================================
# programs
#
find_package(PythonInterp REQUIRED)
#=============================================================================
# cmake modules
#
enable_testing()
#=============================================================================
# check required toolchain variables
#
set(required_variables
CMAKE_C_COMPILER_ID
)
foreach(var ${required_variables})
if (NOT ${var})
message(FATAL_ERROR "Toolchain/config must define ${var}")
endif()
endforeach()
#=============================================================================
# git
#
px4_add_git_submodule(TARGET git_genmsg PATH "Tools/genmsg")
px4_add_git_submodule(TARGET git_gencpp PATH "Tools/gencpp")
px4_add_git_submodule(TARGET git_mavlink PATH "mavlink/include/mavlink/v1.0")
px4_add_git_submodule(TARGET git_gtest PATH "unittets/gtest")
px4_add_git_submodule(TARGET git_uavcan PATH "src/modules/uavcan/libuavcan")
px4_add_git_submodule(TARGET git_nuttx PATH "NuttX")
px4_add_git_submodule(TARGET git_driverframework PATH "src/lib/DriverFramework")
px4_add_git_submodule(TARGET git_ecl PATH "src/lib/ecl")
px4_add_git_submodule(TARGET git_jmavsim PATH "Tools/jMAVSim")
px4_add_git_submodule(TARGET git_gazebo PATH "Tools/sitl_gazebo")
px4_add_git_submodule(TARGET git_matrix PATH "src/lib/matrix")
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "cmake/cmake_hexagon")
add_custom_target(submodule_clean
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
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 ${CMAKE_SOURCE_DIR}
)
add_custom_target(config
COMMAND cmake-gui .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
#=============================================================================
# external libraries
#
px4_os_prebuild_targets(OUT prebuild_targets
BOARD ${BOARD}
THREADS ${THREADS})
#=============================================================================
# build flags
#
px4_os_add_flags(
BOARD ${BOARD}
C_FLAGS c_flags
CXX_FLAGS cxx_flags
EXE_LINKER_FLAGS exe_linker_flags
INCLUDE_DIRS include_dirs
LINK_DIRS link_dirs
DEFINITIONS definitions)
px4_join(OUT CMAKE_EXE_LINKER_FLAGS LIST "${exe_linker_flags}" GLUE " ")
px4_join(OUT CMAKE_C_FLAGS LIST "${c_flags}" GLUE " ")
px4_join(OUT CMAKE_CXX_FLAGS LIST "${cxx_flags}" GLUE " ")
include_directories(${include_dirs})
#message("INCLUDE_DIRS=${include_dirs}")
link_directories(${link_dirs})
add_definitions(${definitions})
#=============================================================================
# source code generation
#
add_subdirectory(msg)
px4_generate_messages(TARGET msg_gen
MSG_FILES ${msg_files}
OS ${OS}
DEPENDS git_genmsg git_gencpp prebuild_targets
)
px4_generate_parameters_xml(OUT parameters.xml BOARD ${BOARD})
px4_generate_airframes_xml(OUT airframes.xml BOARD ${BOARD})
add_custom_target(xml_gen
DEPENDS parameters.xml airframes.xml)
#=============================================================================
# external projects
#
set(ep_base ${CMAKE_BINARY_DIR}/external)
set_property(DIRECTORY PROPERTY EP_BASE ${ep_base})
# add external project install folders to build
link_directories(${ep_base}/Install/lib)
include_directories(${ep_base}/Install/include)
# add the directories so cmake won't warn
execute_process(COMMAND cmake -E make_directory ${ep_base}/Install/lib)
execute_process(COMMAND cmake -E make_directory ${ep_base}/Install/include)
#=============================================================================
# DriverFramework Drivers
#
set(df_driver_libs)
foreach(driver ${config_df_driver_list})
add_subdirectory(src/lib/DriverFramework/drivers/${driver})
list(APPEND df_driver_libs df_${driver})
message("Adding DF driver: ${driver}")
endforeach()
#=============================================================================
# subdirectories
#
set(module_libraries)
foreach(module ${config_module_list})
string(REGEX MATCH "^[./]" external_module ${module})
if(external_module)
STRING(REGEX REPLACE "//" "/" EXT_MODULE ${module})
STRING(REGEX REPLACE "/" "__" EXT_MODULE_PREFIX ${EXT_MODULE})
add_subdirectory(${module} ${CMAKE_BINARY_DIR}/${EXT_MODULE_PREFIX})
else()
add_subdirectory(src/${module})
endif()
px4_mangle_name(${module} mangled_name)
list(APPEND module_libraries ${mangled_name})
#message(STATUS "adding module: ${module}")
endforeach()
# Keep track of external shared libs required for modules
set(module_external_libraries "${module_external_libraries}" CACHE INTERNAL "module_external_libraries")
add_subdirectory(src/firmware/${OS})
#add_dependencies(df_driver_framework nuttx_export_${CONFIG}.stamp)
if (NOT "${OS}" STREQUAL "nuttx")
endif()
if (config_io_board)
add_subdirectory(src/modules/px4iofirmware)
endif()
#=============================================================================
# generate git version
#
px4_create_git_hash_header(HEADER ${CMAKE_BINARY_DIR}/build_git_version.h)
#=============================================================================
# packaging
#
# Important to having packaging at end of cmake file.
#
set(CPACK_PACKAGE_VERSION ${version})
set(CPACK_PACKAGE_CONTACT ${package_contact})
set(CPACK_GENERATOR "ZIP")
set(CPACK_SOURCE_GENERATOR "ZIP")
include(CPack)
endif() # ros alternative endif
# vim: set noet fenc=utf-8 ff=unix ft=cmake :

View File

@ -16,7 +16,7 @@ git checkout -b mydescriptivebranchname
### Edit and build the code
The [developer guide](http://dev.px4.io/) explains how to set up the development environment on Mac OS, Linux or Windows. Please take note of our [coding style](http://px4.io/dev/code_style) when editing files.
The [developer guide](http://px4.io/dev/start) explains how to set up the development environment on Mac OS, Linux or Windows. Please take note of our [coding style](http://px4.io/dev/code_style) when editing files.
### Commit your changes

View File

@ -281,7 +281,7 @@ TYPEDEF_HIDES_STRUCT = NO
# causing a significant performance penality.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will roughly double the
# a logarithmic scale so increasing the size by one will rougly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols
@ -599,7 +599,8 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = ../src/modules/attitude_estimator_ekf/codegen
EXCLUDE = ../src/lib/mathlib/CMSIS \
../src/modules/attitude_estimator_ekf/codegen
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded

View File

@ -9,7 +9,7 @@ http://www.stack.nl/~dimitri/doxygen/download.html for the correct download.
Then go to the following website for inforamtion on the install:
http://www.stack.nl/~dimitri/doxygen/install.html
Then to generate the html, run the following code while you are in this directory:
Then to generate the html, run the following code while you are in the qgroundcontrol/doc directory:
$doxygen Doxyfile
The html file index.html should be in doc/html unless you changed the output directory.

View File

@ -48,7 +48,7 @@ Download QGC from http://qgroundcontrol.org/downloads and install using the wind
## PX4
### Platform Requirements
### Platfrom Requirements
Linux or Eagle with a working IP interface (?? does this need further instructions?)
### Build Host Requirements

View File

@ -33,20 +33,7 @@
{
"tab_size": 8,
"translate_tabs_to_spaces": false,
"highlight_line": true,
"AStyleFormatter":
{
"options_c":
{
"use_only_additional_options": true,
"additional_options_file": "${project_path}/Tools/astylerc"
},
"options_c++":
{
"use_only_additional_options": true,
"additional_options_file": "${project_path}/Tools/astylerc"
}
}
"highlight_line": true
},
"build_systems":
[
@ -70,13 +57,6 @@
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"cmd": ["make posix"],
"shell": true
},
{
"name": "MindPX_V2: make and upload",
"working_dir": "${project_path}",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"cmd": ["make upload mindpx-v2_default -j8"],
"shell": true
}
]
}

View File

@ -1,12 +0,0 @@
{
"board_id": 88,
"magic": "MindPX",
"description": "Firmware for the MindPXFMUv2 board",
"image": "",
"build_time": 0,
"summary": "MindPXFMUv2",
"version": "2.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}

View File

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

531
Makefile
View File

@ -1,6 +1,5 @@
############################################################################
#
# Copyright (c) 2015 - 2016 PX4 Development Team. All rights reserved.
# Copyright (c) 2012-2015 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,301 +28,273 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
# Enforce the presence of the GIT repository
#
# We depend on our submodules, so we have to prevent attempts to
# compile without it being present.
ifeq ($(wildcard .git),)
$(error YOU HAVE TO USE GIT TO DOWNLOAD THIS REPOSITORY. ABORTING.)
# Top-level Makefile for building PX4 firmware images.
#
TARGETS := nuttx posix posix-arm qurt
EXPLICIT_TARGET := $(filter $(TARGETS),$(MAKECMDGOALS))
ifneq ($(EXPLICIT_TARGET),)
export PX4_TARGET_OS=$(EXPLICIT_TARGET)
export GOALS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
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, 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.3/cmake-3.3.2-Linux-x86_64.sh)
$(warning chmod +x cmake-3.3.2-Linux-x86_64.sh)
$(warning sudo mkdir /opt/cmake-3.3.2)
$(warning sudo ./cmake-3.3.2-Linux-x86_64.sh --prefix=/opt/cmake-3.3.2 --exclude-subdir)
$(warning export PATH=/opt/cmake-3.3.2/bin:$$PATH)
$(warning )
$(error Fatal)
#
# Get path and tool configuration
#
export PX4_BASE := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))/
include $(PX4_BASE)makefiles/setup.mk
#
# Get a version string provided by git
# This assumes that git command is available and that
# the directory holding this file also contains .git directory
#
GIT_DESC := $(shell git log -1 --pretty=format:%H)
ifneq ($(words $(GIT_DESC)),1)
GIT_DESC := "unknown_git_version"
endif
# Help
# --------------------------------------------------------------------
# Don't be afraid of this makefile, it is just passing
# arguments to cmake to allow us to keep the wiki pages etc.
# that describe how to build the px4 firmware
# the same even when using cmake instead of make.
#
# Example usage:
#
# make px4fmu-v2_default (builds)
# make px4fmu-v2_default upload (builds and uploads)
# make px4fmu-v2_default test (builds and tests)
#
# This tells cmake to build the nuttx px4fmu-v2 default config in the
# directory build_nuttx_px4fmu-v2_default and then call make
# in that directory with the target upload.
GIT_DESC_SHORT := $(shell echo $(GIT_DESC) | cut -c1-16)
# explicity set default build target
all: px4fmu-v2_default
#
# Canned firmware configurations that we (know how to) build.
#
KNOWN_CONFIGS := $(subst config_,,$(basename $(notdir $(wildcard $(PX4_MK_DIR)/$(PX4_TARGET_OS)/config_*.mk))))
CONFIGS ?= $(KNOWN_CONFIGS)
# Parsing
# --------------------------------------------------------------------
# assume 1st argument passed is the main target, the
# rest are arguments to pass to the makefile generated
# by cmake in the subdirectory
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
j ?= 4
#
# Boards that we (know how to) build NuttX export kits for.
#
KNOWN_BOARDS := $(subst board_,,$(basename $(notdir $(wildcard $(PX4_MK_DIR)/$(PX4_TARGET_OS)/board_*.mk))))
BOARDS ?= $(KNOWN_BOARDS)
NINJA_BUILD := $(shell ninja --version 2>/dev/null)
ifdef NINJA_BUILD
PX4_CMAKE_GENERATOR ?= "Ninja"
PX4_MAKE = ninja
PX4_MAKE_ARGS =
#
# Debugging
#
MQUIET = --no-print-directory
#MQUIET = --print-directory
################################################################################
# No user-serviceable parts below
################################################################################
#
# If the user has listed a config as a target, strip it out and override CONFIGS.
#
FIRMWARE_GOAL = firmware
EXPLICIT_CONFIGS := $(filter $(CONFIGS),$(MAKECMDGOALS))
ifneq ($(EXPLICIT_CONFIGS),)
CONFIGS := $(EXPLICIT_CONFIGS)
.PHONY: $(EXPLICIT_CONFIGS)
$(EXPLICIT_CONFIGS): all
#
# If the user has asked to upload, they must have also specified exactly one
# config.
#
ifneq ($(filter upload,$(MAKECMDGOALS)),)
ifneq ($(words $(EXPLICIT_CONFIGS)),1)
$(error In order to upload, exactly one board config must be specified)
endif
FIRMWARE_GOAL = upload
.PHONY: upload
upload:
@:
endif
endif
ifeq ($(PX4_TARGET_OS),nuttx)
include $(PX4_BASE)makefiles/nuttx/firmware_nuttx.mk
endif
ifeq ($(PX4_TARGET_OS),posix)
include $(PX4_BASE)makefiles/posix/firmware_posix.mk
endif
ifeq ($(PX4_TARGET_OS),posix-arm)
include $(PX4_BASE)makefiles/posix/firmware_posix.mk
endif
ifeq ($(PX4_TARGET_OS),qurt)
include $(PX4_BASE)makefiles/qurt/firmware_qurt.mk
endif
#
# Versioning
#
GIT_VER_FILE = $(PX4_VERSIONING_DIR).build_git_ver
GIT_HEADER_FILE = $(PX4_VERSIONING_DIR)build_git_version.h
$(GIT_VER_FILE) :
$(Q) if [ ! -f $(GIT_VER_FILE) ]; then \
$(MKDIR) -p $(PX4_VERSIONING_DIR); \
$(ECHO) "" > $(GIT_VER_FILE); \
fi
.PHONY: checkgitversion
checkgitversion: $(GIT_VER_FILE)
$(Q) if [ "$(GIT_DESC)" != "$(shell cat $(GIT_VER_FILE))" ]; then \
$(ECHO) "/* Auto Magically Generated file */" > $(GIT_HEADER_FILE); \
$(ECHO) "/* Do not edit! */" >> $(GIT_HEADER_FILE); \
$(ECHO) "#define PX4_GIT_VERSION_STR \"$(GIT_DESC)\"" >> $(GIT_HEADER_FILE); \
$(ECHO) "#define PX4_GIT_VERSION_BINARY 0x$(GIT_DESC_SHORT)" >> $(GIT_HEADER_FILE); \
$(ECHO) $(GIT_DESC) > $(GIT_VER_FILE); \
fi
#
# Sizes
#
.PHONY: size
size:
$(Q) for elfs in Build/*; do if [ -f $$elfs/firmware.elf ]; then $(SIZE) $$elfs/firmware.elf; fi done
#
# Submodule Checks
#
.PHONY: checksubmodules
checksubmodules:
$(Q) ($(PX4_BASE)/Tools/check_submodules.sh)
.PHONY: updatesubmodules
updatesubmodules:
$(Q) (git submodule init)
$(Q) (git submodule update)
MSG_DIR = $(PX4_BASE)msg
UORB_TEMPLATE_DIR = $(PX4_BASE)msg/templates/uorb
MULTIPLATFORM_TEMPLATE_DIR = $(PX4_BASE)msg/templates/px4/uorb
TOPICS_DIR = $(PX4_BASE)src/modules/uORB/topics
MULTIPLATFORM_HEADER_DIR = $(PX4_BASE)src/platforms/$(PX4_TARGET_OS)/px4_messages
MULTIPLATFORM_PREFIX = px4_
TOPICHEADER_TEMP_DIR = $(BUILD_DIR)topics_temporary
MULTI_TOPICHEADER_TEMP_DIR = $(BUILD_DIR)multi_topics_temporary
GENMSG_PYTHONPATH = $(PX4_BASE)Tools/genmsg/src
GENCPP_PYTHONPATH = $(PX4_BASE)Tools/gencpp/src
.PHONY: generateuorbtopicheaders
generateuorbtopicheaders: checksubmodules
@$(ECHO) "Generating uORB topic headers"
$(Q) (PYTHONPATH=$(GENMSG_PYTHONPATH):$(GENCPP_PYTHONPATH):$(PYTHONPATH) $(PYTHON) \
$(PX4_BASE)Tools/px_generate_uorb_topic_headers.py \
-d $(MSG_DIR) -o $(TOPICS_DIR) -e $(UORB_TEMPLATE_DIR) -t $(TOPICHEADER_TEMP_DIR))
@$(ECHO) "Generating multiplatform uORB topic wrapper headers"
$(Q) (PYTHONPATH=$(GENMSG_PYTHONPATH):$(GENCPP_PYTHONPATH):$(PYTHONPATH) $(PYTHON) \
$(PX4_BASE)Tools/px_generate_uorb_topic_headers.py \
-d $(MSG_DIR) -o $(MULTIPLATFORM_HEADER_DIR) -e $(MULTIPLATFORM_TEMPLATE_DIR) -t $(MULTI_TOPICHEADER_TEMP_DIR) -p $(MULTIPLATFORM_PREFIX))
#
# Testing targets
#
testbuild:
$(Q) (cd $(PX4_BASE) && $(MAKE) distclean && $(MAKE) archives && $(MAKE) -j8)
$(Q) (zip -r Firmware.zip $(PX4_BASE)/Images)
nuttx posix posix-arm qurt:
ifeq ($(GOALS),)
$(MAKE) PX4_TARGET_OS=$@ $(GOALS)
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
export PX4_TARGET_OS=$@
endif
# Functions
# --------------------------------------------------------------------
# describe how to build a cmake config
define cmake-build
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(PWD)/build_$@); fi
+@Tools/check_submodules.sh
+@(echo "PX4 CONFIG: $@" && cd $(PWD)/build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
endef
sitl_quad:
$(Q) Tools/sitl_run.sh posix-configs/SITL/init/rcS
sitl_quad_gazebo:
$(Q) Tools/sitl_run.sh posix-configs/SITL/init/rc_iris_ros
sitl_plane:
$(Q) Tools/sitl_run.sh posix-configs/SITL/init/rc.fixed_wing
define cmake-build-other
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake $(2) -G$(PX4_CMAKE_GENERATOR) || (cd .. && rm -rf $(PWD)/build_$@); fi
+@(cd $(PWD)/build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
endef
qurtrun:
$(MAKE) PX4_TARGET_OS=qurt sim
# create empty targets to avoid msgs for targets passed to cmake
define cmake-targ
$(1):
@#
.PHONY: $(1)
endef
define colorecho
@tput setaf 6
@echo $1
@tput sgr0
endef
# ADD CONFIGS HERE
# --------------------------------------------------------------------
# Do not put any spaces between function arguments.
px4fmu-v1_default:
$(call cmake-build,nuttx_px4fmu-v1_default)
px4fmu-v2_default:
$(call cmake-build,nuttx_px4fmu-v2_default)
px4fmu-v2_test:
$(call cmake-build,nuttx_px4fmu-v2_test)
px4fmu-v4_default:
$(call cmake-build,nuttx_px4fmu-v4_default)
px4-stm32f4discovery_default:
$(call cmake-build,nuttx_px4-stm32f4discovery_default)
px4fmu-v2_ekf2:
$(call cmake-build,nuttx_px4fmu-v2_ekf2)
mindpx-v2_default:
$(call cmake-build,nuttx_mindpx-v2_default)
posix_sitl_default:
$(call cmake-build,$@)
posix_sitl_test:
$(call cmake-build,$@)
posix_sitl_replay:
$(call cmake-build,$@)
posix_sitl_broadcast:
$(call cmake-build,$@)
ros_sitl_default:
@echo "This target is deprecated. Use make 'posix_sitl_default gazebo' instead."
qurt_eagle_travis:
$(call cmake-build,$@)
qurt_eagle_default:
$(call cmake-build,$@)
posix_eagle_default:
$(call cmake-build,$@)
eagle_default: posix_eagle_default qurt_eagle_default
eagle_legacy_default: posix_eagle_legacy_driver_default qurt_eagle_legacy_driver_default
qurt_eagle_legacy_driver_default:
$(call cmake-build,$@)
posix_eagle_legacy_driver_default:
$(call cmake-build,$@)
qurt_excelsior_default:
$(call cmake-build,$@)
posix_excelsior_default:
$(call cmake-build,$@)
excelsior_default: posix_excelsior_default qurt_excelsior_default
posix_rpi2_default:
$(call cmake-build,$@)
posix_rpi2_release:
$(call cmake-build,$@)
posix_bebop_default:
$(call cmake-build,$@)
posix: posix_sitl_default
broadcast: posix_sitl_broadcast
sitl_deprecation:
@echo "Deprecated. Use 'make posix_sitl_default jmavsim' or"
@echo "'make posix_sitl_default gazebo' if Gazebo is preferred."
run_sitl_quad: sitl_deprecation
run_sitl_plane: sitl_deprecation
run_sitl_ros: sitl_deprecation
# Other targets
# --------------------------------------------------------------------
.PHONY: gazebo_build uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean
.NOTPARALLEL: gazebo_build uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean
gazebo_build:
@mkdir -p build_gazebo
@if [ ! -e $(PWD)/build_gazebo/CMakeCache.txt ];then cd build_gazebo && cmake -Wno-dev -G$(PX4_CMAKE_GENERATOR) $(PWD)/Tools/sitl_gazebo; fi
@cd build_gazebo && $(PX4_MAKE) $(PX4_MAKE_ARGS)
@cd build_gazebo && $(PX4_MAKE) $(PX4_MAKE_ARGS) sdf
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
checks_defaults: \
check_px4fmu-v1_default \
check_px4fmu-v2_default \
check_mindpx-v2_default \
check_px4-stm32f4discovery_default \
checks_bootloaders: \
checks_tests: \
check_px4fmu-v2_test
checks_alts: \
check_px4fmu-v2_ekf2 \
checks_uavcan: \
check_px4fmu-v4_default_and_uavcan
checks_sitls: \
check_posix_sitl_default \
check_posix_sitl_test \
checks_last: \
check_unittest \
check_format \
check: checks_defaults checks_tests checks_alts checks_uavcan checks_bootloaders checks_sitls checks_last
#
# Unittest targets. Builds and runs the host-level
# unit tests.
.PHONY: tests
tests: generateuorbtopicheaders
$(Q) (mkdir -p $(PX4_BASE)/unittests/build && cd $(PX4_BASE)/unittests/build && cmake .. && $(MAKE) unittests)
.PHONY: format check_format
check_format:
$(call colorecho,"Checking formatting with astyle")
@./Tools/fix_code_style.sh
@./Tools/check_code_style_all.sh
$(Q) (./Tools/check_code_style.sh | sort -n)
check_%:
@echo
$(call colorecho,"Building" $(subst check_,,$@))
@$(MAKE) --no-print-directory $(subst check_,,$@)
@echo
#
# Cleanup targets. 'clean' should remove all built products and force
# a complete re-compilation, 'distclean' should remove everything
# that's generated leaving only files that are in source control.
#
.PHONY: clean
clean:
@echo > /dev/null
$(Q) $(RMDIR) $(BUILD_DIR)*.build
$(Q) $(RMDIR) $(PX4_VERSIONING_DIR)
$(Q) $(REMOVE) $(IMAGE_DIR)*.px4
$(Q) $(RMDIR) $(TOPICHEADER_TEMP_DIR)
$(Q) $(RMDIR) $(MULTI_TOPICHEADER_TEMP_DIR)
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
.PHONY: distclean
distclean: clean
@echo > /dev/null
$(Q) $(REMOVE) $(ARCHIVE_DIR)*.export
$(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean
$(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete)
#
# Print some help text
#
.PHONY: help
help:
@$(ECHO) ""
@$(ECHO) " PX4 firmware builder"
@$(ECHO) " ===================="
@$(ECHO) ""
@$(ECHO) " Available targets:"
@$(ECHO) " ------------------"
@$(ECHO) ""
ifeq ($(PX4_TARGET_OS),nuttx)
@$(ECHO) " archives"
@$(ECHO) " Build the NuttX RTOS archives that are used by the firmware build."
@$(ECHO) ""
endif
@$(ECHO) " all"
@$(ECHO) " Build all firmware configs: $(CONFIGS)"
@$(ECHO) " A limited set of configs can be built with CONFIGS=<list-of-configs>"
@$(ECHO) ""
@for config in $(CONFIGS); do \
$(ECHO) " $$config"; \
$(ECHO) " Build just the $$config firmware configuration."; \
$(ECHO) ""; \
done
@$(ECHO) " clean"
@$(ECHO) " Remove all firmware build pieces."
@$(ECHO) ""
ifeq ($(PX4_TARGET_OS),nuttx)
@$(ECHO) " distclean"
@$(ECHO) " Remove all compilation products, including NuttX RTOS archives."
@$(ECHO) ""
@$(ECHO) " upload"
@$(ECHO) " When exactly one config is being built, add this target to upload the"
@$(ECHO) " firmware to the board when the build is complete. Not supported for"
@$(ECHO) " all configurations."
@$(ECHO) ""
endif
@$(ECHO) " testbuild"
@$(ECHO) " Perform a complete clean build of the entire tree."
@$(ECHO) ""
@$(ECHO) " Common options:"
@$(ECHO) " ---------------"
@$(ECHO) ""
@$(ECHO) " V=1"
@$(ECHO) " If V is set, more verbose output is printed during the build. This can"
@$(ECHO) " help when diagnosing issues with the build or toolchain."
@$(ECHO) ""
ifeq ($(PX4_TARGET_OS),nuttx)
@$(ECHO) " To see help for a specifix target use 'make <target> help' where target is"
@$(ECHO) " one of: "
@$(ECHO) " nuttx"
@$(ECHO) " posix"
@$(ECHO) " qurt"
@$(ECHO) ""
endif
unittest: posix_sitl_test
@export CC=clang
@export CXX=clang++
@export ASAN_OPTIONS=symbolize=1
$(call cmake-build-other,unittest, ../unittests)
@(cd build_unittest && ctest -j2 --output-on-failure)
test_onboard_sitl:
@HEADLESS=1 make posix_sitl_test gazebo_iris
package_firmware:
@zip --junk-paths Firmware.zip `find . -name \*.px4`
clean:
@rm -rf build_*/
@(cd NuttX/nuttx && make clean)
submodulesclean:
@git submodule sync --recursive
@git submodule deinit -f .
@git submodule update --init --recursive --force
distclean: submodulesclean
@git clean -ff -x -d -e ".project" -e ".cproject"
# targets handled by cmake
cmake_targets = test upload package package_source debug debug_tui debug_ddd debug_io debug_io_tui debug_io_ddd check_weak \
run_cmake_config config gazebo gazebo_gdb gazebo_lldb jmavsim replay \
jmavsim_gdb jmavsim_lldb gazebo_gdb_iris gazebo_lldb_tailsitter gazebo_iris gazebo_iris_opt_flow gazebo_tailsitter \
gazebo_gdb_standard_vtol gazebo_lldb_standard_vtol gazebo_standard_vtol gazebo_plane gazebo_solo
$(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ))))
.PHONY: clean
CONFIGS:=$(shell ls cmake/configs | sed -e "s~.*/~~" | sed -e "s~\..*~~")
#help:
# @echo
# @echo "Type 'make ' and hit the tab key twice to see a list of the available"
# @echo "build configurations."
# @echo

2
NuttX

@ -1 +1 @@
Subproject commit f0f4bdc872d324f64e9d93d6f8989d3c1dfa2633
Subproject commit 8004677d8c9222685f331409469e78a66375d55f

View File

@ -1,35 +1,49 @@
## PX4 Pro Drone Autopilot ##
## PX4 Flight Core and PX4 Middleware ##
[![Build Status](https://travis-ci.org/PX4/Firmware.svg?branch=master)](https://travis-ci.org/PX4/Firmware) [![Coverity Scan](https://scan.coverity.com/projects/3966/badge.svg?flat=1)](https://scan.coverity.com/projects/3966?tab=overview)
[![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 directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
This repository contains the PX4 Flight Core, with the main applications located in the src/modules directory. It also contains the PX4 Drone Platform, which contains drivers and middleware to run drones.
* Official Website: http://px4.io
* License: BSD 3-clause (see [LICENSE.md](https://github.com/PX4/Firmware/blob/master/LICENSE.md))
* Supported airframes (more experimental are supported):
* [Multicopters](http://px4.io/portfolio_category/multicopter/)
* [Fixed wing](http://px4.io/portfolio_category/plane/)
* [VTOL](http://px4.io/portfolio_category/vtol/)
* [Multicopters](http://px4.io/platforms/multicopters/start)
* [Fixed wing](http://px4.io/platforms/planes/start)
* [VTOL](http://px4.io/platforms/vtol/start)
* Binaries (always up-to-date from master):
* [Downloads](http://px4.io/firmware/downloads)
* Releases
* [Downloads](https://github.com/PX4/Firmware/releases)
* Mailing list: [Google Groups](http://groups.google.com/group/px4users)
### Users ###
Please refer to the [user documentation](http://px4.io) and [user forum](http://discuss.px4.io) for flying drones with the PX4 flight stack.
Please refer to the [user documentation](https://pixhawk.org/users/start) for flying drones with the PX4 flight stack.
### Developers ###
* [Developer Forum / Mailing list](http://groups.google.com/group/px4users)
* [Guide for Contributions](https://github.com/PX4/Firmware/blob/master/CONTRIBUTING.md)
* [Developer guide](http://dev.px4.io)
Contributing guide:
* [CONTRIBUTING.md](https://github.com/PX4/Firmware/blob/master/CONTRIBUTING.md)
* [PX4 Contribution Guide](http://px4.io/dev/contributing)
Software in the Loop guide:
Use software in the loop [to get started with the codebase](https://github.com/PX4/Firmware/tree/master/posix-configs/SITL)
Developer guide:
http://px4.io/dev/
Testing guide:
http://px4.io/dev/unit_tests
This repository contains code supporting these boards:
* [Snapdragon Flight](http://dev.px4.io/hardware-snapdragon.html)
* FMUv1.x
* FMUv2.x ([Pixhawk](http://dev.px4.io/hardware-pixhawk.html), Pixhawk 2 and [Pixfalcon](http://dev.px4.io/hardware-pixfalcon.html))
* FMUv4.x (Pixhawk X and [Pixracer](http://dev.px4.io/hardware-pixracer.html))
* FMUv2.x
* AeroCore (v1 and v2)
* STM32F4Discovery (basic support) [Tutorial](https://pixhawk.org/modules/stm32f4discovery)
## NuttShell (NSH) ##
NSH usage documentation:
http://px4.io/users/serial_connection

View File

@ -20,8 +20,7 @@ then
param set FW_AIRSPD_MAX 20
param set FW_AIRSPD_MIN 12
param set FW_AIRSPD_TRIM 14
param set FW_R_TC 0.3
param set FW_P_TC 0.3
param set FW_ATT_TC 0.3
param set FW_L1_DAMPING 0.74
param set FW_L1_PERIOD 16
param set FW_LND_ANG 15
@ -38,8 +37,10 @@ then
param set FW_RR_I 0.1
param set FW_RR_IMAX 0.2
param set FW_RR_P 0.3
param set RWTO_TKOFF 1
fi
# Enable gamepad / joystick support
param set COM_RC_IN_MODE 2
set HIL yes
set MIXER AERT

View File

@ -11,6 +11,7 @@ sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ]
then
# TODO review MC_YAWRATE_I
param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.1
param set MC_ROLLRATE_I 0.05
@ -28,3 +29,11 @@ fi
set MIXER quad_w
set PWM_OUT 1234
set PWM_MIN 1200
set MIXER_AUX pass
set PWM_AUX_RATE 50
set PWM_AUX_OUT 1234
set PWM_AUX_DISARMED 1000
set PWM_AUX_MIN 1000
set PWM_AUX_MAX 2000

View File

@ -13,11 +13,11 @@ if [ $AUTOCNF == yes ]
then
# TODO tune roll/pitch separately
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15
param set MC_ROLLRATE_P 0.13
param set MC_ROLLRATE_I 0.05
param set MC_ROLLRATE_D 0.004
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.15
param set MC_PITCHRATE_P 0.13
param set MC_PITCHRATE_I 0.05
param set MC_PITCHRATE_D 0.004
param set MC_YAW_P 2.5
@ -25,10 +25,13 @@ then
param set MC_YAWRATE_I 0.25
param set MC_YAWRATE_D 0.0
param set BAT_V_DIV 12.27559
param set BAT_A_PER_V 15.39103
param set BAT_V_SCALING 0.00989
param set BAT_C_SCALING 0.0124
fi
set MIXER quad_w
set PWM_OUT 1234
set PWM_MIN 1200
set PWM_MAX 1950

View File

@ -30,4 +30,7 @@ fi
set MIXER quad_w
set PWM_MIN 1210
set PWM_MAX 2100
set PWM_OUT 1234

View File

@ -30,6 +30,7 @@ fi
set MIXER sk450_deadcat
set PWM_OUT 1234
set PWM_MIN 1050
set PWM_AUX_OUT 1234
# set PWM_AUX_MIN 900

View File

@ -11,4 +11,7 @@ sh /etc/init.d/rc.mc_defaults
set MIXER quad_x
# Enable gamepad / joystick support
param set COM_RC_IN_MODE 2
set HIL yes

View File

@ -12,11 +12,11 @@ sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.14
param set MC_ROLLRATE_P 0.08
param set MC_ROLLRATE_I 0.1
param set MC_ROLLRATE_D 0.004
param set MC_PITCH_P 6.0
param set MC_PITCHRATE_P 0.14
param set MC_PITCHRATE_P 0.16
param set MC_PITCHRATE_I 0.09
param set MC_PITCHRATE_D 0.004
param set MC_YAW_P 4

View File

@ -11,4 +11,7 @@ sh /etc/init.d/rc.mc_defaults
set MIXER quad_+
# Enable gamepad / joystick support
param set COM_RC_IN_MODE 2
set HIL yes

View File

@ -11,4 +11,7 @@ sh /etc/init.d/rc.fw_defaults
set HIL yes
# Enable gamepad / joystick support
param set COM_RC_IN_MODE 2
set MIXER AERT

View File

@ -14,8 +14,7 @@ then
param set FW_AIRSPD_MIN 12
param set FW_AIRSPD_TRIM 25
param set FW_AIRSPD_MAX 40
param set FW_R_TC 0.3
param set FW_P_TC 0.3
param set FW_ATT_TC 0.3
param set FW_L1_DAMPING 0.74
param set FW_L1_PERIOD 15
param set FW_PR_FF 0.8
@ -37,5 +36,8 @@ fi
set HIL yes
# Enable gamepad / joystick support
param set COM_RC_IN_MODE 2
# Set the AERT mixer for HIL (even if the malolo is a flying wing)
set MIXER AERT

View File

@ -4,17 +4,6 @@
#
# @type Hexarotor Coaxial
#
# @output MAIN1 front right top, CW; angle:60; direction:CW
# @output MAIN2 front right bottom, CCW; angle:60; direction:CCW
# @output MAIN3 back top, CW; angle:180; direction:CW
# @output MAIN4 back bottom, CCW; angle:180; direction:CCW
# @output MAIN5 front left top, CW; angle:-60; direction:CW
# @output MAIN6 front left bottom, CCW;angle:-60; direction:CCW
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer Lorenz Meier <lorenz@px4.io>
#

View File

@ -1,41 +0,0 @@
#!nsh
#
# @name Steadidrone MAVRIK
#
# @type Octo Coax Wide
#
# @maintainer Simon Wilks <simon@uaventure.com>
#
sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ]
then
param set MC_PITCH_P 4.0
param set MC_PITCHRATE_P 0.24
param set MC_PITCHRATE_I 0.09
param set MC_PITCHRATE_D 0.013
param set MC_PITCHRATE_MAX 180.0
param set MC_ROLL_P 4.0
param set MC_ROLLRATE_P 0.16
param set MC_ROLLRATE_I 0.07
param set MC_ROLLRATE_D 0.009
param set MC_ROLLRATE_MAX 180.0
param set MC_YAW_P 3.0
param set MC_YAWRATE_P 0.2
param set MC_YAWRATE_I 0.1
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.5
param set MPC_HOLD_MAX_XY 0.25
param set MPC_THR_MIN 0.15
param set MPC_Z_VEL_MAX 2.0
param set BAT_N_CELLS 4
fi
set MIXER octo_cox_w
set PWM_OUT 12345678

View File

@ -1,44 +1,19 @@
#!nsh
#
# @name Caipiroshka Duo Tailsitter
# @name Duorotor Tailsitter
#
# @type VTOL Duo Tailsitter
#
# @output MAIN1 motor left
# @output MAIN2 motor right
# @output MAIN5 elevon left
# @output MAIN6 elevon right
# @type VTOL Tailsitter
#
# @maintainer Roman Bapst <roman@px4.io>
#
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 6.0
param set MC_ROLLRATE_P 0.12
param set MC_ROLLRATE_I 0.002
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_FF 0.0
param set MC_PITCH_P 4.5
param set MC_PITCHRATE_P 0.3
param set MC_PITCHRATE_I 0.002
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_FF 0.0
param set MC_YAW_P 3.8
param set MC_YAW_FF 0.5
param set MC_YAWRATE_P 0.22
param set MC_YAWRATE_I 0.02
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0.0
param set VT_MOT_COUNT 2
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 0
param set MAV_TYPE 19
fi
set MIXER caipirinha_vtol
set PWM_OUT 1234
set PWM_OUT 12
set PWM_MAX 2000
set PWM_RATE 400
param set VT_MOT_COUNT 2
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 0

View File

@ -14,12 +14,12 @@ then
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.17
param set MC_ROLLRATE_I 0.002
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_D 0.004
param set MC_ROLLRATE_FF 0.0
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.14
param set MC_PITCHRATE_I 0.002
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_D 0.004
param set MC_PITCHRATE_FF 0.0
param set MC_YAW_P 3.8
param set MC_YAW_FF 0.5
@ -31,17 +31,20 @@ then
param set VT_TILT_MC 0.08
param set VT_TILT_TRANS 0.5
param set VT_TILT_FW 0.9
param set VT_MOT_COUNT 6
param set VT_FW_MOT_OFFID 34
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 1
fi
set MIXER firefly6
set PWM_OUT 12345678
set PWM_RATE 400
set MIXER_AUX firefly6
set PWM_AUX_RATE 50
set PWM_AUX_OUT 1234
set PWM_AUX_DISARMED 1000
set PWM_AUX_MIN 1000
set PWM_AUX_MAX 2000
set MAV_TYPE 21
param set VT_MOT_COUNT 6
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 1

View File

@ -2,24 +2,20 @@
#
# @name Quadrotor X Tailsitter
#
# @type VTOL Quad Tailsitter
# @type VTOL Tailsitter
#
# @maintainer Roman Bapst <roman@px4.io>
#
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 0
param set VT_ELEV_MC_LOCK 1
fi
set MIXER quad_x_vtol
set PWM_OUT 1234
set PWM_MAX 2000
set PWM_RATE 400
set MAV_TYPE 20
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 0
param set VT_ELEV_MC_LOCK 1

View File

@ -2,24 +2,20 @@
#
# @name Quadrotor + Tailsitter
#
# @type VTOL Quad Tailsitter
# @type VTOL Tailsitter
#
# @maintainer Roman Bapst <roman@px4.io>
#
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 0
param set VT_ELEV_MC_LOCK 1
fi
set MIXER quad_+_vtol
set PWM_OUT 1234
set PWM_MAX 2000
set PWM_RATE 400
set MAV_TYPE 20
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 0
param set VT_ELEV_MC_LOCK 1

View File

@ -1,6 +1,6 @@
#!nsh
#
# @name Fun Cub Quad VTOL.
# @name Generic AAERT tailplane airframe with Quad VTOL.
#
# @type Standard VTOL
#
@ -14,18 +14,16 @@ then
param set VT_TYPE 2
param set VT_MOT_COUNT 4
param set VT_TRANS_THR 0.75
param set VT_ARSP_TRANS 12
param set VT_ARSP_BLEND 6
param set MC_ROLL_P 6.0
param set MC_ROLLRATE_P 0.17
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15
param set MC_ROLLRATE_I 0.002
param set MC_ROLLRATE_D 0.004
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_FF 0.0
param set MC_PITCH_P 6.0
param set MC_PITCHRATE_P 0.19
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.12
param set MC_PITCHRATE_I 0.002
param set MC_PITCHRATE_D 0.004
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_FF 0.0
param set MC_YAW_P 2.8
param set MC_YAW_FF 0.5
@ -33,28 +31,20 @@ then
param set MC_YAWRATE_I 0.02
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0.0
param set FW_PR_FF 0.5
param set FW_PR_I 0.02
param set FW_PR_IMAX 0.4
param set FW_PR_P 0.08
param set FW_RR_FF 0.6
param set FW_RR_I 0.01
param set FW_RR_IMAX 0.2
param set FW_RR_P 0.05
param set FW_THR_CRUISE 0.75
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 2
fi
set MIXER vtol_quad_x
set PWM_OUT 1234
set PWM_RATE 400
set PWM_OUT 12345678
set MIXER_AUX vtol_AAERT
set PWM_ACHDIS 5
set PWM_AUX_DISARMED 950
set PWM_AUX_RATE 50
set PWM_AUX_OUT 1234
set PWM_AUX_DISARMED 1000
set PWM_AUX_MIN 1000
set PWM_AUX_MAX 2000
set MAV_TYPE 22
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 2

View File

@ -1,48 +0,0 @@
#!nsh
#
# @name Generic quad delta VTOL.
#
# @type Standard VTOL
#
# @maintainer Simon Wilks <simon@uaventure.com>
#
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set VT_TYPE 2
param set VT_MOT_COUNT 4
param set VT_TRANS_THR 0.75
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15
param set MC_ROLLRATE_I 0.002
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_FF 0.0
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.12
param set MC_PITCHRATE_I 0.002
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_FF 0.0
param set MC_YAW_P 2.8
param set MC_YAW_FF 0.5
param set MC_YAWRATE_P 0.22
param set MC_YAWRATE_I 0.02
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0.0
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 2
fi
set MIXER vtol_quad_x
set PWM_OUT 1234
set PWM_RATE 400
set MIXER_AUX vtol_delta
set PWM_ACHDIS 3
set PWM_AUX_DISARMED 950
set MAV_TYPE 22

View File

@ -1,48 +0,0 @@
#!nsh
#
# @name Generic AAVVT v-tail plane airframe with Quad VTOL.
#
# @type Standard VTOL
#
# @maintainer Sander Smeets <sander@droneslab.com>
#
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set VT_TYPE 2
param set VT_MOT_COUNT 4
param set VT_TRANS_THR 0.75
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15
param set MC_ROLLRATE_I 0.002
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_FF 0.0
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.12
param set MC_PITCHRATE_I 0.002
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_FF 0.0
param set MC_YAW_P 2.8
param set MC_YAW_FF 0.5
param set MC_YAWRATE_P 0.22
param set MC_YAWRATE_I 0.02
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0.0
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 2
fi
set MIXER vtol_quad_x
set PWM_OUT 1234
set PWM_RATE 400
set MIXER_AUX vtol_AAVVT
set PWM_ACHDIS 5
set PWM_AUX_DISARMED 950
set MAV_TYPE 22

View File

@ -1,68 +0,0 @@
#!nsh
#
# @name QuadRanger
#
# @type Standard VTOL
#
# @maintainer Sander Smeets <sander@droneslab.com>
#
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set VT_TYPE 2
param set VT_MOT_COUNT 4
param set VT_TRANS_THR 0.75
param set PWM_AUX_REV1 1
param set PWM_AUX_REV2 1
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15
param set MC_ROLLRATE_I 0.1
param set MC_ROLLRATE_D 0.004
param set MC_ROLLRATE_FF 0.0
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.15
param set MC_PITCHRATE_I 0.1
param set MC_PITCHRATE_D 0.004
param set MC_PITCHRATE_FF 0.0
param set MC_YAW_P 3.5
param set MC_YAW_FF 0.7
param set MC_YAWRATE_P 0.6
param set MC_YAWRATE_I 0.04
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0.0
param set MPC_ACC_HOR_MAX 2.0
param set MPC_Z_VEL_MAX 1.5
param set MPC_TKO_SPEED 1.5
param set MPC_LAND_SPEED 0.8
param set FW_THR_CRUISE 65.0
param set FW_PR_P 0.08
param set FW_PR_FF 0.5
param set FW_RR_P 0.05
param set FW_RR_FF 0.6
param set MIS_YAW_TMT 10
param set VT_ARSP_TRANS 15.0
param set VT_ARSP_BLEND 8.0
param set VT_B_TRANS_DUR 4.0
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 2
fi
set MIXER vtol_quad_x
set PWM_OUT 1234
set PWM_RATE 400
set MIXER_AUX vtol_AAERT
set PWM_ACHDIS 5
set PWM_AUX_DISARMED 950
set MAV_TYPE 22

View File

@ -1,88 +0,0 @@
#!nsh
#
# @name Sparkle Tech Ranger VTOL
#
# @type Standard VTOL
#
# @maintainer Andreas Antener <andreas@uaventure.com>
#
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set VT_TYPE 2
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1180
param set MAV_TYPE 22
param set VT_ARSP_TRANS 15.0
param set VT_B_TRANS_DUR 4.0
param set VT_TRANS_MIN_TM 5.0
param set VT_TRANS_THR 0.6
param set VT_TRANS_TIMEOUT 30.0
param set FW_AIRSPD_MAX 22.0
param set FW_AIRSPD_MIN 14.0
param set FW_AIRSPD_TRIM 16.0
param set FW_L1_PERIOD 25.0
param set FW_PR_P 0.060
param set FW_P_RMAX_NEG 40.0
param set FW_P_RMAX_POS 40.0
param set FW_RR_FF 0.4
param set FW_RR_P 0.04
param set FW_R_RMAX 40.0
param set MC_PITCHRATE_D 0.004
param set MC_PITCHRATE_I 0.0
param set MC_PITCHRATE_MAX 60.0
param set MC_PITCHRATE_P 0.21
param set MC_PITCH_P 4.0
param set MC_ROLLRATE_D 0.004
param set MC_ROLLRATE_I 0.002
param set MC_ROLLRATE_MAX 60.0
param set MC_ROLLRATE_P 0.24
param set MC_ROLL_P 4.0
param set MC_YAWRATE_I 0.02
param set MC_YAWRATE_MAX 40.0
param set MC_YAWRATE_P 0.18
param set MC_YAWRAUTO_MAX 40.0
param set MIS_TAKEOFF_ALT 2.5
param set MIS_YAW_TMT 20.0
param set MPC_ACC_HOR_MAX 1.0
param set MPC_HOLD_MAX_XY 0.5
param set MPC_HOLD_MAX_Z 0.5
param set MPC_LAND_SPEED 1.0
param set MPC_MANTHR_MIN 0.05
param set MPC_MAN_Y_MAX 120.0
param set MPC_THR_MIN 0.07
param set MPC_TILTMAX_AIR 35.0
param set MPC_TILTMAX_LND 20.0
param set MPC_TKO_SPEED 1.0
param set MPC_XY_FF 0.1
param set MPC_XY_P 0.3
param set MPC_XY_VEL_MAX 3.0
param set MPC_XY_VEL_P 0.05
param set MPC_Z_FF 0.3
param set MPC_Z_P 0.5
param set MPC_Z_VEL_MAX 1.0
param set MPC_Z_VEL_P 0.1
param set NAV_ACC_RAD 3.0
param set PWM_AUX_REV1 1
param set PWM_AUX_REV2 1
param set PWM_AUX_REV3 1
param set PWM_AUX_REV4 1
fi
set MIXER vtol_quad_x
set PWM_OUT 1234
set PWM_RATE 400
set MIXER_AUX vtol_AAERT
set PWM_ACHDIS 5
set PWM_AUX_DISARMED 950
set MAV_TYPE 22

View File

@ -1,64 +0,0 @@
#!nsh
#
# @name Esky (Big) Lama v4
#
# @type Coaxial Helicopter
#
# @output MAIN1 Left swashplate servomotor, pitch axis
# @output MAIN2 Right swashplate servomotor, roll axis
# @output MAIN3 Upper rotor (CCW)
# @output MAIN4 Lower rotor (CW)
#
# @maintainer Emmanuel Roussel
#
sh /etc/init.d/rc.mc_defaults
set MIXER coax
if [ $AUTOCNF == yes ]
then
param set PE_VELNE_NOISE 0.5
param set PE_VELD_NOISE 0.35
param set PE_POSNE_NOISE 0.5
param set PE_POSD_NOISE 1.25
param set NAV_ACC_RAD 2.0
param set RTL_RETURN_ALT 30.0
param set RTL_DESCEND_ALT 10.0
param set PWM_DISARMED 900
param set PWM_MIN 1075
param set PWM_MAX 1950
param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.17
param set MC_ROLLRATE_I 0.05
param set MC_ROLLRATE_D 0.005
param set MC_ROLLRATE_FF 0
param set MC_PITCH_P 6.5
param set MC_PITCHRATE_P 0.17
param set MC_PITCHRATE_I 0.05
param set MC_PITCHRATE_D 0.005
param set MC_PITCHRATE_FF 0
param set MC_YAW_P 2
param set MC_YAW_FF 0.5
param set MC_YAWRATE_P 0.1
param set MC_YAWRATE_I 0.1
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0
fi
# use PWM parameters for throttle channel
set PWM_OUT 34
set PWM_RATE 400
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX
# This is the gimbal pass mixer
set MIXER_AUX pass
set PWM_AUX_RATE 50
set PWM_AUX_OUT 1234
set PWM_AUX_DISARMED 1500
set PWM_AUX_MIN 1000
set PWM_AUX_MAX 2000

View File

@ -1,12 +0,0 @@
#!nsh
#
# @name Passthrough mode for Snapdragon
#
# @type custom
#
# @maintainer Julian Oes <julian@oes.ch>
#
# This startup can be used on Pixhawk/Pixfalcon/Pixracer for the
# passthrough of RC input and PWM output.
set VEHICLE_TYPE passthrough

View File

@ -6,8 +6,8 @@
#
# @output MAIN1 aileron
# @output MAIN2 elevator
# @output MAIN3 rudder
# @output MAIN4 throttle
# @output MAIN4 rudder
# @output MAIN3 throttle
# @output MAIN5 flaps
#
# @output AUX1 feed-through of RC AUX1 channel
@ -20,9 +20,3 @@
sh /etc/init.d/rc.fw_defaults
set MIXER AERT
# use PWM parameters for throttle channel
set PWM_OUT 4
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX

View File

@ -20,9 +20,3 @@
sh /etc/init.d/rc.fw_defaults
set MIXER AETR
# use PWM parameters for throttle channel
set PWM_OUT 3
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX

View File

@ -1,50 +0,0 @@
#!nsh
#
# @name Bormatec Maja
#
# @type Standard Plane
#
# @output MAIN1 aileron
# @output MAIN2 aileron
# @output MAIN3 elevator
# @output MAIN4 rudder
# @output MAIN5 throttle
# @output MAIN6 wheel
# @output MAIN7 flaps
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer Andreas Antener <andreas@uaventure.com>
#
sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ]
then
param set FW_AIRSPD_MIN 10
param set FW_AIRSPD_TRIM 15
param set FW_AIRSPD_MAX 20
param set FW_MAN_P_MAX 55
param set FW_MAN_R_MAX 55
param set FW_R_LIM 55
param set FW_WR_FF 0.2
param set FW_WR_I 0.2
param set FW_WR_IMAX 0.8
param set FW_WR_P 1
param set FW_W_RMAX 0
# set disarmed value for the ESC
param set PWM_DISARMED 1000
fi
set MIXER AAERTWF
# use PWM parameters for throttle channel
set PWM_OUT 5
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX

View File

@ -1,51 +0,0 @@
#!nsh
#
# @name Applied Aeronautics Albatross
#
# @type Plane A-Tail
#
# @output MAIN1 aileron right
# @output MAIN2 aileron left
# @output MAIN3 v-tail right
# @output MAIN4 v-tail left
# @output MAIN5 throttle
# @output MAIN6 wheel
# @output MAIN7 flaps right
# @output MAIN8 flaps left
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer Andreas Antener <andreas@uaventure.com>
#
sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ]
then
param set FW_AIRSPD_MIN 10
param set FW_AIRSPD_TRIM 15
param set FW_AIRSPD_MAX 20
param set FW_MAN_P_MAX 55
param set FW_MAN_R_MAX 55
param set FW_R_LIM 55
param set FW_WR_FF 0.2
param set FW_WR_I 0.2
param set FW_WR_IMAX 0.8
param set FW_WR_P 1
param set FW_W_RMAX 0
# set disarmed value for the ESC
param set PWM_DISARMED 1000
fi
set MIXER AAVVTWFF
# use PWM parameters for throttle channel
set PWM_OUT 5
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX

View File

@ -24,8 +24,7 @@ then
param set FW_AIRSPD_MAX 15
param set FW_AIRSPD_MIN 10
param set FW_AIRSPD_TRIM 13
param set FW_R_TC 0.3
param set FW_P_TC 0.3
param set FW_ATT_TC 0.3
param set FW_L1_DAMPING 0.74
param set FW_L1_PERIOD 16
param set FW_LND_ANG 15

View File

@ -24,8 +24,7 @@ then
param set FW_AIRSPD_MIN 13
param set FW_AIRSPD_TRIM 15
param set FW_AIRSPD_MAX 25
param set FW_R_TC 0.3
param set FW_P_TC 0.3
param set FW_ATT_TC 0.3
param set FW_L1_DAMPING 0.75
param set FW_L1_PERIOD 15
param set FW_PR_FF 0.2

View File

@ -24,8 +24,7 @@ then
param set FW_AIRSPD_MIN 15
param set FW_AIRSPD_TRIM 20
param set FW_AIRSPD_MAX 40
param set FW_R_TC 0.3
param set FW_P_TC 0.3
param set FW_ATT_TC 0.3
param set FW_L1_DAMPING 0.74
param set FW_L1_PERIOD 16
param set FW_LND_ANG 15

View File

@ -14,7 +14,7 @@
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer Lorenz Meier <lorenz@px4.io>
# @maintainer Simon Wilks <simon@px4.io>
#
sh /etc/init.d/rc.fw_defaults
@ -25,8 +25,7 @@ then
param set FW_AIRSPD_MAX 15
param set FW_AIRSPD_MIN 10
param set FW_AIRSPD_TRIM 13
param set FW_R_TC 0.3
param set FW_P_TC 0.3
param set FW_ATT_TC 0.3
param set FW_L1_DAMPING 0.74
param set FW_L1_PERIOD 16
param set FW_LND_ANG 15
@ -40,9 +39,6 @@ then
param set FW_RR_P 0.04
fi
# Configure this as plane
set MAV_TYPE 1
# Set mixer
set MIXER wingwing
# Provide ESC a constant 1000 us pulse
set PWM_OUT 4

View File

@ -1,55 +0,0 @@
#!nsh
#
# @name Sparkle Tech Pigeon
#
# @url http://www.sparkletech.hk/
#
# @type Flying Wing
#
# @output MAIN1 left aileron
# @output MAIN2 right aileron
# @output MAIN4 throttle
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer Simon Wilks <simon@px4.io>
#
sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ]
then
param set FW_AIRSPD_MIN 15
param set FW_AIRSPD_TRIM 20
param set FW_AIRSPD_MAX 27
param set FW_ATT_TC 0.3
param set FW_L1_DAMPING 0.75
param set FW_L1_PERIOD 15
param set FW_PR_FF 0.35
param set FW_PR_IMAX 0.2
param set FW_PR_P 0.05
param set FW_P_LIM_MAX 45
param set FW_P_LIM_MIN -45
param set FW_P_ROLLFF 1
param set FW_P_TC 0.3
param set FW_RR_FF 0.3
param set FW_RR_IMAX 0.2
param set FW_RR_P 0.03
param set FW_R_LIM 40
param set FW_R_RMAX 50
param set FW_R_TC 0.3
# Bottom of bay and nominal zero-pitch attitude differ
# the payload bay is pitched up about 7 degrees
param set SENS_BOARD_Y_OFF 11.9
param set FW_L1_PERIOD 20.0
fi
set MIXER phantom
# Provide ESC a constant 1000 us pulse
set PWM_OUT 4
set PWM_DISARMED 1000

View File

@ -14,8 +14,7 @@ then
param set FW_AIRSPD_MAX 20
param set FW_AIRSPD_MIN 12
param set FW_AIRSPD_TRIM 16
param set FW_R_TC 0.3
param set FW_P_TC 0.3
param set FW_ATT_TC 0.3
param set FW_L1_DAMPING 0.74
param set FW_L1_PERIOD 16
param set FW_LND_ANG 15

View File

@ -1,36 +0,0 @@
#!nsh
#
# @name Lumenier QAV250
#
# @type Quadrotor x
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer Mark Whitehorn <kd0aij@gmail.com>
#
sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 6.0
param set MC_ROLLRATE_P 0.14
param set MC_ROLLRATE_I 0.23
param set MC_ROLLRATE_D 0.0025
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.235
param set MC_PITCHRATE_I 0.17
param set MC_PITCHRATE_D 0.004
param set MC_YAW_P 4
param set MC_YAWRATE_P 0.3
param set MC_YAWRATE_I 0.2
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.5
param set PWM_MIN 1075
param set MPC_THR_MIN 0.06
param set MPC_MANTHR_MIN 0.06
param set CBRK_IO_SAFETY 22027
param set ATT_BIAS_MAX 0.0
fi

View File

@ -16,11 +16,11 @@ sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15
param set MC_ROLLRATE_P 0.13
param set MC_ROLLRATE_I 0.05
param set MC_ROLLRATE_D 0.003
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.15
param set MC_PITCHRATE_P 0.13
param set MC_PITCHRATE_I 0.05
param set MC_PITCHRATE_D 0.003
param set MC_YAW_P 2.8
@ -30,3 +30,9 @@ then
# DJI ESCs do not support calibration and need a higher min
param set PWM_MIN 1230
fi
# Transitional support: ensure suitable PWM min/max param values
if param compare PWM_MIN 1075
then
param set PWM_MIN 1230
fi

View File

@ -15,14 +15,15 @@ sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ]
then
# TODO REVIEW
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.15
param set MC_ROLLRATE_P 0.16
param set MC_ROLLRATE_I 0.05
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_D 0.01
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.15
param set MC_PITCHRATE_P 0.16
param set MC_PITCHRATE_I 0.05
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_D 0.01
param set MC_YAW_P 2.8
param set MC_YAWRATE_P 0.3
param set MC_YAWRATE_I 0.1
@ -30,3 +31,9 @@ then
# DJI ESCs do not support calibration and need a higher min
param set PWM_MIN 1230
fi
# Transitional support: ensure suitable PWM min/max param values
if param compare PWM_MIN 1075
then
param set PWM_MIN 1230
fi

View File

@ -14,11 +14,11 @@ then
param set MC_ROLL_P 7.0
param set MC_ROLLRATE_P 0.16
param set MC_ROLLRATE_I 0.05
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_D 0.01
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.16
param set MC_PITCHRATE_I 0.05
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_D 0.01
param set MC_YAW_P 2.8
param set MC_YAWRATE_P 0.3
param set MC_YAWRATE_I 0.1

View File

@ -1,88 +0,0 @@
#!nsh
#
# @name 3DR Solo
#
# @type Quadrotor x
#
# @maintainer Andreas Antener <andreas@uaventure.com>
#
sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ]
then
# tuning
param set MC_PITCHRATE_P 0.11
param set MC_ROLLRATE_P 0.11
param set MPC_MANTHR_MIN 0.08
param set MPC_XY_VEL_MAX 3.0
param set MPC_Z_VEL_MAX 2.0
# INAV: higher GPS weights for better altitude control
param set INAV_W_Z_BARO 0.3
param set INAV_W_Z_GPS_P 0.8
param set INAV_W_Z_GPS_V 0.8
# takeoff, land and RTL settings
param set MIS_TAKEOFF_ALT 4.0
param set COM_DISARM_LAND 1
param set RTL_LAND_DELAY 1
param set RTL_DESCEND_ALT 5.0
param set RTL_RETURN_ALT 15.0
param set MPC_TILTMAX_LND 8.0
param set MPC_LAND_SPEED 0.4
param set MPC_HOLD_MAX_Z 1.5
param set MPC_TKO_JMPSPD 2.0
param set MPC_TKO_SPEED 1.5
# setup
# main board rotation: pitch 180
param set SENS_BOARD_ROT 12
# solo external mag rotation
param set CAL_MAG0_ROT 30
# no safety switch
param set CBRK_IO_SAFETY 22027
# battery voltage not available yet
param set CBRK_SUPPLY_CHK 894281
# RC configuration
param set RC_MAP_MODE_SW 5
param set RC_MAP_PITCH 2
param set RC_MAP_ROLL 1
param set RC_MAP_THROTTLE 3
param set RC_MAP_YAW 4
param set RC1_DZ 10
param set RC1_MAX 1988
param set RC1_MIN 1003
param set RC1_REV 1
param set RC1_TRIM 1499
param set RC2_DZ 10
param set RC2_MAX 1987
param set RC2_MIN 1023
param set RC2_REV -1
param set RC2_TRIM 1499
param set RC3_DZ 10
param set RC3_MAX 1877
param set RC3_MIN 1023
param set RC3_REV 1
param set RC3_TRIM 1023
param set RC4_DZ 10
param set RC4_MAX 1998
param set RC4_MIN 1012
param set RC4_REV 1
param set RC4_TRIM 1500
param set RC5_DZ 10
param set RC5_MAX 2000
param set RC5_MIN 1000
param set RC5_REV 1
param set RC5_TRIM 1500
fi
set MIXER solo
set PWM_OUT 1234
set MIXER_AUX none
# enable high-speed link on telem 1
set MAVLINK_F "-d /dev/ttyS1 -b 921600 -r 80000 -m onboard -x"

View File

@ -1,42 +0,0 @@
#!nsh
#
# @name Reaper 500 Quad
#
# @type Quadrotor x
#
# @maintainer Blankered
#
sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.14
param set MC_ROLLRATE_I 0.1
param set MC_ROLLRATE_D 0.004
param set MC_PITCH_P 6.0
param set MC_PITCHRATE_P 0.14
param set MC_PITCHRATE_I 0.09
param set MC_PITCHRATE_D 0.004
param set MC_YAW_P 4
param set NAV_ACC_RAD 2.0
param set RTL_RETURN_ALT 30.0
param set RTL_DESCEND_ALT 10.0
fi
set MIXER quad_h
set PWM_RATE 50
set PWM_OUT 1234
set PWM_MIN 1100
set PWM_MAX 1900
set PWM_DISARMED 1500
set MIXER_AUX pass
set PWM_AUX_RATE 50
set PWM_AUX_OUT 1234
set PWM_AUX_MIN 1000
set PWM_AUX_MAX 2000
set PWM_AUX_DISARMED 950

View File

@ -1,45 +0,0 @@
#!nsh
#
# @name Generic 250 Racer
#
# @type Quadrotor x
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer Mark Whitehorn <kd0aij@gmail.com>
#
sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 8.0
param set MC_ROLLRATE_P 0.19
param set MC_ROLLRATE_I 0.1
param set MC_ROLLRATE_D 0.0055
param set MC_PITCH_P 8.0
param set MC_PITCHRATE_P 0.24
param set MC_PITCHRATE_I 0.1
param set MC_PITCHRATE_D 0.0065
param set MC_YAW_P 4.0
param set MC_YAWRATE_P 0.2
param set MC_YAWRATE_I 0.1
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.5
param set MC_ROLLRATE_MAX 720.0
param set MC_PITCHRATE_MAX 720.0
param set MC_YAWRATE_MAX 400.0
param set MC_ACRO_R_MAX 360.0
param set MC_ACRO_P_MAX 360.0
param set PWM_MIN 1075
param set MPC_THR_MIN 0.06
param set MPC_MANTHR_MIN 0.06
param set ATT_BIAS_MAX 0.0
param set CBRK_IO_SAFETY 22027
fi

View File

@ -1,23 +0,0 @@
#!nsh
#
# @name DJI Matrice 100
#
# @type Quadrotor x
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer James Goppert <james.goppert@gmail.com>
#
sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ]
then
param set MC_ROLLRATE_P 0.05
param set MC_ROLLRATE_D 0.001
param set MC_PITCHRATE_P 0.05
param set MC_PITCHRATE_D 0.001
param set BAT_N_CELLS 6
fi

View File

@ -7,16 +7,17 @@ then
#
# Default parameters for FW
#
param set RTL_RETURN_ALT 100
param set RTL_DESCEND_ALT 100
param set RTL_LAND_DELAY -1
param set NAV_LAND_ALT 90
param set NAV_RTL_ALT 100
param set NAV_RTL_LAND_T -1
param set NAV_ACC_RAD 50
param set PE_VELNE_NOISE 0.3
param set PE_VELD_NOISE 0.35
param set PE_POSNE_NOISE 0.5
param set PE_POSD_NOISE 1.0
param set PE_GBIAS_PNOISE 0.000001
param set PE_ABIAS_PNOISE 0.0002
fi
# This is the gimbal pass mixer

View File

@ -45,10 +45,10 @@ then
if mixer load $OUTPUT_DEV $MIXER_FILE
then
echo "INFO [init] Mixer: $MIXER_FILE on $OUTPUT_DEV"
echo "[i] Mixer: $MIXER_FILE on $OUTPUT_DEV"
else
echo "ERROR [init] Error loading mixer: $MIXER_FILE"
echo "ERROR:[init] Could not load mixer: $MIXER_FILE" >> $LOG_FILE
echo "[i] Error loading mixer: $MIXER_FILE"
echo "ERROR: Could not load mixer: $MIXER_FILE" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
@ -56,8 +56,8 @@ then
else
if [ $MIXER != skip ]
then
echo "ERROR [init] Mixer not defined"
echo "ERROR [init] Mixer not defined" >> $LOG_FILE
echo "[i] Mixer not defined"
echo "ERROR: Mixer not defined" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@ -97,19 +97,7 @@ then
fi
fi
# This is a FMUv2+ thing
if ver hwcmp PX4FMU_V1
then
set MIXER_AUX none
fi
#MindPX has not aux mixer
if ver hwcmp MINDPX_V2
then
set MIXER_AUX none
fi
if [ $MIXER_AUX != none -a $AUX_MODE != none ]
if [ $MIXER_AUX != none ]
then
#
# Load aux mixer
@ -129,18 +117,18 @@ then
fi
fi
if [ $MIXER_AUX_FILE != none ]
if [ $MIXER_AUX_FILE != none -a $FMU_MODE == pwm ]
then
if fmu mode_$AUX_MODE
if fmu mode_pwm
then
if [ -e $OUTPUT_AUX_DEV ]
then
if mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE
then
echo "INFO [init] Mixer: $MIXER_AUX_FILE on $OUTPUT_AUX_DEV"
echo "[i] Mixer: $MIXER_AUX_FILE on $OUTPUT_AUX_DEV"
else
echo "ERROR [init] Error loading mixer: $MIXER_AUX_FILE"
echo "ERROR [init] Could not load mixer: $MIXER_AUX_FILE" >> $LOG_FILE
echo "[i] Error loading mixer: $MIXER_AUX_FILE"
echo "ERROR: Could not load mixer: $MIXER_AUX_FILE" >> $LOG_FILE
fi
else
set PWM_AUX_OUT none
@ -153,7 +141,6 @@ then
set FAILSAFE_AUX none
fi
# Set min / max for aux out and rates
if [ $PWM_AUX_OUT != none ]
then
#
@ -164,6 +151,13 @@ then
pwm rate -c $PWM_AUX_OUT -r $PWM_AUX_RATE -d $OUTPUT_AUX_DEV
fi
#
# Set disarmed, min and max PWM_AUX values
#
if [ $PWM_AUX_DISARMED != none ]
then
pwm disarmed -c $PWM_AUX_OUT -p $PWM_AUX_DISARMED -d $OUTPUT_AUX_DEV
fi
if [ $PWM_AUX_MIN != none ]
then
pwm min -c $PWM_AUX_OUT -p $PWM_AUX_MIN -d $OUTPUT_AUX_DEV
@ -174,23 +168,6 @@ then
fi
fi
# Set disarmed values for aux out
# Transitional support until all configs
# are updated
if [ $PWM_ACHDIS == none ]
then
set PWM_ACHDIS ${PWM_AUX_OUT}
fi
#
# Set disarmed, min and max PWM_AUX values
#
if [ $PWM_AUX_DISARMED != none -a $PWM_ACHDIS != none ]
then
pwm disarmed -c $PWM_ACHDIS -p $PWM_AUX_DISARMED -d $OUTPUT_AUX_DEV
fi
if [ $FAILSAFE_AUX != none ]
then
pwm failsafe -d $OUTPUT_AUX_DEV $FAILSAFE
@ -198,18 +175,5 @@ then
fi
fi
unset PWM_OUT
unset PWM_RATE
unset PWM_ACHDIS
unset PWM_MIN
unset PWM_MAX
unset PWM_AUX_OUT
unset PWM_AUX_RATE
unset PWM_AUX_DISARMED
unset PWM_AUX_MIN
unset PWM_AUX_MAX
unset FAILSAFE_AUX
unset FAILSAFE
unset OUTPUT_DEV
unset OUTPUT_AUX_DEV

View File

@ -18,4 +18,6 @@ fi
if px4io limit $PX4IO_LIMIT
then
else
echo "[i] Set PX4IO update rate to $PX4IO_LIMIT Hz failed!"
fi

View File

@ -0,0 +1,18 @@
#!nsh
#
# Initialize logging services.
#
if [ -d /fs/microsd ]
then
if ver hwcmp PX4FMU_V1
then
if sdlog2 start -r 40 -a -b 3 -t
then
fi
else
if sdlog2 start -r 100 -a -b 12 -t
then
fi
fi
fi

View File

@ -4,31 +4,28 @@
# att & pos estimator, att & pos control.
#
#---------------------------------------
# Estimator group selction
#
# INAV
if param compare SYS_MC_EST_GROUP 0
# The system is defaulting to INAV_ENABLED = 1
# but users can alternatively try the EKF-based
# filter by setting INAV_ENABLED = 0
if param compare INAV_ENABLED 1
then
attitude_estimator_q start
# The system is defaulting to EKF_ATT_ENABLED = 1
# and uses the older EKF filter. However users can
# enable the new quaternion based complimentary
# filter by setting EKF_ATT_ENABLED = 0.
# Note that on FMUv1, the EKF att estimator is not
# available and the Q estimator runs instead.
if param compare EKF_ATT_ENABLED 1
then
attitude_estimator_ekf start
else
attitude_estimator_q start
fi
position_estimator_inav start
else
ekf_att_pos_estimator start
fi
# LPE
if param compare SYS_MC_EST_GROUP 1
then
attitude_estimator_q start
local_position_estimator start
fi
# EKF
if param compare SYS_MC_EST_GROUP 2
then
ekf2 start
fi
#---------------------------------------
if mc_att_control start
then
else

View File

@ -8,6 +8,8 @@ then
param set PE_VELD_NOISE 0.35
param set PE_POSNE_NOISE 0.5
param set PE_POSD_NOISE 1.25
param set PE_GBIAS_PNOISE 0.000001
param set PE_ABIAS_PNOISE 0.0001
param set NAV_ACC_RAD 2.0
param set RTL_RETURN_ALT 30.0
@ -15,8 +17,20 @@ then
param set PWM_DISARMED 900
param set PWM_MIN 1075
param set PWM_MAX 1950
fi
param set RTL_LAND_DELAY 0
# Transitional support: ensure suitable PWM min/max param values
if param compare PWM_MIN 1000
then
param set PWM_MIN 1075
fi
if param compare PWM_MAX 2000
then
param set PWM_MAX 1950
fi
if param compare PWM_DISARMED 0
then
param set PWM_DISARMED 900
fi
# set environment variables (!= parameters)
@ -33,17 +47,3 @@ set PWM_AUX_OUT 1234
set PWM_AUX_DISARMED 1500
set PWM_AUX_MIN 1000
set PWM_AUX_MAX 2000
# Transitional support: ensure suitable PWM min/max param values
if param compare PWM_MIN 1000
then
param set PWM_MIN 1075
fi
if param compare PWM_MAX 2000
then
param set PWM_MAX 1950
fi
if param compare PWM_DISARMED 0
then
param set PWM_DISARMED 900
fi

View File

@ -1,27 +1,10 @@
#!nsh
#
# Standard startup script for PX4FMU v1, v2, v3, v4 onboard sensor drivers.
# Standard startup script for PX4FMU v1, v2, v3 onboard sensor drivers.
#
if ver hwcmp PX4FMU_V1
if ms5611 start
then
if ms5611 start
then
fi
else
# Configure all I2C buses to 100 KHz as they
# are all external or slow
fmu i2c 1 100000
fmu i2c 2 100000
if ms5611 -s start
then
fi
# Blacksheep telemetry
if bst start
then
fi
fi
if adc start
@ -35,11 +18,6 @@ then
then
fi
# External I2C bus
if lis3mdl -X start
then
fi
# Internal I2C bus
if hmc5883 -C -T -I -R 4 start
then
@ -74,10 +52,6 @@ then
then
fi
if meas_airspeed start -b 2
then
fi
else
# FMUv2
if mpu6000 start
@ -92,37 +66,7 @@ then
then
fi
fi
fi
if ver hwcmp PX4FMU_V4
then
# External I2C bus
if hmc5883 -C -T -X start
then
fi
if lis3mdl -R 2 start
then
fi
# Internal SPI bus is rotated 90 deg yaw
if hmc5883 -C -T -S -R 2 start
then
fi
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
if mpu6000 -R 2 -T 20608 start
then
fi
# Internal SPI bus mpu9250 is rotated 90 deg yaw
if mpu9250 -R 2 start
then
fi
fi
if ver hwcmp PX4FMU_V1
then
else
# FMUv1
if mpu6000 start
then
@ -154,30 +98,6 @@ then
fi
fi
if ver hwcmp MINDPX_V2
then
if mpu6500 start
then
fi
if lsm303d start
then
fi
if l3gd20 start
then
fi
# External I2C bus
if hmc5883 -C -T -X start
then
fi
if lis3mdl -R 2 start
then
fi
fi
if meas_airspeed start
then
else
@ -190,12 +110,13 @@ else
fi
fi
if sf10a start
# Check for flow sensor
if px4flow start &
then
fi
# Wait 20 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire)
usleep 20000
if sensors start
then
fi
#
# Start sensors
#
sensors start

View File

@ -3,27 +3,16 @@
# UAVCAN initialization script.
#
#
# Starting stuff according to UAVCAN_ENABLE value
#
if param greater UAVCAN_ENABLE 0
if param compare UAVCAN_ENABLE 1
then
if uavcan start
then
# First sensor publisher to initialize takes lowest instance ID
# This delay ensures that UAVCAN-interfaced sensors would be allocated on lowest instance IDs
sleep 1
echo "[i] UAVCAN started"
else
echo "[i] ERROR: Could not start UAVCAN"
tone_alarm $TUNE_ERR
fi
fi
if param greater UAVCAN_ENABLE 1
then
if uavcan start fw
then
echo "[i] UAVCAN servers started"
else
echo "[i] ERROR: Could not start UAVCAN servers"
tone_alarm $TUNE_ERR
fi
fi

View File

@ -3,7 +3,24 @@
# USB MAVLink start
#
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
mavlink start -r 800000 -d /dev/ttyACM0 -x
# Enable a number of interesting streams we want via USB
mavlink stream -d /dev/ttyACM0 -s PARAM_VALUE -r 300
mavlink stream -d /dev/ttyACM0 -s MISSION_ITEM -r 50
mavlink stream -d /dev/ttyACM0 -s NAMED_VALUE_FLOAT -r 10
mavlink stream -d /dev/ttyACM0 -s OPTICAL_FLOW_RAD -r 10
mavlink stream -d /dev/ttyACM0 -s DISTANCE_SENSOR -r 10
mavlink stream -d /dev/ttyACM0 -s VFR_HUD -r 20
mavlink stream -d /dev/ttyACM0 -s ATTITUDE -r 100
mavlink stream -d /dev/ttyACM0 -s ACTUATOR_CONTROL_TARGET0 -r 30
mavlink stream -d /dev/ttyACM0 -s RC_CHANNELS -r 5
mavlink stream -d /dev/ttyACM0 -s SERVO_OUTPUT_RAW_0 -r 20
mavlink stream -d /dev/ttyACM0 -s SERVO_OUTPUT_RAW_1 -r 20
mavlink stream -d /dev/ttyACM0 -s POSITION_TARGET_GLOBAL_INT -r 10
mavlink stream -d /dev/ttyACM0 -s LOCAL_POSITION_NED -r 30
mavlink stream -d /dev/ttyACM0 -s MANUAL_CONTROL -r 5
mavlink stream -d /dev/ttyACM0 -s HIGHRES_IMU -r 100
mavlink stream -d /dev/ttyACM0 -s GPS_RAW_INT -r 20
# Exit shell to make it available to MAVLink
exit

View File

@ -3,33 +3,10 @@
# Standard apps for vtol:
# att & pos estimator, att & pos control.
#
#
#---------------------------------------
# Estimator group selction
#
# INAV
if param compare SYS_MC_EST_GROUP 0
then
attitude_estimator_q start
position_estimator_inav start
fi
# LPE
if param compare SYS_MC_EST_GROUP 1
then
attitude_estimator_q start
local_position_estimator start
fi
# EKF
if param compare SYS_MC_EST_GROUP 2
then
ekf2 start
fi
#---------------------------------------
attitude_estimator_q start
#ekf_att_pos_estimator start
position_estimator_inav start
vtol_att_control start
mc_att_control start
@ -39,6 +16,6 @@ fw_pos_control_l1 start
#
# Start Land Detector
# Multicopter for now until we have something for VTOL
# Fixed wing for now until we have something for VTOL
#
land_detector start vtol
land_detector start fixedwing

View File

@ -4,46 +4,43 @@ set VEHICLE_TYPE vtol
if [ $AUTOCNF == yes ]
then
#
#Default controller parameters for MC
#
param set MC_ROLL_P 6.0
param set MC_ROLLRATE_P 0.1
param set MC_ROLLRATE_I 0.0
param set MC_ROLLRATE_D 0.003
param set MC_PITCH_P 6.0
param set MC_PITCHRATE_P 0.2
param set MC_PITCHRATE_I 0.0
param set MC_PITCHRATE_D 0.003
param set MC_YAW_P 4
param set MC_YAWRATE_P 0.2
param set MC_YAWRATE_I 0.0
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.3
#
# Default parameters for FW
#
param set FW_PR_FF 0.3
param set FW_PR_I 0.000
param set FW_PR_IMAX 0.2
param set FW_PR_P 0.02
param set FW_RR_FF 0.3
param set FW_RR_I 0.00
param set FW_RR_IMAX 0.2
param set FW_RR_P 0.02
param set PE_VELNE_NOISE 0.5
param set PE_VELD_NOISE 0.3
param set PE_POSNE_NOISE 0.5
param set PE_POSD_NOISE 1.25
param set PE_GBIAS_PNOISE 0.000001
param set PE_ABIAS_PNOISE 0.0001
#
# Default parameters for mission and position handling
#
param set NAV_ACC_RAD 3
param set MPC_TKO_SPEED 1.0
param set MPC_LAND_SPEED 0.7
param set MPC_Z_VEL_MAX 1.5
param set MPC_XY_VEL_MAX 4.0
param set MIS_YAW_TMT 10
param set MPC_ACC_HOR_MAX 2.0
param set RTL_LAND_DELAY 0
fi
# set environment variables (!= parameters)
set PWM_RATE 400
# tell the mixer to use parameters for these instead
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX
# Transitional support: ensure suitable PWM min/max param values
if param compare PWM_MIN 1000
then
param set PWM_MIN 1075
fi
if param compare PWM_MAX 2000
then
param set PWM_MAX 1950
fi
if param compare PWM_DISARMED 0
then
param set PWM_DISARMED 900
fi
set PWM_DISARMED 900
set PWM_MIN 1000
set PWM_MAX 2000

View File

@ -15,6 +15,8 @@ sercon
#
set MODE autostart
set FRC /fs/microsd/etc/rc.txt
set FCONFIG /fs/microsd/etc/config.txt
set TUNE_ERR ML<<CP4CP4CP4CP4CP4
set LOG_FILE /fs/microsd/bootlog.txt
@ -24,6 +26,7 @@ set LOG_FILE /fs/microsd/bootlog.txt
# REBOOTWORK this needs to start after the flight control loop
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
echo "[i] microSD mounted: /fs/microsd"
# Start playing the startup tune
tone_alarm start
else
@ -32,9 +35,9 @@ else
then
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
echo "INFO [init] MicroSD card formatted"
echo "[i] microSD card formatted"
else
echo "ERROR [init] Format failed"
echo "[i] format failed"
tone_alarm MNBG
set LOG_FILE /dev/null
fi
@ -47,10 +50,9 @@ fi
# Look for an init script on the microSD card.
# Disable autostart if the script found.
#
set FRC /fs/microsd/etc/rc.txt
if [ -f $FRC ]
then
echo "INFO [init] Executing script: $FRC"
echo "[i] Executing script: $FRC"
sh $FRC
set MODE custom
fi
@ -58,6 +60,9 @@ unset FRC
if [ $MODE == autostart ]
then
# Try to get an USB console
# REBOOTWORK this needs to start after the flight control loop
nshterm /dev/ttyACM0 &
#
# Start the ORB (first app to start)
@ -76,7 +81,9 @@ then
param select $PARAM_FILE
if param load
then
echo "[param] Loaded: $PARAM_FILE"
else
echo "[param] FAILED loading $PARAM_FILE"
if param reset
then
fi
@ -99,18 +106,6 @@ then
#then
#fi
#
# Set AUTOCNF flag to use it in AUTOSTART scripts
#
if param compare SYS_AUTOCONFIG 1
then
# Wipe out params except RC*
param reset_nostart RC*
set AUTOCNF yes
else
set AUTOCNF no
fi
#
# Set default values
#
@ -126,73 +121,59 @@ then
set PWM_MAX none
set PWM_AUX_OUT none
set PWM_AUX_RATE none
set PWM_ACHDIS none
set PWM_AUX_DISARMED none
set PWM_AUX_MIN none
set PWM_AUX_MAX none
set FAILSAFE_AUX none
set MK_MODE none
set FMU_MODE pwm
set AUX_MODE pwm
set MAVLINK_F default
set EXIT_ON_END no
set MAV_TYPE none
set LOAD_DAPPS yes
set GPS yes
set GPS_FAKE no
set FAILSAFE none
set USE_IO yes
#
# Set AUTOCNF flag to use it in AUTOSTART scripts
#
if param compare SYS_AUTOCONFIG 1
then
# Wipe out params except RC*
param reset_nostart RC*
set AUTOCNF yes
else
set AUTOCNF no
fi
#
# Set USE_IO flag
#
if param compare SYS_USE_IO 1
then
if ver hwcmp PX4FMU_V4
then
set USE_IO no
fi
if ver hwcmp MINDPX_V2
then
set USE_IO no
fi
set USE_IO yes
else
set USE_IO no
fi
# should set to 0.8 for mindpx-v2 borad.
if param compare INAV_LIDAR_ERR 0.5
then
if ver hwcmp MINDPX_V2
then
param set INAV_LIDAR_ERR 0.8
param save
fi
fi
#
# Set parameters and env variables for selected AUTOSTART
#
if param compare SYS_AUTOSTART 0
then
echo "INFO [init] No autostart"
echo "[i] No autostart"
else
sh /etc/init.d/rc.autostart
fi
unset MODE
#
# Wipe incompatible settings for boards not having two outputs
if ver hwcmp PX4FMU_V4
then
set MIXER_AUX none
fi
#
# Override parameters from user configuration file
#
set FCONFIG /fs/microsd/etc/config.txt
if [ -f $FCONFIG ]
then
echo "INFO [init] Custom: $FCONFIG"
echo "[i] Custom config: $FCONFIG"
sh $FCONFIG
fi
unset FCONFIG
@ -214,19 +195,21 @@ then
#
# Check if PX4IO present and update firmware if needed
#
if [ -f /etc/extras/px4io-v2.bin ]
if [ -f /etc/extras/px4io-v2_default.bin ]
then
set IO_FILE /etc/extras/px4io-v2.bin
set IO_FILE /etc/extras/px4io-v2_default.bin
else
set IO_FILE /etc/extras/px4io-v1.bin
set IO_FILE /etc/extras/px4io-v1_default.bin
fi
if px4io checkcrc ${IO_FILE}
then
echo "INFO [init] PX4IO CRC OK" >> $LOG_FILE
echo "PX4IO CRC OK" >> $LOG_FILE
set IO_PRESENT yes
else
echo "PX4IO Trying to update" >> $LOG_FILE
tone_alarm MLL32CP8MB
if px4io start
@ -246,16 +229,16 @@ then
usleep 500000
if px4io checkcrc $IO_FILE
then
echo "INFO [init] PX4IO CRC OK after updating" >> $LOG_FILE
echo "PX4IO CRC OK after updating" >> $LOG_FILE
tone_alarm MLL8CDE
set IO_PRESENT yes
else
echo "ERROR [init] PX4IO update failed" >> $LOG_FILE
echo "ERROR: PX4IO update failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
else
echo "ERROR [init] PX4IO update failed" >> $LOG_FILE
echo "ERROR: PX4IO update failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@ -263,7 +246,8 @@ then
if [ $IO_PRESENT == no ]
then
echo "ERROR [init] PX4IO not found" >> $LOG_FILE
echo "[i] ERROR: PX4IO not found"
echo "ERROR: PX4IO not found" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@ -285,6 +269,7 @@ then
then
# Need IO for output but it not present, disable output
set OUTPUT_MODE none
echo "[i] ERROR: PX4IO not found, disabling output"
# Avoid using ttyS0 for MAVLink on FMUv1
if ver hwcmp PX4FMU_V1
@ -305,11 +290,8 @@ then
then
set FMU_MODE serial
fi
unset HIL
else
unset HIL
gps start
fi
unset HIL
# waypoint storage
# REBOOTWORK this needs to start in parallel
@ -321,33 +303,27 @@ then
# Sensors System (start before Commander so Preflight checks are properly run)
#
sh /etc/init.d/rc.sensors
if [ $GPS == yes ]
then
if [ $GPS_FAKE == yes ]
then
echo "[i] Faking GPS"
gps start -f
else
gps start
fi
fi
unset GPS_FAKE
# Needs to be this early for in-air-restarts
if [ $OUTPUT_MODE == hil ]
then
commander start -hil
else
commander start
fi
#
# Start CPU load monitor
#
load_mon start
commander start
#
# Start primary output
#
set TTYS1_BUSY no
#
# Check if UAVCAN is enabled, default to it for ESCs
#
if param greater UAVCAN_ENABLE 2
then
set OUTPUT_MODE uavcan_esc
fi
# If OUTPUT_MODE == none then something is wrong with setup and we shouldn't try to enable output
if [ $OUTPUT_MODE != none ]
then
@ -355,7 +331,7 @@ then
then
if param compare UAVCAN_ENABLE 0
then
echo "INFO [init] OVERRIDING UAVCAN_ENABLE = 1" >> $LOG_FILE
echo "[i] OVERRIDING UAVCAN_ENABLE = 1"
param set UAVCAN_ENABLE 1
fi
fi
@ -366,7 +342,7 @@ then
then
sh /etc/init.d/rc.io
else
echo "INFO [init] PX4IO start failed" >> $LOG_FILE
echo "ERROR: PX4IO start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@ -375,8 +351,10 @@ then
then
if fmu mode_$FMU_MODE
then
echo "[i] FMU mode_$FMU_MODE started"
else
echo "ERR [init] FMU start failed" >> $LOG_FILE
echo "[i] ERROR: FMU mode_$FMU_MODE start failed"
echo "ERROR: FMU start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
@ -407,8 +385,10 @@ then
if mkblctrl $MKBLCTRL_ARG
then
echo "[i] MK started"
else
echo "ERROR [init] MK start failed" >> $LOG_FILE
echo "[i] ERROR: MK start failed"
echo "ERROR: MK start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
unset MKBLCTRL_ARG
@ -417,10 +397,12 @@ then
if [ $OUTPUT_MODE == hil ]
then
if pwm_out_sim mode_port2_pwm8
if hil mode_port2_pwm8
then
echo "[i] HIL output started"
else
echo "ERROR [init] PWM SIM start failed" >> $LOG_FILE
echo "[i] ERROR: HIL output start failed"
echo "ERROR: HIL output start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@ -434,9 +416,11 @@ then
then
if px4io start
then
echo "[i] PX4IO started"
sh /etc/init.d/rc.io
else
echo "ERROR [init] PX4IO start failed" >> $LOG_FILE
echo "[i] ERROR: PX4IO start failed"
echo "ERROR: PX4IO start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@ -445,8 +429,10 @@ then
then
if fmu mode_$FMU_MODE
then
echo "[i] FMU mode_$FMU_MODE started"
else
echo "ERROR [init] FMU mode_$FMU_MODE start failed" >> $LOG_FILE
echo "[i] ERROR: FMU mode_$FMU_MODE start failed"
echo "ERROR: FMU mode_$FMU_MODE start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
@ -465,6 +451,17 @@ then
fi
fi
# Start sensors depending on the interface being up
if param compare SENS_EN_LL40LS 1
then
if pwm_input start
then
if ll40ls start pwm
then
fi
fi
fi
if [ $MAVLINK_F == default ]
then
# Normal mode, use baudrate 57600 (default) and data rate 1000 bytes/s
@ -476,14 +473,8 @@ then
# Exit from nsh to free port for mavlink
set EXIT_ON_END yes
else
# Start MAVLink on default port: ttyS1
set MAVLINK_F "-r 1200"
# Avoid using ttyS1 for MAVLink on FMUv4
if ver hwcmp PX4FMU_V4
then
set MAVLINK_F "-r 1200 -d /dev/ttyS1"
# Start MAVLink on Wifi (ESP8266 port)
mavlink start -r 20000 -m config -b 921600 -d /dev/ttyS0
fi
fi
fi
@ -493,15 +484,10 @@ then
#
# MAVLink onboard / TELEM2
#
if ver hwcmp PX4FMU_V1
if ver hwcmp PX4FMU_V2
then
else
# XXX We need a better way for runtime eval of shell variables,
# but this works for now
if param compare SYS_COMPANION 10
then
frsky_telemetry start -d /dev/ttyS2
fi
if param compare SYS_COMPANION 921600
then
mavlink start -d /dev/ttyS2 -b 921600 -m onboard -r 80000 -x
@ -514,136 +500,16 @@ then
then
mavlink start -d /dev/ttyS2 -b 57600 -m osd -r 1000
fi
if param compare SYS_COMPANION 257600
then
mavlink start -d /dev/ttyS2 -b 57600 -m magic -r 5000 -x
fi
if param compare SYS_COMPANION 357600
then
mavlink start -d /dev/ttyS2 -b 57600 -r 1000
fi
if param compare SYS_COMPANION 1921600
then
mavlink start -d /dev/ttyS2 -b 921600 -r 20000
fi
# Sensors on the PWM interface bank
# clear pins 5 and 6
if param compare SENS_EN_LL40LS 1
then
set AUX_MODE pwm4
fi
if param greater TRIG_MODE 0
then
# Get FMU driver out of the way
set MIXER_AUX none
set AUX_MODE none
camera_trigger start
fi
fi
# UAVCAN
#
# Starting stuff according to UAVCAN_ENABLE value
#
if param greater UAVCAN_ENABLE 0
then
if uavcan start
then
else
tone_alarm $TUNE_ERR
fi
fi
if param greater UAVCAN_ENABLE 1
then
if uavcan start fw
then
else
tone_alarm $TUNE_ERR
fi
fi
#
# Optional drivers
#
# Sensors on the PWM interface bank
if param compare SENS_EN_LL40LS 1
then
if pwm_input start
then
if ll40ls start pwm
then
fi
fi
fi
# sf0x lidar sensor
if param compare SENS_EN_SF0X 1
then
sf0x start
fi
if ver hwcmp PX4FMU_V4
then
frsky_telemetry start -d /dev/ttyS6
fi
if ver hwcmp PX4FMU_V2
then
# Check for flow sensor - as it is a background task, launch it last
px4flow start &
fi
if ver hwcmp MINDPX_V2
then
#mindxp also need flow
px4flow start &
fi
# Start USB shell if no microSD present, MAVLink else
if [ $LOG_FILE == /dev/null ]
then
# Try to get an USB console
nshterm /dev/ttyACM0 &
else
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
fi
sh /etc/init.d/rc.uavcan
#
# Logging
#
if ver hwcmp PX4FMU_V1
then
if sdlog2 start -r 30 -a -b 2 -t
then
fi
else
# check if we should increase logging rate for ekf2 replay message logging
if param greater EKF2_REC_RPL 0
then
if param compare SYS_LOGGER 0
then
if sdlog2 start -r 500 -e -b 18 -t
then
fi
else
if logger start -r 500
then
fi
fi
else
if param compare SYS_LOGGER 0
then
if sdlog2 start -r 100 -a -b 9 -t
then
fi
else
if logger start -b 12
then
fi
fi
fi
fi
sh /etc/init.d/rc.logging
#
# Start up ARDrone Motor interface
@ -658,7 +524,7 @@ then
#
if [ $VEHICLE_TYPE == fw ]
then
echo "INFO [init] Fixedwing"
echo "[i] FIXED WING"
if [ $MIXER == none ]
then
@ -678,7 +544,10 @@ then
sh /etc/init.d/rc.interface
# Start standard fixedwing apps
sh /etc/init.d/rc.fw_apps
if [ $LOAD_DAPPS == yes ]
then
sh /etc/init.d/rc.fw_apps
fi
fi
#
@ -686,11 +555,11 @@ then
#
if [ $VEHICLE_TYPE == mc ]
then
echo "INFO [init] Multicopter"
echo "[i] MULTICOPTER"
if [ $MIXER == none ]
then
echo "INFO [init] Mixer undefined"
echo "Mixer undefined"
fi
if [ $MAV_TYPE == none ]
@ -704,10 +573,6 @@ then
then
set MAV_TYPE 2
fi
if [ $MIXER == quad_h ]
then
set MAV_TYPE 2
fi
if [ $MIXER == tri_y_yaw- -o $MIXER == tri_y_yaw+ ]
then
set MAV_TYPE 15
@ -724,20 +589,16 @@ then
then
set MAV_TYPE 14
fi
if [ $MIXER == octo_cox -o $MIXER == octo_cox_w ]
if [ $MIXER == octo_cox ]
then
set MAV_TYPE 14
fi
if [ $MIXER == coax ]
then
set MAV_TYPE 3
fi
fi
# Still no MAV_TYPE found
if [ $MAV_TYPE == none ]
then
echo "WARN [init] Unknown MAV_TYPE"
echo "Unknown MAV_TYPE"
param set MAV_TYPE 2
else
param set MAV_TYPE $MAV_TYPE
@ -747,7 +608,10 @@ then
sh /etc/init.d/rc.interface
# Start standard multicopter apps
sh /etc/init.d/rc.mc_apps
if [ $LOAD_DAPPS == yes ]
then
sh /etc/init.d/rc.mc_apps
fi
fi
#
@ -755,11 +619,11 @@ then
#
if [ $VEHICLE_TYPE == vtol ]
then
echo "INFO [init] VTOL"
echo "[init] Vehicle type: VTOL"
if [ $MIXER == none ]
then
echo "WARN [init] VTOL mixer undefined"
echo "Default mixer for vtol not defined"
fi
if [ $MAV_TYPE == none ]
@ -782,7 +646,7 @@ then
# Still no MAV_TYPE found
if [ $MAV_TYPE == none ]
then
echo "WARN [init] Unknown MAV_TYPE"
echo "Unknown MAV_TYPE"
param set MAV_TYPE 19
else
param set MAV_TYPE $MAV_TYPE
@ -792,7 +656,10 @@ then
sh /etc/init.d/rc.interface
# Start standard vtol apps
sh /etc/init.d/rc.vtol_apps
if [ $LOAD_DAPPS == yes ]
then
sh /etc/init.d/rc.vtol_apps
fi
fi
#
@ -807,51 +674,14 @@ then
sh /etc/init.d/rc.interface
# Start standard rover apps
sh /etc/init.d/rc.axialracing_ax10_apps
if [ $LOAD_DAPPS == yes ]
then
sh /etc/init.d/rc.axialracing_ax10_apps
fi
param set MAV_TYPE 10
fi
#
# For snapdragon, we need a passthrough mode
# Do not run any mavlink instances since we need the serial port for
# communication with Snapdragon.
#
if [ $VEHICLE_TYPE == passthrough ]
then
mavlink stop-all
commander stop
# Stop multicopter attitude controller if it is running, the controls come
# from Snapdragon.
if mc_att_control stop
then
fi
# Start snapdragon interface on serial port.
if ver hwcmp PX4FMU_V2
then
# On Pixfalcon use the standard telemetry port (Telem 1).
snapdragon_rc_pwm start -d /dev/ttyS1
px4io start
fi
if ver hwcmp PX4FMU_V4
then
# On Pixracer use Telem 2 port (TL2).
snapdragon_rc_pwm start -d /dev/ttyS2
fmu mode_pwm4
fi
pwm failsafe -c 1234 -p 900
pwm disarmed -c 1234 -p 900
# Arm straightaway.
pwm arm
# Use 400 Hz PWM on all channels.
pwm rate -a -r 400
fi
unset MIXER
unset MAV_TYPE
unset OUTPUT_MODE
@ -866,14 +696,15 @@ then
#
if [ $VEHICLE_TYPE == none ]
then
echo "WARN [init] No autostart ID found"
echo "[i] No autostart ID found"
fi
# Start any custom addons
set FEXTRAS /fs/microsd/etc/extras.txt
if [ -f $FEXTRAS ]
then
echo "INFO [init] Addons script: $FEXTRAS"
echo "[i] Addons script: $FEXTRAS"
sh $FEXTRAS
fi
unset FEXTRAS
@ -881,23 +712,24 @@ then
# Run no SD alarm
if [ $LOG_FILE == /dev/null ]
then
echo "[i] No microSD card found"
# Play SOS
tone_alarm error
fi
# Boot is complete, inform MAVLink app(s) that the system is now fully up and running
mavlink boot_complete
if [ $EXIT_ON_END == yes ]
then
echo "Exit from nsh"
exit
fi
unset EXIT_ON_END
# End of autostart
fi
# There is no further script processing, so we can free some RAM
# There is no further processing, so we can free some RAM
# XXX potentially unset all script variables.
unset TUNE_ERR
# Boot is complete, inform MAVLink app(s) that the system is now fully up and running
mavlink boot_complete
if [ $EXIT_ON_END == yes ]
then
echo "INFO [init] NSH exit"
exit
fi
unset EXIT_ON_END

View File

@ -1,96 +0,0 @@
Aileron/rudder/elevator/throttle/wheel/flaps mixer for PX4FMU
=======================================================
This file defines mixers suitable for controlling a fixed wing aircraft with
aileron, rudder, elevator, throttle and steerable wheel controls using PX4FMU.
The configuration assumes the aileron servo(s) are connected to PX4FMU servo
output 0 and 1, the elevator to output 2, the rudder to output 3, the throttle
to output 4 and the wheel to output 5.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch), 2 (yaw) and 3 (thrust) 4 (flaps) 6 (flaperon).
Aileron mixer (roll + flaperon)
---------------------------------
This mixer assumes that the aileron servos are set up correctly mechanically;
depending on the actual configuration it may be necessary to reverse the scaling
factors (to reverse the servo movement) and adjust the offset, scaling and
endpoints to suit.
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
S: 0 6 -10000 -10000 0 -10000 10000
Elevator mixer
------------
Two scalers total (output, roll).
This mixer assumes that the elevator servo is set up correctly mechanically;
depending on the actual configuration it may be necessary to reverse the scaling
factors (to reverse the servo movement) and adjust the offset, scaling and
endpoints to suit.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 1 -10000 -10000 0 -10000 10000
Rudder mixer
------------
Two scalers total (output, yaw).
This mixer assumes that the rudder servo is set up correctly mechanically;
depending on the actual configuration it may be necessary to reverse the scaling
factors (to reverse the servo movement) and adjust the offset, scaling and
endpoints to suit.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
Motor speed mixer
-----------------
Two scalers total (output, thrust).
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Wheel mixer
------------
Two scalers total (output, yaw).
This mixer assumes that the wheel servo is set up correctly mechanically;
depending on the actual configuration it may be necessary to reverse the scaling
factors (to reverse the servo movement) and adjust the offset, scaling and
endpoints to suit.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
Flaps / gimbal / payload mixer for last three channels,
using the payload control group
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 2 0 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 2 2 10000 10000 0 -10000 10000

View File

@ -1,84 +0,0 @@
Aileron/v-tail/throttle/wheel/flaps mixer for PX4FMU
=======================================================
This file defines mixers suitable for controlling a fixed wing aircraft with
aileron, v-tail (rudder, elevator), throttle, steerable wheel and flaps
using PX4FMU.
The configuration assumes the aileron servos are connected to PX4FMU servo
output 0 and 1, the tail servos to output 2 and 3, the throttle
to output 4, the wheel to output 5 and the flaps to output 6 and 7.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch), 2 (yaw) and 3 (thrust) 4 (flaps) 6 (flaperon).
Aileron mixer (roll + flaperon)
---------------------------------
This mixer assumes that the aileron servos are set up correctly mechanically;
depending on the actual configuration it may be necessary to reverse the scaling
factors (to reverse the servo movement) and adjust the offset, scaling and
endpoints to suit.
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
S: 0 6 -10000 -10000 0 -10000 10000
V-tail mixers
-------------
Three scalers total (output, roll, pitch).
On the assumption that the two tail servos are physically reversed, the pitch
input is inverted between the two servos.
M: 2
O: 10000 10000 0 -10000 10000
S: 0 2 -7000 -7000 0 -10000 10000
S: 0 1 -8000 -8000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 0 2 -7000 -7000 0 -10000 10000
S: 0 1 8000 8000 0 -10000 10000
Motor speed mixer
-----------------
Two scalers total (output, thrust).
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Wheel mixer
------------
Two scalers total (output, yaw).
This mixer assumes that the wheel servo is set up correctly mechanically;
depending on the actual configuration it may be necessary to reverse the scaling
factors (to reverse the servo movement) and adjust the offset, scaling and
endpoints to suit.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 -10000 -10000 0 -10000 10000
Flaps mixer
------------
Flap servos are physically reversed.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 0 5000 -10000 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 0 -5000 10000 -10000 10000

View File

@ -62,3 +62,24 @@ range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Gimbal / flaps / payload mixer for last four channels,
using the payload control group
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 2 0 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 2 1 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 2 2 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 2 3 10000 10000 0 -10000 10000

View File

@ -58,3 +58,23 @@ range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Gimbal / flaps / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -62,3 +62,23 @@ endpoints to suit.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
Gimbal / flaps / payload mixer for last four channels,
using the payload control group
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 2 0 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 2 1 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 2 2 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 2 3 10000 10000 0 -10000 10000

0
ROMFS/px4fmu_common/mixers/FX79.main.mix Normal file → Executable file
View File

View File

@ -49,3 +49,22 @@ range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Gimbal / flaps / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -51,3 +51,23 @@ range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Gimbal / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

0
ROMFS/px4fmu_common/mixers/Viper.main.mix Normal file → Executable file
View File

View File

@ -47,3 +47,22 @@ range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Gimbal / flaps / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -1,39 +1,16 @@
Caipirinha tailsitter mixer
============================
This file defines a mixer for the TBS Caipirinha tailsitter edition. This vehicle
has two motors in total, one attached to each wing. It also has two elevons which
are located in the slipstream of the propellers. This mixer generates 4 PWM outputs
on the main PWM ouput port, two at 400Hz for the motors, and two at 50Hz for the
elevon servos. Channels 1-4 are configured to run at 400Hz, while channels 5-8 run
at the default rate of 50Hz. Note that channels 3 and 4 are assigned but not used.
Motor mixer
------------
Channel 1 connects to the right (starboard) motor.
Channel 2 connects to the left (port) motor.
#!nsh
# Caipirinha vtol mixer for PX4FMU
#
#===========================
R: 2- 10000 10000 10000 0
Zero mixer (2x)
---------------
Channels 3,4 are unused.
Z:
Z:
Elevons mixer
--------------
Channel 5 connects to the right (starboard) elevon.
Channel 6 connects to the left (port) elevon.
#mixer for the elevons
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 10000 10000 0 -10000 10000
S: 1 1 10000 10000 0 -10000 10000
M: 2
O: 7500 7500 0 -10000 10000
S: 1 0 -10000 -10000 0 -10000 10000
S: 1 1 10000 10000 0 -10000 10000
M: 2
O: 7500 7500 0 -10000 10000
S: 1 0 -10000 -10000 0 -10000 10000
O: 10000 10000 0 -10000 10000
S: 1 0 10000 10000 0 -10000 10000
S: 1 1 -10000 -10000 0 -10000 10000

View File

@ -1,33 +0,0 @@
Coaxial helicopter mixer
- Two servomotors act on the swashplate (90° angle on the swashplate, decoupled effect on roll and pitch).
- No collective pitch.
- One motor per rotor.
===========================
Left swashplate servomotor, pitch axis
-------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 1 -10000 -10000 0 -10000 10000
Right swashplate servomotor, roll axis
-------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
Upper rotor (CCW)
Mixing between yaw and thrust
-------------
M: 2
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Lower rotor (CW)
Mixing between yaw and thrust
-------------
M: 2
O: 10000 10000 0 -10000 10000
S: 0 2 -10000 -10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000

View File

@ -47,3 +47,24 @@ range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Gimbal / flaps / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -1,3 +0,0 @@
# Octo coaxial with wide arms
R: 8cw 10000 10000 10000 0

View File

@ -46,3 +46,22 @@ range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
Gimbal / flaps / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -1,26 +0,0 @@
Mixer for SITL plane, using the VTOL airframe for now
=========================================================
Z:
Z:
Z:
Z:
# mixer for the elevons
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 5000 5000 0 -10000 10000
S: 0 1 -5000 -5000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 5000 5000 0 -10000 10000
S: 0 1 5000 5000 0 -10000 10000
# mixer for the pusher/puller throttle
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000

View File

@ -6,13 +6,22 @@ are mixed 100%.
R: 4+ 10000 10000 10000 0
Gimbal / payload mixer for last two channels
Gimbal / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 6 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -1,18 +0,0 @@
Multirotor mixer for PX4FMU
===========================
This file defines a single mixer for a quadrotor in the H configuration. All controls
are mixed 100%.
R: 4h 10000 10000 10000 0
Gimbal / payload mixer for last two 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

View File

@ -1,25 +0,0 @@
Multirotor mixer for TEST
===========================
This file defines a single mixer for a quadrotor with a wide configuration. All controls are mixed 100%.
R: 4w 10000 10000 10000 0
Gimbal / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -6,13 +6,21 @@ are mixed 100%.
R: 4v 10000 10000 10000 0
Gimbal / payload mixer for last two channels
Gimbal / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 6 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -5,13 +5,21 @@ This file defines a single mixer for a quadrotor with a wide configuration. All
R: 4w 10000 10000 10000 0
Gimbal / payload mixer for last two channels
Gimbal / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 6 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -1,7 +1,26 @@
Multirotor mixer for PX4FMU
===========================
This file defines a single mixer for a quadrotor in the X configuration. All controls
are mixed 100%.
R: 4x 10000 10000 10000 0
Gimbal / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 6 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -9,10 +9,10 @@ R: 4x 10000 10000 10000 0
#mixer for the elevons
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 5000 5000 0 -10000 10000
S: 1 1 5000 5000 0 -10000 10000
S: 1 0 10000 10000 0 -10000 10000
S: 1 1 10000 10000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 5000 5000 0 -10000 10000
S: 1 1 -5000 -5000 0 -10000 10000
S: 1 0 10000 10000 0 -10000 10000
S: 1 1 -10000 -10000 0 -10000 10000

View File

@ -5,17 +5,21 @@ This file defines a single mixer for a quadrotor in SK450 DeadCat configuration.
R: 4dc 10000 10000 10000 0
Gimbal / payload mixer for last three channels
Gimbal / payload mixer for last four channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 6 10000 10000 0 -10000 10000
S: 0 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 7 10000 10000 0 -10000 10000
S: 0 6 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000

View File

@ -1,7 +0,0 @@
Multirotor mixer for PX4FMU
===========================
This file defines a single mixer for a quadrotor in the X configuration. All controls
are mixed 100%.
R: 4x 10000 10000 10000 0

View File

@ -1,24 +0,0 @@
Mixer for standard vtol plane (SITL) with motor x configuration
=========================================================
This file defines a single mixer for a standard vtol plane (SITL gazebo) with motors in X configuration.
The plane has two ailerons and one elevator. The ailerons and elevator are treated as elevons
in order to make the standard vtol simulation compatible with the tailsitter simulation.
R: 4x 10000 10000 10000 0
# mixer for the elevons
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 5000 5000 0 -10000 10000
S: 1 1 -5000 -5000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 5000 5000 0 -10000 10000
S: 1 1 5000 5000 0 -10000 10000
# mixer for the pusher/puller throttle
M: 1
O: 10000 10000 0 -10000 10000
S: 1 3 0 20000 -10000 -10000 10000

View File

@ -1,59 +0,0 @@
Aileron/v-tail/throttle VTOL mixer for PX4FMU
=======================================================
This file defines mixers suitable for controlling a fixed wing aircraft with
aileron, v-tail (rudder, elevator) and throttle using PX4FMU.
The configuration assumes the aileron servos are connected to PX4FMU
AUX servo output 0 and 1, the tail servos to output 2 and 3, the throttle
to output 4.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch), 2 (yaw) and 3 (thrust) 4 (flaps) 6 (flaperon).
Aileron mixer (roll + flaperon)
---------------------------------
This mixer assumes that the aileron servos are set up correctly mechanically;
depending on the actual configuration it may be necessary to reverse the scaling
factors (to reverse the servo movement) and adjust the offset, scaling and
endpoints to suit.
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 10000 10000 0 -10000 10000
S: 1 6 10000 10000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 10000 10000 0 -10000 10000
S: 1 6 -10000 -10000 0 -10000 10000
V-tail mixers
-------------
Three scalers total (output, roll, pitch).
On the assumption that the two tail servos are physically reversed, the pitch
input is inverted between the two servos.
M: 2
O: 10000 10000 0 -10000 10000
S: 1 2 -7000 -7000 0 -10000 10000
S: 1 1 -8000 -8000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 1 2 -7000 -7000 0 -10000 10000
S: 1 1 8000 8000 0 -10000 10000
Motor speed mixer
-----------------
Two scalers total (output, thrust).
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 1 3 0 20000 -10000 -10000 10000

View File

@ -1,39 +0,0 @@
Delta-wing VTOL mixer
=====================
This file defines mixers suitable for controlling a delta wing VTOL aircraft using
PX4FMU. The configuration assumes the elevon servos are connected to PX4FMU
AUX servo outputs 0 and 1 and the motor speed control to output 2.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch) and 3 (thrust).
See the README for more information on the scaler format.
Elevon mixers
-------------
Three scalers total (output, roll, pitch).
On the assumption that the two elevon servos are physically reversed, the pitch
input is inverted between the two servos.
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 -6000 -6000 0 -10000 10000
S: 1 1 6500 6500 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 -6000 -6000 0 -10000 10000
S: 1 1 -6500 -6500 0 -10000 10000
Motor speed mixer
-----------------
Two scalers total (output, thrust).
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 1 3 0 20000 -10000 -10000 10000

View File

@ -1,201 +0,0 @@
#!nsh
#
# Standard startup script for PX4FMU v1, v2, v3, v4 onboard sensor drivers.
#
if ver hwcmp PX4FMU_V1
then
if ms5611 start
then
fi
else
# Configure all I2C buses to 100 KHz as they
# are all external or slow
fmu i2c 1 100000
fmu i2c 2 100000
if ms5611 -s start
then
fi
# Blacksheep telemetry
if bst start
then
fi
fi
if adc start
then
fi
if ver hwcmp PX4FMU_V2
then
# External I2C bus
if hmc5883 -C -T -X start
then
fi
# External I2C bus
if lis3mdl -X start
then
fi
# Internal I2C bus
if hmc5883 -C -T -I -R 4 start
then
fi
# external MPU6K is rotated 180 degrees yaw
if mpu6000 -X -R 4 start
then
set BOARD_FMUV3 true
else
set BOARD_FMUV3 false
fi
if [ $BOARD_FMUV3 == true ]
then
# external L3GD20H is rotated 180 degrees yaw
if l3gd20 -X -R 4 start
then
fi
# external LSM303D is rotated 270 degrees yaw
if lsm303d -X -R 6 start
then
fi
# internal MPU6000 is rotated 180 deg roll, 270 deg yaw
if mpu6000 -R 14 start
then
fi
if hmc5883 -C -T -S -R 8 start
then
fi
if meas_airspeed start -b 2
then
fi
else
# FMUv2
if mpu6000 start
then
fi
if l3gd20 start
then
fi
if lsm303d start
then
fi
fi
fi
if ver hwcmp PX4FMU_V4
then
# External I2C bus
if hmc5883 -C -T -X start
then
fi
if lis3mdl -R 2 start
then
fi
# Internal SPI bus is rotated 90 deg yaw
if hmc5883 -C -T -S -R 2 start
then
fi
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
if mpu6000 -R 2 -T 20608 start
then
fi
# Internal SPI bus mpu9250 is rotated 90 deg yaw
if mpu9250 -R 2 start
then
fi
fi
if ver hwcmp PX4FMU_V1
then
# FMUv1
if mpu6000 start
then
fi
if l3gd20 start
then
fi
# MAG selection
if param compare SENS_EXT_MAG 2
then
if hmc5883 -C -I start
then
fi
else
# Use only external as primary
if param compare SENS_EXT_MAG 1
then
if hmc5883 -C -X start
then
fi
else
# auto-detect the primary, prefer external
if hmc5883 start
then
fi
fi
fi
fi
if ver hwcmp MINDPX_V2
then
if mpu6500 start
then
fi
if lsm303d start
then
fi
if l3gd20 start
then
fi
# External I2C bus
if hmc5883 -C -T -X start
then
fi
if lis3mdl -R 2 start
then
fi
fi
if meas_airspeed start
then
else
if ets_airspeed start
then
else
if ets_airspeed start -b 1
then
fi
fi
fi
if sf10a start
then
fi
# Wait 20 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire)
usleep 20000
if sensors start
then
fi

View File

@ -38,11 +38,6 @@ fi
# Start a minimal system
#
#
# Start the ORB (first app to start)
#
uorb start
#
# Load parameters
#
@ -60,11 +55,11 @@ else
echo "[param] FAILED loading $PARAM_FILE"
fi
if [ -f /etc/extras/px4io-v2.bin ]
if [ -f /etc/extras/px4io-v2_default.bin ]
then
set io_file /etc/extras/px4io-v2.bin
set io_file /etc/extras/px4io-v2_default.bin
else
set io_file /etc/extras/px4io-v1.bin
set io_file /etc/extras/px4io-v1_default.bin
fi
if px4io start
@ -109,7 +104,103 @@ then
tests mount
fi
sh /etc/init.d/rc.sensors
#
# Run unit tests at board boot, reporting failure as needed.
# Add new unit tests using the same pattern as below.
#
if mavlink_tests
then
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} mavlink_tests"
fi
if commander_tests
then
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} commander_tests"
fi
if uorb test
then
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} uorb_tests"
fi
# Start all sensors on all boards
ms5611 start
adc start
if mpu6000 -X start
then
fi
if mpu6000 start
then
fi
if l3gd20 -X start
then
fi
if l3gd20 start
then
fi
# MAG selection
if param compare SENS_EXT_MAG 2
then
if hmc5883 -I start
then
fi
else
# Use only external as primary
if param compare SENS_EXT_MAG 1
then
if hmc5883 -X start
then
fi
else
# auto-detect the primary, prefer external
if hmc5883 start
then
fi
fi
fi
if ver hwcmp PX4FMU_V2
then
if lsm303d -X start
then
fi
if lsm303d start
then
fi
if ms5611 -X start
then
fi
fi
if meas_airspeed start
then
else
if ets_airspeed start
then
else
if ets_airspeed start -b 1
then
fi
fi
fi
if sensors start
then
fi
# Check for flow sensor
if px4flow start
@ -120,60 +211,6 @@ if ll40ls start
then
fi
#
# Run unit tests at board boot, reporting failure as needed.
# Add new unit tests using the same pattern as below.
#
echo
echo "--------------------------------------------------------------------------------"
echo "[mavlink_tests] STARTING TEST"
if mavlink_tests
then
echo "[mavlink_tests] PASS"
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} mavlink_tests"
echo "[mavlink_tests] FAILED"
fi
echo "--------------------------------------------------------------------------------"
echo
echo "--------------------------------------------------------------------------------"
echo "[commander_tests] STARTING TEST"
if commander_tests
then
echo "[commander_tests] PASS"
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} commander_tests"
echo "[commander_tests] FAILED"
fi
echo "--------------------------------------------------------------------------------"
echo
echo "--------------------------------------------------------------------------------"
echo "[controllib_test] STARTING TEST"
if controllib_test
then
echo "[controllib_test] PASS"
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} controllib_tests"
echo "[controllib_test] FAILED"
fi
echo "--------------------------------------------------------------------------------"
echo
echo "--------------------------------------------------------------------------------"
echo "[uorb_tests] STARTING TEST"
if uorb_tests
then
echo "[uorb_tests] PASS"
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} uorb_tests"
echo "[uorb_tests] FAILED"
fi
echo "--------------------------------------------------------------------------------"
if tests all
then
else

View File

@ -1,296 +0,0 @@
#!/usr/bin/env python
################################################################################################
# @File MissionCheck.py
# Automated mission loading, execution and monitoring
# for Continuous Integration
#
# @author Sander Smeets <sander@droneslab.com>
#
# Code partly based on DroneKit (c) Copyright 2015-2016, 3D Robotics.
################################################################################################
################################################################################################
# Settings
################################################################################################
connection_string = '127.0.0.1:14540'
import_mission_filename = 'VTOLmission.txt'
max_execution_time = 250
alt_acceptance_radius = 10
################################################################################################
# Init
################################################################################################
# Import DroneKit-Python
from dronekit import connect, Command
from pymavlink import mavutil
import time, sys, argparse
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--connect", help="connection string")
parser.add_argument("-f", "--filename", help="mission filename")
parser.add_argument("-t", "--timeout", help="execution timeout", type=float)
parser.add_argument("-a", "--altrad", help="altitude acceptance radius", type=float)
args = parser.parse_args()
if args.connect:
connection_string = args.connect
if args.filename:
import_mission_filename = args.filename
if args.timeout:
max_execution_time = args.timeout
if args.altrad:
alt_acceptance_radius = args.altrad
mission_failed = False
MAV_MODE_AUTO = 4
# start time counter
start_time = time.time()
elapsed_time = time.time() - start_time
# Connect to the Vehicle
print "Connecting"
vehicle = connect(connection_string, wait_ready=True)
while not vehicle.system_status.state == "STANDBY" or vehicle.gps_0.fix_type < 3:
if time.time() - start_time > 20:
print "FAILED: SITL did not reach standby with GPS fix within 20 seconds"
sys.exit(98)
print "Waiting for vehicle to initialise... %s " % vehicle.system_status.state
time.sleep(1)
# Display basic vehicle state
print " Type: %s" % vehicle._vehicle_type
print " Armed?: %s" % vehicle.armed
print " System status: %s" % vehicle.system_status.state
print " GPS: %s" % vehicle.gps_0
print " Alt: %s" % vehicle.location.global_relative_frame.alt
################################################################################################
# Functions
################################################################################################
def readmission(aFileName):
"""
Load a mission from a file into a list. The mission definition is in the Waypoint file
format (http://qgroundcontrol.org/mavlink/waypoint_protocol#waypoint_file_format).
This function is used by upload_mission().
"""
cmds = vehicle.commands
missionlist=[]
with open(aFileName) as f:
for i, line in enumerate(f):
if i==0:
if not line.startswith('QGC WPL 110'):
raise Exception('File is not supported WP version')
else:
linearray=line.split('\t')
ln_index=int(linearray[0])
ln_currentwp=int(linearray[1])
ln_frame=int(linearray[2])
ln_command=int(linearray[3])
ln_param1=float(linearray[4])
ln_param2=float(linearray[5])
ln_param3=float(linearray[6])
ln_param4=float(linearray[7])
ln_param5=float(linearray[8])
ln_param6=float(linearray[9])
ln_param7=float(linearray[10])
ln_autocontinue=int(linearray[11].strip())
cmd = Command( 0, 0, 0, ln_frame, ln_command, ln_currentwp, ln_autocontinue, ln_param1, ln_param2, ln_param3, ln_param4, ln_param5, ln_param6, ln_param7)
missionlist.append(cmd)
return missionlist
def upload_mission(aFileName):
"""
Upload a mission from a file.
"""
#Read mission from file
missionlist = readmission(aFileName)
#Clear existing mission from vehicle
cmds = vehicle.commands
cmds.clear()
#Add new mission to vehicle
for command in missionlist:
cmds.add(command)
print ' Uploaded mission with %s items' % len(missionlist)
vehicle.commands.upload()
return missionlist
def download_mission():
"""
Downloads the current mission and returns it in a list.
It is used in save_mission() to get the file information to save.
"""
print " Download mission from vehicle"
missionlist=[]
cmds = vehicle.commands
cmds.download()
cmds.wait_ready()
for cmd in cmds:
missionlist.append(cmd)
return missionlist
def save_mission(aFileName):
"""
Save a mission in the Waypoint file format
(http://qgroundcontrol.org/mavlink/waypoint_protocol#waypoint_file_format).
"""
print "\nSave mission from Vehicle to file: %s" % export_mission_filename
#Download mission from vehicle
missionlist = download_mission()
#Add file-format information
output='QGC WPL 110\n'
#Add home location as 0th waypoint
home = vehicle.home_location
output+="%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (0,1,0,16,0,0,0,0,home.lat,home.lon,home.alt,1)
#Add commands
for cmd in missionlist:
commandline="%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (cmd.seq,cmd.current,cmd.frame,cmd.command,cmd.param1,cmd.param2,cmd.param3,cmd.param4,cmd.x,cmd.y,cmd.z,cmd.autocontinue)
output+=commandline
with open(aFileName, 'w') as file_:
print " Write mission to file"
file_.write(output)
def printfile(aFileName):
"""
Print a mission file to demonstrate "round trip"
"""
print "\nMission file: %s" % aFileName
with open(aFileName) as f:
for line in f:
print ' %s' % line.strip()
################################################################################################
# Listeners
################################################################################################
current_sequence = -1
current_sequence_changed = False
current_landed_state = -1
home_position_set = False
#Create a message listener for mission sequence number
@vehicle.on_message('MISSION_CURRENT')
def listener(self, name, mission_current):
global current_sequence, current_sequence_changed
if (current_sequence <> mission_current.seq):
current_sequence = mission_current.seq;
current_sequence_changed = True
print 'current mission sequence: %s' % mission_current.seq
#Create a message listener for mission sequence number
@vehicle.on_message('EXTENDED_SYS_STATE')
def listener(self, name, extended_sys_state):
global current_landed_state
if (current_landed_state <> extended_sys_state.landed_state):
current_landed_state = extended_sys_state.landed_state;
#Create a message listener for home position fix
@vehicle.on_message('HOME_POSITION')
def listener(self, name, home_position):
global home_position_set
home_position_set = True
################################################################################################
# Start mission test
################################################################################################
while not home_position_set:
if time.time() - start_time > 30:
print "FAILED: getting home position 30 seconds"
sys.exit(98)
print "Waiting for home position..."
time.sleep(1)
#Upload mission from file
missionlist = upload_mission(import_mission_filename)
time.sleep(2)
# set mission mode the hard way
vehicle._master.mav.command_long_send(vehicle._master.target_system, vehicle._master.target_component,
mavutil.mavlink.MAV_CMD_DO_SET_MODE, 0,
MAV_MODE_AUTO,
0, 0, 0, 0, 0, 0)
time.sleep(1)
# Arm vehicle
vehicle.armed = True
while not vehicle.system_status.state == "ACTIVE":
if time.time() - start_time > 30:
print "FAILED: vehicle did not arm within 30 seconds"
sys.exit(98)
print "Waiting for vehicle to arm..."
time.sleep(1)
# Wait for completion of mission items
while (current_sequence < len(missionlist)-1 and elapsed_time < max_execution_time):
time.sleep(.2)
if current_sequence > 0 and current_sequence_changed:
if missionlist[current_sequence-1].z - alt_acceptance_radius > vehicle.location.global_relative_frame.alt or missionlist[current_sequence-1].z + alt_acceptance_radius < vehicle.location.global_relative_frame.alt:
print "waypoint %s out of bounds altitude %s gps altitude: %s" % (current_sequence, missionlist[current_sequence-1].z, vehicle.location.global_relative_frame.alt)
mission_failed = True
current_sequence_changed = False
elapsed_time = time.time() - start_time
if elapsed_time < max_execution_time:
print "Mission items have been executed"
# wait for the vehicle to have landed
while (current_landed_state != 1 and elapsed_time < max_execution_time):
time.sleep(1)
elapsed_time = time.time() - start_time
if elapsed_time < max_execution_time:
print "Vehicle has landed"
# Disarm vehicle
vehicle.armed = False
# count elapsed time
elapsed_time = time.time() - start_time
# Close vehicle object before exiting script
vehicle.close()
time.sleep(2)
# Validate time constraint
if elapsed_time <= max_execution_time and not mission_failed:
print "Mission succesful time elapsed %s" % elapsed_time
sys.exit(0)
if elapsed_time > max_execution_time:
print "Mission FAILED to execute within %s seconds" % max_execution_time
sys.exit(99)
if mission_failed:
print "Mission FAILED out of bounds"
sys.exit(100)
print "Mission FAILED something strange happened"
sys.exit(101)

View File

@ -1,9 +0,0 @@
QGC WPL 110
0 1 0 16 0 0 0 0 47.3979949951 8.54559612274 25.0 1
1 0 2 3000 4.0 0.0 0.0 0.0 47.3980331421 8.54578971863 25.0 1
2 0 3 16 0.0 0.0 -0.0 0.0 47.399269104 8.54557228088 25.0 1
3 0 3 16 0.0 0.0 -0.0 0.0 47.3992652893 8.54230213165 25.0 1
4 0 3 16 0.0 0.0 -0.0 0.0 47.3974761963 8.54239082336 25.0 1
5 0 3 16 0.0 0.0 -0.0 0.0 47.3976669312 8.54509449005 25.0 1
6 0 2 3000 3.0 0.0 0.0 0.0 47.3977851868 8.54526233673 25.0 1
7 0 3 21 25.0 0.0 -0.0 0.0 47.3979797363 8.54460906982 25.0 1

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