Compare commits

..

30 Commits

Author SHA1 Message Date
Daniel Agar ba0b512f0d boards: Holybro H7 boards clear MPU early in board init
- needed if the bootloader configures the memory protection unit (MPU)
2021-08-31 18:01:06 -04:00
Daniel Agar 7476a2953e boards: CUAV H7 boards clear MPU early in board init
- needed if the bootloader configures the memory protection unit (MPU)
2021-08-31 17:59:34 -04:00
Lorenz Meier 15e6ca9e1e MRO: Set up MPU after boot to app
This is needed in case the bootloader configured the MPU, which could interfere with the app as the bootloader memory map / configuration is different.
2021-08-31 17:57:23 -04:00
Daniel Agar b9e7063237 boards: cube orange fully clear any existing MPU configuration as soon as possible 2021-08-31 17:56:23 -04:00
Daniel Agar 0a6045367f px4io_serial: ensure TX DMA is stopped if exiting early on stream error
- otherwise the next retry can happen quickly enough that dma setup
hangs waiting for the stream
2021-08-31 17:56:00 -04:00
Daniel Agar 3f88a6d0bf boards: cubeorange/cubeyellow use amber LED for armed state 2021-08-29 21:31:21 -04:00
Jukka Laitinen d1c09ec358 Fix memory corruption when work queue is being deleted
When the last WorkItem is deleted, it is removed from a work queue and the
queue is being stopped. But, the queue itself might get deleted in the middle,
in a higher priority thread than where the WorkItem deletion was performed from

If the WorkQueue::Detach accesses the member variables after this, there is memory
corruption

This happens in particular when launching i2c or spi devices in
I2CSPIDriverBase::module_start:

- The "initializer" is deleted when the instance is not found and the iterator
  while loop continues.
- The workqueue is deleted in the middle of "initializer" deletion when the
  WorkQueueRunner returns.

This prevents deletion of the WorkQueue before the Detach has been finished,
in the specific case that the ::Detach triggers the deletion

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-08-29 21:31:12 -04:00
Daniel Agar ca744626cd boards: io-v2 increase idle thread stack 280 -> 316 bytes 2021-08-26 23:57:10 -04:00
Daniel Agar ea577f15b9 px4iofirmware: never directly touch mixer from isr 2021-08-26 23:57:10 -04:00
Daniel Agar d9f3c820ab sensors: always start baro/GPS/mag aggregators if SYS_HAS_* set
- add new SYS_HAS_GPS parameter
2021-08-23 14:14:27 -04:00
David Sidrane 8e57a62c9d rgbled_ncp5623c:Add comand line mapping of PWM to color 2021-08-21 11:52:15 -04:00
David Sidrane b961f6a1e1 rgbled_ncp5623c:Needs 2 retries 2021-08-21 11:52:15 -04:00
David Sidrane 09140c01bf rgbled_ncp5623c:Can change address, return actual 2021-08-21 11:52:15 -04:00
David Sidrane 822ae46235 rgbled_ncp5623c:Document support for ncp5623[c|b] parts 2021-08-21 11:52:15 -04:00
David Sidrane f70381dfdd i2c_spi_buses:Support devices that may change address 2021-08-21 11:52:15 -04:00
David Sidrane 84066f574d vcm1193l:Bug Fix set default address 2021-08-21 11:52:15 -04:00
David Sidrane c8426da50d px4_fmu-v5x:Newer HW Start BARRO on bus 2 2021-08-21 11:52:15 -04:00
David Sidrane 6bab917a3d px4_fmu-v6x:Use HB 10pin GPS rotation 2021-08-21 11:52:15 -04:00
David Sidrane 531301e176 px4_fmu-v5x:Use HB 10pin GPS rotation 2021-08-21 11:52:15 -04:00
David Sidrane 04f4157828 rcS:Scope netman to all 5X and 6X 2021-08-21 11:52:15 -04:00
Daniel Agar c5f82ed838 ekf2: fix sensor_combined last_generation 2021-08-12 10:03:25 -04:00
Daniel Agar 99501b4c38 flight_mode_manager: ManualAcceleration support weathervane yaw handler
- fixes https://github.com/PX4/PX4-Autopilot/issues/17911
2021-08-12 10:02:13 -04:00
Daniel Agar 9e4a04f58a mavlink: receiver fix HIL_STATE_QUATERNION map projection init
- fixes https://github.com/PX4/PX4-Autopilot/issues/17977
2021-08-02 09:59:41 -04:00
Daniel Agar 1682fd5671 boards: px4_fmu-v2 disable load_mon module to save flash 2021-08-01 13:51:11 -04:00
bresch a8572f0fdd ECL: update to include latest bugfixes
- fix yaw spin on ground after large mag field change
- change covariance prediction for better stability
- fix yaw alignment in air for mag-less mode
- improve tilt alignment for non-static applications
- add momentum drag model
2021-08-01 12:54:15 -04:00
Daniel Agar a299a3bbd0 sensors: populate sensors_status_imu healthy flags even in multi-EKF mode 2021-08-01 12:54:08 -04:00
Julian Oes 349dd63072 mavlink: fix offboard velocity input
This reverts the behavior for offboard velocity setpoint.

Back in v1.11, the velocity input in NED_BODY was assumed to be in the
world frame but rotated by yaw to the vehicle frame. With the current
state the frame is completely fixed to the body. While this might be
technically correct, it doesn't seem much intuitive for multicopters
and breaks the MAVSDK offboard velocity API.

So as an example, with a velocity setpoint of 5 m/s forward, the drone
would in
- v1.11: fly forward with 5 m/s
- v1.12: start to fly forward by pitching down but then descend rapidly
  as the forward velocity would translate to a setpoint in Z into the
  ground as it is pitched down.

