Merge branch 'master' of github.com:PX4/Firmware

This commit is contained in:
Youssef Demitri
2015-10-16 15:34:13 +02:00
523 changed files with 16593 additions and 11454 deletions
+3
View File
@@ -17,7 +17,9 @@
.~lock.* .~lock.*
Archives/* Archives/*
Build/* Build/*
Testing/
build/* build/*
build_*/
core core
cscope.out cscope.out
Firmware.sublime-workspace Firmware.sublime-workspace
@@ -52,3 +54,4 @@ src/platforms/posix/px4_messages/
src/platforms/posix-arm/px4_messages/ src/platforms/posix-arm/px4_messages/
src/platforms/qurt/px4_messages/ src/platforms/qurt/px4_messages/
ROMFS/*/*/rc.autostart ROMFS/*/*/rc.autostart
rootfs/
+2 -2
View File
@@ -4,8 +4,8 @@
[submodule "NuttX"] [submodule "NuttX"]
path = NuttX path = NuttX
url = git://github.com/PX4/NuttX.git url = git://github.com/PX4/NuttX.git
[submodule "src/lib/uavcan"] [submodule "src/modules/uavcan/libuavcan"]
path = src/lib/uavcan path = src/modules/uavcan/libuavcan
url = git://github.com/UAVCAN/libuavcan.git url = git://github.com/UAVCAN/libuavcan.git
[submodule "Tools/genmsg"] [submodule "Tools/genmsg"]
path = Tools/genmsg path = Tools/genmsg
+73 -42
View File
@@ -3,8 +3,12 @@
language: cpp language: cpp
# use travis-ci docker based infrastructure matrix:
sudo: false include:
- os: linux
sudo: false
- os: osx
osx_image: beta-xcode6.3
cache: cache:
directories: directories:
@@ -32,17 +36,34 @@ addons:
- texinfo - texinfo
- zlib1g-dev - zlib1g-dev
before_install:
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
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
&& 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.8" CC="gcc-4.8"; fi
;
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew tap PX4/homebrew-px4
&& brew update
&& brew install genromfs
&& brew install kconfig-frontends
&& brew install gcc-arm-none-eabi
&& brew install astyle
&& sudo easy_install pip
&& sudo pip install pyserial empy
;
fi
before_script: 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 # setup ccache
- mkdir -p ~/bin - mkdir -p ~/bin
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-g++ - ln -s /usr/bin/ccache ~/bin/arm-none-eabi-g++
@@ -56,9 +77,6 @@ before_script:
- ln -s /usr/bin/ccache ~/bin/g++-4.8 - ln -s /usr/bin/ccache ~/bin/g++-4.8
- ln -s /usr/bin/ccache ~/bin/gcc-4.8 - ln -s /usr/bin/ccache ~/bin/gcc-4.8
- export PATH=~/bin:$PATH - export PATH=~/bin:$PATH
# grab astyle 2.05.1
- wget -O ~/bin/astyle https://github.com/PX4/astyle/releases/download/2.05.1/astyle-linux && chmod +x ~/bin/astyle
- astyle --version
env: env:
global: global:
@@ -70,41 +88,54 @@ env:
script: script:
- make check_format - make check_format
- ccache -z
- arm-none-eabi-gcc --version - arm-none-eabi-gcc --version
- echo 'Building POSIX Firmware..' && echo -en 'travis_fold:start:script.1\\r' - echo 'Building POSIX Firmware..' && echo -en 'travis_fold:start:script.1\\r'
- make posix -j4 - make posix_sitl_simple
- ccache -s
- echo -en 'travis_fold:end:script.1\\r' - echo -en 'travis_fold:end:script.1\\r'
- echo 'Running Tests..' && echo -en 'travis_fold:start:script.2\\r' - echo 'Running Tests..' && echo -en 'travis_fold:start:script.2\\r'
- make tests - make posix_sitl_simple test
- cat src/modules/systemlib/mixer/mixer_multirotor.generated.h - cat build_posix_sitl_simple/src/modules/systemlib/mixer/mixer_multirotor.generated.h
- echo -en 'travis_fold:end:script.2\\r' - echo -en 'travis_fold:end:script.2\\r'
- echo 'Building NuttX..' && echo -en 'travis_fold:start:script.3\\r' - echo 'Building NuttX Firmware..' && echo -en 'travis_fold:start:script.3\\r'
- make archives - make px4fmu-v1_default
- ccache -s - make px4fmu-v2_default
- echo -en 'travis_fold:end:script.3\\r' - echo -en 'travis_fold:end:script.3\\r'
- echo 'Building NuttX Firmware..' && echo -en 'travis_fold:start:script.4\\r' - echo 'Running Tests..' && echo -en 'travis_fold:start:script.4\\r'
- make -j4 - make px4fmu-v2_default test
- make size
- ccache -s
- echo -en 'travis_fold:end:script.4\\r' - echo -en 'travis_fold:end:script.4\\r'
- zip Firmware.zip Images/*.px4 #- make px4fmu-v2_default package
#- 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_script: #after_script:
- git clone git://github.com/PX4/CI-Tools.git #- git clone git://github.com/PX4/CI-Tools.git
- ./CI-Tools/s3cmd-configure #- ./CI-Tools/s3cmd-configure
# upload newest build for this branch with s3 index ## upload newest build for this branch with s3 index
- ./CI-Tools/s3cmd-put Images/px4*.px4 CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/ #- ./CI-Tools/s3cmd-put Images/px4*.px4 CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/
# archive newest build by date with s3 index ## 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 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/directory/index.html archives/Firmware/$TRAVIS_BRANCH/
# upload top level index.html and timestamp.html ## upload top level index.html and timestamp.html
- ./CI-Tools/s3cmd-put CI-Tools/index.html index.html #- ./CI-Tools/s3cmd-put CI-Tools/index.html index.html
- ./CI-Tools/s3cmd-put CI-Tools/timestamp.html timestamp.html #- ./CI-Tools/s3cmd-put CI-Tools/timestamp.html timestamp.html
- echo "" #- echo ""
- echo "Binaries have been posted to:" #- echo "Binaries have been posted to:"
- echo https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip #- echo https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip
deploy: deploy:
provider: releases provider: releases
+313 -317
View File
File diff suppressed because it is too large Load Diff
+145 -254
View File
@@ -1,5 +1,6 @@
############################################################################
# #
# Copyright (c) 2012-2015 PX4 Development Team. All rights reserved. # Copyright (c) 2015 PX4 Development Team. All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
@@ -28,280 +29,170 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE. # POSSIBILITY OF SUCH DAMAGE.
# #
############################################################################
# Enforce the presence of the GIT repository
# #
# Top-level Makefile for building PX4 firmware images. # We depend on our submodules, so we have to prevent attempts to
# # compile without it being present.
ifeq ($(wildcard .git),)
TARGETS := nuttx posix posix-arm qurt $(error YOU HAVE TO USE GIT TO DOWNLOAD THIS REPOSITORY. ABORTING.)
EXPLICIT_TARGET := $(filter $(TARGETS),$(MAKECMDGOALS))
ifneq ($(EXPLICIT_TARGET),)
export PX4_TARGET_OS=$(EXPLICIT_TARGET)
export GOALS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
endif 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.
# #
# Get path and tool configuration # Example usage:
# #
export PX4_BASE := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))/ # make px4fmu-v2_default (builds)
include $(PX4_BASE)makefiles/setup.mk # make px4fmu-v2_default upload (builds and uploads)
# make px4fmu-v2_default test (builds and tests)
# #
# Get a version string provided by git # This tells cmake to build the nuttx px4fmu-v2 default config in the
# This assumes that git command is available and that # directory build_nuttx_px4fmu-v2_default and then call make
# the directory holding this file also contains .git directory # in that directory with the target upload.
#
GIT_DESC := $(shell git log -1 --pretty=format:%H)
ifneq ($(words $(GIT_DESC)),1)
GIT_DESC := "unknown_git_version"
endif
GIT_DESC_SHORT := $(shell echo $(GIT_DESC) | cut -c1-16) # explicity set default build target
all: px4fmu-v2_default
# # Parsing
# Canned firmware configurations that we (know how to) build. # --------------------------------------------------------------------
# # assume 1st argument passed is the main target, the
KNOWN_CONFIGS := $(subst config_,,$(basename $(notdir $(wildcard $(PX4_MK_DIR)/$(PX4_TARGET_OS)/config_*.mk)))) # rest are arguments to pass to the makefile generated
CONFIGS ?= $(KNOWN_CONFIGS) # by cmake in the subdirectory
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
j ?= 4
# # disable ninja by default for now because it hides upload progress
# Boards that we (know how to) build NuttX export kits for. #NINJA_BUILD := $(shell ninja --version 2>/dev/null)
# ifdef NINJA_BUILD
KNOWN_BOARDS := $(subst board_,,$(basename $(notdir $(wildcard $(PX4_MK_DIR)/$(PX4_TARGET_OS)/board_*.mk)))) PX4_CMAKE_GENERATOR ?= "Ninja"
BOARDS ?= $(KNOWN_BOARDS) 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
qurt_fixup:
makefiles/qurt/setup.sh $(PX4_BASE)
restore:
cd src/lib/eigen && git checkout .
git submodule update
#
# 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 $(PX4_TARGET_OS))
.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 else
export PX4_TARGET_OS=$@
ifdef SYSTEMROOT
# Windows
PX4_CMAKE_GENERATOR ?= "MSYS Makefiles"
else
PX4_CMAKE_GENERATOR ?= "Unix Makefiles"
endif endif
PX4_MAKE = make
PX4_MAKE_ARGS = -j$(j) --no-print-directory
endif
# Functions
# --------------------------------------------------------------------
# describe how to build a cmake config
define cmake-build
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then git submodule update --init --recursive --force && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1); fi
+$(PX4_MAKE) -C $(PWD)/build_$@ $(PX4_MAKE_ARGS) $(ARGS)
endef
# create empty targets to avoid msgs for targets passed to cmake
define cmake-targ
$(1):
@#
.PHONY: $(1)
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_simple:
$(call cmake-build,nuttx_px4fmu-v2_simple)
nuttx_sim_simple:
$(call cmake-build,$@)
posix_sitl_simple:
$(call cmake-build,$@)
ros_sitl_simple:
$(call cmake-build,$@)
qurt_eagle_travis:
$(call cmake-build,$@)
posix: posix_sitl_simple
ros: ros_sitl_simple
run_sitl_quad: posix
Tools/sitl_run.sh posix-configs/SITL/init/rcS
run_sitl_plane: posix
Tools/sitl_run.sh posix-configs/SITL/init/rc.fixed_wing
run_sitl_ros: posix
Tools/sitl_run.sh posix-configs/SITL/init/rc_iris_ros
lldb_sitl_quad: posix
Tools/sitl_run.sh posix-configs/SITL/init/rcS lldb
lldb_sitl_plane: posix
Tools/sitl_run.sh posix-configs/SITL/init/rc.fixed_wing lldb
lldb_sitl_ros: posix
Tools/sitl_run.sh posix-configs/SITL/init/rc_iris_ros lldb
gdb_sitl_quad: posix
Tools/sitl_run.sh posix-configs/SITL/init/rcS gdb
gdb_sitl_plane: posix
Tools/sitl_run.sh posix-configs/SITL/init/rc.fixed_wing lldb
gdb_sitl_ros: posix
Tools/sitl_run.sh posix-configs/SITL/init/rc_iris_ros lldb
sitl_quad: sitl_quad:
$(Q) Tools/sitl_run.sh posix-configs/SITL/init/rcS @echo "Deprecated. Use 'run_sitl_quad' instead."
sitl_quad_gazebo:
$(Q) Tools/sitl_run.sh posix-configs/SITL/init/rc_iris_ros
sitl_plane: sitl_plane:
$(Q) Tools/sitl_run.sh posix-configs/SITL/init/rc.fixed_wing @echo "Deprecated. Use 'run_sitl_plane' instead."
qurtrun: sitl_ros:
$(MAKE) PX4_TARGET_OS=qurt sim @echo "Deprecated. Use 'run_sitl_ros' instead."
# # Other targets
# 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) --no-print-directory unittests)
.PHONY: check_format
check_format: check_format:
$(Q) (./Tools/check_code_style.sh) @./Tools/check_code_style.sh
#
# 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: clean:
@echo > /dev/null @rm -rf build_*/
$(Q) $(RMDIR) $(BUILD_DIR)*.build @(cd NuttX && git clean -d -f -x)
$(Q) $(RMDIR) $(PX4_VERSIONING_DIR) @(cd src/modules/uavcan/libuavcan && git clean -d -f -x)
$(Q) $(REMOVE) $(IMAGE_DIR)*.px4
$(Q) $(RMDIR) $(TOPICHEADER_TEMP_DIR)
$(Q) $(RMDIR) $(MULTI_TOPICHEADER_TEMP_DIR)
.PHONY: distclean # targets handled by cmake
distclean: clean cmake_targets = test upload package package_source debug debug_tui debug_ddd debug_io debug_io_tui debug_io_ddd check_weak libuavcan
@echo > /dev/null $(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ))))
$(Q) $(REMOVE) $(ARCHIVE_DIR)*.export
$(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean
$(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete)
.PHONY: clean
CONFIGS:=$(shell ls cmake/configs | sed -e "s~.*/~~" | sed -e "s~\..*~~")
# Future:
#$(CONFIGS):
## @cd Build/$@ && cmake ../.. -DCONFIG=$@
# @cd Build/$@ && make
# #
# Print some help text #clean-all:
# @rm -rf Build/*
# #
.PHONY: help #help:
help: # @echo
@$(ECHO) "" # @echo "Type 'make ' and hit the tab key twice to see a list of the available"
@$(ECHO) " PX4 firmware builder" # @echo "build configurations."
@$(ECHO) " ====================" # @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
+1 -1
Submodule NuttX updated: 8891d035df...3009fb230e
+5 -3
View File
@@ -16,7 +16,7 @@ This repository contains the PX4 Flight Core, with the main applications located
* [Downloads](http://px4.io/firmware/downloads) * [Downloads](http://px4.io/firmware/downloads)
* Releases * Releases
* [Downloads](https://github.com/PX4/Firmware/releases) * [Downloads](https://github.com/PX4/Firmware/releases)
* Mailing list: [Google Groups](http://groups.google.com/group/px4users) * Forum / Mailing list: [Google Groups](http://groups.google.com/group/px4users)
### Users ### ### Users ###
@@ -29,7 +29,7 @@ Contributing guide:
* [PX4 Contribution Guide](http://px4.io/dev/contributing) * [PX4 Contribution Guide](http://px4.io/dev/contributing)
Software in the Loop guide: 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) Use software in the loop [to get started with the codebase](https://pixhawk.org/dev/simulation/native_sitl).
Developer guide: Developer guide:
http://px4.io/dev/ http://px4.io/dev/
@@ -38,8 +38,10 @@ Testing guide:
http://px4.io/dev/unit_tests http://px4.io/dev/unit_tests
This repository contains code supporting these boards: This repository contains code supporting these boards:
* [Snapdragon Flight](https://www.intrinsyc.com/qualcomm-snapdragon-flight/)
* FMUv1.x * FMUv1.x
* FMUv2.x * FMUv2.x (Pixhawk)
* FMUv3.x (Pixhawk 2)
* AeroCore (v1 and v2) * AeroCore (v1 and v2)
* STM32F4Discovery (basic support) [Tutorial](https://pixhawk.org/modules/stm32f4discovery) * STM32F4Discovery (basic support) [Tutorial](https://pixhawk.org/modules/stm32f4discovery)
+4
View File
@@ -20,3 +20,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
set MIXER AERT set MIXER AERT
# The ESC requires a specific pulse to arm.
set PWM_OUT 4
set PWM_DISARMED p:PWM_DISARMED
+4
View File
@@ -20,3 +20,7 @@
sh /etc/init.d/rc.fw_defaults sh /etc/init.d/rc.fw_defaults
set MIXER AETR set MIXER AETR
# The ESC requires a specific pulse to arm.
set PWM_OUT 3
set PWM_DISARMED p:PWM_DISARMED
+1 -12
View File
@@ -9,18 +9,7 @@
# filter by setting INAV_ENABLED = 0 # filter by setting INAV_ENABLED = 0
if param compare INAV_ENABLED 1 if param compare INAV_ENABLED 1
then then
# The system is defaulting to EKF_ATT_ENABLED = 1 attitude_estimator_q start
# 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 position_estimator_inav start
else else
ekf_att_pos_estimator start ekf_att_pos_estimator start
+3 -1
View File
@@ -112,4 +112,6 @@ fi
# Wait 20 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire) # Wait 20 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire)
usleep 20000 usleep 20000
sensors start if sensors start
then
fi
+5 -5
View File
@@ -365,11 +365,6 @@ then
then then
fi fi
#
# UAVCAN
#
sh /etc/init.d/rc.uavcan
# #
# Sensors System (start before Commander so Preflight checks are properly run) # Sensors System (start before Commander so Preflight checks are properly run)
# #
@@ -576,6 +571,11 @@ then
fi fi
fi fi
#
# UAVCAN
#
sh /etc/init.d/rc.uavcan
# #
# Logging # Logging
# #
+1 -1
View File
@@ -25,7 +25,7 @@ for fn in $(find src/examples \
-path './NuttX' -prune -o \ -path './NuttX' -prune -o \
-path './src/lib/eigen' -prune -o \ -path './src/lib/eigen' -prune -o \
-path './src/lib/mathlib/CMSIS' -prune -o \ -path './src/lib/mathlib/CMSIS' -prune -o \
-path './src/lib/uavcan' -prune -o \ -path './src/modules/uavcan/libuavcan' -prune -o \
-path './src/modules/attitude_estimator_ekf/codegen' -prune -o \ -path './src/modules/attitude_estimator_ekf/codegen' -prune -o \
-path './src/modules/ekf_att_pos_estimator' -prune -o \ -path './src/modules/ekf_att_pos_estimator' -prune -o \
-path './src/modules/sdlog2' -prune -o \ -path './src/modules/sdlog2' -prune -o \
-144
View File
@@ -1,144 +0,0 @@
#!/bin/sh
[ -n "$GIT_SUBMODULES_ARE_EVIL" ] && {
# GIT_SUBMODULES_ARE_EVIL is set, meaning user doesn't want submodules
echo "Skipping submodules. NUTTX_SRC is set to $NUTTX_SRC"
exit 0
}
if [ -d NuttX/nuttx ];
then
STATUSRETVAL=$(git submodule summary | grep -A20 -i "NuttX" | grep "<")
if [ -z "$STATUSRETVAL" ]; then
echo "Checked NuttX submodule, correct version found"
else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
echo ""
echo " NuttX sub repo not at correct version. Try 'git submodule update'"
echo " or follow instructions on http://pixhawk.org/dev/git/submodules"
echo ""
echo " DO NOT FORGET TO RUN 'make distclean && make archives' AFTER EACH NUTTX UPDATE!"
exit 1
fi
else
git submodule update --init --recursive
fi
if [ -d mavlink/include/mavlink/v1.0 ];
then
STATUSRETVAL=$(git submodule summary | grep -A20 -i "mavlink/include/mavlink/v1.0" | grep "<")
if [ -z "$STATUSRETVAL" ]; then
echo "Checked mavlink submodule, correct version found"
else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
echo ""
echo "mavlink sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else
git submodule update --init --recursive
fi
if [ -d uavcan ]
then
STATUSRETVAL=$(git submodule summary | grep -A20 -i uavcan | grep "<")
if [ -z "$STATUSRETVAL" ]
then
echo "Checked uavcan submodule, correct version found"
else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
echo ""
echo "uavcan sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else
git submodule update --init --recursive
fi
if [ -d src/lib/eigen ]
then
echo "ARG = $1"
if [ $1 = "qurt" ]
then
# QuRT needs to use Eigen 3.2 because the toolchain doews not support C++11
STATUSRETVAL=$(true)
else
STATUSRETVAL=$(git submodule summary | grep -A20 -i eigen | grep "<")
if [ -z "$STATUSRETVAL" ]
then
echo "Checked Eigen submodule, correct version found"
else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
echo ""
echo "eigen sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
fi
else
git submodule update --init --recursive
fi
if [ -d Tools/gencpp ]
then
STATUSRETVAL=$(git submodule summary | grep -A20 -i gencpp | grep "<")
if [ -z "$STATUSRETVAL" ]
then
echo "Checked gencpp submodule, correct version found"
else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
echo ""
echo "gencpp sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else
git submodule update --init --recursive
fi
if [ -d Tools/genmsg ]
then
STATUSRETVAL=$(git submodule summary | grep -A20 -i genmsg | grep "<")
if [ -z "$STATUSRETVAL" ]
then
echo "Checked genmsg submodule, correct version found"
else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
echo ""
echo "genmsg sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else
git submodule update --init --recursive
fi
exit 0
+78 -26
View File
@@ -1,6 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
import glob import glob
import os
import sys import sys
# This script is run from Build/<target>_default.build/$(PX4_BASE)/Firmware/src/systemcmds/topic_listener # This script is run from Build/<target>_default.build/$(PX4_BASE)/Firmware/src/systemcmds/topic_listener
@@ -20,20 +21,42 @@ for index,m in enumerate(raw_messages):
temp_list = [] temp_list = []
f = open(m,'r') f = open(m,'r')
for line in f.readlines(): for line in f.readlines():
if(line.split(' ')[0] == "float32"): if ('float32[' in line.split(' ')[0]):
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0])
temp_list.append(("float_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
elif ('float64[' in line.split(' ')[0]):
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0])
temp_list.append(("double_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
elif ('uint64[' in line.split(' ')[0]):
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0])
temp_list.append(("uint64_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
elif(line.split(' ')[0] == "float32"):
temp_list.append(("float",line.split(' ')[1].split('\t')[0].split('\n')[0])) temp_list.append(("float",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "uint64"): elif(line.split(' ')[0] == "float64"):
temp_list.append(("double",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "uint64") and len(line.split('=')) == 1:
temp_list.append(("uint64",line.split(' ')[1].split('\t')[0].split('\n')[0])) temp_list.append(("uint64",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif (line.split(' ')[0] == "bool"): elif(line.split(' ')[0] == "uint32") and len(line.split('=')) == 1:
temp_list.append(("uint32",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "uint16") and len(line.split('=')) == 1:
temp_list.append(("uint16",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "int64") and len(line.split('=')) == 1:
temp_list.append(("int64",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "int32") and len(line.split('=')) == 1:
temp_list.append(("int32",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "int16") and len(line.split('=')) == 1:
temp_list.append(("int16",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif (line.split(' ')[0] == "bool") and len(line.split('=')) == 1:
temp_list.append(("bool",line.split(' ')[1].split('\t')[0].split('\n')[0])) temp_list.append(("bool",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif (line.split(' ')[0] == "uint8") and len(line.split('=')) == 1: elif (line.split(' ')[0] == "uint8") and len(line.split('=')) == 1:
temp_list.append(("uint8",line.split(' ')[1].split('\t')[0].split('\n')[0])) temp_list.append(("uint8",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif ('float32[' in line.split(' ')[0]): elif (line.split(' ')[0] == "int8") and len(line.split('=')) == 1:
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0]) temp_list.append(("int8",line.split(' ')[1].split('\t')[0].split('\n')[0]))
temp_list.append(("float_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
f.close() f.close()
messages.append(m.split('/')[-1].split('.')[0]) (m_head, m_tail) = os.path.split(m)
messages.append(m_tail.split('.')[0])
#messages.append(m.split('/')[-1].split('.')[0])
message_elements.append(temp_list) message_elements.append(temp_list)
num_messages = len(messages); num_messages = len(messages);
@@ -74,24 +97,32 @@ print("""
****************************************************************************/ ****************************************************************************/
/** /**
* @file topic_listener.cpp, autogenerated by Tools/generate_listener.py * @file topic_listener.cpp
*
* Autogenerated by Tools/generate_listener.py
* *
* Tool for listening to topics when running flight stack on linux. * Tool for listening to topics when running flight stack on linux.
*/ */
#include <px4_middleware.h> #include <px4_middleware.h>
#include <px4_app.h> #include <px4_app.h>
#include <px4_config.h> #include <px4_config.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <cstring>
#include <uORB/uORB.h> #include <uORB/uORB.h>
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#include <inttypes.h> #include <inttypes.h>
#ifndef PRIu64
#define PRIu64 "llu"
#endif
#ifndef PRI64
#define PRI64 "lld"
#endif
""") """)
for m in messages: for m in messages:
print("#include <uORB/topics/%s.h>" % m) print("#include <uORB/topics/%s.h>" % m)
@@ -108,39 +139,60 @@ int listener_main(int argc, char *argv[]) {
return 1; return 1;
} }
""") """)
print("\tuint32_t num_msgs = (uint32_t)std::stoi(argv[2],NULL,10);") print("\tunsigned num_msgs = atoi(argv[2]);")
print("\tif(strncmp(argv[1],\"%s\",50)== 0) {" % messages[0]) print("\tif (strncmp(argv[1],\"%s\",50) == 0) {" % messages[0])
print("\t\tsub = orb_subscribe(ORB_ID(%s));" % messages[0]) print("\t\tsub = orb_subscribe(ORB_ID(%s));" % messages[0])
print("\t\tID = ORB_ID(%s);" % messages[0]) print("\t\tID = ORB_ID(%s);" % messages[0])
print("\t\tstruct %s_s container;" % messages[0]) print("\t\tstruct %s_s container;" % messages[0])
print("\t\tmemset(&container, 0, sizeof(container));") print("\t\tmemset(&container, 0, sizeof(container));")
for index,m in enumerate(messages[1:]): for index,m in enumerate(messages[1:]):
print("\t} else if(strncmp(argv[1],\"%s\",50) == 0) {" % m) print("\t} else if (strncmp(argv[1],\"%s\",50) == 0) {" % m)
print("\t\tsub = orb_subscribe(ORB_ID(%s));" % m) print("\t\tsub = orb_subscribe(ORB_ID(%s));" % m)
print("\t\tID = ORB_ID(%s);" % m) print("\t\tID = ORB_ID(%s);" % m)
print("\t\tstruct %s_s container;" % m) print("\t\tstruct %s_s container;" % m)
print("\t\tmemset(&container, 0, sizeof(container));") print("\t\tmemset(&container, 0, sizeof(container));")
print("\t\tbool updated;") print("\t\tbool updated;")
print("\t\tfor(uint32_t i = 0;i<num_msgs;i++) {") print("\t\tfor (unsigned i = 0; i < num_msgs; i++) {")
print("\t\t\torb_check(sub,&updated);") print("\t\t\torb_check(sub,&updated);")
print("\t\t\tupdated = true;") print("\t\t\tupdated = true;")
print("\t\t\tif(updated) {") print("\t\t\tif (updated) {")
print("\t\tprintf(\"\\nTOPIC: %s #%%d\\n\", i);" % m)
print("\t\t\torb_copy(ID,sub,&container);") print("\t\t\torb_copy(ID,sub,&container);")
for item in message_elements[index+1]: for item in message_elements[index+1]:
if item[0] == "float": if item[0] == "float":
print("\t\t\tprintf(\"%s: %%f\\n \",(double)container.%s);" % (item[1], item[1])) print("\t\t\tprintf(\"%s: %%8.4f\\n\",(double)container.%s);" % (item[1], item[1]))
elif item[0] == "float_array": elif item[0] == "float_array":
print("\t\t\tprintf(\"%s:\");" % item[1]) print("\t\t\tprintf(\"%s: \");" % item[1])
print("\t\t\tfor (int j=0;j<%d;j++) {" % item[2]) print("\t\t\tfor (int j = 0; j < %d; j++) {" % item[2])
print("\t\t\t\tprintf(\"%%f \",(double)container.%s[j]);" % item[1]) print("\t\t\t\tprintf(\"%%8.4f \",(double)container.%s[j]);" % item[1])
print("\t\t\t}")
print("\t\t\tprintf(\"\\n\");")
elif item[0] == "double":
print("\t\t\tprintf(\"%s: %%8.4f\\n\",(double)container.%s);" % (item[1], item[1]))
elif item[0] == "double_array":
print("\t\t\tprintf(\"%s: \");" % item[1])
print("\t\t\tfor (int j = 0; j < %d; j++) {" % item[2])
print("\t\t\t\tprintf(\"%%8.4f \",(double)container.%s[j]);" % item[1])
print("\t\t\t}") print("\t\t\t}")
print("\t\t\tprintf(\"\\n\");") print("\t\t\tprintf(\"\\n\");")
elif item[0] == "uint64": elif item[0] == "uint64":
print("\t\t\tprintf(\"%s: %%\" PRIu64 \"\\n \",container.%s);" % (item[1], item[1])) print("\t\t\tprintf(\"%s: %%\" PRIu64 \"\\n\",container.%s);" % (item[1], item[1]))
elif item[0] == "uint64_array":
print("\t\t\tprintf(\"%s: \");" % item[1])
print("\t\t\tfor (int j = 0; j < %d; j++) {" % item[2])
print("\t\t\t\tprintf(\"%%\" PRIu64 \"\",container.%s[j]);" % item[1])
print("\t\t\t}")
print("\t\t\tprintf(\"\\n\");")
elif item[0] == "int64":
print("\t\t\tprintf(\"%s: %%\" PRI64 \"\\n\",container.%s);" % (item[1], item[1]))
elif item[0] == "int32":
print("\t\t\tprintf(\"%s: %%d\\n\",container.%s);" % (item[1], item[1]))
elif item[0] == "uint32":
print("\t\t\tprintf(\"%s: %%d\\n\",container.%s);" % (item[1], item[1]))
elif item[0] == "uint8": elif item[0] == "uint8":
print("\t\t\tprintf(\"%s: %%u\\n \",container.%s);" % (item[1], item[1])) print("\t\t\tprintf(\"%s: %%u\\n\",container.%s);" % (item[1], item[1]))
elif item[0] == "bool": elif item[0] == "bool":
print("\t\t\tprintf(\"%s: %%s\\n \",container.%s ? \"True\" : \"False\");" % (item[1], item[1])) print("\t\t\tprintf(\"%s: %%s\\n\",container.%s ? \"True\" : \"False\");" % (item[1], item[1]))
print("\t\t\t}") print("\t\t\t}")
print("\t\t}") print("\t\t}")
print("\t} else {") print("\t} else {")
+12 -1
View File
@@ -98,7 +98,9 @@ static void list_builtins(void)
static int shutdown_main(int argc, char *argv[]) static int shutdown_main(int argc, char *argv[])
{ {
cout << "Shutting down" << endl; cout.flush();
cout << endl << "Shutting down" << endl;
cout.flush();
exit(0); exit(0);
} }
@@ -133,5 +135,14 @@ static int sleep_main(int argc, char *argv[])
sleep(atoi(argv[1])); sleep(atoi(argv[1]));
return 0; return 0;
} }
static int usleep_main(int argc, char *argv[])
{
if (argc != 2) {
cout << "Usage: usleep <microseconds>" << endl;
return 1;
}
usleep(atoi(argv[1]));
return 0;
}
""") """)
+3
View File
@@ -0,0 +1,3 @@
run
pro hand -p true -s false -n false SIGCONT
continue
+2 -1
View File
@@ -1,5 +1,6 @@
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
import codecs import codecs
import os
class RCOutput(): class RCOutput():
def __init__(self, groups, board): def __init__(self, groups, board):
@@ -30,7 +31,7 @@ class RCOutput():
for group in groups: for group in groups:
result += "# GROUP: %s\n\n" % group.GetName() result += "# GROUP: %s\n\n" % group.GetName()
for param in group.GetParams(): for param in group.GetParams():
path = param.GetPath().rsplit('/', 1)[1] path = os.path.split(param.GetPath())[1]
id_val = param.GetId() id_val = param.GetId()
name = param.GetFieldValue("short_desc") name = param.GetFieldValue("short_desc")
long_desc = param.GetFieldValue("long_desc") long_desc = param.GetFieldValue("long_desc")
+3 -2
View File
@@ -1,5 +1,6 @@
import sys import sys
import re import re
import os
class ParameterGroup(object): class ParameterGroup(object):
""" """
@@ -151,7 +152,7 @@ class SourceParser(object):
Returns list of supported file extensions that can be parsed by this Returns list of supported file extensions that can be parsed by this
parser. The parser uses any extension. parser. The parser uses any extension.
""" """
return [""] return ["", ".hil"]
def Parse(self, path, contents): def Parse(self, path, contents):
""" """
@@ -160,7 +161,7 @@ class SourceParser(object):
""" """
airframe_id = None airframe_id = None
airframe_id = path.rsplit('/',1)[1].split('_',1)[0] airframe_id = os.path.split(path)[1].split('_',1)[0]
# Skip if not numeric # Skip if not numeric
if (not self.IsNumber(airframe_id)): if (not self.IsNumber(airframe_id)):
+5 -3
View File
@@ -16,9 +16,11 @@ class SourceScanner(object):
extensions = tuple(parser.GetSupportedExtensions()) extensions = tuple(parser.GetSupportedExtensions())
for dirname, dirnames, filenames in os.walk(srcdir): for dirname, dirnames, filenames in os.walk(srcdir):
for filename in filenames: for filename in filenames:
path = os.path.join(dirname, filename) extension = os.path.splitext(filename)[1]
if not self.ScanFile(path, parser): if extension in extensions:
return False path = os.path.join(dirname, filename)
if not self.ScanFile(path, parser):
return False
return True return True
def ScanFile(self, path, parser): def ScanFile(self, path, parser):
+99
View File
@@ -0,0 +1,99 @@
#!/usr/bin/env python
import xml.etree.ElementTree as ET
import os
if len(os.sys.argv) != 2:
print("Error in %s" % os.sys.argv[0])
print("Usage: %s <parameters.xml>" % os.sys.argv[0])
raise SystemExit
fp_header = open("px4_parameters.h", "w")
fp_src = open("px4_parameters.c", "w")
tree = ET.parse(os.sys.argv[1])
root = tree.getroot()
# Generate the header file content
header = """
#include <stdint.h>
#include <systemlib/param/param.h>
// DO NOT EDIT
// This file is autogenerated from parameters.xml
__BEGIN_DECLS
struct px4_parameters_t {
"""
start_name = ""
end_name = ""
for group in root:
if group.tag == "group":
header += """
/*****************************************************************
* %s
****************************************************************/""" % group.attrib["name"]
for param in group:
if not start_name:
start_name = param.attrib["name"]
end_name = param.attrib["name"]
header += """
const struct param_info_s __param__%s;""" % param.attrib["name"]
header += """
const unsigned int param_count;
};
extern const struct px4_parameters_t px4_parameters;
"""
# Generate the C file content
src = """
#include <px4_parameters.h>
// DO NOT EDIT
// This file is autogenerated from paramaters.xml
const
#ifndef __PX4_DARWIN
__attribute__((used, section("__param")))
#endif
struct px4_parameters_t px4_parameters = {
"""
i=0
for group in root:
if group.tag == "group":
src += """
/*****************************************************************
* %s
****************************************************************/""" % group.attrib["name"]
for param in group:
if not start_name:
start_name = param.attrib["name"]
end_name = param.attrib["name"]
val_str = "#error UNKNOWN PARAM TYPE, FIX px_generate_params.py"
if (param.attrib["type"] == "FLOAT"):
val_str = ".val.f = "
elif (param.attrib["type"] == "INT32"):
val_str = ".val.i = "
i+=1
src += """
{
"%s",
PARAM_TYPE_%s,
%s%s
},
""" % (param.attrib["name"], param.attrib["type"], val_str, param.attrib["default"])
src += """
%d
};
//extern const struct px4_parameters_t px4_parameters;
__END_DECLS
""" % i
fp_header.write(header)
fp_src.write(src)
+20 -8
View File
@@ -43,6 +43,11 @@ import shutil
import filecmp import filecmp
import argparse import argparse
import sys
px4_tools_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(px4_tools_dir + "/genmsg/src")
sys.path.append(px4_tools_dir + "/gencpp/src")
try: try:
import genmsg.template_tools import genmsg.template_tools
except ImportError as e: except ImportError as e:
@@ -79,7 +84,7 @@ def convert_file(filename, outputdir, templatedir, includepath):
""" """
Converts a single .msg file to a uorb header Converts a single .msg file to a uorb header
""" """
print("Generating headers from {0}".format(filename)) #print("Generating headers from {0}".format(filename))
genmsg.template_tools.generate_from_file(filename, genmsg.template_tools.generate_from_file(filename,
package, package,
outputdir, outputdir,
@@ -136,7 +141,7 @@ def convert_dir(inputdir, outputdir, templatedir):
return True return True
def copy_changed(inputdir, outputdir, prefix=''): def copy_changed(inputdir, outputdir, prefix='', quiet=False):
""" """
Copies files from inputdir to outputdir if they don't exist in Copies files from inputdir to outputdir if they don't exist in
ouputdir or if their content changed ouputdir or if their content changed
@@ -153,7 +158,8 @@ def copy_changed(inputdir, outputdir, prefix=''):
fno = os.path.join(outputdir, prefix + f) fno = os.path.join(outputdir, prefix + f)
if not os.path.isfile(fno): if not os.path.isfile(fno):
shutil.copy(fni, fno) shutil.copy(fni, fno)
print("{0}: new header file".format(f)) if not quiet:
print("{0}: new header file".format(f))
continue continue
if os.path.getmtime(fni) > os.path.getmtime(fno): if os.path.getmtime(fni) > os.path.getmtime(fno):
@@ -161,13 +167,15 @@ def copy_changed(inputdir, outputdir, prefix=''):
# only copy if contents do not match # only copy if contents do not match
if not filecmp.cmp(fni, fno): if not filecmp.cmp(fni, fno):
shutil.copy(fni, fno) shutil.copy(fni, fno)
print("{0}: updated".format(f)) if not quiet:
print("{0}: updated".format(f))
continue continue
#print("{0}: unchanged".format(f)) if not quiet:
print("{0}: unchanged".format(f))
def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix): def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix, quiet=False):
""" """
Converts all .msg files in inputdir to uORB header files Converts all .msg files in inputdir to uORB header files
Unchanged existing files are not overwritten. Unchanged existing files are not overwritten.
@@ -175,7 +183,7 @@ def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix):
# Create new headers in temporary output directory # Create new headers in temporary output directory
convert_dir(inputdir, temporarydir, templatedir) convert_dir(inputdir, temporarydir, templatedir)
# Copy changed headers from temporary dir to output dir # Copy changed headers from temporary dir to output dir
copy_changed(temporarydir, outputdir, prefix) copy_changed(temporarydir, outputdir, prefix, quiet)
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
@@ -193,6 +201,9 @@ if __name__ == "__main__":
parser.add_argument('-p', dest='prefix', default='', parser.add_argument('-p', dest='prefix', default='',
help='string added as prefix to the output file ' help='string added as prefix to the output file '
' name when converting directories') ' name when converting directories')
parser.add_argument('-q', dest='quiet', default=False, action='store_true',
help='string added as prefix to the output file '
' name when converting directories')
args = parser.parse_args() args = parser.parse_args()
if args.file is not None: if args.file is not None:
@@ -208,4 +219,5 @@ if __name__ == "__main__":
args.outputdir, args.outputdir,
args.templatedir, args.templatedir,
args.temporarydir, args.temporarydir,
args.prefix) args.prefix,
args.quiet)
+2 -2
View File
@@ -76,8 +76,8 @@ def main():
pruned_content += line pruned_content += line
# overwrite old scratch file # overwrite old scratch file
with open(file_path, "w") as f: with open(file_path, "wb") as f:
f.write(pruned_content) f.write(pruned_content.encode("ascii", errors='strict'))
if __name__ == '__main__': if __name__ == '__main__':
+15 -4
View File
@@ -1,5 +1,16 @@
#!/bin/bash #!/bin/bash
cp Tools/posix_lldbinit build_posix_sitl_simple/src/firmware/posix/.lldbinit
mkdir -p Build/posix_sitl.build/rootfs/fs/microsd cp Tools/posix.gdbinit build_posix_sitl_simple/src/firmware/posix/.gdbinit
mkdir -p Build/posix_sitl.build/rootfs/eeprom cd build_posix_sitl_simple/src/firmware/posix
cd Build/posix_sitl.build && ./mainapp ../../$1 mkdir -p rootfs/fs/microsd
mkdir -p rootfs/eeprom
touch rootfs/eeprom/parameters
if [ "$2" == "lldb" ]
then
lldb -- mainapp ../../../../$1
elif [ "$2" == "gdb" ]
then
gdb --args mainapp ../../../../$1
else
./mainapp ../../../../$1
fi
Vendored
+2 -2
View File
@@ -73,12 +73,12 @@ Vagrant.configure(2) do |config|
# Enable provisioning with a shell script. Additional provisioners such as # Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use. # documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Ensure we start in the Firmware folder # Ensure we start in the Firmware folder
echo "cd /Firmware" >> ~/.bashrc echo "cd /Firmware" >> ~/.bashrc
# Install software # Install software
sudo apt-get update sudo apt-get update
sudo apt-get install -y build-essential ccache cmake clang-3.5 lldb-3.5 g++-4.8 gcc-4.8 genromfs libc6-i386 libncurses5-dev python-argparse python-empy python-serial s3cmd texinfo zlib1g-dev git-core sudo apt-get install -y build-essential ccache cmake clang-3.5 lldb-3.5 g++-4.8 gcc-4.8 genromfs libc6-i386 libncurses5-dev python-argparse python-empy python-serial s3cmd texinfo zlib1g-dev git-core zip gdb
pushd . pushd .
cd ~ cd ~
wget -q https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2 wget -q https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2
File diff suppressed because it is too large Load Diff
+177
View File
@@ -0,0 +1,177 @@
include(nuttx/px4_impl_nuttx)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
#
# Board support modules
#
drivers/device
drivers/stm32
drivers/stm32/adc
drivers/stm32/tone_alarm
drivers/led
drivers/px4fmu
drivers/px4io
drivers/boards/px4fmu-v1
drivers/ardrone_interface
drivers/rgbled
drivers/mpu6000
drivers/lsm303d
drivers/l3gd20
drivers/hmc5883
drivers/ms5611
drivers/mb12xx
drivers/sf0x
drivers/ll40ls
drivers/trone
drivers/gps
drivers/pwm_out_sim
drivers/hott
drivers/hott/hott_telemetry
drivers/hott/hott_sensors
drivers/blinkm
drivers/airspeed
drivers/ets_airspeed
drivers/meas_airspeed
drivers/frsky_telemetry
modules/sensors
drivers/mkblctrl
drivers/px4flow
#
# System commands
#
systemcmds/bl_update
systemcmds/mixer
systemcmds/param
systemcmds/perf
systemcmds/pwm
systemcmds/esc_calib
systemcmds/reboot
systemcmds/top
systemcmds/config
systemcmds/nshterm
systemcmds/mtd
systemcmds/dumpfile
systemcmds/ver
#
# General system control
#
modules/commander
modules/navigator
modules/mavlink
modules/gpio_led
modules/land_detector
#
# Estimation modules (EKF/ SO3 / other filters)
#
# Too high RAM usage due to static allocations
# modules/attitude_estimator_ekf
modules/attitude_estimator_q
modules/ekf_att_pos_estimator
modules/position_estimator_inav
#
# Vehicle Control
#
# modules/segway # XXX Needs GCC 4.7 fix
modules/fw_pos_control_l1
modules/fw_att_control
modules/mc_att_control
modules/mc_pos_control
modules/vtol_att_control
#
# Logging
#
modules/sdlog2
#
# Library modules
#
modules/param
modules/systemlib
modules/systemlib/mixer
modules/controllib
modules/uORB
modules/dataman
#
# Libraries
#
#lib/mathlib/CMSIS
lib/mathlib
lib/mathlib/math/filter
lib/ecl
lib/external_lgpl
lib/geo
lib/geo_lookup
lib/conversion
lib/launchdetection
platforms/nuttx
# had to add for cmake, not sure why wasn't in original config
platforms/common
platforms/nuttx/px4_layer
#
# OBC challenge
#
modules/bottle_drop
#
# Rover apps
#
examples/rover_steering_control
#
# Demo apps
#
#examples/math_demo
# Tutorial code from
# https://px4.io/dev/px4_simple_app
#examples/px4_simple_app
# Tutorial code from
# https://px4.io/dev/daemon
#examples/px4_daemon_app
# Tutorial code from
# https://px4.io/dev/debug_values
#examples/px4_mavlink_debug
# Tutorial code from
# https://px4.io/dev/example_fixedwing_control
#examples/fixedwing_control
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_io_board
px4io-v1
)
set(config_extra_libs
${CMAKE_SOURCE_DIR}/src/lib/mathlib/CMSIS/libarm_cortexM4lf_math.a
)
set(config_io_extra_libs
#${CMAKE_SOURCE_DIR}/src/lib/mathlib/CMSIS/libarm_cortexM3l_math.a
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
MAIN "sercon" STACK "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
MAIN "serdis" STACK "2048")
+185
View File
@@ -0,0 +1,185 @@
include(nuttx/px4_impl_nuttx)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
#
# Board support modules
#
drivers/device
drivers/stm32
drivers/stm32/adc
drivers/stm32/tone_alarm
drivers/led
drivers/px4fmu
drivers/px4io
drivers/boards/px4fmu-v2
drivers/rgbled
drivers/mpu6000
drivers/mpu9250
drivers/lsm303d
drivers/l3gd20
drivers/hmc5883
drivers/ms5611
drivers/mb12xx
drivers/sf0x
drivers/ll40ls
drivers/trone
drivers/gps
drivers/pwm_out_sim
drivers/hott
drivers/hott/hott_telemetry
drivers/hott/hott_sensors
drivers/blinkm
drivers/airspeed
drivers/ets_airspeed
drivers/meas_airspeed
drivers/frsky_telemetry
modules/sensors
drivers/mkblctrl
drivers/px4flow
drivers/oreoled
drivers/gimbal
drivers/pwm_input
drivers/camera_trigger
#
# System commands
#
systemcmds/bl_update
systemcmds/mixer
systemcmds/param
systemcmds/perf
systemcmds/pwm
systemcmds/esc_calib
systemcmds/reboot
systemcmds/topic_listener
systemcmds/top
systemcmds/config
systemcmds/nshterm
systemcmds/mtd
systemcmds/dumpfile
systemcmds/ver
#
# General system control
#
modules/commander
modules/navigator
modules/mavlink
modules/gpio_led
modules/uavcan
modules/land_detector
#
# Estimation modules (EKF/ SO3 / other filters)
#
# Too high RAM usage due to static allocations
# modules/attitude_estimator_ekf
modules/attitude_estimator_q
modules/ekf_att_pos_estimator
modules/position_estimator_inav
#
# Vehicle Control
#
# modules/segway # XXX Needs GCC 4.7 fix
modules/fw_pos_control_l1
modules/fw_att_control
modules/mc_att_control
modules/mc_pos_control
modules/vtol_att_control
#
# Logging
#
modules/sdlog2
#
# Library modules
#
modules/param
modules/systemlib
modules/systemlib/mixer
modules/controllib
modules/uORB
modules/dataman
#
# Libraries
#
#lib/mathlib/CMSIS
lib/mathlib
lib/mathlib/math/filter
lib/ecl
lib/external_lgpl
lib/geo
lib/geo_lookup
lib/conversion
lib/launchdetection
platforms/nuttx
# had to add for cmake, not sure why wasn't in original config
platforms/common
platforms/nuttx/px4_layer
#
# OBC challenge
#
modules/bottle_drop
#
# Rover apps
#
examples/rover_steering_control
#
# Demo apps
#
#examples/math_demo
# Tutorial code from
# https://px4.io/dev/px4_simple_app
#examples/px4_simple_app
# Tutorial code from
# https://px4.io/dev/daemon
#examples/px4_daemon_app
# Tutorial code from
# https://px4.io/dev/debug_values
#examples/px4_mavlink_debug
# Tutorial code from
# https://px4.io/dev/example_fixedwing_control
#examples/fixedwing_control
# Hardware test
#examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_io_board
px4io-v2
)
set(config_extra_libs
${CMAKE_SOURCE_DIR}/src/lib/mathlib/CMSIS/libarm_cortexM4lf_math.a
uavcan
uavcan_stm32_driver
)
set(config_io_extra_libs
#${CMAKE_SOURCE_DIR}/src/lib/mathlib/CMSIS/libarm_cortexM3l_math.a
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
MAIN "sercon" STACK "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
MAIN "serdis" STACK "2048")
+143
View File
@@ -0,0 +1,143 @@
include(nuttx/px4_impl_nuttx)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
#
# Board support modules
#
drivers/device
drivers/stm32
drivers/stm32/adc
drivers/stm32/tone_alarm
drivers/led
drivers/px4fmu
drivers/px4io
drivers/boards/px4fmu-v2
drivers/rgbled
drivers/mpu6000
drivers/mpu9250
drivers/lsm303d
drivers/l3gd20
drivers/hmc5883
drivers/ms5611
drivers/mb12xx
drivers/sf0x
drivers/ll40ls
drivers/trone
drivers/gps
drivers/pwm_out_sim
drivers/hott
drivers/hott/hott_telemetry
drivers/hott/hott_sensors
drivers/blinkm
drivers/airspeed
drivers/ets_airspeed
drivers/meas_airspeed
drivers/frsky_telemetry
modules/sensors
drivers/mkblctrl
drivers/px4flow
drivers/oreoled
drivers/gimbal
drivers/pwm_input
drivers/camera_trigger
#
# System commands
#
systemcmds/bl_update
systemcmds/mixer
systemcmds/param
systemcmds/perf
systemcmds/pwm
systemcmds/esc_calib
systemcmds/reboot
systemcmds/top
systemcmds/config
systemcmds/nshterm
systemcmds/mtd
systemcmds/dumpfile
systemcmds/ver
#
# Logging
#
modules/sdlog2
#
# Library modules
#
modules/param
modules/systemlib
modules/systemlib/mixer
modules/controllib
modules/uORB
modules/dataman
#
# Libraries
#
#lib/mathlib/CMSIS
lib/mathlib
lib/mathlib/math/filter
lib/ecl
lib/external_lgpl
lib/geo
lib/geo_lookup
lib/conversion
lib/launchdetection
platforms/nuttx
# had to add for cmake, not sure why wasn't in original config
platforms/common
platforms/nuttx/px4_layer
#
# Demo apps
#
#examples/math_demo
# Tutorial code from
# https://px4.io/dev/px4_simple_app
examples/px4_simple_app
# Tutorial code from
# https://px4.io/dev/daemon
examples/px4_daemon_app
# Tutorial code from
# https://px4.io/dev/debug_values
examples/px4_mavlink_debug
# Tutorial code from
# https://px4.io/dev/example_fixedwing_control
examples/fixedwing_control
# Hardware test
examples/hwtest
)
set(config_extra_builtin_cmds
serdis
sercon
)
set(config_io_board
px4io-v2
)
set(config_extra_libs
${CMAKE_SOURCE_DIR}/src/lib/mathlib/CMSIS/libarm_cortexM4lf_math.a
)
set(config_io_extra_libs
${CMAKE_SOURCE_DIR}/src/lib/mathlib/CMSIS/libarm_cortexM3l_math.a
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
MAIN "sercon" STACK "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
MAIN "serdis" STACK "2048")
+21
View File
@@ -0,0 +1,21 @@
include(nuttx/px4_impl_nuttx)
message(WARNING "this is a work in progress and doesn't build yet")
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-native.cmake)
set(config_module_list
#platforms/nuttx
#platforms/nuttx/px4_layer
platforms/common
#drivers/led
drivers/device
#modules/systemlib
#modules/uORB
#examples/px4_simple_app
#lib/mathlib/math/filter
#lib/conversion
)
set(config_extra_builtin_cmds
)
+46
View File
@@ -0,0 +1,46 @@
include(posix/px4_impl_posix)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake)
set(config_module_list
drivers/device
drivers/blinkm
drivers/pwm_out_sim
drivers/rgbled
drivers/led
drivers/boards/sitl
systemcmds/param
systemcmds/mixer
systemcmds/ver
modules/mavlink
modules/attitude_estimator_ekf
modules/ekf_att_pos_estimator
modules/mc_pos_control
modules/mc_att_control
modules/param
modules/systemlib
modules/systemlib/mixer
modules/uORB
modules/sensors
modules/dataman
modules/sdlog2
modules/simulator
modules/commander
modules/controllib
lib/mathlib
lib/mathlib/math/filter
lib/geo
lib/geo_lookup
lib/conversion
platforms/common
platforms/posix/px4_layer
platforms/posix/work_queue
)
+40
View File
@@ -0,0 +1,40 @@
include(posix/px4_impl_posix)
# Use build stubs unless explicitly set not to
if("${DSPAL_STUBS_ENABLE}" STREQUAL "")
set(DSPAL_STUBS_ENABLE "1")
endif()
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake)
set(config_module_list
drivers/device
drivers/boards/sitl
drivers/led
systemcmds/param
systemcmds/ver
modules/mavlink
modules/param
modules/systemlib
modules/uORB
modules/sensors
modules/dataman
modules/sdlog2
modules/simulator
modules/commander
lib/mathlib
lib/mathlib/math/filter
lib/geo
lib/geo_lookup
lib/conversion
platforms/common
platforms/posix/px4_layer
platforms/posix/work_queue
modules/muorb/krait
)
+15
View File
@@ -0,0 +1,15 @@
include(posix/px4_impl_posix)
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake)
set(config_module_list
drivers/device
modules/uORB
platforms/posix/px4_layer
platforms/posix/work_queue
modules/muorb/krait
)
+35
View File
@@ -0,0 +1,35 @@
include(posix/px4_impl_posix)
# Use build stubs unless explicitly set not to
if("${DSPAL_STUBS_ENABLE}" STREQUAL "")
set(DSPAL_STUBS_ENABLE "1")
endif()
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake)
set(config_module_list
drivers/device
systemcmds/param
systemcmds/ver
modules/mavlink
modules/param
modules/systemlib
modules/uORB
modules/dataman
lib/mathlib
lib/mathlib/math/filter
lib/geo
lib/geo_lookup
lib/conversion
platforms/common
platforms/posix/px4_layer
platforms/posix/work_queue
modules/muorb/krait
)
+71
View File
@@ -0,0 +1,71 @@
include(posix/px4_impl_posix)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-native.cmake)
set(config_module_list
drivers/led
drivers/device
drivers/boards/sitl
drivers/pwm_out_sim
drivers/rgbled
platforms/common
platforms/posix/px4_layer
platforms/posix/work_queue
platforms/posix/drivers/adcsim
platforms/posix/drivers/gpssim
platforms/posix/drivers/tonealrmsim
platforms/posix/drivers/accelsim
platforms/posix/drivers/airspeedsim
platforms/posix/drivers/barosim
platforms/posix/drivers/gyrosim
systemcmds/param
systemcmds/mixer
systemcmds/ver
systemcmds/esc_calib
systemcmds/reboot
systemcmds/topic_listener
modules/uORB
modules/param
modules/systemlib
modules/systemlib/mixer
modules/sensors
modules/simulator
modules/mavlink
modules/attitude_estimator_ekf
modules/attitude_estimator_q
modules/ekf_att_pos_estimator
modules/position_estimator_inav
modules/navigator
modules/mc_pos_control
modules/mc_att_control
modules/mc_pos_control_multiplatform
modules/mc_att_control_multiplatform
modules/land_detector
modules/fw_att_control
modules/fw_pos_control_l1
modules/dataman
modules/sdlog2
modules/commander
modules/controllib
lib/mathlib
lib/mathlib/math/filter
lib/conversion
lib/ecl
lib/external_lgpl
lib/geo
lib/geo_lookup
lib/launchdetection
)
set(config_extra_builtin_cmds
serdis
sercon
)
add_custom_target(sercon)
set_target_properties(sercon PROPERTIES
MAIN "sercon" STACK "2048")
add_custom_target(serdis)
set_target_properties(serdis PROPERTIES
MAIN "serdis" STACK "2048")
+28
View File
@@ -0,0 +1,28 @@
include(qurt/px4_impl_qurt)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.4.cmake)
set(config_module_list
drivers/device
#
# System commands
#
systemcmds/param
#
# Library modules
#
modules/param
modules/systemlib
modules/uORB
#
# QuRT port
#
platforms/common
platforms/qurt/px4_layer
platforms/posix/work_queue
platforms/qurt/tests/hello
)
+63
View File
@@ -0,0 +1,63 @@
include(qurt/px4_impl_qurt)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.4.cmake)
set(config_module_list
drivers/device
drivers/boards/sitl
drivers/pwm_out_sim
drivers/led
drivers/rgbled
modules/sensors
#
# System commands
#
systemcmds/param
systemcmds/mixer
#
# Estimation modules (EKF/ SO3 / other filters)
#
#modules/attitude_estimator_ekf
modules/ekf_att_pos_estimator
modules/attitude_estimator_q
modules/position_estimator_inav
#
# Vehicle Control
#
modules/mc_att_control
modules/mc_pos_control
#
# Library modules
#
modules/param
modules/systemlib
modules/systemlib/mixer
modules/uORB
modules/commander
#
# Libraries
#
lib/mathlib
lib/mathlib/math/filter
lib/geo
lib/geo_lookup
lib/conversion
modules/controllib
#
# QuRT port
#
platforms/common
platforms/qurt/px4_layer
platforms/posix/work_queue
#
# sources for muorb over fastrpc
#
modules/muorb/adsp
)
+41
View File
@@ -0,0 +1,41 @@
include(qurt/px4_impl_qurt)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.4.cmake)
set(config_module_list
drivers/device
#
# System commands
#
systemcmds/param
#
# Library modules
#
modules/param
modules/systemlib
modules/uORB
#
# Libraries
#
lib/mathlib
lib/mathlib/math/filter
lib/geo
lib/geo_lookup
lib/conversion
#
# QuRT port
#
platforms/common
platforms/qurt/px4_layer
platforms/posix/work_queue
platforms/qurt/tests/muorb
#
# sources for muorb over fastrpc
#
modules/muorb/adsp
)
+85
View File
@@ -0,0 +1,85 @@
include(qurt/px4_impl_qurt)
if ("${HEXAGON_DRIVERS_ROOT}" STREQUAL "")
message(FATAL_ERROR "HEXAGON_DRIVERS_ROOT is not set")
endif()
if ("${EAGLE_DRIVERS_SRC}" STREQUAL "")
message(FATAL_ERROR "EAGLE_DRIVERS_SRC is not set")
endif()
include_directories(${HEXAGON_DRIVERS_ROOT}/inc)
# For Actual flight we need to link against the driver dynamic libraries
set(target_libraries
-L${HEXAGON_DRIVERS_ROOT}/libs
mpu9x50
uart_esc
csr_gps
rc_receiver
)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.4.cmake)
set(config_module_list
#
# Board support modules
#
drivers/device
modules/sensors
$(EAGLE_DRIVERS_SRC)/mpu9x50
$(EAGLE_DRIVERS_SRC)/uart_esc
$(EAGLE_DRIVERS_SRC)/rc_receiver
$(EAGLE_DRIVERS_SRC)/csr_gps
#
# System commands
#
systemcmds/param
#
# Estimation modules (EKF/ SO3 / other filters)
#
#modules/attitude_estimator_ekf
modules/ekf_att_pos_estimator
modules/attitude_estimator_q
modules/position_estimator_inav
#
# Vehicle Control
#
modules/mc_att_control
modules/mc_pos_control
#
# Library modules
#
modules/param
modules/systemlib
modules/systemlib/mixer
modules/uORB
modules/commander
modules/controllib
#
# Libraries
#
lib/mathlib
lib/mathlib/math/filter
lib/geo
lib/geo_lookup
lib/conversion
#
# QuRT port
#
platforms/common
platforms/qurt/px4_layer
platforms/posix/work_queue
#
# sources for muorb over fastrpc
#
modules/muorb/adsp
)
+39
View File
@@ -0,0 +1,39 @@
include(qurt/px4_impl_qurt)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.4.cmake)
set(config_module_list
drivers/device
#
# System commands
#
systemcmds/param
#
# Library modules
#
modules/param
modules/systemlib
modules/systemlib/mixer
modules/uORB
#
# Libraries
#
lib/mathlib
lib/mathlib/math/filter
lib/conversion
#
# QuRT port
#
platforms/common
platforms/qurt/px4_layer
platforms/posix/work_queue
platforms/qurt/tests/hello
platforms/posix/tests/vcdev_test
platforms/posix/tests/hrt_test
platforms/posix/tests/wqueue
)
+68
View File
@@ -0,0 +1,68 @@
include(qurt/px4_impl_qurt)
# Run a full link with build stubs to make sure qurt target isn't broken
set(QURT_ENABLE_STUBS "1")
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.4.cmake)
set(config_module_list
drivers/device
drivers/boards/sitl
drivers/pwm_out_sim
drivers/led
drivers/rgbled
modules/sensors
#
# System commands
#
systemcmds/param
systemcmds/mixer
#
# Estimation modules (EKF/ SO3 / other filters)
#
#modules/attitude_estimator_ekf
modules/ekf_att_pos_estimator
modules/attitude_estimator_q
modules/position_estimator_inav
#
# Vehicle Control
#
modules/mc_att_control
modules/mc_pos_control
#
# Library modules
#
modules/param
modules/systemlib
modules/systemlib/mixer
modules/uORB
modules/commander
modules/controllib
#
# Libraries
#
lib/mathlib
lib/mathlib/math/filter
lib/geo
lib/geo_lookup
lib/conversion
lib/ecl
#
# QuRT port
#
platforms/common
platforms/qurt/px4_layer
platforms/posix/work_queue
#
# sources for muorb over fastrpc
#
modules/muorb/adsp
)
+98
View File
@@ -0,0 +1,98 @@
#!/usr/bin/env python
"""
This converts a binary imagge to an object file
"""
from __future__ import print_function
import subprocess
import argparse
import re
from subprocess import PIPE
#pylint: disable=invalid-name
parser = argparse.ArgumentParser(description='Convert bin to obj.')
parser.add_argument('--c_flags', required=True)
parser.add_argument('--c_compiler', required=True)
parser.add_argument('--include_path', required=True)
parser.add_argument('--nm', required=True)
parser.add_argument('--ld', required=True)
parser.add_argument('--objcopy', required=True)
parser.add_argument('--bin', required=True)
parser.add_argument('--obj', required=True)
parser.add_argument('--var', required=True)
args = parser.parse_args()
in_bin = args.bin
c_flags = args.c_flags
c_compiler = args.c_compiler
include_path = args.include_path
nm = args.nm
ld = args.ld
obj = args.obj
var = args.var
objcopy = args.objcopy
sym = "_binary_" + in_bin.replace('/', '_').replace('.', '_').replace('-', '_')
#print("sym: ", sym)
# write empty file
with open('{obj:s}.c'.format(**locals()), 'w') as f:
f.write("")
def run_cmd(cmd, d):
cmd = cmd.format(**d)
#print(cmd)
proc = subprocess.Popen(cmd.split(), stdout=PIPE, stderr=PIPE)
stdout, stderr = proc.communicate()
if stderr.decode() != "":
raise RuntimeError(stderr)
return stdout
# do compile
run_cmd("{c_compiler:s} -I{include_path:s} {c_flags:s} -c {obj:s}.c -o {obj:s}.c.o",
locals())
# link
run_cmd("{ld:s} -r -o {obj:s}.bin.o {obj:s}.c.o -b binary {in_bin:s}",
locals())
# get size of image
stdout = run_cmd("{nm:s} -p --radix=x {obj:s}.bin.o", locals())
re_string = r"^([0-9A-Fa-f]+) .*{sym:s}_size".format(**locals())
re_size = re.compile(re_string, re.MULTILINE)
size_match = re.search(re_size, stdout.decode())
try:
size = size_match.group(1)
except AttributeError as e:
raise RuntimeError("{:s}\nre:{:s}\n{:s}".format(
e, re_string, stdout))
except IndexError as e:
group0 = size_match.group(0)
raise RuntimeError("{:s}\ngroup 0:{:s}\n{:s}".format(
e, group0, stdout))
#print("romfs size: ", size)
# write size to file
with open('{obj:s}.c'.format(**locals()), 'w') as f:
f.write("const unsigned int {var:s}_len = 0x{size:s};".format(
**locals()))
# do compile
run_cmd("{c_compiler:s} -I{include_path:s} {c_flags:s} -c {obj:s}.c -o {obj:s}.c.o",
locals())
# link
run_cmd("{ld:s} -r -o {obj:s} {obj:s}.c.o {obj:s}.bin.o",
locals())
# obj copy
run_cmd("""
{objcopy:s} {obj:s}
--redefine-sym {sym:s}_start={var:s}
--strip-symbol {sym:s}_size
--strip-symbol {sym:s}_end
--rename-section .data=.rodata
""", locals())
# vim: set et ft=python fenc= ff=unix sts=4 sw=4 ts=4 :
+10
View File
@@ -0,0 +1,10 @@
/* builtin command list - automatically generated, do not edit */
#include <nuttx/config.h>
#include <nuttx/binfmt/builtin.h>
#include <nuttx/config.h>
${builtin_apps_decl_string}
const struct builtin_s g_builtins[] = {
${builtin_apps_string}
{NULL, 0, 0, NULL}
};
const int g_builtin_count = ${command_count};
File diff suppressed because it is too large Load Diff
+88
View File
@@ -0,0 +1,88 @@
/* builtin command list - automatically generated, do not edit */
#include <string>
#include <map>
#include <stdio.h>
#include <px4_tasks.h>
#include <px4_posix.h>
#include <px4_log.h>
#include <stdlib.h>
using namespace std;
extern void px4_show_devices(void);
extern "C" {
${builtin_apps_decl_string}
static int shutdown_main(int argc, char *argv[]);
static int list_tasks_main(int argc, char *argv[]);
static int list_files_main(int argc, char *argv[]);
static int list_devices_main(int argc, char *argv[]);
static int list_topics_main(int argc, char *argv[]);
static int sleep_main(int argc, char *argv[]);
}
static map<string,px4_main_t> app_map(void)
{
static map<string,px4_main_t> apps;
${builtin_apps_string}
apps["shutdown"] = shutdown_main;
apps["list_tasks"] = list_tasks_main;
apps["list_files"] = list_files_main;
apps["list_devices"] = list_devices_main;
apps["list_topics"] = list_topics_main;
apps["sleep"] = sleep_main;
return apps;
}
map<string,px4_main_t> apps = app_map();
static void list_builtins(void)
{
cout << "Builtin Commands:" << endl;
for (map<string,px4_main_t>::iterator it=apps.begin(); it!=apps.end(); ++it)
cout << '\t' << it->first << endl;
}
static int shutdown_main(int argc, char *argv[])
{
printf("Shutting down\\n");
exit(0);
}
static int list_tasks_main(int argc, char *argv[])
{
px4_show_tasks();
return 0;
}
static int list_devices_main(int argc, char *argv[])
{
px4_show_devices();
return 0;
}
static int list_topics_main(int argc, char *argv[])
{
px4_show_topics();
return 0;
}
static int list_files_main(int argc, char *argv[])
{
px4_show_files();
return 0;
}
static int sleep_main(int argc, char *argv[])
{
if (argc != 2) {
cout << "Usage: sleep <seconds>" << endl;
return 1;
}
sleep(atoi(argv[1]));
return 0;
}
@@ -44,3 +44,4 @@ SECTIONS
__param_end = .; __param_end = .;
} }
} }
INSERT AFTER .rodata;
+236
View File
@@ -0,0 +1,236 @@
############################################################################
#
# 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.
#
############################################################################
#=============================================================================
#
# Defined functions in this file
#
# OS Specific Functions
#
# * px4_posix_add_firmware
# * px4_posix_generate_builtin_commands
# * px4_posix_add_export
# * px4_posix_generate_romfs
#
# Required OS Inteface Functions
#
# * px4_os_add_flags
# * px4_os_prebuild_targets
#
include(common/px4_base)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/posix)
#=============================================================================
#
# px4_posix_generate_builtin_commands
#
# This function generates the builtin_commands.c src for posix
#
# Usage:
# px4_posix_generate_builtin_commands(
# MODULE_LIST <in-list>
# OUT <file>)
#
# Input:
# MODULE_LIST : list of modules
#
# Output:
# OUT : generated builtin_commands.c src
#
# Example:
# px4_posix_generate_builtin_commands(
# OUT <generated-src> MODULE_LIST px4_simple_app)
#
function(px4_posix_generate_builtin_commands)
px4_parse_function_args(
NAME px4_posix_generate_builtin_commands
ONE_VALUE OUT
MULTI_VALUE MODULE_LIST
REQUIRED MODULE_LIST OUT
ARGN ${ARGN})
set(builtin_apps_string)
set(builtin_apps_decl_string)
set(command_count 0)
foreach(module ${MODULE_LIST})
# default
set(MAIN_DEFAULT MAIN-NOTFOUND)
set(STACK_DEFAULT 1024)
set(PRIORITY_DEFAULT SCHED_PRIORITY_DEFAULT)
foreach(property MAIN STACK PRIORITY)
get_target_property(${property} ${module} ${property})
if(NOT ${property})
set(${property} ${${property}_DEFAULT})
endif()
endforeach()
if (MAIN)
set(builtin_apps_string
"${builtin_apps_string}\tapps[\"${MAIN}\"] = ${MAIN}_main;\n")
set(builtin_apps_decl_string
"${builtin_apps_decl_string}extern int ${MAIN}_main(int argc, char *argv[]);\n")
math(EXPR command_count "${command_count}+1")
endif()
endforeach()
configure_file(${CMAKE_SOURCE_DIR}/cmake/posix/apps.h_in
${OUT})
endfunction()
#=============================================================================
#
# px4_os_add_flags
#
# Set ths posix build flags.
#
# Usage:
# px4_os_add_flags(
# C_FLAGS <inout-variable>
# CXX_FLAGS <inout-variable>
# EXE_LINKER_FLAGS <inout-variable>
# INCLUDE_DIRS <inout-variable>
# LINK_DIRS <inout-variable>
# DEFINITIONS <inout-variable>)
#
# Input:
# BOARD : flags depend on board/posix config
#
# Input/Output: (appends to existing variable)
# C_FLAGS : c compile flags variable
# CXX_FLAGS : c++ compile flags variable
# EXE_LINKER_FLAGS : executable linker flags variable
# INCLUDE_DIRS : include directories
# LINK_DIRS : link directories
# DEFINITIONS : definitions
#
# Example:
# px4_os_add_flags(
# C_FLAGS CMAKE_C_FLAGS
# CXX_FLAGS CMAKE_CXX_FLAGS
# EXE_LINKER_FLAG CMAKE_EXE_LINKER_FLAGS
# INCLUDES <list>)
#
function(px4_os_add_flags)
set(inout_vars
C_FLAGS CXX_FLAGS EXE_LINKER_FLAGS INCLUDE_DIRS LINK_DIRS DEFINITIONS)
px4_parse_function_args(
NAME px4_add_flags
ONE_VALUE ${inout_vars} BOARD
REQUIRED ${inout_vars} BOARD
ARGN ${ARGN})
px4_add_common_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})
set(PX4_BASE )
set(added_include_dirs
src/modules/systemlib
src/lib/eigen
src/platforms/posix/include
mavlink/include/mavlink
)
if(UNIX AND APPLE)
set(added_definitions
-D__PX4_POSIX
-D__PX4_DARWIN
-DCLOCK_MONOTONIC=1
-Dnoreturn_function=__attribute__\(\(noreturn\)\)
-include ${PX4_INCLUDE_DIR}visibility.h
)
else()
set(added_definitions
-D__PX4_POSIX
-D__PX4_LINUX
-DCLOCK_MONOTONIC=1
-Dnoreturn_function=__attribute__\(\(noreturn\)\)
-include ${PX4_INCLUDE_DIR}visibility.h
)
endif()
set(added_exe_linker_flags
-lpthread
)
# Add the toolchain specific flags
set(added_cflags ${POSIX_CMAKE_C_FLAGS})
set(added_cxx_flags ${POSIX_CMAKE_CXX_FLAGS})
# output
foreach(var ${inout_vars})
string(TOLOWER ${var} lower_var)
set(${${var}} ${${${var}}} ${added_${lower_var}} PARENT_SCOPE)
#message(STATUS "posix: set(${${var}} ${${${var}}} ${added_${lower_var}} PARENT_SCOPE)")
endforeach()
endfunction()
#=============================================================================
#
# px4_os_prebuild_targets
#
# This function generates os dependent targets
#
# Usage:
# px4_os_prebuild_targets(
# OUT <out-list_of_targets>
# BOARD <in-string>
# )
#
# Input:
# BOARD : board
# THREADS : number of threads for building
#
# Output:
# OUT : the target list
#
# Example:
# px4_os_prebuild_targets(OUT target_list BOARD px4fmu-v2)
#
function(px4_os_prebuild_targets)
px4_parse_function_args(
NAME px4_os_prebuild_targets
ONE_VALUE OUT BOARD THREADS
REQUIRED OUT BOARD
ARGN ${ARGN})
add_custom_target(${OUT})
endfunction()
+84
View File
@@ -0,0 +1,84 @@
/* builtin command list - automatically generated, do not edit */
#include <string>
#include <map>
#include <stdio.h>
#include <px4_tasks.h>
#include <px4_posix.h>
#include <px4_log.h>
#include <stdlib.h>
using namespace std;
extern void px4_show_devices(void);
extern "C" {
${builtin_apps_decl_string}
static int shutdown_main(int argc, char *argv[]);
static int list_tasks_main(int argc, char *argv[]);
static int list_files_main(int argc, char *argv[]);
static int list_devices_main(int argc, char *argv[]);
static int list_topics_main(int argc, char *argv[]);
static int sleep_main(int argc, char *argv[]);
}
void init_app_map(map<string,px4_main_t> &apps)
{
${builtin_apps_string}
apps["shutdown"] = shutdown_main;
apps["list_tasks"] = list_tasks_main;
apps["list_files"] = list_files_main;
apps["list_devices"] = list_devices_main;
apps["list_topics"] = list_topics_main;
apps["sleep"] = sleep_main;
}
void list_builtins(map<string,px4_main_t> &apps)
{
printf("Builtin Commands:\\n");
for (map<string,px4_main_t>::iterator it=apps.begin(); it!=apps.end(); ++it)
printf("\\t%s\\n", (it->first).c_str());
}
static int shutdown_main(int argc, char *argv[])
{
printf("Shutting down\\n");
exit(0);
}
static int list_tasks_main(int argc, char *argv[])
{
px4_show_tasks();
return 0;
}
static int list_devices_main(int argc, char *argv[])
{
px4_show_devices();
return 0;
}
static int list_topics_main(int argc, char *argv[])
{
px4_show_topics();
return 0;
}
static int list_files_main(int argc, char *argv[])
{
px4_show_files();
return 0;
}
static int sleep_main(int argc, char *argv[])
{
if (argc != 2) {
PX4_WARN( "Usage: sleep <seconds>" );
return 1;
}
unsigned long usecs = ( (unsigned long) atol( argv[1] ) ) * 1000 * 1000;
PX4_WARN("Sleeping for %s, %ld",argv[1],usecs);
usleep( usecs );
return 0;
}
+236
View File
@@ -0,0 +1,236 @@
############################################################################
#
# 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.
#
############################################################################
#=============================================================================
#
# Defined functions in this file
#
# OS Specific Functions
#
# * px4_qurt_add_firmware
# * px4_qurt_generate_builtin_commands
# * px4_qurt_add_export
# * px4_qurt_generate_romfs
#
# Required OS Inteface Functions
#
# * px4_os_add_flags
# * px4_os_prebuild_targets
#
include(common/px4_base)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/qurt)
#=============================================================================
#
# px4_qurt_generate_builtin_commands
#
# This function generates the builtin_commands.c src for qurt
#
# Usage:
# px4_qurt_generate_builtin_commands(
# MODULE_LIST <in-list>
# OUT <file>)
#
# Input:
# MODULE_LIST : list of modules
#
# Output:
# OUT : generated builtin_commands.c src
#
# Example:
# px4_qurt_generate_builtin_commands(
# OUT <generated-src> MODULE_LIST px4_simple_app)
#
function(px4_qurt_generate_builtin_commands)
px4_parse_function_args(
NAME px4_qurt_generate_builtin_commands
ONE_VALUE OUT
MULTI_VALUE MODULE_LIST
REQUIRED MODULE_LIST OUT
ARGN ${ARGN})
set(builtin_apps_string)
set(builtin_apps_decl_string)
set(command_count 0)
foreach(module ${MODULE_LIST})
# default
set(MAIN_DEFAULT MAIN-NOTFOUND)
set(STACK_DEFAULT 1024)
set(PRIORITY_DEFAULT SCHED_PRIORITY_DEFAULT)
foreach(property MAIN STACK PRIORITY)
get_target_property(${property} ${module} ${property})
if(NOT ${property})
set(${property} ${${property}_DEFAULT})
endif()
endforeach()
if (MAIN)
set(builtin_apps_string
"${builtin_apps_string}\tapps[\"${MAIN}\"] = ${MAIN}_main;\n")
set(builtin_apps_decl_string
"${builtin_apps_decl_string}extern int ${MAIN}_main(int argc, char *argv[]);\n")
math(EXPR command_count "${command_count}+1")
endif()
endforeach()
configure_file(${CMAKE_SOURCE_DIR}/cmake/qurt/apps.h_in ${OUT})
endfunction()
#=============================================================================
#
# px4_os_add_flags
#
# Set ths qurt build flags.
#
# Usage:
# px4_os_add_flags(
# C_FLAGS <inout-variable>
# CXX_FLAGS <inout-variable>
# EXE_LINKER_FLAGS <inout-variable>
# INCLUDE_DIRS <inout-variable>
# LINK_DIRS <inout-variable>
# DEFINITIONS <inout-variable>)
#
# Input:
# BOARD : flags depend on board/qurt config
#
# Input/Output: (appends to existing variable)
# C_FLAGS : c compile flags variable
# CXX_FLAGS : c++ compile flags variable
# EXE_LINKER_FLAGS : executable linker flags variable
# INCLUDE_DIRS : include directories
# LINK_DIRS : link directories
# DEFINITIONS : definitions
#
# Example:
# px4_os_add_flags(
# C_FLAGS CMAKE_C_FLAGS
# CXX_FLAGS CMAKE_CXX_FLAGS
# EXE_LINKER_FLAG CMAKE_EXE_LINKER_FLAGS
# INCLUDES <list>)
#
function(px4_os_add_flags)
set(inout_vars
C_FLAGS CXX_FLAGS EXE_LINKER_FLAGS INCLUDE_DIRS LINK_DIRS DEFINITIONS)
px4_parse_function_args(
NAME px4_add_flags
ONE_VALUE ${inout_vars} BOARD
REQUIRED ${inout_vars} BOARD
ARGN ${ARGN})
px4_add_common_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})
set(DSPAL_ROOT src/lib/dspal)
set(added_include_dirs
${DSPAL_ROOT}/include
${DSPAL_ROOT}/sys
${DSPAL_ROOT}/sys/sys
${DSPAL_ROOT}/mpu_spi/inc
${DSPAL_ROOT}/uart_esc/inc
src/platforms/qurt/include
src/platforms/posix/include
)
set(added_definitions
-D__PX4_QURT
-D__PX4_POSIX
-include ${PX4_INCLUDE_DIR}visibility.h
)
# Add the toolchain specific flags
set(added_cflags ${QURT_CMAKE_C_FLAGS})
set(added_cxx_flags ${QURT_CMAKE_CXX_FLAGS})
# FIXME @jgoppert - how to work around issues like this?
# Without changing global variables?
# Clear -rdynamic flag which fails for hexagon
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
# output
foreach(var ${inout_vars})
string(TOLOWER ${var} lower_var)
set(${${var}} ${${${var}}} ${added_${lower_var}} PARENT_SCOPE)
#message(STATUS "qurt: set(${${var}} ${${${var}}} ${added_${lower_var}} PARENT_SCOPE)")
endforeach()
endfunction()
#=============================================================================
#
# px4_os_prebuild_targets
#
# This function generates os dependent targets
#
# Usage:
# px4_os_prebuild_targets(
# OUT <out-list_of_targets>
# BOARD <in-string>
# )
#
# Input:
# BOARD : board
# THREADS : number of threads for building
#
# Output:
# OUT : the target list
#
# Example:
# px4_os_prebuild_targets(OUT target_list BOARD px4fmu-v2)
#
function(px4_os_prebuild_targets)
px4_parse_function_args(
NAME px4_os_prebuild_targets
ONE_VALUE OUT BOARD THREADS
REQUIRED OUT BOARD
ARGN ${ARGN})
add_custom_target(git_eigen_patched
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/lib/eigen
COMMAND git checkout .
COMMAND git checkout master
COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/cmake/qurt/qurt_eigen.patch
DEPENDS git_eigen)
add_custom_target(${OUT} DEPENDS git_dspal git_eigen_patched)
add_custom_target(ALL DEPENDS git_eigen_patched)
endfunction()
# vim: set noet fenc=utf-8 ff=unix nowrap:
+37
View File
@@ -0,0 +1,37 @@
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 1ca1d66..9bc928b 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -194,6 +194,12 @@
#define EIGEN_ARCH_PPC 0
#endif
+/// \internal EIGEN_ARCH_HEXAGON set to 1 if the architecture is Hexagon
+#ifdef __HEXAGON_ARCH__
+ #define EIGEN_ARCH_HEXAGON 1
+#else
+ #define EIGEN_ARCH_HEXAGON 0
+#endif
// Operating system identification, EIGEN_OS_*
@@ -334,15 +340,16 @@
#endif
// Do we support r-value references?
-#if (__has_feature(cxx_rvalue_references) || \
+#if ((__has_feature(cxx_rvalue_references) || \
(defined(__cplusplus) && __cplusplus >= 201103L) || \
defined(__GXX_EXPERIMENTAL_CXX0X__) || \
- (EIGEN_COMP_MSVC >= 1600))
+ (EIGEN_COMP_MSVC >= 1600)) && (!defined(EIGEN_ARCH_HEXAGON)))
#define EIGEN_HAVE_RVALUE_REFERENCES
#endif
// Does the compiler support result_of?
-#if (__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L))
+#if ((__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L)) && \
+ (!defined(EIGEN_ARCH_HEXAGON)))
#define EIGEN_HAS_STD_RESULT_OF 1
#endif

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