mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-24 21:57:35 +08:00
Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ccfc91dfc | |||
| bd17653383 | |||
| 440449b85f | |||
| b1eb762753 | |||
| 6ac6917430 | |||
| 949fef1f3b | |||
| d6ee418cdf | |||
| 0709a9bb1c | |||
| 0af1716864 | |||
| 78ecad6170 | |||
| 89dff2d31c | |||
| b85a01f4c2 | |||
| e13884410b | |||
| 205d4400eb | |||
| 8fbbf56c4d | |||
| 34160bb6c9 | |||
| 58060b23d9 | |||
| a8e3c46cdb | |||
| 14274ab071 | |||
| 54c7e74de3 | |||
| 10f4fc7783 | |||
| 1a222bf06e | |||
| 87610957a4 | |||
| d79eea0c41 | |||
| 4c59997ff4 | |||
| 774ad80ba0 | |||
| 0101934f47 | |||
| 0ad65738db | |||
| 9ac860ac33 | |||
| 9087ba2259 | |||
| f34862f143 | |||
| eeb73fdbe6 | |||
| 36dea8487c | |||
| bc79ea54dc | |||
| 858a30df21 | |||
| 209fde9ff3 | |||
| 847b3b5b64 | |||
| 54c91002cd | |||
| cfef0c5d5a | |||
| 5a046cae7e | |||
| f80f0e6c7e | |||
| cbf6c97682 | |||
| 8c6ade0fc8 | |||
| 7f4ffcef93 | |||
| e61d8d6e7e | |||
| ae0438e8f5 | |||
| 65745a3676 | |||
| 4a0fa08953 | |||
| c8e6d93cc0 | |||
| 12ad7b17ce | |||
| fcf0d3536f | |||
| f70b6fbf0b | |||
| 72d08fe915 | |||
| 2cf66a5d8f | |||
| 883624d915 | |||
| 6f6d3f98a6 | |||
| fedf8f0266 | |||
| b5430c22c4 | |||
| 645fb2ff8c |
+1
-14
@@ -13,7 +13,6 @@ pipeline {
|
||||
arm64: "px4io/px4-dev-aarch64:2021-05-04",
|
||||
base: "px4io/px4-dev-base-bionic:2021-05-04",
|
||||
nuttx: "px4io/px4-dev-nuttx-focal:2021-05-04",
|
||||
snapdragon: "lorenzmeier/px4-dev-snapdragon:2020-04-01"
|
||||
]
|
||||
|
||||
def armhf_builds = [
|
||||
@@ -106,14 +105,8 @@ pipeline {
|
||||
archive: true
|
||||
]
|
||||
|
||||
def snapdragon_builds = [
|
||||
target: ["atlflight_eagle_qurt", "atlflight_eagle_default"],
|
||||
image: docker_images.snapdragon,
|
||||
archive: false
|
||||
]
|
||||
|
||||
def docker_builds = [
|
||||
armhf_builds, base_builds, nuttx_builds_archive//, snapdragon_builds
|
||||
armhf_builds, base_builds, nuttx_builds_archive
|
||||
]
|
||||
|
||||
for (def build_type = 0; build_type < docker_builds.size(); build_type++) {
|
||||
@@ -165,12 +158,6 @@ pipeline {
|
||||
def createBuildNode(Boolean archive, String docker_image, String target) {
|
||||
return {
|
||||
|
||||
// TODO: fix the snapdragon image
|
||||
bypass_entrypoint = ''
|
||||
if (docker_image == 'lorenzmeier/px4-dev-snapdragon:2020-04-01') {
|
||||
bypass_entrypoint = ' --entrypoint=""'
|
||||
}
|
||||
|
||||
node {
|
||||
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_dagar') {
|
||||
docker.image(docker_image).inside('-e CCACHE_BASEDIR=${WORKSPACE} -v ${CCACHE_DIR}:${CCACHE_DIR}:rw' + bypass_entrypoint) {
|
||||
|
||||
+376
-356
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -12,6 +12,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-clang:2021-05-04
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
|
||||
@@ -12,6 +12,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-armhf:2021-05-04
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
matrix:
|
||||
config: [
|
||||
|
||||
@@ -12,6 +12,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-aarch64:2021-05-04
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
matrix:
|
||||
config: [
|
||||
|
||||
@@ -11,6 +11,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-10.15
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
matrix:
|
||||
config: [
|
||||
|
||||
@@ -12,83 +12,50 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-nuttx-focal:2021-05-04
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
matrix:
|
||||
config: [
|
||||
airmind_mindpx-v2_default,
|
||||
ark_can-flow_canbootloader,
|
||||
ark_can-flow_debug,
|
||||
ark_can-flow_default,
|
||||
ark_can-gps_canbootloader,
|
||||
ark_can-gps_debug,
|
||||
ark_can-gps_default,
|
||||
av_x-v1_default,
|
||||
bitcraze_crazyflie21_default,
|
||||
bitcraze_crazyflie_default,
|
||||
cuav_can-gps-v1_canbootloader,
|
||||
cuav_can-gps-v1_debug,
|
||||
cuav_can-gps-v1_default,
|
||||
cuav_nora_default,
|
||||
cuav_x7pro_default,
|
||||
cubepilot_cubeorange_default,
|
||||
cubepilot_cubeorange_test,
|
||||
cubepilot_cubeyellow_default,
|
||||
cubepilot_cubeyellow_test,
|
||||
cubepilot_io-v2_default,
|
||||
freefly_can-rtk-gps_canbootloader,
|
||||
freefly_can-rtk-gps_default,
|
||||
holybro_can-gps-v1_canbootloader,
|
||||
holybro_can-gps-v1_debug,
|
||||
holybro_can-gps-v1_default,
|
||||
holybro_durandal-v1_default,
|
||||
holybro_kakutef7_default,
|
||||
holybro_pix32v5_default,
|
||||
modalai_fc-v1_default,
|
||||
modalai_fc-v1_rtps,
|
||||
modalai_fc-v2_default,
|
||||
mro_ctrl-zero-f7-oem_default,
|
||||
mro_ctrl-zero-f7_default,
|
||||
mro_ctrl-zero-h7-oem_default,
|
||||
mro_ctrl-zero-h7_default,
|
||||
mro_pixracerpro_default,
|
||||
mro_x21-777_default,
|
||||
mro_x21_default,
|
||||
nxp_fmuk66-e_default,
|
||||
nxp_fmuk66-e_rtps,
|
||||
nxp_fmuk66-e_socketcan,
|
||||
nxp_fmuk66-v3_default,
|
||||
nxp_fmuk66-v3_rtps,
|
||||
nxp_fmuk66-v3_socketcan,
|
||||
nxp_fmurt1062-v1_default,
|
||||
nxp_ucans32k146_canbootloader,
|
||||
nxp_ucans32k146_default,
|
||||
omnibus_f4sd_default,
|
||||
px4_fmu-v2_default,
|
||||
px4_fmu-v2_fixedwing,
|
||||
px4_fmu-v2_multicopter,
|
||||
px4_fmu-v2_rover,
|
||||
px4_fmu-v3_default,
|
||||
px4_fmu-v4_cannode,
|
||||
px4_fmu-v4_default,
|
||||
px4_fmu-v4pro_default,
|
||||
px4_fmu-v5_ctrlalloc,
|
||||
px4_fmu-v5_debug,
|
||||
px4_fmu-v5_default,
|
||||
px4_fmu-v5_fixedwing,
|
||||
px4_fmu-v5_multicopter,
|
||||
px4_fmu-v5_optimized,
|
||||
px4_fmu-v5_rover,
|
||||
px4_fmu-v5_rtps,
|
||||
px4_fmu-v5_stackcheck,
|
||||
px4_fmu-v5_uavcanv0periph,
|
||||
px4_fmu-v5_uavcanv1,
|
||||
px4_fmu-v5x_base_phy_DP83848C,
|
||||
px4_fmu-v5x_default,
|
||||
px4_fmu-v6u_default,
|
||||
px4_fmu-v6x_default,
|
||||
px4_io-v2_default,
|
||||
spracing_h7extreme_default,
|
||||
uvify_core_default
|
||||
airmind_mindpx-v2,
|
||||
ark_can-flow,
|
||||
ark_can-gps,
|
||||
av_x-v1,
|
||||
bitcraze_crazyflie,
|
||||
bitcraze_crazyflie21,
|
||||
cuav_can-gps-v1,
|
||||
cuav_nora,
|
||||
cuav_x7pro,
|
||||
cubepilot_cubeorange,
|
||||
cubepilot_cubeyellow,
|
||||
freefly_can-rtk-gps,
|
||||
holybro_can-gps-v1,
|
||||
holybro_durandal-v1,
|
||||
holybro_kakutef7,
|
||||
holybro_pix32v5,
|
||||
modalai_fc-v1,
|
||||
modalai_fc-v2,
|
||||
mro_ctrl-zero-f7,
|
||||
mro_ctrl-zero-f7-oem,
|
||||
mro_ctrl-zero-h7,
|
||||
mro_ctrl-zero-h7-oem,
|
||||
mro_pixracerpro,
|
||||
mro_x21,
|
||||
mro_x21-777,
|
||||
nxp_fmuk66-e,
|
||||
nxp_fmuk66-v3,
|
||||
nxp_fmurt1062-v1,
|
||||
nxp_ucans32k146,
|
||||
omnibus_f4sd,
|
||||
px4_fmu-v2,
|
||||
px4_fmu-v3,
|
||||
px4_fmu-v4,
|
||||
px4_fmu-v4pro,
|
||||
px4_fmu-v5,
|
||||
px4_fmu-v5x,
|
||||
px4_fmu-v6u,
|
||||
px4_fmu-v6x,
|
||||
spracing_h7extreme,
|
||||
uvify_core
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
@@ -117,8 +84,8 @@ jobs:
|
||||
ccache -s
|
||||
ccache -z
|
||||
|
||||
- name: make ${{matrix.config}}
|
||||
run: make ${{matrix.config}}
|
||||
- name: make all_variants_${{matrix.config}}
|
||||
run: make all_variants_${{matrix.config}}
|
||||
- name: make ${{matrix.config}} bloaty_compileunits
|
||||
run: make ${{matrix.config}} bloaty_compileunits || true
|
||||
- name: make ${{matrix.config}} bloaty_inlines
|
||||
@@ -137,7 +104,7 @@ jobs:
|
||||
run: ccache -s
|
||||
|
||||
- name: Upload px4 package
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: px4_package_${{matrix.config}}
|
||||
path: build/${{matrix.config}}/${{matrix.config}}.px4
|
||||
path: build/**/*.px4
|
||||
|
||||
@@ -12,6 +12,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-nuttx-focal:2021-05-04
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
matrix:
|
||||
config: [
|
||||
|
||||
@@ -8,13 +8,14 @@ jobs:
|
||||
container: px4io/px4-dev-base-focal:2021-05-04
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: checkout newest version of branch
|
||||
run: |
|
||||
git fetch origin pull/${{github.event.pull_request.number}}/head:${{github.head_ref}}
|
||||
git checkout ${GITHUB_HEAD_REF}
|
||||
- name: main test
|
||||
run: cd ${GITHUB_WORKSPACE}/src/lib/ecl; make test
|
||||
working-directory: src/lib/ecl
|
||||
run: make tests TESTFILTER=EKF
|
||||
- name: Check if there is a functional change
|
||||
run: git diff --exit-code
|
||||
working-directory: src/lib/ecl/test/change_indication
|
||||
working-directory: src/modules/ekf2/test/change_indication
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
|
||||
name: EKF Build Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
Linux-GCC:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-base-focal:2021-05-04
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: main build
|
||||
run: make
|
||||
working-directory: src/lib/ecl
|
||||
- name: clean build
|
||||
run: make clean
|
||||
working-directory: src/lib/ecl
|
||||
- name: main test
|
||||
run: make test
|
||||
working-directory: src/lib/ecl
|
||||
Linux-Clang:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-clang:2021-05-04
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: main build
|
||||
run: make
|
||||
working-directory: src/lib/ecl
|
||||
- name: clean build
|
||||
run: make clean
|
||||
working-directory: src/lib/ecl
|
||||
- name: main test
|
||||
run: make test
|
||||
working-directory: src/lib/ecl
|
||||
Mac-OS:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: main build
|
||||
run: make
|
||||
working-directory: src/lib/ecl
|
||||
- name: clean build
|
||||
run: make clean
|
||||
working-directory: src/lib/ecl
|
||||
- name: main test
|
||||
run: make test
|
||||
working-directory: src/lib/ecl
|
||||
@@ -11,11 +11,13 @@ jobs:
|
||||
GIT_COMMITTER_NAME: PX4BuildBot
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: main test updates change indication files
|
||||
run: cd ${GITHUB_WORKSPACE}/src/lib/ecl; make test
|
||||
run: make tests TESTFILTER=EKF
|
||||
- name: Check if there exists diff and save result in variable
|
||||
run: echo "CHANGE_INDICATED=$(git diff --exit-code --output=/dev/null || echo $?)" >> $GITHUB_ENV
|
||||
working-directory: src/lib/ecl/test/change_indication
|
||||
working-directory: src/modules/ekf2/test/change_indication
|
||||
- name: auto-commit any changes to change indication
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
|
||||
@@ -11,6 +11,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
+3
-7
@@ -18,10 +18,6 @@
|
||||
path = src/lib/matrix
|
||||
url = https://github.com/PX4/PX4-Matrix.git
|
||||
branch = master
|
||||
[submodule "boards/atlflight/cmake_hexagon"]
|
||||
path = boards/atlflight/cmake_hexagon
|
||||
url = https://github.com/PX4/cmake_hexagon.git
|
||||
branch = px4
|
||||
[submodule "src/drivers/gps/devices"]
|
||||
path = src/drivers/gps/devices
|
||||
url = https://github.com/PX4/PX4-GPSDrivers.git
|
||||
@@ -38,9 +34,6 @@
|
||||
path = platforms/nuttx/NuttX/apps
|
||||
url = https://github.com/PX4/NuttX-apps.git
|
||||
branch = px4_firmware_nuttx-10.0.0+
|
||||
[submodule "platforms/qurt/dspal"]
|
||||
path = platforms/qurt/dspal
|
||||
url = https://github.com/ATLFlight/dspal.git
|
||||
[submodule "Tools/flightgear_bridge"]
|
||||
path = Tools/flightgear_bridge
|
||||
url = https://github.com/PX4/PX4-FlightGear-Bridge.git
|
||||
@@ -70,3 +63,6 @@
|
||||
[submodule "src/lib/events/libevents"]
|
||||
path = src/lib/events/libevents
|
||||
url = https://github.com/mavlink/libevents.git
|
||||
[submodule "Tools/simulation-ignition"]
|
||||
path = Tools/simulation-ignition
|
||||
url = https://github.com/Auterion/px4-simulation-ignition.git
|
||||
@@ -174,6 +174,7 @@ endif
|
||||
# --------------------------------------------------------------------
|
||||
# describe how to build a cmake config
|
||||
define cmake-build
|
||||
$(eval CMAKE_ARGS += -DCONFIG=$(1))
|
||||
@$(eval BUILD_DIR = "$(SRC_DIR)/build/$(1)")
|
||||
@# check if the desired cmake configuration matches the cache then CMAKE_CACHE_CHECK stays empty
|
||||
@$(call cmake-cache-check)
|
||||
@@ -213,7 +214,7 @@ define colorecho
|
||||
endef
|
||||
|
||||
# Get a list of all config targets boards/*/*.cmake
|
||||
ALL_CONFIG_TARGETS := $(shell find boards -maxdepth 3 -mindepth 3 ! -name '*common*' ! -name '*sdflight*' -name '*.cmake' -print | sed -e 's|boards\/||' | sed -e 's|\.cmake||' | sed -e 's|\/|_|g' | sort)
|
||||
ALL_CONFIG_TARGETS := $(shell find boards -maxdepth 3 -mindepth 3 -name '*.cmake' -print | sed -e 's|boards\/||' | sed -e 's|\.cmake||' | sed -e 's|\/|_|g' | sort)
|
||||
|
||||
# ADD CONFIGS HERE
|
||||
# --------------------------------------------------------------------
|
||||
@@ -221,16 +222,12 @@ ALL_CONFIG_TARGETS := $(shell find boards -maxdepth 3 -mindepth 3 ! -name '*comm
|
||||
|
||||
# All targets.
|
||||
$(ALL_CONFIG_TARGETS):
|
||||
@$(eval PX4_CONFIG = $@)
|
||||
@$(eval CMAKE_ARGS += -DCONFIG=$(PX4_CONFIG))
|
||||
@$(call cmake-build,$(PX4_CONFIG)$(BUILD_DIR_SUFFIX))
|
||||
@$(call cmake-build,$@$(BUILD_DIR_SUFFIX))
|
||||
|
||||
# Filter for only default targets to allow omiting the "_default" postfix
|
||||
CONFIG_TARGETS_DEFAULT := $(patsubst %_default,%,$(filter %_default,$(ALL_CONFIG_TARGETS)))
|
||||
$(CONFIG_TARGETS_DEFAULT):
|
||||
@$(eval PX4_CONFIG = $@_default)
|
||||
@$(eval CMAKE_ARGS += -DCONFIG=$(PX4_CONFIG))
|
||||
@$(call cmake-build,$(PX4_CONFIG)$(BUILD_DIR_SUFFIX))
|
||||
@$(call cmake-build,$@_default$(BUILD_DIR_SUFFIX))
|
||||
|
||||
all_config_targets: $(ALL_CONFIG_TARGETS)
|
||||
all_default_targets: $(CONFIG_TARGETS_DEFAULT)
|
||||
@@ -243,16 +240,6 @@ endef
|
||||
# All targets with just dependencies but no recipe must either be marked as phony (or have the special @: as recipe).
|
||||
.PHONY: all px4_sitl_default all_config_targets all_default_targets
|
||||
|
||||
# Multi- config targets.
|
||||
eagle_default: atlflight_eagle_default atlflight_eagle_qurt
|
||||
eagle_rtps: atlflight_eagle_rtps atlflight_eagle_qurt-rtps
|
||||
|
||||
excelsior_default: atlflight_excelsior_default atlflight_excelsior_qurt
|
||||
excelsior_rtps: atlflight_excelsior_rtps atlflight_excelsior_qurt-rtps
|
||||
|
||||
.PHONY: eagle_default eagle_rtps
|
||||
.PHONY: excelsior_default excelsior_rtps
|
||||
|
||||
# Other targets
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
@@ -306,6 +293,11 @@ check_%:
|
||||
@$(MAKE) --no-print-directory $(subst check_,,$@)
|
||||
@echo
|
||||
|
||||
all_variants_%:
|
||||
@echo 'Building all $(subst all_variants_,,$@) variants:' $(filter $(subst all_variants_,,$@)_%, $(ALL_CONFIG_TARGETS))
|
||||
@echo
|
||||
$(foreach a,$(filter $(subst all_variants_,,$@)_%, $(ALL_CONFIG_TARGETS)), $(call cmake-build,$(a)$(BUILD_DIR_SUFFIX)))
|
||||
|
||||
uorb_graphs:
|
||||
@./Tools/uorb_graph/create.py --src-path src --exclude-path src/examples --exclude-path src/lib --file Tools/uorb_graph/graph_full
|
||||
@$(MAKE) --no-print-directory px4_fmu-v2_default uorb_graph
|
||||
@@ -360,7 +352,6 @@ format:
|
||||
.PHONY: rostest python_coverage
|
||||
|
||||
tests:
|
||||
$(eval CMAKE_ARGS += -DCONFIG=px4_sitl_test)
|
||||
$(eval CMAKE_ARGS += -DTESTFILTER=$(TESTFILTER))
|
||||
$(eval ARGS += test_results)
|
||||
$(eval ASAN_OPTIONS += color=always:check_initialization_order=1:detect_stack_use_after_return=1)
|
||||
@@ -511,7 +502,7 @@ help:
|
||||
@echo "Where <target> is one of:"
|
||||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | \
|
||||
awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | \
|
||||
egrep -v -e '^[^[:alnum:]]' -e '^($(subst $(space),|,$(ALL_CONFIG_TARGETS)))$$' -e '_default$$' -e '^(posix|eagle|Makefile)'
|
||||
egrep -v -e '^[^[:alnum:]]' -e '^($(subst $(space),|,$(ALL_CONFIG_TARGETS)))$$' -e '_default$$' -e '^(Makefile)'
|
||||
@echo
|
||||
@echo "Or, $(MAKE) <config_target> [<make_target(s)>]"
|
||||
@echo "Use '$(MAKE) list_config_targets' for a list of configuration targets."
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
This repository holds the [PX4](http://px4.io) flight control solution for drones, with the main applications located in the [src/modules](https://github.com/PX4/PX4-Autopilot/tree/master/src/modules) directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
|
||||
|
||||
PX4 is highly portable, OS-independent and supports Linux, NuttX and QuRT out of the box.
|
||||
PX4 is highly portable, OS-independent and supports Linux, NuttX and MacOS out of the box.
|
||||
|
||||
* Official Website: http://px4.io (License: BSD 3-clause, [LICENSE](https://github.com/PX4/PX4-Autopilot/blob/master/LICENSE))
|
||||
* [Supported airframes](https://docs.px4.io/master/en/airframes/airframe_reference.html) ([portfolio](http://px4.io/#airframes)):
|
||||
|
||||
@@ -5,46 +5,62 @@ import subprocess
|
||||
from subprocess import call, Popen
|
||||
from argparse import ArgumentParser
|
||||
import re
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
COLOR_RED = "\x1b[31m"
|
||||
COLOR_GREEN = "\x1b[32m"
|
||||
COLOR_YELLOW = "\x1b[33m"
|
||||
COLOR_WHITE = "\x1b[37m"
|
||||
COLOR_RESET = "\x1b[0m"
|
||||
|
||||
def print_line(line):
|
||||
if "WARNING" in line:
|
||||
line = line.replace("WARNING", f"{COLOR_YELLOW}WARNING{COLOR_RESET}", 1)
|
||||
elif "WARN" in line:
|
||||
line = line.replace("WARN", f"{COLOR_YELLOW}WARN{COLOR_RESET}", 1)
|
||||
elif "ERROR" in line:
|
||||
line = line.replace("ERROR", f"{COLOR_RED}ERROR{COLOR_RESET}", 1)
|
||||
elif "INFO" in line:
|
||||
line = line.replace("INFO", f"{COLOR_WHITE}INFO{COLOR_RESET}", 1)
|
||||
|
||||
if "PASSED" in line:
|
||||
line = line.replace("PASSED", f"{COLOR_GREEN}PASSED{COLOR_RESET}", 1)
|
||||
|
||||
if "FAILED" in line:
|
||||
line = line.replace("FAILED", f"{COLOR_RED}FAILED{COLOR_RESET}", 1)
|
||||
|
||||
current_time = datetime.datetime.now()
|
||||
print('[{0}] {1}'.format(current_time.isoformat(timespec='milliseconds'), line), end='')
|
||||
|
||||
def monitor_firmware_upload(port, baudrate):
|
||||
databits = serial.EIGHTBITS
|
||||
stopbits = serial.STOPBITS_ONE
|
||||
parity = serial.PARITY_NONE
|
||||
ser = serial.Serial(port, baudrate, databits, parity, stopbits, timeout=1)
|
||||
ser = serial.Serial(port, baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1, xonxoff=True, rtscts=False, dsrdtr=False)
|
||||
|
||||
finished = 0
|
||||
|
||||
timeout = 300 # 5 minutes
|
||||
timeout = 180 # 3 minutes
|
||||
timeout_start = time.time()
|
||||
timeout_newline = time.time()
|
||||
|
||||
while finished == 0:
|
||||
while True:
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
if (len(serial_line) > 0):
|
||||
print(serial_line.replace('\n', ''))
|
||||
|
||||
if len(serial_line) > 0:
|
||||
print_line(serial_line)
|
||||
|
||||
if "NuttShell (NSH)" in serial_line:
|
||||
finished = 1
|
||||
break
|
||||
|
||||
if time.time() - timeout_start > 10:
|
||||
if "nsh>" in serial_line:
|
||||
finished = 1
|
||||
break
|
||||
sys.exit(0)
|
||||
elif "nsh>" in serial_line:
|
||||
sys.exit(0)
|
||||
|
||||
if time.time() > timeout_start + timeout:
|
||||
print("Error, timeout")
|
||||
finished = 1
|
||||
break
|
||||
sys.exit(-1)
|
||||
|
||||
# newline every 10 seconds if still running
|
||||
if time.time() - timeout_newline > 10:
|
||||
timeout_newline = time.time()
|
||||
ser.write('\n'.encode("ascii"))
|
||||
ser.write("\n".encode("ascii"))
|
||||
ser.flush()
|
||||
|
||||
ser.close()
|
||||
|
||||
def main():
|
||||
parser = ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--device', "-d", nargs='?', default=None, help='', required=True)
|
||||
|
||||
Executable
+137
@@ -0,0 +1,137 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import serial, time
|
||||
import subprocess
|
||||
from subprocess import call, Popen
|
||||
from argparse import ArgumentParser
|
||||
import re
|
||||
import sys
|
||||
|
||||
COLOR_RED = "\x1b[31m"
|
||||
COLOR_GREEN = "\x1b[32m"
|
||||
COLOR_YELLOW = "\x1b[33m"
|
||||
COLOR_WHITE = "\x1b[37m"
|
||||
COLOR_RESET = "\x1b[0m"
|
||||
|
||||
def print_line(line):
|
||||
if "WARNING" in line:
|
||||
line = line.replace("WARNING", f"{COLOR_YELLOW}WARNING{COLOR_RESET}", 1)
|
||||
elif "WARN" in line:
|
||||
line = line.replace("WARN", f"{COLOR_YELLOW}WARN{COLOR_RESET}", 1)
|
||||
elif "ERROR" in line:
|
||||
line = line.replace("ERROR", f"{COLOR_RED}ERROR{COLOR_RESET}", 1)
|
||||
elif "INFO" in line:
|
||||
line = line.replace("INFO", f"{COLOR_WHITE}INFO{COLOR_RESET}", 1)
|
||||
|
||||
if "PASSED" in line:
|
||||
line = line.replace("PASSED", f"{COLOR_GREEN}PASSED{COLOR_RESET}", 1)
|
||||
|
||||
if "FAILED" in line:
|
||||
line = line.replace("FAILED", f"{COLOR_RED}FAILED{COLOR_RESET}", 1)
|
||||
|
||||
print(line, end='')
|
||||
|
||||
def do_param_set_cmd(port, baudrate, param_name, param_value):
|
||||
ser = serial.Serial(port, baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=0.1, xonxoff=True, rtscts=False, dsrdtr=False)
|
||||
|
||||
timeout_start = time.time()
|
||||
timeout = 10 # 10 seconds
|
||||
|
||||
# wait for nsh prompt
|
||||
while True:
|
||||
ser.write("\n".encode("ascii"))
|
||||
ser.flush()
|
||||
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
|
||||
if "nsh>" in serial_line:
|
||||
break
|
||||
else:
|
||||
if len(serial_line) > 0:
|
||||
print_line(serial_line)
|
||||
|
||||
if time.time() > timeout_start + timeout:
|
||||
print("Error, timeout waiting for prompt")
|
||||
sys.exit(1)
|
||||
|
||||
# clear
|
||||
ser.readlines()
|
||||
|
||||
# run command
|
||||
timeout_start = time.time()
|
||||
timeout = 10 # 10 seconds
|
||||
|
||||
cmd = "param set " + param_name + " " + param_value
|
||||
|
||||
# write command (param set) and wait for command echo
|
||||
serial_cmd = '{0}\r\n'.format(cmd)
|
||||
ser.write(serial_cmd.encode("ascii"))
|
||||
ser.flush()
|
||||
while True:
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
|
||||
if cmd in serial_line:
|
||||
print_line(serial_line)
|
||||
break
|
||||
else:
|
||||
if len(serial_line) > 0:
|
||||
print_line(serial_line)
|
||||
|
||||
if time.time() > timeout_start + timeout:
|
||||
print("Error, timeout waiting for command echo")
|
||||
break
|
||||
|
||||
# verify param value
|
||||
cmd = "param show " + param_name
|
||||
serial_cmd = '{0}\r\n'.format(cmd)
|
||||
ser.write(serial_cmd.encode("ascii"))
|
||||
ser.flush()
|
||||
|
||||
param_show_response = param_name + " ["
|
||||
|
||||
timeout_start = time.time()
|
||||
timeout = 2 # 2 seconds
|
||||
|
||||
while True:
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
|
||||
if param_show_response in serial_line:
|
||||
print_line(serial_line)
|
||||
current_param_value = serial_line.split(":")[-1].strip()
|
||||
|
||||
if (current_param_value == param_value):
|
||||
sys.exit(0)
|
||||
else:
|
||||
sys.exit(1)
|
||||
else:
|
||||
if len(serial_line) > 0:
|
||||
print_line(serial_line)
|
||||
|
||||
if time.time() > timeout_start + timeout:
|
||||
if "nsh>" in serial_line:
|
||||
sys.exit(1) # error, command didn't complete successfully
|
||||
elif "NuttShell (NSH)" in serial_line:
|
||||
sys.exit(1) # error, command didn't complete successfully
|
||||
|
||||
if len(serial_line) <= 0:
|
||||
ser.write("\r\n".encode("ascii"))
|
||||
ser.flush()
|
||||
|
||||
if time.time() > timeout_start + timeout:
|
||||
print("Error, timeout")
|
||||
sys.exit(-1)
|
||||
|
||||
ser.close()
|
||||
|
||||
def main():
|
||||
parser = ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--device', "-d", nargs='?', default=None, help='', required=True)
|
||||
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int, help="Mavlink port baud rate (default=57600)", default=57600)
|
||||
parser.add_argument("--name", "-p", dest="param_name", help="Parameter name")
|
||||
parser.add_argument("--value", "-v", dest="param_value", help="Parameter value")
|
||||
args = parser.parse_args()
|
||||
|
||||
do_param_set_cmd(args.device, args.baudrate, args.param_name, args.param_value)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+70
-35
@@ -6,52 +6,89 @@ from subprocess import call, Popen
|
||||
from argparse import ArgumentParser
|
||||
import re
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
COLOR_RED = "\x1b[31m"
|
||||
COLOR_GREEN = "\x1b[32m"
|
||||
COLOR_YELLOW = "\x1b[33m"
|
||||
COLOR_WHITE = "\x1b[37m"
|
||||
COLOR_RESET = "\x1b[0m"
|
||||
|
||||
def print_line(line):
|
||||
if "WARNING" in line:
|
||||
line = line.replace("WARNING", f"{COLOR_YELLOW}WARNING{COLOR_RESET}", 1)
|
||||
elif "WARN" in line:
|
||||
line = line.replace("WARN", f"{COLOR_YELLOW}WARN{COLOR_RESET}", 1)
|
||||
elif "ERROR" in line:
|
||||
line = line.replace("ERROR", f"{COLOR_RED}ERROR{COLOR_RESET}", 1)
|
||||
elif "INFO" in line:
|
||||
line = line.replace("INFO", f"{COLOR_WHITE}INFO{COLOR_RESET}", 1)
|
||||
|
||||
if "PASSED" in line:
|
||||
line = line.replace("PASSED", f"{COLOR_GREEN}PASSED{COLOR_RESET}", 1)
|
||||
|
||||
if "FAILED" in line:
|
||||
line = line.replace("FAILED", f"{COLOR_RED}FAILED{COLOR_RESET}", 1)
|
||||
|
||||
current_time = datetime.datetime.now()
|
||||
print('[{0}] {1}'.format(current_time.isoformat(timespec='milliseconds'), line), end='')
|
||||
|
||||
def do_nsh_cmd(port, baudrate, cmd):
|
||||
databits = serial.EIGHTBITS
|
||||
stopbits = serial.STOPBITS_ONE
|
||||
parity = serial.PARITY_NONE
|
||||
ser = serial.Serial(port, baudrate, databits, parity, stopbits, timeout=0.1)
|
||||
ser = serial.Serial(port, baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=0.1, xonxoff=True, rtscts=False, dsrdtr=False)
|
||||
|
||||
# run command
|
||||
timeout_start = time.time()
|
||||
timeout = 10 # 10 seconds
|
||||
|
||||
# wait for nsh prompt
|
||||
while True:
|
||||
ser.write("\n".encode("ascii"))
|
||||
ser.flush()
|
||||
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
|
||||
if "nsh>" in serial_line:
|
||||
break
|
||||
else:
|
||||
if len(serial_line) > 0:
|
||||
print_line(serial_line)
|
||||
|
||||
if time.time() > timeout_start + timeout:
|
||||
print("Error, timeout waiting for prompt")
|
||||
sys.exit(1)
|
||||
|
||||
# clear
|
||||
ser.write("\n".encode("ascii"))
|
||||
ser.flush()
|
||||
ser.readline()
|
||||
ser.readlines()
|
||||
|
||||
# run command
|
||||
timeout_start = time.time()
|
||||
timeout = 1 # 1 second
|
||||
|
||||
success_cmd = "cmd succeeded!"
|
||||
|
||||
serial_cmd = '{0}; echo "{1}"\n'.format(cmd, success_cmd)
|
||||
# wait for command echo
|
||||
serial_cmd = '{0}; echo "{1}"\r\n'.format(cmd, success_cmd)
|
||||
ser.write(serial_cmd.encode("ascii"))
|
||||
ser.flush()
|
||||
ser.readline()
|
||||
while True:
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
|
||||
# TODO: require successful command echo
|
||||
# while True:
|
||||
# serial_cmd = '{0}; echo "{1}"\n'.format(cmd, success_cmd)
|
||||
# ser.write(serial_cmd.encode("ascii"))
|
||||
# ser.flush()
|
||||
if cmd in serial_line:
|
||||
break
|
||||
elif serial_line.startswith(success_cmd) and len(serial_line) <= len(success_cmd) + 2:
|
||||
print_line(serial_line)
|
||||
# we missed the echo, but command ran and succeeded
|
||||
sys.exit(0)
|
||||
else:
|
||||
if len(serial_line) > 0:
|
||||
print_line(serial_line)
|
||||
|
||||
# serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
|
||||
# if cmd in serial_line:
|
||||
# break
|
||||
# else:
|
||||
# print(serial_line, end='')
|
||||
|
||||
# if time.time() > timeout_start + timeout:
|
||||
# print("Error, timeout")
|
||||
# sys.exit(-1)
|
||||
# break
|
||||
|
||||
# time.sleep(1)
|
||||
if time.time() > timeout_start + timeout:
|
||||
print("Error, timeout waiting for command echo")
|
||||
break
|
||||
|
||||
|
||||
timeout_start = time.time()
|
||||
timeout = 30 # 30 seconds
|
||||
timeout = 180 # 3 minutes
|
||||
|
||||
while True:
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
@@ -60,17 +97,15 @@ def do_nsh_cmd(port, baudrate, cmd):
|
||||
break
|
||||
else:
|
||||
if len(serial_line) > 0:
|
||||
print(serial_line, end='')
|
||||
print_line(serial_line)
|
||||
|
||||
if "nsh>" in serial_line:
|
||||
#sys.exit(-1) # error, command didn't complete successfully
|
||||
break # TODO: return error on failure
|
||||
sys.exit(1) # error, command didn't complete successfully
|
||||
elif "NuttShell (NSH)" in serial_line:
|
||||
#sys.exit(-1) # error, command didn't complete successfully
|
||||
break # TODO: return error on failure
|
||||
sys.exit(1) # error, command didn't complete successfully
|
||||
|
||||
if len(serial_line) <= 0:
|
||||
ser.write("\n".encode("ascii"))
|
||||
ser.write("\r\n".encode("ascii"))
|
||||
ser.flush()
|
||||
|
||||
if time.time() > timeout_start + timeout:
|
||||
|
||||
+86
-50
@@ -8,12 +8,58 @@ import re
|
||||
import unittest
|
||||
import os
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
COLOR_RED = "\x1b[31m"
|
||||
COLOR_GREEN = "\x1b[32m"
|
||||
COLOR_YELLOW = "\x1b[33m"
|
||||
COLOR_WHITE = "\x1b[37m"
|
||||
COLOR_RESET = "\x1b[0m"
|
||||
|
||||
def print_line(line):
|
||||
if "WARNING" in line:
|
||||
line = line.replace("WARNING", f"{COLOR_YELLOW}WARNING{COLOR_RESET}", 1)
|
||||
elif "WARN" in line:
|
||||
line = line.replace("WARN", f"{COLOR_YELLOW}WARN{COLOR_RESET}", 1)
|
||||
elif "ERROR" in line:
|
||||
line = line.replace("ERROR", f"{COLOR_RED}ERROR{COLOR_RESET}", 1)
|
||||
elif "INFO" in line:
|
||||
line = line.replace("INFO", f"{COLOR_WHITE}INFO{COLOR_RESET}", 1)
|
||||
|
||||
if "PASSED" in line:
|
||||
line = line.replace("PASSED", f"{COLOR_GREEN}PASSED{COLOR_RESET}", 1)
|
||||
|
||||
if "FAILED" in line:
|
||||
line = line.replace("FAILED", f"{COLOR_RED}FAILED{COLOR_RESET}", 1)
|
||||
|
||||
current_time = datetime.datetime.now()
|
||||
print('[{0}] {1}'.format(current_time.isoformat(timespec='milliseconds'), line), end='')
|
||||
|
||||
def do_test(port, baudrate, test_name):
|
||||
databits = serial.EIGHTBITS
|
||||
stopbits = serial.STOPBITS_ONE
|
||||
parity = serial.PARITY_NONE
|
||||
ser = serial.Serial(port, baudrate, databits, parity, stopbits, timeout=1)
|
||||
ser = serial.Serial(port, baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=0.2, xonxoff=True, rtscts=False, dsrdtr=False)
|
||||
|
||||
timeout_start = time.time()
|
||||
timeout = 10 # 10 seconds
|
||||
|
||||
# wait for nsh prompt
|
||||
while True:
|
||||
ser.write("\n".encode("ascii"))
|
||||
ser.flush()
|
||||
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
|
||||
if "nsh>" in serial_line:
|
||||
break
|
||||
else:
|
||||
if len(serial_line) > 0:
|
||||
print(serial_line, end='')
|
||||
|
||||
if time.time() > timeout_start + timeout:
|
||||
print("Error, timeout waiting for prompt")
|
||||
return False
|
||||
|
||||
# clear
|
||||
ser.readlines()
|
||||
|
||||
success = False
|
||||
|
||||
@@ -22,48 +68,38 @@ def do_test(port, baudrate, test_name):
|
||||
cmd = 'tests ' + test_name
|
||||
print("| Running:", cmd)
|
||||
print('|======================================================================')
|
||||
|
||||
timeout_start = time.time()
|
||||
timeout = 10 # 10 seconds
|
||||
|
||||
# clear
|
||||
ser.write("\n".encode("ascii"))
|
||||
ser.flush()
|
||||
ser.readline()
|
||||
timeout = 2 # 2 seconds
|
||||
|
||||
# wait for command echo
|
||||
serial_cmd = '{0}\n'.format(cmd)
|
||||
ser.write(serial_cmd.encode("ascii"))
|
||||
ser.flush()
|
||||
ser.readline()
|
||||
while True:
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
|
||||
# TODO: retry command
|
||||
# while True:
|
||||
# serial_cmd = '{0}\n'.format(cmd)
|
||||
# ser.write(serial_cmd.encode("ascii"))
|
||||
# ser.flush()
|
||||
if cmd in serial_line:
|
||||
break
|
||||
else:
|
||||
if len(serial_line) > 0:
|
||||
print_line(serial_line)
|
||||
|
||||
# serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
|
||||
# if cmd in serial_line:
|
||||
# break
|
||||
# else:
|
||||
# print(serial_line.replace('\n', ''))
|
||||
|
||||
# if time.time() > timeout_start + timeout:
|
||||
# print("Error, unable to write cmd")
|
||||
# return False
|
||||
|
||||
# time.sleep(1)
|
||||
if time.time() > timeout_start + timeout:
|
||||
print("Error, timeout waiting for command echo")
|
||||
break
|
||||
|
||||
|
||||
# print results, wait for final result (PASSED or FAILED)
|
||||
timeout = 180 # 3 minutes
|
||||
timeout = 300 # 5 minutes
|
||||
timeout_start = time.time()
|
||||
timeout_newline = timeout_start
|
||||
|
||||
while True:
|
||||
serial_line = ser.readline().decode("ascii", errors='ignore')
|
||||
if (len(serial_line) > 0):
|
||||
print(serial_line, end='')
|
||||
|
||||
if len(serial_line) > 0:
|
||||
print_line(serial_line)
|
||||
|
||||
if test_name + " PASSED" in serial_line:
|
||||
success = True
|
||||
@@ -74,7 +110,7 @@ def do_test(port, baudrate, test_name):
|
||||
|
||||
if time.time() > timeout_start + timeout:
|
||||
print("Error, timeout")
|
||||
print(test_name + " FAILED")
|
||||
print(test_name + f" {COLOR_RED}FAILED{COLOR_RESET}")
|
||||
success = False
|
||||
break
|
||||
|
||||
@@ -103,15 +139,30 @@ class TestHardwareMethods(unittest.TestCase):
|
||||
def test_bson(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "bson"))
|
||||
|
||||
# def test_dataman(self):
|
||||
# self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "dataman"))
|
||||
def test_conv(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "conv"))
|
||||
|
||||
def floattest_float(self):
|
||||
def test_dataman(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "dataman"))
|
||||
|
||||
# def test_file(self):
|
||||
# self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "file"))
|
||||
|
||||
def test_file2(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "file2"))
|
||||
|
||||
def test_float(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "float"))
|
||||
|
||||
def test_hrt(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "hrt"))
|
||||
|
||||
def test_int(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "int"))
|
||||
|
||||
def test_i2c_spi_cli(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "i2c_spi_cli"))
|
||||
|
||||
def test_IntrusiveQueue(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "IntrusiveQueue"))
|
||||
|
||||
@@ -127,21 +178,6 @@ class TestHardwareMethods(unittest.TestCase):
|
||||
def test_matrix(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "matrix"))
|
||||
|
||||
def test_microbench_atomic(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_atomic"))
|
||||
|
||||
def test_microbench_hrt(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_hrt"))
|
||||
|
||||
def test_microbench_math(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_math"))
|
||||
|
||||
def test_microbench_matrix(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_matrix"))
|
||||
|
||||
def test_microbench_uorb(self):
|
||||
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "microbench_uorb"))
|
||||
|
||||
# def test_mixer(self):
|
||||
# self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "mixer"))
|
||||
|
||||
|
||||
@@ -12,16 +12,16 @@ exec find boards msg src platforms test \
|
||||
-path platforms/nuttx/NuttX -prune -o \
|
||||
-path platforms/qurt/dspal -prune -o \
|
||||
-path src/drivers/uavcan/libuavcan -prune -o \
|
||||
-path src/drivers/uavcan/uavcan_drivers/kinetis/driver/include/uavcan_kinetis -prune -o \
|
||||
-path src/drivers/uavcan_v1/libcanard -prune -o \
|
||||
-path src/drivers/uavcannode_gps_demo/libcanard -prune -o \
|
||||
-path src/drivers/uavcan/uavcan_drivers/kinetis/driver/include/uavcan_kinetis -prune -o \
|
||||
-path src/lib/ecl -prune -o \
|
||||
-path src/lib/crypto/monocypher -prune -o \
|
||||
-path src/lib/events/libevents -prune -o \
|
||||
-path src/lib/matrix -prune -o \
|
||||
-path src/lib/parameters/uthash -prune -o \
|
||||
-path src/modules/ekf2/EKF -prune -o \
|
||||
-path src/modules/gyro_fft/CMSIS_5 -prune -o \
|
||||
-path src/modules/micrortps_bridge/micro-CDR -prune -o \
|
||||
-path src/modules/micrortps_bridge/microRTPS_client -prune -o \
|
||||
-path test/mavsdk_tests/catch2 -prune -o \
|
||||
-path src/lib/crypto/monocypher -prune -o \
|
||||
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
|
||||
|
||||
@@ -11,9 +11,6 @@ if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||
elif [[ $@ =~ .*pilotpi.arm64 ]]; then
|
||||
# scumaker_pilotpi_arm64
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-aarch64:latest"
|
||||
elif [[ $@ =~ .*eagle.* ]] || [[ $@ =~ .*excelsior.* ]]; then
|
||||
# eagle, excelsior
|
||||
PX4_DOCKER_REPO="lorenzmeier/px4-dev-snapdragon:2020-04-01"
|
||||
elif [[ $@ =~ .*navio2.* ]] || [[ $@ =~ .*raspberry.* ]] || [[ $@ =~ .*bebop.* ]]; then
|
||||
# posix_rpi_cross, posix_bebop_default
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2021-02-04"
|
||||
|
||||
@@ -5,17 +5,47 @@ import html
|
||||
|
||||
class MarkdownTablesOutput():
|
||||
def __init__(self, groups, board, image_path):
|
||||
result = ("# Airframes Reference\n"
|
||||
"> **Note** **This list is [auto-generated](https://github.com/PX4/PX4-Autopilot/blob/master/Tools/px4airframes/markdownout.py) from the source code**.\n"
|
||||
"> \n"
|
||||
"> **AUX** channels may not be present on some flight controllers.\n"
|
||||
"> If present, PWM AUX channels are commonly labelled **AUX OUT**.\n"
|
||||
"> \n"
|
||||
"\n")
|
||||
result = """# Airframes Reference
|
||||
|
||||
result += """This page lists all supported airframes and types including
|
||||
the motor assignment and numbering. The motors in **green** rotate clockwise,
|
||||
the ones in **blue** counterclockwise.\n\n"""
|
||||
:::note
|
||||
**This list is [auto-generated](https://github.com/PX4/PX4-Autopilot/blob/master/Tools/px4airframes/markdownout.py) from the source code** using the build command: `make airframe_metadata`.
|
||||
:::
|
||||
|
||||
This page lists all supported airframes and types including the motor assignment and numbering.
|
||||
The motors in **green** rotate clockwise, the ones in **blue** counterclockwise.
|
||||
|
||||
**AUX** channels may not be present on some flight controllers.
|
||||
If present, PWM AUX channels are commonly labelled **AUX OUT**.
|
||||
|
||||
<style>
|
||||
table {
|
||||
display: table;
|
||||
table-layout: fixed;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
table.common {
|
||||
float: right;
|
||||
width: 70%;
|
||||
}
|
||||
table.airframes {
|
||||
width: 100%;
|
||||
}
|
||||
table.airframes th:nth-child(1) {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
tr > * {
|
||||
vertical-align : top;
|
||||
}
|
||||
td, th {
|
||||
text-align : left;
|
||||
}
|
||||
img {
|
||||
max-height: 180px;
|
||||
width: 29%;
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>\n\n"""
|
||||
|
||||
type_set = set()
|
||||
|
||||
@@ -33,7 +63,7 @@ class MarkdownTablesOutput():
|
||||
image_name = group.GetImageName()
|
||||
result += '<div>\n'
|
||||
image_name = image_path + image_name
|
||||
result += '<img src="%s.svg" width="29%%" style="max-height: 180px;"/>\n' % (image_name)
|
||||
result += '<img src="%s.svg"/>\n' % (image_name)
|
||||
|
||||
# check if all outputs are equal for the group: if so, show them
|
||||
# only once
|
||||
@@ -63,19 +93,17 @@ class MarkdownTablesOutput():
|
||||
outputs_prev[i] = ''
|
||||
|
||||
if outputs_match[0] or outputs_match[1]:
|
||||
result += '<table style="float: right; width: 70%; font-size:1.5rem;">\n'
|
||||
result += ' <colgroup><col></colgroup>\n'
|
||||
result += '<table class="common">\n'
|
||||
result += ' <thead>\n'
|
||||
result += ' <tr><th>Common Outputs</th></tr>\n'
|
||||
result += ' </thead>\n'
|
||||
result += '<tbody>\n'
|
||||
result += '<tr>\n <td style="vertical-align: top;"><ul>%s%s</ul></td>\n</tr>\n' % (outputs_prev[0], outputs_prev[1])
|
||||
result += ' <tbody>\n'
|
||||
result += '<tr>\n <td><ul>%s%s</ul></td>\n</tr>\n' % (outputs_prev[0], outputs_prev[1])
|
||||
result += '</tbody></table>\n'
|
||||
|
||||
result += '</div>\n\n'
|
||||
|
||||
result += '<table style="width: 100%; table-layout:fixed; font-size:1.5rem;">\n'
|
||||
result += ' <colgroup><col style="width: 30%"><col style="width: 70%"></colgroup>\n'
|
||||
result += '<table class="generic">\n'
|
||||
result += ' <thead>\n'
|
||||
result += ' <tr><th>Name</th><th></th></tr>\n'
|
||||
result += ' </thead>\n'
|
||||
@@ -90,10 +118,12 @@ class MarkdownTablesOutput():
|
||||
maintainer = param.GetMaintainer()
|
||||
maintainer_entry = ''
|
||||
if maintainer != '':
|
||||
maintainer_entry = '<p>Maintainer: %s</p>' % (html.escape(maintainer))
|
||||
maintainer_entry = 'Maintainer: %s' % (html.escape(maintainer))
|
||||
url = param.GetFieldValue('url')
|
||||
name_anchor='id="%s_%s_%s"' % (group.GetClass(),group.GetName(),name)
|
||||
name_anchor='%s_%s_%s' % (group.GetClass(),group.GetName(),name)
|
||||
name_anchor=name_anchor.replace(' ','_').lower()
|
||||
name_anchor=name_anchor.replace('"','_').lower()
|
||||
name_anchor='id="%s"' % name_anchor
|
||||
name_entry = name
|
||||
if url != '':
|
||||
name_entry = '<a href="%s">%s</a>' % (url, name)
|
||||
@@ -120,7 +150,7 @@ class MarkdownTablesOutput():
|
||||
else:
|
||||
outputs_entry = ''
|
||||
|
||||
result += ('<tr %s>\n <td style="vertical-align: top;">%s</td>\n <td style="vertical-align: top;">%s%s%s</td>\n\n</tr>\n' %
|
||||
result += ('<tr %s>\n <td>%s</td>\n <td>%s%s%s</td>\n</tr>\n' %
|
||||
(name_anchor, name_entry, maintainer_entry, airframe_id_entry,
|
||||
outputs_entry))
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Setup environment to make PX4 visible to Gazebo.
|
||||
#
|
||||
# Note, this is not necessary if using a ROS catkin workspace with the px4
|
||||
# package as the paths are exported.
|
||||
#
|
||||
# License: according to LICENSE.md in the root directory of the PX4 Firmware repository
|
||||
|
||||
if [ "$#" != 2 ]; then
|
||||
echo -e "usage: source setup_gazebo.bash src_dir build_dir\n"
|
||||
return 1
|
||||
fi
|
||||
|
||||
SRC_DIR=$1
|
||||
BUILD_DIR=$2
|
||||
|
||||
# setup Gazebo env and update package path
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${SRC_DIR}/build/px4_sitl_default/build_ign_gazebo
|
||||
export IGN_GAZEBO_SYSTEM_PLUGIN_PATH=$IGN_GAZEBO_SYSTEM_PLUGIN_PATH:${SRC_DIR}/build/px4_sitl_default/build_ign_gazebo
|
||||
export IGN_GAZEBO_RESOURCE_PATH=$IGN_GAZEBO_RESOURCE_PATH:${SRC_DIR}/Tools/simulation-ignition/models
|
||||
|
||||
echo -e "LD_LIBRARY_PATH $LD_LIBRARY_PATH"
|
||||
Submodule
+1
Submodule Tools/simulation-ignition added at 794a8dc505
+1
-1
Submodule Tools/sitl_gazebo updated: 1f3f1b1dec...b6be00542b
@@ -177,6 +177,10 @@ elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]; then
|
||||
echo "You need to have gazebo simulator installed!"
|
||||
exit 1
|
||||
fi
|
||||
elif [ "$program" == "ignition" ] && [ -z "$no_sim" ]; then
|
||||
echo "Ignition Gazebo"
|
||||
source "$src_path/Tools/setup_ignition.bash" "${src_path}" "${build_path}"
|
||||
ign gazebo -r "${src_path}/Tools/simulation-ignition/worlds/ignition.world"&
|
||||
elif [ "$program" == "flightgear" ] && [ -z "$no_sim" ]; then
|
||||
echo "FG setup"
|
||||
cd "${src_path}/Tools/flightgear_bridge/"
|
||||
|
||||
Submodule boards/atlflight/cmake_hexagon deleted from 08fd0a7304
@@ -1,32 +0,0 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2018 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.
|
||||
#
|
||||
############################################################################
|
||||
@@ -1,64 +0,0 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2020 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
if("${PX4_PLATFORM}" MATCHES "qurt")
|
||||
|
||||
add_custom_target(upload
|
||||
COMMAND ${PX4_BOARD_DIR}/scripts/adb_upload.sh
|
||||
${PX4_BINARY_DIR}/platforms/qurt/libpx4.so ${PX4_BINARY_DIR}/platforms/qurt/libpx4muorb_skel.so ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/px4.config # source
|
||||
/usr/share/data/adsp # destination
|
||||
DEPENDS px4 px4muorb_skel ${PX4_BOARD_DIR}/scripts/adb_upload.sh
|
||||
COMMENT "uploading px4"
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
else()
|
||||
|
||||
add_custom_target(upload
|
||||
COMMAND ${PX4_BOARD_DIR}/scripts/adb_upload.sh
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config ${PX4_BINARY_DIR}/etc # source
|
||||
/home/linaro # destination
|
||||
DEPENDS px4 ${PX4_BOARD_DIR}/scripts/adb_upload.sh
|
||||
COMMENT "uploading px4"
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
add_custom_target(sanity
|
||||
COMMAND ./px4_snapflight_sanitytest.sh -i -t
|
||||
DEPENDS px4
|
||||
WORKING_DIRECTORY ${PX4_BOARD_DIR}/scripts
|
||||
COMMENT "uploading px4"
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
endif()
|
||||
@@ -1,128 +0,0 @@
|
||||
|
||||
# The Eagle board is the first generation Snapdragon Flight board by Qualcomm.
|
||||
|
||||
include(px4_git)
|
||||
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
"${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon"
|
||||
"${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon/toolchain"
|
||||
)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
|
||||
else()
|
||||
set(QC_SOC_TARGET "APQ8074")
|
||||
endif()
|
||||
|
||||
# Disable the creation of the parameters.xml file by scanning individual
|
||||
# source files, and scan all source files. This will create a parameters.xml
|
||||
# file that contains all possible parameters, even if the associated module
|
||||
# is not used. This is necessary for parameter synchronization between the
|
||||
# ARM and DSP processors.
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
set(CONFIG_SHMEM "1")
|
||||
add_definitions(-DORB_COMMUNICATOR)
|
||||
|
||||
# atlflight toolchain doesn't properly set the compiler, so these aren't set automatically
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:C>:-std=gnu99>)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=gnu++11>)
|
||||
|
||||
add_definitions(
|
||||
-D__PX4_POSIX_EAGLE
|
||||
-D__PX4_LINUX
|
||||
)
|
||||
|
||||
px4_add_board(
|
||||
PLATFORM posix
|
||||
VENDOR atlflight
|
||||
MODEL eagle
|
||||
LABEL default
|
||||
TOOLCHAIN arm-linux-gnueabihf
|
||||
ROMFSROOT px4fmu_common
|
||||
DRIVERS
|
||||
#barometer # all available barometer drivers
|
||||
batt_smbus
|
||||
camera_trigger
|
||||
differential_pressure # all available differential pressure drivers
|
||||
distance_sensor # all available distance sensor drivers
|
||||
gps
|
||||
#imu # all available imu drivers
|
||||
#lights/rgbled
|
||||
#magnetometer # all available magnetometer drivers
|
||||
pwm_out_sim
|
||||
qshell/posix
|
||||
rc_input
|
||||
smart_battery/batmon
|
||||
#telemetry # all available telemetry drivers
|
||||
MODULES
|
||||
airspeed_selector
|
||||
attitude_estimator_q
|
||||
camera_feedback
|
||||
commander
|
||||
dataman
|
||||
ekf2
|
||||
events
|
||||
flight_mode_manager
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
gyro_calibration
|
||||
gyro_fft
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
#load_mon
|
||||
local_position_estimator
|
||||
logger
|
||||
mavlink
|
||||
mc_att_control
|
||||
mc_hover_thrust_estimator
|
||||
mc_pos_control
|
||||
mc_rate_control
|
||||
#micrortps_bridge
|
||||
muorb/krait
|
||||
muorb/test
|
||||
navigator
|
||||
rc_update
|
||||
rover_pos_control
|
||||
sensors
|
||||
#sih
|
||||
temperature_compensation
|
||||
simulator
|
||||
vmount
|
||||
vtol_att_control
|
||||
SYSTEMCMDS
|
||||
#bl_update
|
||||
#dumpfile
|
||||
esc_calib
|
||||
#hardfault_log
|
||||
led_control
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
#mtd
|
||||
#nshterm
|
||||
param
|
||||
perf
|
||||
pwm
|
||||
sd_bench
|
||||
shutdown
|
||||
system_time
|
||||
#top
|
||||
topic_listener
|
||||
tune_control
|
||||
uorb
|
||||
ver
|
||||
work_queue
|
||||
EXAMPLES
|
||||
#fake_gps
|
||||
#fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
|
||||
#hello
|
||||
#hwtest # Hardware test
|
||||
#matlab_csv_serial
|
||||
#px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
|
||||
#px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
|
||||
#rover_steering_control # Rover example app
|
||||
#uuv_example_app
|
||||
#work_item
|
||||
)
|
||||
@@ -1,88 +0,0 @@
|
||||
|
||||
# The Eagle board is the first generation Snapdragon Flight board by Qualcomm.
|
||||
#
|
||||
# This cmake config builds for QURT which is the operating system running on
|
||||
# the DSP side.
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
|
||||
else()
|
||||
set(QC_SOC_TARGET "APQ8074")
|
||||
endif()
|
||||
|
||||
include(px4_git)
|
||||
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
|
||||
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
|
||||
|
||||
if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
|
||||
message(FATAL_ERROR "Enviroment variable HEXAGON_SDK_ROOT must be set")
|
||||
else()
|
||||
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
|
||||
endif()
|
||||
|
||||
include(toolchain/Toolchain-qurt)
|
||||
include(qurt_flags)
|
||||
include_directories(${HEXAGON_SDK_INCLUDES})
|
||||
|
||||
set(CONFIG_SHMEM "1")
|
||||
add_definitions(-DORB_COMMUNICATOR)
|
||||
|
||||
# Disable the creation of the parameters.xml file by scanning individual
|
||||
# source files, and scan all source files. This will create a parameters.xml
|
||||
# file that contains all possible parameters, even if the associated module
|
||||
# is not used. This is necessary for parameter synchronization between the
|
||||
# ARM and DSP processors.
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# This definition allows to differentiate the specific board.
|
||||
add_definitions(-D__PX4_QURT_EAGLE)
|
||||
|
||||
px4_add_board(
|
||||
PLATFORM qurt
|
||||
VENDOR atlflight
|
||||
MODEL eagle
|
||||
LABEL qurt
|
||||
DRIVERS
|
||||
barometer/bmp280
|
||||
gps
|
||||
imu/invensense/mpu9250
|
||||
#magnetometer/hmc5883
|
||||
qshell/qurt
|
||||
snapdragon_spektrum_rc
|
||||
MODULES
|
||||
airspeed_selector
|
||||
attitude_estimator_q
|
||||
commander
|
||||
ekf2
|
||||
flight_mode_manager
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
gyro_calibration
|
||||
gyro_fft
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
local_position_estimator
|
||||
mc_att_control
|
||||
mc_hover_thrust_estimator
|
||||
mc_pos_control
|
||||
mc_rate_control
|
||||
muorb/adsp
|
||||
rc_update
|
||||
rover_pos_control
|
||||
sensors
|
||||
temperature_compensation
|
||||
vmount
|
||||
vtol_att_control
|
||||
SYSTEMCMDS
|
||||
led_control
|
||||
mixer
|
||||
#motor_ramp
|
||||
motor_test
|
||||
param
|
||||
perf
|
||||
#pwm
|
||||
#topic_listener
|
||||
ver
|
||||
work_queue
|
||||
)
|
||||
@@ -1,2 +0,0 @@
|
||||
minidm.log
|
||||
px4.log
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$#" < 2 ]]; then
|
||||
echo "usage: adb_upload.sh SRC1 [SRC2 ...] DEST"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Get last argument
|
||||
for last; do true; done
|
||||
|
||||
echo "Wait for device..."
|
||||
adb wait-for-device
|
||||
|
||||
echo "Creating folder structure..."
|
||||
adb shell mkdir -p $last
|
||||
|
||||
echo "Uploading..."
|
||||
# Go through source files and push them one by one.
|
||||
i=0
|
||||
for arg
|
||||
do
|
||||
if [[ $((i+1)) == "$#" ]]; then
|
||||
break
|
||||
fi
|
||||
# echo "Pushing $arg to $last"
|
||||
adb push $arg $last
|
||||
((i+=1))
|
||||
done
|
||||
|
||||
# Make sure they are synced to the file system
|
||||
echo "Syncing FS..."
|
||||
adb shell sync
|
||||
@@ -1,288 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################################################################
|
||||
#
|
||||
# This script loads PX4 binaries to the Snapdragon Flight target and does a quick on-target sanity test.
|
||||
#
|
||||
# Pre-requisites:
|
||||
# - Snapdragon Flight board connected to the host computer via USB cable
|
||||
# - Snapdragon Flight board must have the latest platform BSP and flight controller addon installed"
|
||||
# - mini-dm installed on host computer (see https://github.com/ATLFlight/ATLFlightDocs/blob/master/UserGuide.md#adsp)
|
||||
# - PX4 software was built and binaries are in their usual locations in the Firmware tree.
|
||||
#
|
||||
# This script supports two modes:
|
||||
# - Default mode (supported by PX4 community)
|
||||
# - Legacy mode (uses proprietary drivers for ESC and RC Receiver, supported by Qualcomm)
|
||||
#
|
||||
# For help and cmd line options, run the script with the -h option
|
||||
#
|
||||
#################################################################################################
|
||||
|
||||
# Halt on error
|
||||
set -e
|
||||
|
||||
# Verbose mode
|
||||
## set -x
|
||||
|
||||
# Mode of operation
|
||||
readonly MODE_DEFAULT=0
|
||||
readonly MODE_LEGACY=1
|
||||
readonly MODE_8x96=2
|
||||
readonly MODE_MAX=$MODE_8x96
|
||||
|
||||
readonly RESULT_PASS=0
|
||||
readonly RESULT_FAIL=3
|
||||
readonly EXIT_ERROR=3
|
||||
|
||||
|
||||
# List of expected strings from the apps proc
|
||||
declare -a appsproc_strings_present=(
|
||||
"on udp port 14556 remote port 14550"
|
||||
)
|
||||
|
||||
# List of unexpected strings from the apps proc
|
||||
declare -a appsproc_strings_absent=(
|
||||
"ERROR"
|
||||
"Getting Bulk data from fastRPC link"
|
||||
"Segmentation fault"
|
||||
)
|
||||
|
||||
# List of expected strings from the DSP
|
||||
declare -a dsp_strings_present=(
|
||||
"EKF aligned"
|
||||
)
|
||||
|
||||
# List of unexpected strings from the DSP
|
||||
declare -a dsp_strings_absent=(
|
||||
"Segmentation fault"
|
||||
)
|
||||
|
||||
|
||||
install=0
|
||||
test=0
|
||||
mode=0
|
||||
result=$RESULT_PASS
|
||||
|
||||
# Default mini-dm path (needs to be installed in this location or overriden through cmd line
|
||||
minidmPath=~/Qualcomm/Hexagon_SDK/3.0/tools/debug/mini-dm/Linux_Debug
|
||||
|
||||
# Default workspace path (parent directory of the script location)
|
||||
workspace=`pwd`/../../../..
|
||||
|
||||
|
||||
verifypx4test() {
|
||||
|
||||
#TODO: This needs to be fixed. For now, skip string checks for 8x96 platform.
|
||||
if [ $mode == 2 ]; then
|
||||
echo -e "[WARNING] Skipping string checks for 8x96 platform"
|
||||
return
|
||||
fi
|
||||
|
||||
echo -e "Verifying test results..."
|
||||
|
||||
# verify the presence of expected stings in the apps proc console log
|
||||
for lineString in "${appsproc_strings_present[@]}"
|
||||
do
|
||||
if ! grep -Fq "$lineString" px4.log
|
||||
then
|
||||
# code if not found
|
||||
echo -e "[ERROR] Missing expected string in apps proc log: $lineString"
|
||||
result=$RESULT_FAIL
|
||||
fi
|
||||
done
|
||||
|
||||
# verify the absence of unexpected stings in the apps proc console log
|
||||
for lineString in "${appsproc_strings_absent[@]}"
|
||||
do
|
||||
if grep -Fq "$lineString" px4.log
|
||||
then
|
||||
# code if not found
|
||||
echo -e "[ERROR] Found unexpected string in apps proc log: $lineString"
|
||||
result=$RESULT_FAIL
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "Displaying the content of the minidm.log"
|
||||
cat minidm.log
|
||||
echo -e "Analyzing the log for success and failure indications."
|
||||
|
||||
# verify the presence of expected stings in the DSP console log
|
||||
for lineString in "${dsp_strings_present[@]}"
|
||||
do
|
||||
if ! grep -Fq "$lineString" minidm.log
|
||||
then
|
||||
# code if not found
|
||||
echo -e "[ERROR] Missing expected string in DSP log: $lineString"
|
||||
result=$RESULT_FAIL
|
||||
fi
|
||||
done
|
||||
|
||||
# verify the absence of unexpected stings in the DSP console log
|
||||
for lineString in "${dsp_strings_absent[@]}"
|
||||
do
|
||||
if grep -Fq "$lineString" minidm.log
|
||||
then
|
||||
# code if not found
|
||||
echo -e "[ERROR] Found unexpected string in DSP log: $lineString"
|
||||
result=$RESULT_FAIL
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "Verification complete."
|
||||
|
||||
if [ $result -eq $RESULT_FAIL ]; then
|
||||
echo -e "PX4 test result: FAIL"
|
||||
else
|
||||
echo -e "PX4 test result: PASS"
|
||||
fi
|
||||
}
|
||||
|
||||
installpx4() {
|
||||
|
||||
if [ $install -eq 0 ]; then
|
||||
echo -e "SKIPPING install"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Reboot the target before beginning the installation
|
||||
echo -e "Rebooting the target..."
|
||||
adb reboot
|
||||
adb wait-for-usb-device
|
||||
# Wait a bit longer after bootup, before copying binaries to the target.
|
||||
sleep 30
|
||||
adb devices
|
||||
|
||||
echo -e "Now installing PX4 binaries..."
|
||||
# Copy binaries to the target
|
||||
if [ $mode == 0 ]; then
|
||||
# copy default binaries
|
||||
echo -e "Copying the PX4 binaries from the eagle_default build tree..."
|
||||
adb push $workspace/build/atlflight_eagle_qurt/platforms/qurt/libpx4.so /usr/share/data/adsp
|
||||
adb push $workspace/build/atlflight_eagle_qurt/platforms/qurt/libpx4muorb_skel.so /usr/share/data/adsp
|
||||
adb push $workspace/build/atlflight_eagle_default/bin/px4 /home/linaro
|
||||
adb push $workspace/posix-configs/eagle/flight/px4.config /usr/share/data/adsp
|
||||
adb push $workspace/posix-configs/eagle/flight/mainapp.config /home/linaro
|
||||
fi
|
||||
|
||||
echo -e "Installation complete."
|
||||
}
|
||||
|
||||
|
||||
testpx4() {
|
||||
|
||||
if [ $test -eq 0 ]; then
|
||||
echo -e "SKIPPING test"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
echo -e "Starting PX4 test..."
|
||||
|
||||
# Remove previous instances of the file
|
||||
rm px4.log | true
|
||||
rm minidm.log | true
|
||||
|
||||
# Start mini-dm
|
||||
echo -e "Starting mini-dm..."
|
||||
${minidmPath}/mini-dm > minidm.log &
|
||||
sleep 5
|
||||
# Verify that mini-dm is running
|
||||
checkProc=$(ps -aef | grep mini-dm | grep -v grep)
|
||||
|
||||
if [ -z "${checkProc}" ]; then
|
||||
echo "[ERROR] Unable to start mini-dm from path: ${minidmPath}"
|
||||
exit $EXIT_ERROR
|
||||
fi
|
||||
|
||||
|
||||
# Start PX4
|
||||
echo -e "Starting PX4..."
|
||||
if [ $mode == 2 ]; then
|
||||
# 8x96 platform
|
||||
adb shell "/home/root/px4 /home/root/mainapp.config" > px4.log 2>&1 &
|
||||
else
|
||||
# 8x74 platform
|
||||
adb shell "/home/linaro/px4 /home/linaro/mainapp.config" > px4.log 2>&1 &
|
||||
fi
|
||||
sleep 20
|
||||
# Verify that PX4 is still running
|
||||
checkProc=$(adb shell "ps -aef | grep px4 | grep -v grep")
|
||||
if [ -z "${checkProc}" ]; then
|
||||
echo "[ERROR] PX4 is not running on target!"
|
||||
exit $EXIT_ERROR
|
||||
fi
|
||||
|
||||
# Stop the PX4 process on target
|
||||
adb shell "ps -eaf | grep px4 | grep -v grep | awk '{print $2}' | tr -s ' ' | cut -d' ' -f2 | xargs kill"
|
||||
sleep 5
|
||||
|
||||
# Stop the mini-dm
|
||||
killall mini-dm
|
||||
|
||||
echo -e "PX4 test complete."
|
||||
|
||||
# Verify the results
|
||||
verifypx4test
|
||||
|
||||
echo -e "For more information, see px4.log and minidm.log."
|
||||
}
|
||||
|
||||
|
||||
usage() {
|
||||
echo -e "\nThis script can copy PX4 binaries to the Snapdragon Flight target and do a quick on-target sanity test.\n"
|
||||
echo -e "Pre-requisites:"
|
||||
echo -e "- Snapdragon Flight board must be connected to host computer via USB"
|
||||
echo -e "- Snapdragon Flight board must have the latest platform BSP and flight controller addon installed"
|
||||
echo -e "- mini-dm must be installed on host computer (see https://github.com/ATLFlight/ATLFlightDocs/blob/master/UserGuide.md#adsp)"
|
||||
echo -e "- PX4 software was built and binaries are in their usual locations in the tree\n"
|
||||
echo -e "USAGE:\n ${0} [-m mode] [-i] [-t] [-l <minidm-path>]"
|
||||
echo -e " -m --> Build mode (0 = default mode, 1 = legacy mode)"
|
||||
echo -e " -i --> Install the PX4 binaries"
|
||||
echo -e " -t --> Test PX4 on target"
|
||||
echo -e " -l --> location of the mini-dm executable (Default: ${minidmPath})"
|
||||
echo -e " -h --> Display this help information"
|
||||
}
|
||||
|
||||
# Parse the command line options
|
||||
while getopts "m:l:ith" opt;
|
||||
do
|
||||
case $opt in
|
||||
m)
|
||||
if [ $OPTARG -gt $MODE_MAX ]; then
|
||||
echo "Invalid mode: $OPTARG (max allowed is $MODE_MAX)"
|
||||
exit $EXIT_ERROR
|
||||
fi
|
||||
mode=$OPTARG
|
||||
echo "Will run the script in mode $mode."
|
||||
;;
|
||||
i)
|
||||
install=1
|
||||
;;
|
||||
t)
|
||||
test=1
|
||||
;;
|
||||
l)
|
||||
minidmPath=$OPTARG
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
:)
|
||||
echo "Option -$OPTARG requires an argument" >&2
|
||||
exit 1;;
|
||||
?)
|
||||
echo "Unknown arg $opt"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Install the PX4 binaries
|
||||
installpx4
|
||||
|
||||
# Run the sanity test
|
||||
testpx4
|
||||
|
||||
exit $result
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
############################################################################
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
add_library(drivers_board
|
||||
board_config.h
|
||||
i2c.cpp
|
||||
init.c
|
||||
spi.cpp
|
||||
)
|
||||
@@ -1,53 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2017 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file board_config.h
|
||||
*
|
||||
* EAGLE internal definitions
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define BOARD_OVERRIDE_UUID "EAGLEID000000000" // must be of length 16
|
||||
#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_EAGLE
|
||||
|
||||
/*
|
||||
* I2C busses
|
||||
*/
|
||||
#define PX4_NUMBER_I2C_BUSES 3
|
||||
|
||||
// Battery ADC channels
|
||||
|
||||
#include <system_config.h>
|
||||
#include <px4_platform_common/board_common.h>
|
||||
@@ -1,40 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2020 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_arch/i2c_hw_description.h>
|
||||
|
||||
constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
|
||||
initI2CBusExternal(2),
|
||||
initI2CBusExternal(3),
|
||||
initI2CBusExternal(9),
|
||||
};
|
||||
@@ -1,41 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2020 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_arch/spi_hw_description.h>
|
||||
#include <drivers/drv_sensor.h>
|
||||
|
||||
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
|
||||
initSPIBus(1, {
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_MPU9250),
|
||||
}),
|
||||
};
|
||||
@@ -1,126 +0,0 @@
|
||||
|
||||
# Excelsior is the code name of a board currently in development.
|
||||
|
||||
include(px4_git)
|
||||
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
"${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon"
|
||||
"${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon/toolchain"
|
||||
)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
|
||||
else()
|
||||
set(QC_SOC_TARGET "APQ8074")
|
||||
endif()
|
||||
|
||||
# Disable the creation of the parameters.xml file by scanning individual
|
||||
# source files, and scan all source files. This will create a parameters.xml
|
||||
# file that contains all possible parameters, even if the associated module
|
||||
# is not used. This is necessary for parameter synchronization between the
|
||||
# ARM and DSP processors.
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
set(CONFIG_SHMEM "1")
|
||||
add_definitions(-DORB_COMMUNICATOR)
|
||||
|
||||
# atlflight toolchain doesn't properly set the compiler, so these aren't set automatically
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:C>:-std=gnu99>)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=gnu++11>)
|
||||
|
||||
add_definitions(
|
||||
-D__PX4_POSIX_EXCELSIOR
|
||||
-D__PX4_LINUX
|
||||
)
|
||||
|
||||
px4_add_board(
|
||||
PLATFORM posix
|
||||
VENDOR atlflight
|
||||
MODEL excelsior
|
||||
LABEL default
|
||||
TOOLCHAIN arm-oemllib32-linux-gnueabi
|
||||
DRIVERS
|
||||
#barometer # all available barometer drivers
|
||||
batt_smbus
|
||||
camera_trigger
|
||||
differential_pressure # all available differential pressure drivers
|
||||
distance_sensor # all available distance sensor drivers
|
||||
gps
|
||||
#imu # all available imu drivers
|
||||
#lights/rgbled
|
||||
#magnetometer # all available magnetometer drivers
|
||||
pwm_out_sim
|
||||
qshell/posix
|
||||
rc_input
|
||||
smart_battery/batmon
|
||||
#telemetry # all available telemetry drivers
|
||||
MODULES
|
||||
airspeed_selector
|
||||
attitude_estimator_q
|
||||
camera_feedback
|
||||
commander
|
||||
dataman
|
||||
ekf2
|
||||
events
|
||||
flight_mode_manager
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
gyro_calibration
|
||||
gyro_fft
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
#load_mon
|
||||
local_position_estimator
|
||||
logger
|
||||
mavlink
|
||||
mc_att_control
|
||||
mc_hover_thrust_estimator
|
||||
mc_pos_control
|
||||
mc_rate_control
|
||||
#micrortps_bridge
|
||||
muorb/krait
|
||||
muorb/test
|
||||
navigator
|
||||
rc_update
|
||||
rover_pos_control
|
||||
sensors
|
||||
#sih
|
||||
simulator
|
||||
vmount
|
||||
vtol_att_control
|
||||
SYSTEMCMDS
|
||||
#bl_update
|
||||
#dumpfile
|
||||
esc_calib
|
||||
#hardfault_log
|
||||
led_control
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
#mtd
|
||||
#nshterm
|
||||
param
|
||||
perf
|
||||
pwm
|
||||
sd_bench
|
||||
shutdown
|
||||
system_time
|
||||
#top
|
||||
topic_listener
|
||||
tune_control
|
||||
uorb
|
||||
ver
|
||||
work_queue
|
||||
EXAMPLES
|
||||
#fake_gps
|
||||
#fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
|
||||
#hello
|
||||
#hwtest # Hardware test
|
||||
#matlab_csv_serial
|
||||
#px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
|
||||
#px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
|
||||
#rover_steering_control # Rover example app
|
||||
#uuv_example_app
|
||||
#work_item
|
||||
)
|
||||
@@ -1,88 +0,0 @@
|
||||
|
||||
# Excelsior is the code name of a board currently in development.
|
||||
#
|
||||
# This cmake config builds for QURT which is the operating system running on
|
||||
# the DSP side.
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
|
||||
else()
|
||||
set(QC_SOC_TARGET "APQ8074")
|
||||
endif()
|
||||
|
||||
include(px4_git)
|
||||
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
|
||||
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")
|
||||
|
||||
if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
|
||||
message(FATAL_ERROR "Enviroment variable HEXAGON_SDK_ROOT must be set")
|
||||
else()
|
||||
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
|
||||
endif()
|
||||
|
||||
include(toolchain/Toolchain-qurt)
|
||||
include(qurt_flags)
|
||||
include_directories(${HEXAGON_SDK_INCLUDES})
|
||||
|
||||
set(CONFIG_SHMEM "1")
|
||||
add_definitions(-DORB_COMMUNICATOR)
|
||||
|
||||
# Disable the creation of the parameters.xml file by scanning individual
|
||||
# source files, and scan all source files. This will create a parameters.xml
|
||||
# file that contains all possible parameters, even if the associated module
|
||||
# is not used. This is necessary for parameter synchronization between the
|
||||
# ARM and DSP processors.
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# This definition allows to differentiate the specific board.
|
||||
add_definitions(-D__PX4_QURT_EXCELSIOR)
|
||||
|
||||
px4_add_board(
|
||||
PLATFORM qurt
|
||||
VENDOR atlflight
|
||||
MODEL excelsior
|
||||
LABEL qurt
|
||||
DRIVERS
|
||||
barometer/bmp280
|
||||
gps
|
||||
imu/invensense/mpu9250
|
||||
magnetometer/hmc5883
|
||||
qshell/qurt
|
||||
snapdragon_spektrum_rc
|
||||
MODULES
|
||||
airspeed_selector
|
||||
attitude_estimator_q
|
||||
commander
|
||||
ekf2
|
||||
flight_mode_manager
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
gyro_calibration
|
||||
gyro_fft
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
local_position_estimator
|
||||
mc_att_control
|
||||
mc_hover_thrust_estimator
|
||||
mc_pos_control
|
||||
mc_rate_control
|
||||
muorb/adsp
|
||||
rc_update
|
||||
rover_pos_control
|
||||
sensors
|
||||
temperature_compensation
|
||||
vmount
|
||||
vtol_att_control
|
||||
SYSTEMCMDS
|
||||
led_control
|
||||
mixer
|
||||
#motor_ramp
|
||||
motor_test
|
||||
param
|
||||
perf
|
||||
#pwm
|
||||
#topic_listener
|
||||
ver
|
||||
work_queue
|
||||
)
|
||||
@@ -1,51 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2017 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file board_config.h
|
||||
*
|
||||
* EXCELSIOR internal definitions
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define BOARD_OVERRIDE_UUID "EAGLEID000000000" // must be of length 16
|
||||
#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_EAGLE
|
||||
|
||||
/*
|
||||
* I2C busses
|
||||
*/
|
||||
#define PX4_NUMBER_I2C_BUSES 3
|
||||
|
||||
#include <system_config.h>
|
||||
#include <px4_platform_common/board_common.h>
|
||||
@@ -1,40 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2020 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_arch/i2c_hw_description.h>
|
||||
|
||||
constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
|
||||
initI2CBusExternal(2),
|
||||
initI2CBusExternal(3),
|
||||
initI2CBusExternal(9),
|
||||
};
|
||||
@@ -1,41 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2020 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_arch/spi_hw_description.h>
|
||||
#include <drivers/drv_sensor.h>
|
||||
|
||||
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
|
||||
initSPIBus(1, {
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_MPU9250),
|
||||
}),
|
||||
};
|
||||
@@ -244,22 +244,6 @@ RingBuffer::force(double val)
|
||||
return force(&val, sizeof(val));
|
||||
}
|
||||
|
||||
// FIXME - clang crashes on this get() call
|
||||
#ifdef __PX4_QURT
|
||||
#define __PX4_SBCAP my_sync_bool_compare_and_swap
|
||||
static inline bool my_sync_bool_compare_and_swap(volatile unsigned *a, unsigned b, unsigned c)
|
||||
{
|
||||
if (*a == b) {
|
||||
*a = c;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#else
|
||||
#define __PX4_SBCAP __sync_bool_compare_and_swap
|
||||
#endif
|
||||
bool
|
||||
RingBuffer::get(void *val, size_t val_size)
|
||||
{
|
||||
@@ -284,7 +268,7 @@ RingBuffer::get(void *val, size_t val_size)
|
||||
}
|
||||
|
||||
/* if the tail pointer didn't change, we got our item */
|
||||
} while (!__PX4_SBCAP(&_tail, candidate, next));
|
||||
} while (!__sync_bool_compare_and_swap(&_tail, candidate, next));
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
|
||||
/* HEATER */
|
||||
#define GPIO_HEATER_OUTPUT /* PA8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* PWM */
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 14
|
||||
|
||||
@@ -31,7 +31,7 @@ px4_add_board(
|
||||
gps
|
||||
heater
|
||||
#imu # all available imu drivers
|
||||
imu/analog_devices/adis16448
|
||||
#imu/analog_devices/adis16448
|
||||
imu/bosch/bmi088
|
||||
imu/invensense/icm20649
|
||||
imu/invensense/icm20689
|
||||
@@ -102,6 +102,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
|
||||
/* HEATER */
|
||||
#define GPIO_HEATER_OUTPUT /* PA8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* PWM */
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 14
|
||||
@@ -117,8 +118,8 @@
|
||||
#define GPIO_nPOWER_IN_CAN /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2)
|
||||
#define GPIO_nPOWER_IN_C /* PG0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN0)
|
||||
|
||||
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_CAN /* Brick 1 is Chosen */
|
||||
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_ADC /* Brick 2 is Chosen */
|
||||
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_ADC /* Brick 1 is Chosen */
|
||||
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_CAN /* Brick 2 is Chosen */
|
||||
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB is Chosen */
|
||||
|
||||
#define GPIO_VDD_5V_HIPOWER_EN /* PD11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN11)
|
||||
|
||||
@@ -103,6 +103,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -100,6 +100,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -98,6 +98,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -174,6 +174,7 @@
|
||||
* PWM in future
|
||||
*/
|
||||
#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* PWM Capture
|
||||
*
|
||||
|
||||
@@ -98,6 +98,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -209,6 +209,7 @@
|
||||
* PWM in future
|
||||
*/
|
||||
#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* PWM Capture
|
||||
*
|
||||
|
||||
@@ -102,6 +102,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -95,6 +95,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -100,6 +100,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -80,6 +80,7 @@ CONFIG_KINETIS_I2C0=y
|
||||
CONFIG_KINETIS_I2C1=y
|
||||
CONFIG_KINETIS_LPTMR0=y
|
||||
CONFIG_KINETIS_LPUART0=y
|
||||
CONFIG_KINETIS_LPUART0_RXDMA=y
|
||||
CONFIG_KINETIS_MERGE_TTY=y
|
||||
CONFIG_KINETIS_PDB=y
|
||||
CONFIG_KINETIS_PIT=y
|
||||
|
||||
@@ -81,6 +81,7 @@ CONFIG_KINETIS_I2C0=y
|
||||
CONFIG_KINETIS_I2C1=y
|
||||
CONFIG_KINETIS_LPTMR0=y
|
||||
CONFIG_KINETIS_LPUART0=y
|
||||
CONFIG_KINETIS_LPUART0_RXDMA=y
|
||||
CONFIG_KINETIS_MERGE_TTY=y
|
||||
CONFIG_KINETIS_PDB=y
|
||||
CONFIG_KINETIS_PIT=y
|
||||
|
||||
@@ -64,8 +64,7 @@
|
||||
|
||||
#include <kinetis.h>
|
||||
#include <kinetis_uart.h>
|
||||
#include <hardware/kinetis_uart.h>
|
||||
#include <hardware/kinetis_sim.h>
|
||||
#include <kinetis_lpuart.h>
|
||||
#include "board_config.h"
|
||||
|
||||
#include "arm_arch.h"
|
||||
@@ -189,6 +188,26 @@ kinetis_boardinitialize(void)
|
||||
|
||||
VDD_3V3_SPEKTRUM_POWER_EN(true);
|
||||
}
|
||||
/****************************************************************************
|
||||
* Name: kinetis_serial_dma_poll_all
|
||||
*
|
||||
* Description:
|
||||
* Checks receive DMA buffers for received bytes that have not accumulated
|
||||
* to the point where the DMA half/full interrupt has triggered.
|
||||
*
|
||||
* This function should be called from a timer or other periodic context.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void kinetis_lpserial_dma_poll_all(void)
|
||||
{
|
||||
#if defined(LPSERIAL_HAVE_DMA)
|
||||
kinetis_lpserial_dma_poll();
|
||||
#endif
|
||||
#if defined(SERIAL_HAVE_DMA)
|
||||
kinetis_serial_dma_poll();
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_app_initialize
|
||||
@@ -235,6 +254,25 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
||||
}
|
||||
|
||||
/* set up the serial DMA polling */
|
||||
#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA)
|
||||
static struct hrt_call serial_dma_call;
|
||||
struct timespec ts;
|
||||
|
||||
/*
|
||||
* Poll at 1ms intervals for received bytes that have not triggered
|
||||
* a DMA event.
|
||||
*/
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 1000000;
|
||||
|
||||
hrt_call_every(&serial_dma_call,
|
||||
ts_to_abstime(&ts),
|
||||
ts_to_abstime(&ts),
|
||||
(hrt_callout)kinetis_lpserial_dma_poll_all,
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
/* initial LED state */
|
||||
drv_led_start();
|
||||
led_off(LED_RED);
|
||||
|
||||
@@ -81,6 +81,7 @@ CONFIG_KINETIS_I2C0=y
|
||||
CONFIG_KINETIS_I2C1=y
|
||||
CONFIG_KINETIS_LPTMR0=y
|
||||
CONFIG_KINETIS_LPUART0=y
|
||||
CONFIG_KINETIS_LPUART0_RXDMA=y
|
||||
CONFIG_KINETIS_MERGE_TTY=y
|
||||
CONFIG_KINETIS_PDB=y
|
||||
CONFIG_KINETIS_PIT=y
|
||||
|
||||
@@ -82,6 +82,7 @@ CONFIG_KINETIS_I2C0=y
|
||||
CONFIG_KINETIS_I2C1=y
|
||||
CONFIG_KINETIS_LPTMR0=y
|
||||
CONFIG_KINETIS_LPUART0=y
|
||||
CONFIG_KINETIS_LPUART0_RXDMA=y
|
||||
CONFIG_KINETIS_MERGE_TTY=y
|
||||
CONFIG_KINETIS_PDB=y
|
||||
CONFIG_KINETIS_PIT=y
|
||||
|
||||
@@ -64,8 +64,7 @@
|
||||
|
||||
#include <kinetis.h>
|
||||
#include <kinetis_uart.h>
|
||||
#include <hardware/kinetis_uart.h>
|
||||
#include <hardware/kinetis_sim.h>
|
||||
#include <kinetis_lpuart.h>
|
||||
#include "board_config.h"
|
||||
|
||||
#include "arm_arch.h"
|
||||
@@ -189,6 +188,26 @@ kinetis_boardinitialize(void)
|
||||
|
||||
VDD_3V3_SPEKTRUM_POWER_EN(true);
|
||||
}
|
||||
/****************************************************************************
|
||||
* Name: kinetis_serial_dma_poll_all
|
||||
*
|
||||
* Description:
|
||||
* Checks receive DMA buffers for received bytes that have not accumulated
|
||||
* to the point where the DMA half/full interrupt has triggered.
|
||||
*
|
||||
* This function should be called from a timer or other periodic context.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void kinetis_lpserial_dma_poll_all(void)
|
||||
{
|
||||
#if defined(LPSERIAL_HAVE_DMA)
|
||||
kinetis_lpserial_dma_poll();
|
||||
#endif
|
||||
#if defined(SERIAL_HAVE_DMA)
|
||||
kinetis_serial_dma_poll();
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_app_initialize
|
||||
@@ -235,6 +254,25 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
||||
}
|
||||
|
||||
/* set up the serial DMA polling */
|
||||
#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA)
|
||||
static struct hrt_call serial_dma_call;
|
||||
struct timespec ts;
|
||||
|
||||
/*
|
||||
* Poll at 1ms intervals for received bytes that have not triggered
|
||||
* a DMA event.
|
||||
*/
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 1000000;
|
||||
|
||||
hrt_call_every(&serial_dma_call,
|
||||
ts_to_abstime(&ts),
|
||||
ts_to_abstime(&ts),
|
||||
(hrt_callout)kinetis_lpserial_dma_poll_all,
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
/* initial LED state */
|
||||
drv_led_start();
|
||||
led_off(LED_RED);
|
||||
|
||||
@@ -94,6 +94,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -215,6 +215,7 @@
|
||||
*/
|
||||
#define HEATER_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_50OHM | IOMUX_SPEED_MEDIUM | IOMUX_SLEW_FAST)
|
||||
#define GPIO_HEATER_OUTPUT /* GPIO_B1_09 QTIMER2_TIMER3 GPIO2_IO25 */ (GPIO_QTIMER2_TIMER3_1 | HEATER_IOMUX)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* PWM Capture
|
||||
*
|
||||
|
||||
@@ -45,7 +45,7 @@ px4_add_board(
|
||||
#magnetometer # all available magnetometer drivers
|
||||
magnetometer/hmc5883
|
||||
#optical_flow # all available optical flow drivers
|
||||
optical_flow/px4flow
|
||||
#optical_flow/px4flow
|
||||
#osd
|
||||
#pca9685
|
||||
#protocol_splitter
|
||||
@@ -97,6 +97,7 @@ px4_add_board(
|
||||
#i2cdetect
|
||||
#led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
#motor_ramp
|
||||
#motor_test
|
||||
|
||||
@@ -101,6 +101,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
/* Heater pins */
|
||||
#define GPIO_HEATER_INPUT (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN6)
|
||||
#define GPIO_HEATER_OUTPUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN6)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* Power switch controls */
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -100,6 +100,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -69,7 +69,7 @@ px4_add_board(
|
||||
flight_mode_manager
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
gyro_calibration
|
||||
#gyro_calibration
|
||||
#gyro_fft
|
||||
land_detector
|
||||
#landing_target_estimator
|
||||
|
||||
@@ -42,13 +42,13 @@ px4_add_board(
|
||||
#lights/rgbled_pwm
|
||||
#magnetometer # all available magnetometer drivers
|
||||
magnetometer/isentek/ist8310
|
||||
optical_flow # all available optical flow drivers
|
||||
#optical_flow # all available optical flow drivers
|
||||
#osd
|
||||
#pca9685
|
||||
#pca9685_pwm_out
|
||||
#power_monitor/ina226
|
||||
#protocol_splitter
|
||||
pwm_input
|
||||
#pwm_input
|
||||
pwm_out_sim
|
||||
pwm_out
|
||||
px4io
|
||||
@@ -96,9 +96,9 @@ px4_add_board(
|
||||
#uuv_att_control
|
||||
#uuv_pos_control
|
||||
#vmount
|
||||
vtol_att_control
|
||||
#vtol_att_control
|
||||
SYSTEMCMDS
|
||||
#bl_update
|
||||
bl_update
|
||||
dmesg
|
||||
#dumpfile
|
||||
#esc_calib
|
||||
@@ -107,6 +107,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
#motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -209,6 +209,8 @@
|
||||
* PWM in future
|
||||
*/
|
||||
#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
|
||||
/* PWM Capture
|
||||
*
|
||||
|
||||
@@ -71,8 +71,8 @@ px4_add_board(
|
||||
flight_mode_manager
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
gyro_calibration
|
||||
gyro_fft
|
||||
#gyro_calibration
|
||||
#gyro_fft
|
||||
land_detector
|
||||
#landing_target_estimator
|
||||
load_mon
|
||||
|
||||
@@ -101,6 +101,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -202,6 +202,7 @@
|
||||
* PWM in future
|
||||
*/
|
||||
#define GPIO_HEATER_OUTPUT /* PB10 T2CH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* PWM Capture
|
||||
*
|
||||
|
||||
@@ -34,6 +34,7 @@ px4_add_board(
|
||||
imu/bosch/bmi088
|
||||
imu/invensense/icm20602
|
||||
imu/invensense/icm20948 # required for ak09916 mag
|
||||
imu/invensense/icm20649
|
||||
imu/invensense/icm42688p
|
||||
irlock
|
||||
lights # all available light drivers
|
||||
@@ -41,7 +42,7 @@ px4_add_board(
|
||||
optical_flow # all available optical flow drivers
|
||||
osd
|
||||
pca9685
|
||||
pca9685_pwm_out
|
||||
#pca9685_pwm_out
|
||||
power_monitor/ina226
|
||||
#protocol_splitter
|
||||
pwm_input
|
||||
@@ -49,9 +50,10 @@ px4_add_board(
|
||||
pwm_out
|
||||
px4io
|
||||
rc_input
|
||||
roboclaw
|
||||
rpm
|
||||
#roboclaw
|
||||
#rpm
|
||||
safety_button
|
||||
#smart_battery/batmon
|
||||
telemetry # all available telemetry drivers
|
||||
test_ppm
|
||||
tone_alarm
|
||||
@@ -73,7 +75,7 @@ px4_add_board(
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
load_mon
|
||||
local_position_estimator
|
||||
#local_position_estimator
|
||||
logger
|
||||
mavlink
|
||||
mc_att_control
|
||||
@@ -101,6 +103,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -189,6 +189,7 @@
|
||||
* PWM in future
|
||||
*/
|
||||
#define GPIO_HEATER_OUTPUT /* PA2 T2CH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN2)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* PWM Capture
|
||||
*
|
||||
|
||||
@@ -99,6 +99,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
|
||||
@@ -227,6 +227,7 @@
|
||||
* PWM in future
|
||||
*/
|
||||
#define GPIO_HEATER_OUTPUT /* PB10 T2CH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* PWM Capture
|
||||
*
|
||||
|
||||
@@ -73,7 +73,7 @@ px4_add_board(
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
load_mon
|
||||
local_position_estimator
|
||||
#local_position_estimator
|
||||
logger
|
||||
mavlink
|
||||
mc_att_control
|
||||
@@ -100,6 +100,7 @@ px4_add_board(
|
||||
i2cdetect
|
||||
led_control
|
||||
mft
|
||||
microbench
|
||||
mixer
|
||||
motor_test
|
||||
mtd
|
||||
|
||||
@@ -145,6 +145,7 @@
|
||||
/* Heater pins (reserved) */
|
||||
#define GPIO_HEATER_INPUT (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN6)
|
||||
#define GPIO_HEATER_OUTPUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN6)
|
||||
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
|
||||
|
||||
/* Power switch controls */
|
||||
|
||||
|
||||
@@ -179,9 +179,7 @@ function(px4_add_module)
|
||||
endif()
|
||||
set_target_properties(${MODULE} PROPERTIES STACK_MAX ${STACK_MAX})
|
||||
|
||||
if(${PX4_PLATFORM} STREQUAL "qurt")
|
||||
set_property(TARGET ${MODULE} PROPERTY POSITION_INDEPENDENT_CODE TRUE)
|
||||
elseif(${PX4_PLATFORM} STREQUAL "nuttx")
|
||||
if(${PX4_PLATFORM} STREQUAL "nuttx")
|
||||
target_compile_options(${MODULE} PRIVATE -Wframe-larger-than=${STACK_MAX})
|
||||
endif()
|
||||
|
||||
|
||||
Submodule mavlink/include/mavlink/v2.0 updated: 636fae5ca3...94963ac650
@@ -44,6 +44,7 @@ set(msg_files
|
||||
airspeed.msg
|
||||
airspeed_validated.msg
|
||||
airspeed_wind.msg
|
||||
baro_bias_estimate.msg
|
||||
battery_status.msg
|
||||
camera_capture.msg
|
||||
camera_trigger.msg
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint64 timestamp_sample # the timestamp of the raw data (microseconds)
|
||||
|
||||
uint32 baro_device_id # unique device ID for the sensor that does not change between power cycles
|
||||
float32 bias # estimated barometric altitude bias (m)
|
||||
float32 bias_var # estimated barometric altitude bias variance (m^2)
|
||||
|
||||
float32 innov # innovation of the last measurement fusion (m)
|
||||
float32 innov_var # innovation variance of the last measurement fusion (m^2)
|
||||
float32 innov_test_ratio # normalized innovation squared test ratio
|
||||
@@ -331,16 +331,16 @@ int UART_node::init()
|
||||
}
|
||||
|
||||
// Set up the UART for non-canonical binary communication: 8 bits, 1 stop bit, no parity.
|
||||
uart_config.c_iflag &= !(INPCK | ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);
|
||||
uart_config.c_iflag &= ~(INPCK | ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);
|
||||
uart_config.c_iflag |= IGNBRK | IGNPAR;
|
||||
|
||||
uart_config.c_oflag &= !(OPOST | ONLCR | OCRNL | ONOCR | ONLRET | OFILL | NLDLY | VTDLY);
|
||||
uart_config.c_oflag &= ~(OPOST | ONLCR | OCRNL | ONOCR | ONLRET | OFILL | NLDLY | VTDLY);
|
||||
uart_config.c_oflag |= NL0 | VT0;
|
||||
|
||||
uart_config.c_cflag &= !(CSIZE | CSTOPB | PARENB);
|
||||
uart_config.c_cflag &= ~(CSIZE | CSTOPB | PARENB);
|
||||
uart_config.c_cflag |= CS8 | CREAD | CLOCAL;
|
||||
|
||||
uart_config.c_lflag &= !(ISIG | ICANON | ECHO | TOSTOP | IEXTEN);
|
||||
uart_config.c_lflag &= ~(ISIG | ICANON | ECHO | TOSTOP | IEXTEN);
|
||||
|
||||
// Flow control
|
||||
if (hw_flow_control) {
|
||||
|
||||
@@ -343,6 +343,8 @@ rtps:
|
||||
id: 159
|
||||
- msg: event
|
||||
id: 160
|
||||
- msg: baro_bias_estimate
|
||||
id: 161
|
||||
########## multi topics: begin ##########
|
||||
- msg: actuator_controls_0
|
||||
id: 180
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
set(SRCS)
|
||||
|
||||
if (NOT "${PX4_PLATFORM}" MATCHES "qurt" AND NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")
|
||||
if(NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")
|
||||
list(APPEND SRCS
|
||||
px4_log.cpp
|
||||
)
|
||||
|
||||
@@ -84,10 +84,6 @@ public:
|
||||
*/
|
||||
inline T load() const
|
||||
{
|
||||
#ifdef __PX4_QURT
|
||||
return _value;
|
||||
#else
|
||||
|
||||
#if defined(__PX4_NUTTX)
|
||||
|
||||
if (!__atomic_always_lock_free(sizeof(T), 0)) {
|
||||
@@ -101,8 +97,6 @@ public:
|
||||
{
|
||||
return __atomic_load_n(&_value, __ATOMIC_SEQ_CST);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,10 +104,6 @@ public:
|
||||
*/
|
||||
inline void store(T value)
|
||||
{
|
||||
#ifdef __PX4_QURT
|
||||
_value = value;
|
||||
#else
|
||||
|
||||
#if defined(__PX4_NUTTX)
|
||||
|
||||
if (!__atomic_always_lock_free(sizeof(T), 0)) {
|
||||
@@ -126,8 +116,6 @@ public:
|
||||
{
|
||||
__atomic_store(&_value, &value, __ATOMIC_SEQ_CST);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,11 +124,6 @@ public:
|
||||
*/
|
||||
inline T fetch_add(T num)
|
||||
{
|
||||
#ifdef __PX4_QURT
|
||||
// TODO: fix
|
||||
return _value++;
|
||||
#else
|
||||
|
||||
#if defined(__PX4_NUTTX)
|
||||
|
||||
if (!__atomic_always_lock_free(sizeof(T), 0)) {
|
||||
@@ -154,8 +137,6 @@ public:
|
||||
{
|
||||
return __atomic_fetch_add(&_value, num, __ATOMIC_SEQ_CST);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,13 +282,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
#ifdef __PX4_QURT
|
||||
// It seems that __atomic_store and __atomic_load are not supported on Qurt,
|
||||
// so the best that we can do is to use volatile.
|
||||
volatile T _value{};
|
||||
#else
|
||||
T _value {};
|
||||
#endif
|
||||
};
|
||||
|
||||
using atomic_int = atomic<int>;
|
||||
|
||||
@@ -89,33 +89,14 @@ constexpr bool PX4_ISFINITE(double x) { return __builtin_isfinite(x); }
|
||||
#define USEC_PER_TICK (1000000/PX4_TICKS_PER_SEC)
|
||||
#define USEC2TICK(x) (((x)+(USEC_PER_TICK/2))/USEC_PER_TICK)
|
||||
|
||||
#ifdef __PX4_QURT
|
||||
|
||||
// QURT specific
|
||||
# include "dspal_math.h"
|
||||
# define PX4_ROOTFSDIR "."
|
||||
# define PX4_TICKS_PER_SEC 1000L
|
||||
|
||||
#else // __PX4_QURT
|
||||
|
||||
// All POSIX except QURT.
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern long PX4_TICKS_PER_SEC;
|
||||
__END_DECLS
|
||||
|
||||
# if defined(__PX4_POSIX_EAGLE) || defined(__PX4_POSIX_EXCELSIOR)
|
||||
# define PX4_ROOTFSDIR "/home/linaro"
|
||||
# else
|
||||
# define PX4_ROOTFSDIR "."
|
||||
# endif
|
||||
|
||||
#endif // __PX4_QURT
|
||||
#define PX4_ROOTFSDIR "."
|
||||
|
||||
#define PX4_STORAGEDIR PX4_ROOTFSDIR
|
||||
#endif // __PX4_POSIX
|
||||
|
||||
#if defined(__PX4_POSIX)
|
||||
/****************************************************************************
|
||||
* Defines for POSIX and ROS
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2015 Ramakrishna Kintada. 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <parameters/param.h>
|
||||
|
||||
#define MAX_SHMEM_PARAMS 2000 //MAP_SIZE - (LOCK_SIZE - sizeof(struct shmem_info))
|
||||
|
||||
#define PARAM_BUFFER_SIZE (MAX_SHMEM_PARAMS / 8 + 1)
|
||||
|
||||
struct shmem_info {
|
||||
union param_value_u params_val[MAX_SHMEM_PARAMS];
|
||||
unsigned char krait_changed_index[MAX_SHMEM_PARAMS / 8 + 1]; /*bit map of all params changed by krait*/
|
||||
unsigned char adsp_changed_index[MAX_SHMEM_PARAMS / 8 + 1]; /*bit map of all params changed by adsp*/
|
||||
|
||||
#ifdef __PX4_NUTTX
|
||||
};
|
||||
#else
|
||||
} __attribute__((packed));
|
||||
#endif
|
||||
|
||||
#if (defined(__PX4_POSIX_EXCELSIOR) || defined(__PX4_QURT_EXCELSIOR))
|
||||
#define MAP_ADDRESS 0x861FC000
|
||||
#else
|
||||
#define MAP_ADDRESS 0xfbfc000
|
||||
#endif
|
||||
#define MAP_SIZE 16384
|
||||
#define MAP_MASK (MAP_SIZE - 1)
|
||||
|
||||
#define LOCK_OFFSET 0
|
||||
#define LOCK_SIZE 4
|
||||
#define LOCK_MEM 1
|
||||
#define UNLOCK_MEM 2
|
||||
|
||||
#define TYPE_MASK 0x1
|
||||
|
||||
extern bool handle_in_range(param_t);
|
||||
|
||||
#ifdef __PX4_QURT
|
||||
extern struct shmem_info *shmem_info_p;
|
||||
|
||||
int get_shmem_lock(const char *caller_file_name, int caller_line_number);
|
||||
void release_shmem_lock(const char *caller_file_name, int caller_line_number);
|
||||
void init_shared_memory(void);
|
||||
|
||||
void copy_params_to_shmem(const param_info_s *param_info_base);
|
||||
#endif
|
||||
|
||||
void update_to_shmem(param_t param, union param_value_u value);
|
||||
int update_from_shmem(param_t param, union param_value_u *value);
|
||||
void update_index_from_shmem(void);
|
||||
@@ -45,10 +45,6 @@
|
||||
#include <queue.h>
|
||||
#include <px4_platform_types.h>
|
||||
|
||||
#ifdef __PX4_QURT
|
||||
#include <dspal_types.h>
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define HPWORK 0
|
||||
|
||||
@@ -49,7 +49,7 @@ WorkQueue::WorkQueue(const wq_config_t &config) :
|
||||
// set the threads name
|
||||
#ifdef __PX4_DARWIN
|
||||
pthread_setname_np(_config.name);
|
||||
#elif !defined(__PX4_QURT)
|
||||
#else
|
||||
pthread_setname_np(pthread_self(), _config.name);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -156,9 +156,9 @@ if((DEFINED ENV{SIGNING_TOOL}) AND (NOT NUTTX_DIR MATCHES "external"))
|
||||
COMMAND $ENV{SIGNING_TOOL} $ENV{SIGNING_ARGS} ${PX4_BINARY_OUTPUT} ${PX4_BINARY_DIR}/${PX4_BOARD}.bin
|
||||
DEPENDS ${PX4_BINARY_OUTPUT}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
)
|
||||
else()
|
||||
set(PX4_BINARY_OUTPUT ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin)
|
||||
set(PX4_BINARY_OUTPUT ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin)
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${PX4_BINARY_OUTPUT}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -o xtrace
|
||||
|
||||
@JLinkGDBServerExe_PATH@ -device @DEBUG_DEVICE@ -select usb -endian little -if SWD -speed auto -ir -LocalhostOnly 1 -strict -vd -singlerun &
|
||||
|
||||
cd @PX4_BINARY_DIR@ && @CMAKE_GDB@ -silent -nh \
|
||||
@@ -12,3 +10,6 @@ cd @PX4_BINARY_DIR@ && @CMAKE_GDB@ -silent -nh \
|
||||
-ex "monitor reset 0" \
|
||||
-ex "continue" \
|
||||
@PX4_CONFIG@.elf
|
||||
|
||||
# exit with status of last command
|
||||
exit $?
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -o xtrace
|
||||
|
||||
killall JLinkGDBServerCLExe
|
||||
|
||||
JLinkGDBServerCLExe -silent -device @DEBUG_DEVICE@ -select usb -if SWD -speed auto -LocalhostOnly 1 -strict -vd -singlerun &
|
||||
@JLinkGDBServerCLExe_PATH@ -silent -device @DEBUG_DEVICE@ -select usb -if SWD -speed auto -LocalhostOnly 1 -strict -vd -singlerun -timeout 3000 -powertarget 0 -nogui &
|
||||
sleep 2
|
||||
|
||||
pgrep -i JLinkGDBServer
|
||||
|
||||
# exit with status of last command
|
||||
exit $?
|
||||
|
||||
@@ -1,14 +1,42 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -o xtrace
|
||||
if command -v gdb-multiarch &> /dev/null
|
||||
then
|
||||
GDB_CMD=$(command -v gdb-multiarch)
|
||||
|
||||
gdb-multiarch -silent -nx -batch \
|
||||
-ex "target remote localhost:2331" \
|
||||
-ex "monitor reset 0" \
|
||||
-ex "load" \
|
||||
-ex "monitor reset 0" \
|
||||
-ex "monitor go" \
|
||||
-ex "monitor sleep 3000" \
|
||||
-ex "disconnect" \
|
||||
-ex "quit" \
|
||||
${1}
|
||||
elif command -v arm-none-eabi-gdb &> /dev/null
|
||||
then
|
||||
GDB_CMD=$(command -v arm-none-eabi-gdb)
|
||||
|
||||
else
|
||||
echo "gdb arm-none-eabi or multi-arch not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
file ${1}
|
||||
|
||||
gdb_cmd_file=$(mktemp)
|
||||
|
||||
cat >"${gdb_cmd_file}" <<EOL
|
||||
target remote localhost:2331
|
||||
monitor reset 0
|
||||
load
|
||||
monitor reset 0
|
||||
monitor go
|
||||
EOL
|
||||
|
||||
for i in 1 2 3;
|
||||
do
|
||||
${GDB_CMD} -silent --nh --nx --nw -batch -x ${gdb_cmd_file} ${1}
|
||||
gdb_ret=$?
|
||||
|
||||
if [ $gdb_ret -ne 0 ]; then
|
||||
echo "GDB error, retrying"
|
||||
killall JLinkGDBServerCLExe
|
||||
sleep 5
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
exit 1
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user