This commit restores the behavior to what we had previously.
2021-07-22 22:09:56 -04:00
David Sidrane 6b51c6390a Revert "nxp_fmuk66-v3:DMA Poll not needed"
This reverts commit 962f02220a.
2021-07-22 22:08:18 -04:00
David Sidrane 4f7909ee8e Revert "nxp_fmuk66-e:DMA Poll not needed"
This reverts commit 39d684958d.
2021-07-22 22:08:11 -04:00
David Sidrane cbb48f9af3 NuttX with Kinetis SerialPoll back in 2021-07-22 22:08:04 -04:00
920 changed files with 16204 additions and 87761 deletions
+19 -6
View File
@@ -9,10 +9,11 @@ pipeline {
script {
def build_nodes = [:]
def docker_images = [
armhf: "px4io/px4-dev-armhf:2021-05-04",
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",
armhf: "px4io/px4-dev-armhf:2021-04-29",
arm64: "px4io/px4-dev-aarch64:2021-04-29",
base: "px4io/px4-dev-base-bionic:2021-04-29",
nuttx: "px4io/px4-dev-nuttx-focal:2021-04-29",
snapdragon: "lorenzmeier/px4-dev-snapdragon:2020-04-01"
]
def armhf_builds = [
@@ -105,8 +106,14 @@ 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
armhf_builds, base_builds, nuttx_builds_archive//, snapdragon_builds
]
for (def build_type = 0; build_type < docker_builds.size(); build_type++) {
@@ -126,7 +133,7 @@ pipeline {
// TODO: actually upload artifacts to S3
// stage('S3 Upload') {
// agent {
// docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
// docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
// }
// options {
// skipDefaultCheckout()
@@ -158,6 +165,12 @@ 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) {
+542 -488
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2,7 +2,7 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/cpp
{
"name": "px4-dev-nuttx",
"image": "px4io/px4-dev-nuttx-focal:2021-05-04",
"image": "px4io/px4-dev-nuttx-focal:2021-04-29",
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
+1 -2
View File
@@ -11,7 +11,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -30,7 +29,7 @@ jobs:
"parameters_metadata",
]
container:
image: px4io/px4-dev-nuttx-focal:2021-05-04
image: px4io/px4-dev-nuttx-focal:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
+1 -2
View File
@@ -11,8 +11,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-clang:2021-05-04
timeout-minutes: 60
container: px4io/px4-dev-clang:2021-04-29
steps:
- uses: actions/checkout@v1
with:
+1 -2
View File
@@ -11,8 +11,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-armhf:2021-05-04
timeout-minutes: 60
container: px4io/px4-dev-armhf:2021-04-29
strategy:
matrix:
config: [
+1 -2
View File
@@ -11,8 +11,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-aarch64:2021-05-04
timeout-minutes: 60
container: px4io/px4-dev-aarch64:2021-04-29
strategy:
matrix:
config: [
-1
View File
@@ -11,7 +11,6 @@ on:
jobs:
build:
runs-on: macos-10.15
timeout-minutes: 60
strategy:
matrix:
config: [
+79 -46
View File
@@ -11,51 +11,84 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-05-04
timeout-minutes: 60
container: px4io/px4-dev-nuttx-focal:2021-04-29
strategy:
matrix:
config: [
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
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
]
steps:
- uses: actions/checkout@v1
@@ -84,8 +117,8 @@ jobs:
ccache -s
ccache -z
- name: make all_variants_${{matrix.config}}
run: make all_variants_${{matrix.config}}
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: make ${{matrix.config}} bloaty_compileunits
run: make ${{matrix.config}} bloaty_compileunits || true
- name: make ${{matrix.config}} bloaty_inlines
@@ -104,7 +137,7 @@ jobs:
run: ccache -s
- name: Upload px4 package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v1
with:
name: px4_package_${{matrix.config}}
path: build/**/*.px4
path: build/${{matrix.config}}/${{matrix.config}}.px4
+1 -2
View File
@@ -11,8 +11,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-05-04
timeout-minutes: 60
container: px4io/px4-dev-nuttx-focal:2021-04-29
strategy:
matrix:
config: [
+4 -4
View File
@@ -23,7 +23,7 @@ jobs:
needs: enumerate_targets
strategy:
matrix: ${{fromJson(needs.enumerate_targets.outputs.matrix)}}
container: px4io/px4-dev-${{ matrix.container }}:2021-05-04
container: px4io/px4-dev-${{ matrix.container }}:2021-04-29
steps:
- uses: actions/checkout@v1
with:
@@ -56,13 +56,13 @@ jobs:
- name: ccache post-run
run: ccache -s
- name: parameter & events metadata
- name: parameter metadata
run: |
make ${{matrix.target}} ver_gen events_json
make ${{matrix.target}} ver_gen
./src/lib/version/get_git_tag_or_branch_version.sh build/${{ matrix.target }} >> $GITHUB_ENV
cd build/${{ matrix.target }}
mkdir _metadata || true
cp parameters.* events/*.xz _metadata
cp parameters.* _metadata
- uses: jakejarvis/s3-sync-action@master
with:
@@ -1,21 +0,0 @@
name: EKF Change Indicator
on: pull_request
jobs:
unit_tests:
runs-on: ubuntu-latest
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: make tests TESTFILTER=EKF
- name: Check if there is a functional change
run: git diff --exit-code
working-directory: src/modules/ekf2/test/change_indication
@@ -1,29 +0,0 @@
name: EKF Update Change Indicator
on: push
jobs:
unit_tests:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-05-04
env:
GIT_COMMITTER_EMAIL: bot@px4.io
GIT_COMMITTER_NAME: PX4BuildBot
steps:
- uses: actions/checkout@v2.3.1
with:
fetch-depth: 0
- name: main test updates change indication files
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/modules/ekf2/test/change_indication
- name: auto-commit any changes to change indication
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[AUTO COMMIT] update change indication'
commit_user_name: ${GIT_COMMITTER_NAME}
commit_user_email: ${GIT_COMMITTER_EMAIL}
- if: ${{env.CHANGE_INDICATED}}
name: if there is a functional change, fail check
run: exit 1
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
#- {vehicle: "tiltrotor", mission: "VTOL_mission_1", build_type: "RelWithDebInfo"}
container:
image: px4io/px4-dev-ros-melodic:2021-05-04
image: px4io/px4-dev-ros-melodic:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
#- {test_file: "mavros_posix_tests_offboard_rpyrt_ctl.test", vehicle: "iris", build_type: "RelWithDebInfo"}
container:
image: px4io/px4-dev-ros-melodic:2021-05-04
image: px4io/px4-dev-ros-melodic:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
+9 -47
View File
@@ -11,7 +11,7 @@ jobs:
airframe:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-05-04
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
@@ -20,24 +20,13 @@ jobs:
- name: airframe metadata
run: |
make airframe_metadata
./src/lib/version/get_git_tag_or_branch_version.sh build/px4_sitl_default >> $GITHUB_ENV
cd build/px4_sitl_default/docs
# TODO: deploy to userguide gitbook
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: 'px4-travis'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1'
SOURCE_DIR: 'build/px4_sitl_default/docs/'
DEST_DIR: 'Firmware/${{ env.version }}/_general/'
ls -ls *
# TODO: deploy to userguide gitbook and s3
module:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-05-04
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
@@ -52,7 +41,7 @@ jobs:
parameter:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-05-04
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
@@ -74,36 +63,9 @@ jobs:
SOURCE_DIR: 'build/px4_sitl_default/docs/'
DEST_DIR: 'Firmware/${{ env.version }}/_general/'
events:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-05-04
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: events metadata
run: |
make extract_events
./src/lib/version/get_git_tag_or_branch_version.sh build/px4_sitl_default >> $GITHUB_ENV
cd build/px4_sitl_default
mkdir _events_full || true
cp events/all_events_full.json.xz _events_full/all_events.json.xz
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: 'px4-travis'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1'
SOURCE_DIR: 'build/px4_sitl_default/_events_full/'
DEST_DIR: 'Firmware/${{ env.version }}/_general/'
uorb_graph:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-05-04
container: px4io/px4-dev-nuttx-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
@@ -118,7 +80,7 @@ jobs:
micrortps_agent:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-05-04
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
@@ -132,7 +94,7 @@ jobs:
ROS_msgs:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-05-04
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
@@ -145,7 +107,7 @@ jobs:
ROS2_bridge:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-05-04
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
+1 -2
View File
@@ -11,7 +11,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -22,7 +21,7 @@ jobs:
- {latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage", model: "standard_vtol" } # Zurich
container:
image: px4io/px4-dev-simulation-focal:2021-05-04
image: px4io/px4-dev-simulation-focal:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
+11 -7
View File
@@ -18,6 +18,14 @@
path = src/lib/matrix
url = https://github.com/PX4/PX4-Matrix.git
branch = master
[submodule "src/lib/ecl"]
path = src/lib/ecl
url = https://github.com/PX4/PX4-ECL.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
@@ -34,6 +42,9 @@
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
@@ -59,10 +70,3 @@
[submodule "src/lib/crypto/monocypher"]
path = src/lib/crypto/monocypher
url = https://github.com/PX4/Monocypher.git
branch = px4
[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
-10
View File
@@ -6,16 +6,6 @@ CONFIG:
buildType: RelWithDebInfo
settings:
CONFIG: px4_sitl_default
px4_sitl_asan:
short: px4_sitl (AddressSanitizer)
buildType: AddressSanitizer
settings:
CONFIG: px4_sitl_default
px4_sitl_ubsan:
short: px4_sitl (UndefinedBehaviorSanitizer)
buildType: UndefinedBehaviorSanitizer
settings:
CONFIG: px4_sitl_default
px4_sitl_replay:
short: px4_sitl_replay
buildType: RelWithDebInfo
-7
View File
@@ -129,10 +129,6 @@ define_property(GLOBAL PROPERTY PX4_MODULE_PATHS
BRIEF_DOCS "PX4 module paths"
FULL_DOCS "List of paths to all PX4 modules"
)
define_property(GLOBAL PROPERTY PX4_SRC_FILES
BRIEF_DOCS "src files from all PX4 modules & libs"
FULL_DOCS "SRC files from px4_add_{module,library}"
)
#=============================================================================
# configuration
@@ -421,9 +417,6 @@ foreach(module ${config_module_list})
add_subdirectory(src/${module})
endforeach()
# add events lib after modules and libs as it needs to know all source files (PX4_SRC_FILES)
add_subdirectory(src/lib/events EXCLUDE_FROM_ALL)
# must be the last module before firmware
add_subdirectory(src/lib/parameters EXCLUDE_FROM_ALL)
target_link_libraries(parameters_interface INTERFACE parameters)
Vendored
+12 -12
View File
@@ -15,7 +15,7 @@ pipeline {
// stage('Catkin build on ROS workspace') {
// agent {
// docker {
// image 'px4io/px4-dev-ros-melodic:2021-05-04'
// image 'px4io/px4-dev-ros-melodic:2021-04-29'
// args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
// }
// }
@@ -56,7 +56,7 @@ pipeline {
stage('Colcon build on ROS2 workspace') {
agent {
docker {
image 'px4io/px4-dev-ros2-foxy:2021-05-04'
image 'px4io/px4-dev-ros2-foxy:2021-04-29'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
}
}
@@ -85,7 +85,7 @@ pipeline {
stage('Airframe') {
agent {
docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
}
steps {
sh 'make distclean'
@@ -105,7 +105,7 @@ pipeline {
stage('Parameter') {
agent {
docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
}
steps {
sh 'make distclean'
@@ -125,7 +125,7 @@ pipeline {
stage('Module') {
agent {
docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
}
steps {
sh 'make distclean'
@@ -146,7 +146,7 @@ pipeline {
stage('uORB graphs') {
agent {
docker {
image 'px4io/px4-dev-nuttx-focal:2021-05-04'
image 'px4io/px4-dev-nuttx-focal:2021-04-29'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
@@ -176,7 +176,7 @@ pipeline {
stage('Userguide') {
agent {
docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
}
steps {
sh('export')
@@ -206,7 +206,7 @@ pipeline {
stage('QGroundControl') {
agent {
docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
}
steps {
sh('export')
@@ -234,7 +234,7 @@ pipeline {
stage('microRTPS agent') {
agent {
docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
}
steps {
sh('export')
@@ -264,7 +264,7 @@ pipeline {
stage('PX4 ROS msgs') {
agent {
docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
}
steps {
sh('export')
@@ -293,7 +293,7 @@ pipeline {
stage('PX4 ROS2 bridge') {
agent {
docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
}
steps {
sh('export')
@@ -336,7 +336,7 @@ pipeline {
stage('S3') {
agent {
docker { image 'px4io/px4-dev-base-focal:2021-05-04' }
docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
}
steps {
sh('export')
+23 -16
View File
@@ -174,7 +174,6 @@ 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)
@@ -214,7 +213,7 @@ define colorecho
endef
# Get a list of all config targets boards/*/*.cmake
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)
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)
# ADD CONFIGS HERE
# --------------------------------------------------------------------
@@ -222,12 +221,16 @@ ALL_CONFIG_TARGETS := $(shell find boards -maxdepth 3 -mindepth 3 -name '*.cmake
# All targets.
$(ALL_CONFIG_TARGETS):
@$(call cmake-build,$@$(BUILD_DIR_SUFFIX))
@$(eval PX4_CONFIG = $@)
@$(eval CMAKE_ARGS += -DCONFIG=$(PX4_CONFIG))
@$(call cmake-build,$(PX4_CONFIG)$(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):
@$(call cmake-build,$@_default$(BUILD_DIR_SUFFIX))
@$(eval PX4_CONFIG = $@_default)
@$(eval CMAKE_ARGS += -DCONFIG=$(PX4_CONFIG))
@$(call cmake-build,$(PX4_CONFIG)$(BUILD_DIR_SUFFIX))
all_config_targets: $(ALL_CONFIG_TARGETS)
all_default_targets: $(CONFIG_TARGETS_DEFAULT)
@@ -240,6 +243,16 @@ 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
# --------------------------------------------------------------------
@@ -266,6 +279,7 @@ misc_qgc_extra_firmware: \
check_bitcraze_crazyflie_default \
check_bitcraze_crazyflie21_default \
check_airmind_mindpx-v2_default \
check_px4_fmu-v2_lpe \
sizes
# builds with RTPS
@@ -293,11 +307,6 @@ 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
@@ -311,21 +320,18 @@ coverity_scan: px4_sitl_default
# Documentation
# --------------------------------------------------------------------
.PHONY: parameters_metadata airframe_metadata module_documentation extract_events px4_metadata doxygen
.PHONY: parameters_metadata airframe_metadata module_documentation px4_metadata doxygen
parameters_metadata:
@$(MAKE) --no-print-directory px4_sitl_default metadata_parameters ver_gen
airframe_metadata:
@$(MAKE) --no-print-directory px4_sitl_default metadata_airframes ver_gen
@$(MAKE) --no-print-directory px4_sitl_default metadata_airframes
module_documentation:
@$(MAKE) --no-print-directory px4_sitl_default metadata_module_documentation
extract_events:
@$(MAKE) --no-print-directory px4_sitl_default metadata_extract_events ver_gen
px4_metadata: parameters_metadata airframe_metadata module_documentation extract_events
px4_metadata: parameters_metadata airframe_metadata module_documentation
doxygen:
@mkdir -p "$(SRC_DIR)"/build/doxygen
@@ -352,6 +358,7 @@ 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)
@@ -502,7 +509,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 '^(Makefile)'
egrep -v -e '^[^[:alnum:]]' -e '^($(subst $(space),|,$(ALL_CONFIG_TARGETS)))$$' -e '_default$$' -e '^(posix|eagle|Makefile)'
@echo
@echo "Or, $(MAKE) <config_target> [<make_target(s)>]"
@echo "Use '$(MAKE) list_config_targets' for a list of configuration targets."
+2 -2
View File
@@ -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 MacOS out of the box.
PX4 is highly portable, OS-independent and supports Linux, NuttX and QuRT 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)):
@@ -110,7 +110,7 @@ This repository contains code supporting Pixhawk standard boards (best supported
* [Hex Cube Yellow](https://docs.px4.io/master/en/flight_controller/cubepilot_cube_yellow.html)
* [Airmind MindPX V2.8](http://www.mindpx.net/assets/accessories/UserGuide_MindPX.pdf)
* [Airmind MindRacer V1.2](http://mindpx.net/assets/accessories/mindracer_user_guide_v1.2.pdf)
* [Bitcraze Crazyflie 2.0](https://docs.px4.io/master/en/complete_vehicles/crazyflie2.html)
* [Bitcraze Crazyflie 2.0](https://docs.px4.io/master/en/flight_controller/crazyflie2.html)
* [Omnibus F4 SD](https://docs.px4.io/master/en/flight_controller/omnibus_f4_sd.html)
* [Holybro Kakute F7](https://docs.px4.io/master/en/flight_controller/kakutef7.html)
* [Raspberry PI with Navio 2](https://docs.px4.io/master/en/flight_controller/raspberry_pi_navio2.html)
@@ -1,54 +0,0 @@
#!/bin/sh
#
# @name Plane SITL
#
. ${R}etc/init.d/rc.fw_defaults
param set-default EKF2_ARSP_THR 8
param set-default EKF2_FUSE_BETA 1
param set-default EKF2_MAG_ACCLIM 0
param set-default EKF2_MAG_YAWLIM 0
param set-default FW_LND_AIRSPD_SC 1
param set-default FW_LND_ANG 8
param set-default FW_THR_LND_MAX 0
param set-default FW_L1_PERIOD 12
param set-default FW_MAN_P_MAX 30
param set-default FW_PR_I 0.4
param set-default FW_PR_P 0.9
param set-default FW_PR_FF 0.2
param set-default FW_PSP_OFF 2
param set-default FW_P_LIM_MAX 32
param set-default FW_P_LIM_MIN -15
param set-default FW_RR_FF 0.1
param set-default FW_RR_P 0.3
param set-default FW_THR_MAX 0.6
param set-default FW_THR_MIN 0.05
param set-default FW_THR_CRUISE 0.25
param set-default FW_T_ALT_TC 2
param set-default FW_T_CLMB_MAX 8
param set-default FW_T_HRATE_FF 0.5
param set-default FW_T_SINK_MAX 2.7
param set-default FW_T_SINK_MIN 2.2
param set-default FW_T_TAS_TC 2
param set-default FW_W_EN 1
param set-default MIS_LTRMIN_ALT 30
param set-default MIS_TAKEOFF_ALT 30
param set-default NAV_ACC_RAD 15
param set-default NAV_DLL_ACT 2
param set-default NAV_LOITER_RAD 50
param set-default RWTO_TKOFF 1
set MIXER_FILE etc/mixers-sitl/plane_sitl.main.mix
set MIXER custom
@@ -60,7 +60,6 @@ px4_add_romfs_files(
1034_rascal-electric
1035_techpod
1036_malolo
1037_believer
1040_standard_vtol
1041_tailsitter
1042_tiltrotor
+4 -4
View File
@@ -48,10 +48,10 @@ else
# shellcheck disable=SC2012
REQUESTED_AUTOSTART=$(ls "${R}etc/init.d-posix/airframes" | sed -n 's/^\([0-9][0-9]*\)_'${PX4_SIM_MODEL}'$/\1/p')
if [ -z "$REQUESTED_AUTOSTART" ]; then
echo "ERROR [init] Unknown model $PX4_SIM_MODEL (not found by name on ${R}etc/init.d-posix/airframes)"
echo "Error: Unknown model $PX4_SIM_MODEL (not found by name on ${R}etc/init.d-posix/airframes)"
exit 1
else
echo "INFO [init] found model autostart file as SYS_AUTOSTART=$REQUESTED_AUTOSTART"
echo "Info: found model autostart file as SYS_AUTOSTART=$REQUESTED_AUTOSTART"
fi
fi
@@ -126,7 +126,7 @@ then
param set SYS_RESTART_TYPE 2
fi
param set-default BAT1_N_CELLS 4
param set-default BAT_N_CELLS 4
param set-default CBRK_AIRSPD_CHK 0
param set-default CBRK_SUPPLY_CHK 894281
@@ -229,7 +229,7 @@ navigator start
if px4-micrortps_client status > /dev/null 2>&1
then
# shellcheck disable=SC2154
micrortps_client start -t UDP -r $((2019+2*px4_instance)) -s $((2020+2*px4_instance))
micrortps_client start -t UDP $((2019+2*px4_instance)) -s $((2020+2*px4_instance))
fi
if param greater -s MNT_MODE_IN -1
@@ -13,13 +13,12 @@
# @output MAIN6 gear
#
# @maintainer Lorenz Meier <lorenz@px4.io>
# @board px4_fmu-v2 exclude
#
. ${R}etc/init.d/rc.fw_defaults
param set-default BAT1_N_CELLS 3
param set-default BAT_N_CELLS 3
param set-default FW_AIRSPD_MAX 20
param set-default FW_AIRSPD_MIN 12
@@ -38,9 +38,8 @@ param set-default MC_YAWRATE_P 0.25
param set-default MC_YAWRATE_I 0.25
param set-default MC_YAWRATE_D 0
param set-default BAT1_V_DIV 12.27559
param set-default BAT1_A_PER_V 15.39103
param set-default BAT_V_DIV 12.27559
param set-default BAT_A_PER_V 15.39103
set MIXER quad_w
set PWM_OUT 1234
@@ -26,7 +26,7 @@
. ${R}etc/init.d/rc.mc_defaults
param set-default BAT1_N_CELLS 4
param set-default BAT_N_CELLS 4
param set-default MC_ROLL_P 7
param set-default MC_ROLLRATE_P 0.13
@@ -26,8 +26,8 @@
. ${R}etc/init.d/rc.mc_defaults
param set-default BAT1_N_CELLS 6
param set-default BAT1_V_EMPTY 3.5
param set-default BAT_N_CELLS 6
param set-default BAT_V_EMPTY 3.5
param set-default MC_ROLL_P 7
param set-default MC_ROLLRATE_P 0.08
@@ -45,7 +45,6 @@ param set-default MC_YAWRATE_D 0
param set-default MPC_XY_VEL_MAX 2
param set-default PWM_MAIN_MIN 1080
set MIXER quad_w
set PWM_OUT 1234
@@ -6,7 +6,6 @@
# @class Copter
#
# @maintainer Lorenz Meier <lorenz@px4.io>
# @board px4_fmu-v2 exclude
#
. ${R}etc/init.d/rc.mc_defaults
@@ -14,7 +14,7 @@
. ${R}etc/init.d/rc.vtol_defaults
param set-default BAT1_N_CELLS 3
param set-default BAT_N_CELLS 3
param set-default COM_RC_IN_MODE 1
@@ -44,8 +44,7 @@ param set-default MPC_HOLD_MAX_XY 0.25
param set-default MPC_THR_MIN 0.15
param set-default MPC_Z_VEL_MAX_DN 2
param set-default BAT1_N_CELLS 4
param set-default BAT_N_CELLS 4
set MIXER octo_cox_w
set PWM_OUT 12345678
@@ -23,9 +23,9 @@
. ${R}etc/init.d/rc.vtol_defaults
param set-default BAT1_CAPACITY 23000
param set-default BAT1_N_CELLS 4
param set-default BAT1_R_INTERNAL 0.0025
param set-default BAT_CAPACITY 23000
param set-default BAT_N_CELLS 4
param set-default BAT_R_INTERNAL 0.0025
param set-default CBRK_AIRSPD_CHK 162128
param set-default CBRK_IO_SAFETY 22027
@@ -23,7 +23,8 @@
. ${R}etc/init.d/rc.vtol_defaults
param set-default BAT1_N_CELLS 6
param set-default BAT_N_CELLS 6
param set-default FW_AIRSPD_MAX 30
param set-default FW_AIRSPD_MIN 19
@@ -13,7 +13,6 @@
# @maintainer Trent Lukaczyk <aerialhedgehog@gmail.com>
#
# @board bitcraze_crazyflie exclude
# @board px4_fmu-v2 exclude
#
. ${R}etc/init.d/rc.mc_defaults
@@ -13,7 +13,6 @@
# @maintainer Trent Lukaczyk <aerialhedgehog@gmail.com>
#
# @board bitcraze_crazyflie exclude
# @board px4_fmu-v2 exclude
#
. ${R}etc/init.d/rc.mc_defaults
@@ -26,8 +26,8 @@
. ${R}etc/init.d/rc.fw_defaults
param set-default BAT1_CAPACITY 2500
param set-default BAT1_N_CELLS 3
param set-default BAT_CAPACITY 2500
param set-default BAT_N_CELLS 3
param set-default PWM_AUX_RATE 50
param set-default PWM_MAIN_RATE 50
@@ -46,6 +46,5 @@ param set-default FW_R_LIM 40
param set-default FW_P_LIM_MAX 25
param set-default FW_P_LIM_MIN -5
param set-default FW_P_RMAX_NEG 20
set MIXER TF-AutoG2
set MIXER_AUX pass
@@ -48,7 +48,8 @@ param set-default PWM_MAIN_DISARM 1000
# the payload bay is pitched up about 7 degrees
param set-default SENS_BOARD_Y_OFF 7
set MIXER fw_generic_wing
set MIXER phantom
# Provide ESC a constant 1000 us pulse
set PWM_OUT 4
@@ -23,7 +23,7 @@
. ${R}etc/init.d/rc.fw_defaults
param set-default BAT1_N_CELLS 2
param set-default BAT_N_CELLS 2
param set-default FW_AIRSPD_MAX 15
param set-default FW_AIRSPD_MIN 10
param set-default FW_AIRSPD_TRIM 13
@@ -48,7 +48,7 @@ param set-default PWM_MAIN_DISARM 1000
set MAV_TYPE 1
# Set mixer.
set MIXER fw_generic_wing
set MIXER wingwing
# Provide ESC a constant 1000 us pulse.
set PWM_OUT 4
@@ -27,4 +27,5 @@ param set-default FW_AIRSPD_TRIM 15
param set-default NAV_LOITER_RAD 150
set MIXER fw_generic_wing
set MIXER FX79
@@ -49,7 +49,8 @@ param set-default PWM_MAIN_DISARM 1000
# the payload bay is pitched up about 7 degrees
param set-default SENS_BOARD_Y_OFF 11.9
set MIXER fw_generic_wing
set MIXER phantom
# Provide ESC a constant 1000 us pulse
set PWM_OUT 4
@@ -63,6 +63,6 @@ param set-default PWM_MAIN_REV2 1
param set-default PWM_MAIN_MIN 900
param set-default PWM_MAIN_MAX 2100
set MIXER fw_generic_wing
set MIXER caipi
set PWM_OUT 1234
@@ -127,9 +127,9 @@ param set-default IMU_GYRO_CUTOFF 100
param set-default SENS_EN_PMW3901 1
# Power Parameters
param set-default BAT1_N_CELLS 4
param set-default BAT1_A_PER_V 36.364
param set-default BAT1_V_DIV 18.182
param set-default BAT_N_CELLS 4
param set-default BAT_A_PER_V 36.364
param set-default BAT_V_DIV 18.182
# Circuit breakers
param set-default CBRK_IO_SAFETY 22027
@@ -0,0 +1,38 @@
#!/bin/sh
#
# @name Hobbyking Micro PCB
#
# @type Quadrotor x
# @class Copter
#
# @maintainer Thomas Gubler <thomas@px4.io>
#
# @board px4_fmu-v2 exclude
# @board px4_fmu-v3 exclude
# @board px4_fmu-v4 exclude
# @board px4_fmu-v4pro exclude
# @board px4_fmu-v5 exclude
# @board px4_fmu-v5x exclude
# @board bitcraze_crazyflie exclude
#
. ${R}etc/init.d/rc.mc_defaults
set MIXER quad_x
set PWM_OUT 1234
param set-default MC_ROLL_P 7
param set-default MC_ROLLRATE_P 0.1
param set-default MC_ROLLRATE_I 0.05
param set-default MC_ROLLRATE_D 0.003
param set-default MC_PITCH_P 7
param set-default MC_PITCHRATE_P 0.1
param set-default MC_PITCHRATE_I 0.05
param set-default MC_PITCHRATE_D 0.003
param set-default MC_YAW_P 2.8
param set-default MC_YAWRATE_P 0.2
param set-default MC_YAWRATE_I 0.1
param set-default MC_YAWRATE_D 0
param set-default PWM_MAIN_MIN 1200
@@ -54,7 +54,7 @@ param set-default DSHOT_CONFIG 600
param set-default SYS_HAS_BARO 0
param set-default SYS_HAS_MAG 0
param set-default BAT1_N_CELLS 2
param set-default BAT_N_CELLS 2
# The Whoop uses reversed props
set MIXER quad_h
set PWM_OUT 1234
@@ -20,7 +20,7 @@ set PWM_OUT 1234
# The set does not include a battery, but most people will probably use 4S
param set-default BAT1_N_CELLS 4
param set-default BAT_N_CELLS 4
param set-default IMU_GYRO_CUTOFF 120
param set-default IMU_DGYRO_CUTOFF 45
@@ -17,7 +17,7 @@ set MIXER quad_x
set PWM_OUT 1234
param set-default BAT1_N_CELLS 4
param set-default BAT_N_CELLS 4
param set-default GPS_1_CONFIG 0
param set-default RC_PORT_CONFIG 201
@@ -17,7 +17,7 @@ set MIXER quad_x
set PWM_OUT 1234
param set-default BAT1_N_CELLS 6
param set-default BAT_N_CELLS 6
param set-default MC_ROLL_P 6.5
param set-default MC_ROLLRATE_P 0.05
@@ -92,10 +92,10 @@ param set-default MPC_TKO_RAMP_T 1
param set-default MPC_TKO_SPEED 1.1
param set-default MPC_VEL_MANUAL 3
param set-default BAT1_SOURCE 0
param set-default BAT1_N_CELLS 4
param set-default BAT1_V_DIV 10.14
param set-default BAT1_A_PER_V 18.18
param set-default BAT_SOURCE 0
param set-default BAT_N_CELLS 4
param set-default BAT_V_DIV 10.14
param set-default BAT_A_PER_V 18.18
#param set CBRK_IO_SAFETY 22027
param set-default COM_DISARM_LAND 2
@@ -73,7 +73,7 @@ param set-default PWM_MAIN_RATE 0
param set-default SENS_BOARD_ROT 2
param set-default BAT1_SOURCE 0
param set-default BAT_SOURCE 0
param set-default CBRK_IO_SAFETY 22027
#param set COM_DISARM_LAND 3
@@ -102,10 +102,10 @@ param set-default MPC_TKO_RAMP_T 1
param set-default MPC_TKO_SPEED 1.1
param set-default MPC_VEL_MANUAL 3
param set-default BAT1_SOURCE 0
param set-default BAT1_N_CELLS 4
param set-default BAT1_V_DIV 10.14
param set-default BAT1_A_PER_V 18.18
param set-default BAT_SOURCE 0
param set-default BAT_N_CELLS 4
param set-default BAT_V_DIV 10.14
param set-default BAT_A_PER_V 18.18
#param set CBRK_IO_SAFETY 22027
param set-default COM_DISARM_LAND 2
@@ -21,7 +21,7 @@ set MIXER quad_x
set PWM_OUT 1234
param set-default BAT1_N_CELLS 1
param set-default BAT_N_CELLS 1
param set-default MC_ROLL_P 8
param set-default MC_ROLLRATE_P 0.19
@@ -32,18 +32,17 @@ set PWM_OUT 1234
param reset_all SYS_AUTOSTART SYS_AUTOCONFIG RC* COM_FLTMODE* LND_FLIGHT_T_* TC_* CAL_ACC* CAL_GYRO* CAL_MAG* SENS_BOARD* EKF2_MAGBIAS*
# battery
param set-default BAT_CAPACITY 2750
param set-default BAT_CRIT_THR 0.15
param set-default BAT_EMERGEN_THR 0.075
param set-default BAT_LOW_THR 0.20
param set-default BAT1_CAPACITY 2750
param set-default BAT1_N_CELLS 4
param set-default BAT1_R_INTERNAL 0.06
param set-default BAT1_SOURCE 1
param set-default BAT1_V_CHARGED 4.15
param set-default BAT1_V_DIV 11.1625
param set-default BAT1_V_EMPTY 3.65
param set-default BAT1_V_OFFS_CURR -0.0045
param set-default BAT_N_CELLS 4
param set-default BAT_R_INTERNAL 0.06
param set-default BAT_SOURCE 1
param set-default BAT_V_CHARGED 4.15
param set-default BAT_V_DIV 11.1625
param set-default BAT_V_EMPTY 3.65
param set-default BAT_V_OFFS_CURR -0.0045
# sensor calibration
param set-default CAL_MAG_SIDES 63
@@ -19,9 +19,9 @@
set MIXER quad_x_cw
set PWM_OUT 1234
param set-default BAT1_N_CELLS 1
param set-default BAT1_CAPACITY 240
param set-default BAT1_SOURCE 1
param set-default BAT_N_CELLS 1
param set-default BAT_CAPACITY 240
param set-default BAT_SOURCE 1
param set-default CBRK_SUPPLY_CHK 894281
param set-default CBRK_USB_CHK 197848
@@ -16,7 +16,7 @@
. ${R}etc/init.d/rc.rover_defaults
param set-default BAT1_N_CELLS 2
param set-default BAT_N_CELLS 2
param set-default EKF2_ANGERR_INIT 0.01
param set-default EKF2_GBIAS_INIT 0.01
@@ -19,7 +19,7 @@
. ${R}etc/init.d/rc.rover_defaults
param set-default BAT1_N_CELLS 4
param set-default BAT_N_CELLS 4
param set-default EKF2_GBIAS_INIT 0.01
param set-default EKF2_ANGERR_INIT 0.01
@@ -21,7 +21,7 @@
. ${R}etc/init.d/rc.rover_defaults
param set-default BAT1_N_CELLS 2
param set-default BAT_N_CELLS 2
param set-default EKF2_GBIAS_INIT 0.01
param set-default EKF2_ANGERR_INIT 0.01
@@ -116,9 +116,9 @@ param set-default COM_DISARM_LAND 3
param set-default PWM_MAIN_RATE 0
# Battery
param set-default BAT1_SOURCE 0
param set-default BAT1_N_CELLS 4
param set-default BAT1_V_DIV 10.133
param set-default BAT_SOURCE 0
param set-default BAT_N_CELLS 4
param set-default BAT_V_DIV 10.133
# TELEM1 ttyS1
param set-default MAV_0_CONFIG 101
@@ -71,6 +71,7 @@ px4_add_romfs_files(
4016_holybro_px4vision
4017_nxp_hovergames
4018_s500_ctrlalloc
4020_hk_micro_pcb
4030_3dr_solo
4031_3dr_quad
4040_reaper
+1 -1
View File
@@ -128,7 +128,7 @@ else
then
param reset_all
fi
if ver hwtypecmp V5X00 V5X90 V5Xa0
if ver hwcmp PX4_FMU_V5X PX4_FMU_V6X
then
netman update -i eth0
fi
@@ -39,6 +39,7 @@ px4_add_romfs_files(
AETRFG.main.mix
babyshark.main.mix
blade130.main.mix
caipi.main.mix
CCPM.main.mix
claire.aux.mix
claire.main.mix
@@ -52,6 +53,7 @@ px4_add_romfs_files(
firefly6.aux.mix
firefly6.main.mix
fw_generic_wing.main.mix
FX79.main.mix
generic_diff_rover.main.mix
hexa_cox.main.mix
hexa_+.main.mix
@@ -64,6 +66,7 @@ px4_add_romfs_files(
octo_+.main.mix
octo_x.main.mix
pass.aux.mix
phantom.main.mix
quad_dc.main.mix
quad_h.main.mix
quad_+.main.mix
@@ -91,4 +94,5 @@ px4_add_romfs_files(
vtol_convergence.main.mix
vtol_delta.aux.mix
vtol_tailsitter_duo.main.mix
wingwing.main.mix
)
+50
View File
@@ -0,0 +1,50 @@
FX-79 Delta-wing mixer for PX4FMU
=================================
Designed for FX-79.
TODO (sjwilks): Add mixers for flaps.
This file defines mixers suitable for controlling a delta wing aircraft using
PX4FMU. The configuration assumes the elevon servos are connected to PX4FMU
servo outputs 0 and 1 and the motor speed control to output 3. Output 2 is
assumed to be unused.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch) and 3 (thrust).
See the README for more information on the scaler format.
Elevon mixers
-------------
Three scalers total (output, roll, pitch).
On the assumption that the two elevon servos are physically reversed, the pitch
input is inverted between the two servos.
The scaling factor for roll inputs is adjusted to implement differential travel
for the elevons.
M: 2
S: 0 0 8500 8500 0 -10000 10000
S: 0 1 9500 9500 0 -10000 10000
M: 2
S: 0 0 8500 8500 0 -10000 10000
S: 0 1 -9500 -9500 0 -10000 10000
Output 2
--------
This mixer is empty.
Z:
Motor speed mixer
-----------------
Two scalers total (output, thrust).
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.
M: 1
S: 0 3 0 20000 -10000 -10000 10000
@@ -2,7 +2,6 @@
# 1-4 (main): Ailerons (Y-cable), A-tail left, Pusher, A-tail right
# 5-8 (main): quad motors
#=============================
# @board px4_fmu-v2 exclude
Aileron mixer (roll)
+48
View File
@@ -0,0 +1,48 @@
Delta-wing mixer
===========================
Designed for TBS Caipirinha
This file defines mixers suitable for controlling a delta wing aircraft using
PX4FMU. The configuration assumes the elevon servos are connected to PX4FMU
servo outputs 0 and 1 and the motor speed control to output 3. Output 2 is
assumed to be unused.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch) and 3 (thrust).
See the README for more information on the scaler format.
Elevon mixers
-------------
Three scalers total (output, roll, pitch).
On the assumption that the two elevon servos are physically reversed, the pitch
input is inverted between the two servos.
The scaling factor for roll inputs is adjusted to implement differential travel
for the elevons.
M: 2
S: 0 0 8000 8000 0 -10000 10000
S: 0 1 9000 9000 0 -10000 10000
M: 2
S: 0 0 8000 8000 0 -10000 10000
S: 0 1 -9000 -9000 0 -10000 10000
Output 2
--------
This mixer is empty.
Z:
Motor speed mixer
-----------------
Two scalers total (output, thrust).
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.
M: 1
S: 0 3 0 20000 -10000 -10000 10000
@@ -1,8 +1,6 @@
Thrust tilt/ Starboard Thrust / Port Thrust / Tail Thrust mixer for PX4FMU
=======================================================
# @board px4_fmu-v2 exclude
This file defines mixers suitable for controlling an airship with
a thrust tilt, starboard and port thruster and a tail thruster using PX4FMU.
The configuration assumes the starboard thruster is connected to PX4FMU
@@ -1,6 +1,5 @@
# DeltaQuad mixer for PX4FMU
#=============================
# @board px4_fmu-v2 exclude
Quad motors 1 - 4
-------------
@@ -1,4 +1,3 @@
# Dodeca Cox
# @board px4_fmu-v2 exclude
R: 6a
@@ -1,4 +1,3 @@
# Dodeca Cox
# @board px4_fmu-v2 exclude
R: 6m
@@ -1,8 +1,6 @@
# mixer for the FireFly6 tilt mechansim servo, elevons and landing gear
=======================================================================
# @board px4_fmu-v2 exclude
Tilt mechanism servo mixer
---------------------------
M: 1
@@ -1,6 +1,4 @@
# FireFly6 mixer for PX4FMU
#
#===========================
# @board px4_fmu-v2 exclude
R: 6c
@@ -1,4 +1,3 @@
# @board px4_fmu-v2 exclude
# Roll channel for mount
M: 1
@@ -0,0 +1,45 @@
Phantom FX-61 mixer
===================
This file defines mixers suitable for controlling a delta wing aircraft using
PX4/Pixhawk. The configuration assumes the elevon servos are connected to
servo outputs 0 and 1 and the motor speed control to output 3. Output 2 is
assumed to be unused.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch) and 3 (thrust).
See the README for more information on the scaler format.
Elevon mixers
-------------
Three scalers total (output, roll, pitch).
On the assumption that the two elevon servos are physically reversed, the pitch
input is inverted between the two servos.
The scaling factor are set so that pitch will have more travel than roll.
M: 2
S: 0 0 -6000 -6000 0 -10000 10000
S: 0 1 6500 6500 0 -10000 10000
M: 2
S: 0 0 -6000 -6000 0 -10000 10000
S: 0 1 -6500 -6500 0 -10000 10000
Output 2
--------
This mixer is empty.
Z:
Motor speed mixer
-----------------
Two scalers total (output, thrust).
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.
M: 1
S: 0 3 0 20000 -10000 -10000 10000
@@ -1,8 +1,6 @@
Tilt-Quadrotor mixer for PX4FMU (2/2) V2
===========================
# @board px4_fmu-v2 exclude
This file defines the aux outputs mixer for a Tilt-quadrotor in the + configuration.
# @output AUX1 Outer servo motor for rotor 2 arm
@@ -1,8 +1,6 @@
Tilt-Quadrotor mixer for PX4FMU (1/2) V2
===========================
# @board px4_fmu-v2 exclude
This file defines the main outputs mixer for a Tilt-quadrotor in the + configuration.
# @output MAIN1 motor 1
@@ -1,5 +1,3 @@
# @board px4_fmu-v2 exclude
# Motor 1
M: 3
S: 0 2 -4000 -4000 0 -4000 +4000
@@ -1,8 +1,6 @@
Mixer for an AAERT VTOL
=======================
# @board px4_fmu-v2 exclude
Aileron 1 mixer
---------------
M: 1
@@ -1,8 +1,6 @@
Aileron/v-tail/throttle VTOL mixer for PX4FMU
=======================================================
# @board px4_fmu-v2 exclude
This file defines mixers suitable for controlling a fixed wing aircraft with
aileron, v-tail (rudder, elevator) and throttle using PX4FMU.
The configuration assumes the aileron servos are connected to PX4FMU
@@ -1,7 +1,5 @@
# Generic quadplane tiltrotor servo mixer
# @board px4_fmu-v2 exclude
# Tilt mechanism servo mixer
---------------------------
# front left up:2000 down:1000
@@ -1,5 +1,4 @@
# E-flite Convergence Tricopter Y-Configuration Mixer
# @board px4_fmu-v2 exclude
# Motors
R: 3y
@@ -0,0 +1,48 @@
Delta-wing mixer for PX4FMU
===========================
Designed for Wing Wing Z-84
This file defines mixers suitable for controlling a delta wing aircraft using
PX4FMU. The configuration assumes the elevon servos are connected to PX4FMU
servo outputs 0 and 1 and the motor speed control to output 3. Output 2 is
assumed to be unused.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch) and 3 (thrust).
See the README for more information on the scaler format.
Elevon mixers
-------------
Three scalers total (output, roll, pitch).
On the assumption that the two elevon servos are physically reversed, the pitch
input is inverted between the two servos.
The scaling factor for roll inputs is adjusted to implement differential travel
for the elevons.
M: 2
S: 0 0 -6000 -6000 0 -10000 10000
S: 0 1 6500 6500 0 -10000 10000
M: 2
S: 0 0 -6000 -6000 0 -10000 10000
S: 0 1 -6500 -6500 0 -10000 10000
Output 2
--------
This mixer is empty.
Z:
Motor speed mixer
-----------------
Two scalers total (output, thrust).
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.
M: 1
S: 0 3 0 20000 -10000 -10000 10000
+22 -38
View File
@@ -5,62 +5,46 @@ 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):
ser = serial.Serial(port, baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1, xonxoff=True, rtscts=False, dsrdtr=False)
databits = serial.EIGHTBITS
stopbits = serial.STOPBITS_ONE
parity = serial.PARITY_NONE
ser = serial.Serial(port, baudrate, databits, parity, stopbits, timeout=1)
timeout = 180 # 3 minutes
finished = 0
timeout = 300 # 5 minutes
timeout_start = time.time()
timeout_newline = time.time()
while True:
while finished == 0:
serial_line = ser.readline().decode("ascii", errors='ignore')
if len(serial_line) > 0:
print_line(serial_line)
if (len(serial_line) > 0):
print(serial_line.replace('\n', ''))
if "NuttShell (NSH)" in serial_line:
sys.exit(0)
elif "nsh>" in serial_line:
sys.exit(0)
finished = 1
break
if time.time() - timeout_start > 10:
if "nsh>" in serial_line:
finished = 1
break
if time.time() > timeout_start + timeout:
print("Error, timeout")
sys.exit(-1)
finished = 1
break
# 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)
-137
View File
@@ -1,137 +0,0 @@
#! /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()
+37 -72
View File
@@ -6,89 +6,52 @@ 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):
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()
databits = serial.EIGHTBITS
stopbits = serial.STOPBITS_ONE
parity = serial.PARITY_NONE
ser = serial.Serial(port, baudrate, databits, parity, stopbits, timeout=0.1)
# run command
timeout_start = time.time()
timeout = 1 # 1 second
timeout = 10 # 10 seconds
# clear
ser.write("\n".encode("ascii"))
ser.flush()
ser.readline()
success_cmd = "cmd succeeded!"
# wait for command echo
serial_cmd = '{0}; echo "{1}"\r\n'.format(cmd, success_cmd)
serial_cmd = '{0}; echo "{1}"\n'.format(cmd, success_cmd)
ser.write(serial_cmd.encode("ascii"))
ser.flush()
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
ser.readline()
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)
# 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 time.time() > timeout_start + timeout:
print("Error, timeout waiting for command echo")
break
# 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)
timeout_start = time.time()
timeout = 180 # 3 minutes
timeout = 30 # 30 seconds
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
@@ -97,15 +60,17 @@ def do_nsh_cmd(port, baudrate, cmd):
break
else:
if len(serial_line) > 0:
print_line(serial_line)
print(serial_line, end='')
if "nsh>" in serial_line:
sys.exit(1) # error, command didn't complete successfully
#sys.exit(-1) # error, command didn't complete successfully
break # TODO: return error on failure
elif "NuttShell (NSH)" in serial_line:
sys.exit(1) # error, command didn't complete successfully
#sys.exit(-1) # error, command didn't complete successfully
break # TODO: return error on failure
if len(serial_line) <= 0:
ser.write("\r\n".encode("ascii"))
ser.write("\n".encode("ascii"))
ser.flush()
if time.time() > timeout_start + timeout:
+50 -86
View File
@@ -8,58 +8,12 @@ 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):
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()
databits = serial.EIGHTBITS
stopbits = serial.STOPBITS_ONE
parity = serial.PARITY_NONE
ser = serial.Serial(port, baudrate, databits, parity, stopbits, timeout=1)
success = False
@@ -68,38 +22,48 @@ def do_test(port, baudrate, test_name):
cmd = 'tests ' + test_name
print("| Running:", cmd)
print('|======================================================================')
timeout_start = time.time()
timeout = 2 # 2 seconds
timeout = 10 # 10 seconds
# clear
ser.write("\n".encode("ascii"))
ser.flush()
ser.readline()
# wait for command echo
serial_cmd = '{0}\n'.format(cmd)
ser.write(serial_cmd.encode("ascii"))
ser.flush()
while True:
serial_line = ser.readline().decode("ascii", errors='ignore')
ser.readline()
if cmd in serial_line:
break
else:
if len(serial_line) > 0:
print_line(serial_line)
# TODO: retry command
# while True:
# serial_cmd = '{0}\n'.format(cmd)
# ser.write(serial_cmd.encode("ascii"))
# ser.flush()
if time.time() > timeout_start + timeout:
print("Error, timeout waiting for command echo")
break
# 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)
# print results, wait for final result (PASSED or FAILED)
timeout = 300 # 5 minutes
timeout = 180 # 3 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_line(serial_line)
if (len(serial_line) > 0):
print(serial_line, end='')
if test_name + " PASSED" in serial_line:
success = True
@@ -110,7 +74,7 @@ def do_test(port, baudrate, test_name):
if time.time() > timeout_start + timeout:
print("Error, timeout")
print(test_name + f" {COLOR_RED}FAILED{COLOR_RESET}")
print(test_name + " FAILED")
success = False
break
@@ -139,30 +103,15 @@ class TestHardwareMethods(unittest.TestCase):
def test_bson(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "bson"))
def test_conv(self):
self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "conv"))
# def test_dataman(self):
# self.assertTrue(do_test(self.TEST_DEVICE, self.TEST_BAUDRATE, "dataman"))
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):
def floattest_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"))
@@ -178,6 +127,21 @@ 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"))
+3 -4
View File
@@ -12,16 +12,15 @@ 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/lib/crypto/monocypher -prune -o \
-path src/lib/events/libevents -prune -o \
-path src/drivers/uavcan/uavcan_drivers/kinetis/driver/include/uavcan_kinetis -prune -o \
-path src/lib/ecl -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
-20
View File
@@ -1,20 +0,0 @@
#!/usr/bin/env python
import argparse
import lzma
parser = argparse.ArgumentParser(description="""Compress a file with xz""")
parser.add_argument('filename', metavar='file', help='Input file (output: file.xz)')
args = parser.parse_args()
filename = args.filename
def save_compressed(filename):
#create xz compressed version
xz_filename=filename+'.xz'
with lzma.open(xz_filename, 'wt', preset=9) as f:
with open(filename, 'r') as content_file:
f.write(content_file.read())
save_compressed(filename)
+5 -2
View File
@@ -4,13 +4,16 @@ if [ -z ${PX4_DOCKER_REPO+x} ]; then
echo "guessing PX4_DOCKER_REPO based on input";
if [[ $@ =~ .*px4_fmu.* ]]; then
# nuttx-px4fmu-v{1,2,3,4,5}
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-05-04"
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-04-29"
elif [[ $@ =~ .*navio2.* ]] || [[ $@ =~ .*raspberry.* ]] || [[ $@ =~ .*beaglebone.* ]] || [[ $@ =~ .*pilotpi.default ]]; then
# beaglebone_blue_default, emlid_navio2_default, px4_raspberrypi_default, scumaker_pilotpi_default
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2021-02-04"
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"
@@ -27,7 +30,7 @@ fi
# otherwise default to nuttx
if [ -z ${PX4_DOCKER_REPO+x} ]; then
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-05-04"
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-04-29"
fi
# docker hygiene
+20 -50
View File
@@ -5,47 +5,17 @@ import html
class MarkdownTablesOutput():
def __init__(self, groups, board, image_path):
result = """# Airframes Reference
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")
:::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"""
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"""
type_set = set()
@@ -63,7 +33,7 @@ img {
image_name = group.GetImageName()
result += '<div>\n'
image_name = image_path + image_name
result += '<img src="%s.svg"/>\n' % (image_name)
result += '<img src="%s.svg" width="29%%" style="max-height: 180px;"/>\n' % (image_name)
# check if all outputs are equal for the group: if so, show them
# only once
@@ -93,17 +63,19 @@ img {
outputs_prev[i] = ''
if outputs_match[0] or outputs_match[1]:
result += '<table class="common">\n'
result += '<table style="float: right; width: 70%; font-size:1.5rem;">\n'
result += ' <colgroup><col></colgroup>\n'
result += ' <thead>\n'
result += ' <tr><th>Common Outputs</th></tr>\n'
result += ' </thead>\n'
result += ' <tbody>\n'
result += '<tr>\n <td><ul>%s%s</ul></td>\n</tr>\n' % (outputs_prev[0], outputs_prev[1])
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></table>\n'
result += '</div>\n\n'
result += '<table class="generic">\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 += ' <thead>\n'
result += ' <tr><th>Name</th><th></th></tr>\n'
result += ' </thead>\n'
@@ -118,12 +90,10 @@ img {
maintainer = param.GetMaintainer()
maintainer_entry = ''
if maintainer != '':
maintainer_entry = 'Maintainer: %s' % (html.escape(maintainer))
maintainer_entry = '<p>Maintainer: %s</p>' % (html.escape(maintainer))
url = param.GetFieldValue('url')
name_anchor='%s_%s_%s' % (group.GetClass(),group.GetName(),name)
name_anchor='id="%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)
@@ -150,7 +120,7 @@ img {
else:
outputs_entry = ''
result += ('<tr %s>\n <td>%s</td>\n <td>%s%s%s</td>\n</tr>\n' %
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' %
(name_anchor, name_entry, maintainer_entry, airframe_id_entry,
outputs_entry))
-58
View File
@@ -1,58 +0,0 @@
import codecs
import json
import sys
import os
class JsonOutput():
def __init__(self, groups):
all_json = {}
all_json['version'] = 1
component = {}
all_json['components'] = {1: component} #1: autopilot component
all_events = {}
component['namespace'] = "px4"
component['event_groups'] = all_events
for group in groups:
current_group = {}
current_events = {}
current_group['events'] = current_events
all_events[group] = current_group
for e in groups[group]:
event_obj = {}
event_obj['name'] = e.name
event_obj['message'] = e.message
if e.description is not None:
event_obj['description'] = e.description
args = []
for i in range(len(e.arguments)):
arg = {}
arg['type'] = e.arguments[i][0]
arg['name'] = e.arguments[i][1]
args.append(arg)
if len(args) > 0:
event_obj['arguments'] = args
sub_id = e.sub_id
assert sub_id not in current_events, \
"Duplicate event ID for {0} (message: '{1}'), other event message: '{2}'".format(
e.name, e.message, current_events[sub_id]['message'])
current_events[sub_id] = event_obj
self.json = all_json
def save(self, filename):
need_to_write = True
# only write if current file is not the same, to avoid updating the file
# timestamp
if os.path.isfile(filename):
with open(filename, 'rb') as json_file:
existing_data = json.load(json_file)
if existing_data == self.json:
need_to_write = False
if need_to_write:
with codecs.open(filename, 'w', 'utf-8') as f:
f.write(json.dumps(self.json,indent=2))
-308
View File
@@ -1,308 +0,0 @@
import sys
import re
import math
def hash_32_fnv1a(data: str):
hash_val = 0x811c9dc5
prime = 0x1000193
for i in range(len(data)):
value = ord(data[i])
hash_val = hash_val ^ value
hash_val *= prime
hash_val &= 0xffffffff
return hash_val
class Event(object):
"""
Single event definition
"""
def __init__(self):
self.name = None
self.message = None
self.description = None
self.group = "default"
self._arguments = []
@staticmethod
def _get_id(name):
return 0xffffff & hash_32_fnv1a(name)
@property
def arguments(self):
""" list of (type: str, name: str) tuples """
return self._arguments
def set_default_arguments(self, num_args):
""" set argument names to default (if not specified) """
for i in range(num_args):
self.add_argument(None, "arg"+str(i))
def _shift_printed_arguments(self, msg, offset):
""" shift all {<idx> arguments by an offset """
i = 0
while i < len(msg):
if msg[i] == '\\': # escaped character
i += 2
continue
if msg[i] == '{':
m = re.match(r"^(\d+)", msg[i+1:])
if m:
arg_idx = int(m.group(1)) + offset
msg = msg[:i+1] + str(arg_idx) + msg[i+1+len(m.group(1)):]
i += 1
return msg
def prepend_arguments(self, arguments):
""" prepend additional arguments, and shift all '{<index>}' in the
description and message
:param arguments: list of (type: str, name: str) tuples
"""
self._arguments = arguments + self._arguments
num_added = len(arguments)
if self.message is not None:
self.message = self._shift_printed_arguments(self.message, num_added)
if self.description is not None:
self.description = self._shift_printed_arguments(self.description, num_added)
def add_argument(self, arg_type, name):
self._arguments.append((arg_type, name))
@property
def sub_id(self):
return self._get_id(self.name)
def validate(self):
if self.name is None: raise Exception("missing event name")
if self.message is None: raise Exception("missing event message for {}".format(self.name))
# just to ensure a common convention
assert self.message[-1] != '.', "Avoid event message ending in '.' ({:})".format(self.message)
# description is optional
class SourceParser(object):
"""
Parses provided data and stores all found events internally.
"""
re_split_lines = re.compile(r'[\r\n]+')
re_comment_start = re.compile(r'^\/\*\s*EVENT$')
re_events_send = re.compile(r'^events::send[<\(]')
re_comment_content = re.compile(r'^\*\s*(.*)')
re_comment_tag = re.compile(r'^@([a-zA-Z][a-zA-Z0-9_]*):?\s*(.*)')
re_comment_end = re.compile(r'(.*?)\s*\*\/$')
re_code_end = re.compile(r'(.*?)\s*;$')
re_template_args = re.compile(r'([a-zA-Z0-9_:\.]+)\s*<([a-zA-Z0-9_,\s:]+)\s*>\s*\((.*)\);$')
re_no_template_args = re.compile(r'([a-zA-Z0-9_:\.]+)\s*\((.*)\);$')
re_event_id = re.compile(r'(events::)?ID\("([a-zA-Z0-9_]+)\"')
def __init__(self):
self._events = {}
@property
def events(self):
""" dict of 'group': [Event] list """
return self._events
def Parse(self, contents):
"""
Incrementally parse program contents and append all found events
to the list.
"""
# This code is essentially a comment-parsing grammar. "state"
# represents parser state. It contains human-readable state
# names.
state = None
def finalize_current_tag(event, tag, value):
if tag is None: return
if tag == "description":
descr = value.strip()
# merge continued lines (but not e.g. enumerations)
for i in range(1, len(descr)-1):
if descr[i-1] != '\n' and descr[i] == '\n' and descr[i+1].isalpha():
descr = descr[:i] + ' ' + descr[i+1:]
event.description = descr
elif tag == "group":
known_groups = ["calibration", "health", "arming_check", "normal"]
event.group = value.strip()
if not event.group in known_groups:
raise Exception("Unknown event group: '{}'\nKnown groups: {}\n" \
"If this is not a typo, add the new group to the script".format(event.group, known_groups))
elif tag.startswith("arg"):
arg_index = int(tag[3:])-1
arg_name = value.strip()
assert len(event.arguments) == arg_index, "Invalid argument ordering/duplicate ({}, {})".format(tag, value)
event.add_argument(None, arg_name)
else:
raise Exception("Invalid tag: {}\nvalue: {}".format(tag, value))
for line in self.re_split_lines.split(contents):
line = line.strip()
# Ignore empty lines
if line == "":
continue
assert not line.startswith("using namespace events;"), "Avoid 'using namespace events;', as it prevents proper events extraction"
# Check for '/* EVENT'
if self.re_comment_start.match(line):
state = "parse-comments"
event = Event()
current_tag = None
current_value = None
current_code = ""
continue
# Check for events::send (allow '/* EVENT' to be optional)
if state is None and self.re_events_send.match(line):
state = "parse-command"
event = Event()
current_tag = None
current_value = None
current_code = ""
if state is None:
assert 'events::ID(' not in line or line.startswith('//'), \
"unmatched 'events::ID(' found in line '{:}'".format(line)
continue
if state == "parse-command":
current_code += line
m = self.re_code_end.search(line)
if m:
# extract template arguments
m = self.re_template_args.search(current_code)
if m:
call, template_args, args = m.group(1, 2, 3)
template_args = template_args.split(',')
else:
m = self.re_no_template_args.search(current_code)
if m:
template_args = []
call, args = m.group(1, 2)
else:
raise Exception("Failed to parse code line {:}".format(current_code))
# if event arguments are not specified, use default naming
if len(event.arguments) == 0:
event.set_default_arguments(len(template_args))
# get argument types from template arguments
assert len(template_args) == len(event.arguments), \
"Number of arguments mismatch (args: {:})".format(template_args)
num_args = len(template_args)
for i in range(num_args):
arg_name = event.arguments[i][1]
arg_type = template_args[i].strip()
if arg_type.startswith('events::'):
arg_type = arg_type[8:]
arg_type = arg_type.replace('enums::', '')
event.arguments[i] = (arg_type, arg_name)
#print("method: {}, args: {}, template args: {}".format(call, args, event.arguments))
ignore_event = False
# extract function arguments
args_split = self._parse_arguments(args)
if call == "events::send" or call == "send":
if len(args_split) == 1:
# This is a send call for a generated event
ignore_event = True
else:
assert len(args_split) == num_args + 3, \
"Unexpected Number of arguments for: {:}, " \
"num template args: {:} (missing template args?)" \
.format(args_split, num_args)
m = self.re_event_id.search(args_split[0])
if m:
_, event_name = m.group(1, 2)
else:
raise Exception("Could not extract event ID from {:}".format(args_split[0]))
event.name = event_name
event.message = args_split[2][1:-1]
elif call in ['reporter.healthFailure', 'reporter.armingCheckFailure']:
assert len(args_split) == num_args + 5, \
"Unexpected Number of arguments for: {:}, {:}".format(args_split, num_args)
m = self.re_event_id.search(args_split[2])
if m:
_, event_name = m.group(1, 2)
else:
raise Exception("Could not extract event ID from {:}".format(args_split[2]))
event.name = event_name
event.message = args_split[4][1:-1]
if 'health' in call:
event.group = "health"
else:
event.group = "arming_check"
event.prepend_arguments([('common::navigation_mode_category_t', 'modes'),
('uint8_t', 'health_component_index')])
else:
raise Exception("unknown event method call: {}, args: {}".format(call, args))
if not ignore_event:
event.validate()
# insert
if not event.group in self._events:
self._events[event.group] = []
self._events[event.group].append(event)
state = None
else: # parse-comments
m = self.re_comment_end.search(line)
if m:
line = m.group(1)
last_comment_line = True
else:
last_comment_line = False
m = self.re_comment_content.match(line)
if m:
comment_content = m.group(1)
m = self.re_comment_tag.match(comment_content)
if m:
finalize_current_tag(event, current_tag, current_value)
current_tag, current_value = m.group(1, 2)
elif current_tag is not None:
current_value += "\n"+comment_content
# else: empty line before any tag
elif not last_comment_line:
# Invalid comment line (inside comment, but not starting with
# "*" or "*/".
raise Exception("Excpected a comment, got '{}'".format(line))
if last_comment_line:
finalize_current_tag(event, current_tag, current_value)
state = "parse-command"
return True
def _parse_arguments(self, args):
"""
given a string of arguments, returns a list of strings split into the
arguments, with respecting brackets.
args is expected to be a single line.
Note: comments are not handled, also template arguments.
e.g. "32, test(4,4), \"e(c\", ab" -> ["32", "test(4,4)", "\"e(c\"", "ab"]
"""
args_split = []
start = 0
bracket = 0
in_string = False
for i in range(len(args)):
if in_string and args[i] == "\"" and args[i-1] != "\\":
in_string = False
elif not in_string and args[i] == "\"":
in_string = True
if in_string:
continue
if args[i] in "{([":
bracket += 1
if args[i] in "})]":
bracket -= 1
if bracket == 0 and args[i] == ',':
args_split.append(args[start:i].strip())
start = i + 1
args_split.append(args[start:].strip())
return args_split
-52
View File
@@ -1,52 +0,0 @@
import os
import re
import codecs
import sys
class SourceScanner(object):
"""
Traverses directory tree, reads all source files, and passes their contents
to the Parser.
"""
def ScanDir(self, srcdirs, parser):
"""
Scans provided path and passes all found contents to the parser using
parser.Parse method.
"""
extensions = tuple([".cpp"])
for srcdir in srcdirs:
if os.path.isfile(srcdir):
if not self.ScanFile(srcdir, parser):
return False
else:
for dirname, dirnames, filenames in os.walk(srcdir):
for filename in filenames:
if filename.endswith(extensions):
path = os.path.join(dirname, filename)
try:
if not self.ScanFile(path, parser):
return False
except:
print(("Exception in file %s" % path))
raise
return True
def ScanFile(self, path, parser):
"""
Scans provided file and passes its contents to the parser using
parser.Parse method.
"""
with codecs.open(path, 'r', 'utf-8') as f:
try:
contents = f.read()
except:
contents = ''
print('Failed reading file: %s, skipping content.' % path)
pass
try:
return parser.Parse(contents)
except Exception as e:
print("Exception while parsing file {}".format(path))
raise
-102
View File
@@ -1,102 +0,0 @@
#!/usr/bin/env python
############################################################################
#
# 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.
#
############################################################################
#
# PX4 events processor (main executable file)
#
# This tool scans the PX4 source code for definitions of events.
#
import sys
import os
import argparse
from px4events import srcscanner, srcparser, jsonout
import re
import codecs
def main():
# Parse command line arguments
parser = argparse.ArgumentParser(description="Process events definitions.")
parser.add_argument("-s", "--src-path",
default=["../src"],
metavar="PATH",
nargs='*',
help="one or more paths/files to source files to scan for events")
parser.add_argument("-j", "--json",
nargs='?',
const="events.json",
metavar="FILENAME",
help="Create Json output file"
" (default FILENAME: events.json)")
parser.add_argument('-v', '--verbose',
action='store_true',
help="verbose output")
args = parser.parse_args()
# Check for valid command
if not (args.json):
print("Error: You need to specify at least one output method!")
parser.print_usage()
sys.exit(1)
# Initialize source scanner and parser
scanner = srcscanner.SourceScanner()
parser = srcparser.SourceParser()
# Scan directories, and parse the files
if args.verbose:
print("Scanning source path/files " + str(args.src_path))
# canonicalize + remove duplicates
src_paths = set()
for path in args.src_path:
src_paths.add(os.path.realpath(path))
if not scanner.ScanDir(src_paths, parser):
sys.exit(1)
events = parser.events
# Output to JSON file
if args.json:
if args.verbose: print("Creating Json file " + args.json)
cur_dir = os.path.dirname(os.path.realpath(__file__))
out = jsonout.JsonOutput(events)
out.save(args.json)
if __name__ == "__main__":
main()
-1
View File
@@ -4,7 +4,6 @@ cerberus
coverage
empy>=3.3
jinja2>=2.8
jsonschema
matplotlib>=3.0.*
numpy>=1.13
nunavut>=1.1.0
-1
View File
@@ -44,7 +44,6 @@ in pkgs.mkShell {
coverage
empy
jinja2
jsonschema
matplotlib
numpy
packaging
-23
View File
@@ -1,23 +0,0 @@
#!/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"
-4
View File
@@ -177,10 +177,6 @@ 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/"
+2 -2
View File
@@ -24,10 +24,10 @@ px4_add_board(
#sensors
SYSTEMCMDS
param
perf
#perf
#reboot
#system_time
top
#top
#topic_listener
#uorb
#ver

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