mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-19 22:50:34 +08:00
Compare commits
212 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e64e9e08e | |||
| 984467b83b | |||
| 95b3005679 | |||
| 88e7452492 | |||
| 84b6b472b4 | |||
| 444e5d2d4a | |||
| c0d9e2ac7a | |||
| 5f94eb1493 | |||
| 42bdfe0fb2 | |||
| e468798e91 | |||
| d928a3a8d0 | |||
| 37a6ac5c93 | |||
| a3a19da651 | |||
| 351a9050c3 | |||
| 1c1f8da7d9 | |||
| e4111a03bf | |||
| aa2c47a56b | |||
| 82962acd5c | |||
| d65ddbf810 | |||
| b9667e955d | |||
| 56b59dc155 | |||
| 30d8df7001 | |||
| 99309625e8 | |||
| 19d6e69b0b | |||
| 6d4ec4e623 | |||
| beb5fc5eb6 | |||
| 30bfe0d379 | |||
| 1ef9ee7622 | |||
| 01bcc47fb1 | |||
| 190371c6ee | |||
| e626f8666c | |||
| a95c11d48a | |||
| 72be724b86 | |||
| 357bf024f6 | |||
| e4a16bfc80 | |||
| e878d0c0ef | |||
| 8e8b35dadf | |||
| 133aeb10a6 | |||
| 72955221cb | |||
| 9aa355a08c | |||
| 5c73d24765 | |||
| 05a5bbe120 | |||
| ebd64bfab6 | |||
| 16a144c00f | |||
| de598f3e7e | |||
| 3d6c376b47 | |||
| 904f18f409 | |||
| b6b32c5a94 | |||
| 92fc13d928 | |||
| 57f11c8149 | |||
| c40a38bd88 | |||
| 3143f6bd0a | |||
| 55d8adb35b | |||
| d5ecfe0efe | |||
| d1b660b104 | |||
| 4038eeec3e | |||
| e14216c6c7 | |||
| 80409672b1 | |||
| 6453a1c311 | |||
| 1e49eb419d | |||
| e6cc3d0118 | |||
| 208552fdab | |||
| c67af1479f | |||
| 7563ddd91f | |||
| 05f5ab7988 | |||
| eb9bcb0c28 | |||
| 99824c445c | |||
| c8738e3a0d | |||
| 57b3c26ab0 | |||
| 1d96de5cf6 | |||
| e195a3c0c6 | |||
| 485ec14246 | |||
| 6889443bd7 | |||
| a37e3e7b06 | |||
| ce8dd2ba48 | |||
| 0c2a8266bc | |||
| 39ab1f5809 | |||
| 013856fac1 | |||
| ec9dce2e89 | |||
| 70826c5af4 | |||
| db591f25a6 | |||
| 3f1740cb46 | |||
| b4687c27fe | |||
| a3f398943e | |||
| 7f78ae449a | |||
| 8b780f2a96 | |||
| b405a1aa49 | |||
| 45968c614e | |||
| c0a56ce268 | |||
| f5fd369ce8 | |||
| 1128ada90a | |||
| 15bb8c0f2e | |||
| c6aa82441f | |||
| 88c5565a29 | |||
| decf1ac0a8 | |||
| 351f2a8287 | |||
| 8fe5ce4f65 | |||
| 327b7e611e | |||
| 4a18baa4bd | |||
| 83b832fdce | |||
| 2235c40e28 | |||
| 877f37d79e | |||
| b19b0d0163 | |||
| 3b2b60adde | |||
| 8dc73c4621 | |||
| 258fc786dc | |||
| 17535c288c | |||
| 632596c1ea | |||
| 618724b409 | |||
| f000238987 | |||
| f82785a322 | |||
| f8c9be087b | |||
| 715a1ff701 | |||
| 9ebfed010f | |||
| 9e2e888f5e | |||
| 2f52926972 | |||
| 69aa8689c0 | |||
| f5edff2647 | |||
| 672b29d555 | |||
| 03528a6200 | |||
| bca0be47bc | |||
| 9511248514 | |||
| f5d9ac4526 | |||
| 56c794108d | |||
| 2dcb525cd9 | |||
| 42fa41e601 | |||
| 1fa5136e30 | |||
| 392d445783 | |||
| e127ada07b | |||
| 87c697a0d6 | |||
| 81764c43a1 | |||
| 02ab5e0704 | |||
| e776aca9ef | |||
| 6b7aed3d44 | |||
| 95a35c972d | |||
| 0be6069b83 | |||
| 66b451e61f | |||
| 5568afbb12 | |||
| 6b7b34a71a | |||
| 2a077181d9 | |||
| a8bf47e606 | |||
| 646f711b1a | |||
| 0d6cb46c83 | |||
| afa085da7f | |||
| 745fa3720e | |||
| e18da100ed | |||
| c1cb48c2ea | |||
| 39e04d9712 | |||
| 724f5a97a9 | |||
| a6502c9f2b | |||
| dccfcb85c1 | |||
| a617e9c54b | |||
| f275085e84 | |||
| 288e3ae74a | |||
| 24665f10f2 | |||
| a36c922fc0 | |||
| 77d6c722a7 | |||
| bae413a332 | |||
| abe0ca1307 | |||
| f5193bb155 | |||
| 2307d4aa22 | |||
| 018ec97c41 | |||
| bfa72a1bee | |||
| b7e2a9c320 | |||
| 4d465533b5 | |||
| 03183ccacf | |||
| 0196241c10 | |||
| 3557644010 | |||
| 46b09acf0b | |||
| 4348dcce2a | |||
| a6d2c2cf5e | |||
| e5503480e3 | |||
| e739afe362 | |||
| e34993969b | |||
| 05489f9ecf | |||
| c26b699f8a | |||
| 98d8935034 | |||
| 8d1b0e45fa | |||
| eb70c9f6f3 | |||
| fdf7867a3e | |||
| c99f56f010 | |||
| 73e5ff109c | |||
| 7e79d65aa4 | |||
| 439670444f | |||
| a6a913bf25 | |||
| 54a351639c | |||
| d00ad1b815 | |||
| 20d0661e87 | |||
| 173407581b | |||
| 7ed90c6d0c | |||
| a07d10704b | |||
| 18d89e4bc1 | |||
| fd267fb9a5 | |||
| 18f0311161 | |||
| 24b1ef93b2 | |||
| c6870006c7 | |||
| d9ae2ed7ac | |||
| 2a48c1cb18 | |||
| 65ad6afb08 | |||
| 4632fbd600 | |||
| 69aebe650b | |||
| 53b9e66c66 | |||
| 957a06a780 | |||
| 8fe65c6722 | |||
| 3303323971 | |||
| 053d3020b0 | |||
| cfb24869e9 | |||
| 4396b6e9f6 | |||
| 6929493134 | |||
| a28ad8e845 | |||
| 1ceca8f2cf | |||
| ffe0ec27e6 |
@@ -9,7 +9,7 @@ pipeline {
|
||||
script {
|
||||
def build_nodes = [:]
|
||||
def docker_images = [
|
||||
armhf: "px4io/px4-dev-armhf:2022-08-12",
|
||||
armhf: "px4io/px4-dev-armhf:2023-06-26",
|
||||
arm64: "px4io/px4-dev-aarch64:2022-08-12",
|
||||
base: "px4io/px4-dev-ros2-foxy:2022-08-12",
|
||||
nuttx: "px4io/px4-dev-nuttx-focal:2022-08-12",
|
||||
@@ -40,6 +40,8 @@ pipeline {
|
||||
"ark_can-flow_default",
|
||||
"ark_can-gps_canbootloader",
|
||||
"ark_can-gps_default",
|
||||
"ark_cannode_canbootloader",
|
||||
"ark_cannode_default",
|
||||
"ark_can-rtk-gps_canbootloader",
|
||||
"ark_can-rtk-gps_default",
|
||||
"ark_fmu-v6x_bootloader",
|
||||
@@ -53,8 +55,10 @@ pipeline {
|
||||
"cuav_nora_default",
|
||||
"cuav_x7pro_default",
|
||||
"cubepilot_cubeorange_default",
|
||||
"cubepilot_cubeorangeplus_default",
|
||||
"cubepilot_cubeyellow_default",
|
||||
"diatone_mamba-f405-mk2_default",
|
||||
"flywoo_gn-f405_default",
|
||||
"freefly_can-rtk-gps_canbootloader",
|
||||
"freefly_can-rtk-gps_default",
|
||||
"holybro_can-gps-v1_canbootloader",
|
||||
@@ -72,7 +76,7 @@ pipeline {
|
||||
"matek_h743_default",
|
||||
"modalai_fc-v1_default",
|
||||
"modalai_fc-v2_default",
|
||||
"modalai_voxl2-io_default",
|
||||
"mro_ctrl-zero-classic_default",
|
||||
"mro_ctrl-zero-f7_default",
|
||||
"mro_ctrl-zero-f7-oem_default",
|
||||
"mro_ctrl-zero-h7-oem_default",
|
||||
@@ -85,6 +89,7 @@ pipeline {
|
||||
"nxp_fmuk66-v3_default",
|
||||
"nxp_fmuk66-v3_socketcan",
|
||||
"nxp_fmurt1062-v1_default",
|
||||
"nxp_mr-canhubk3_default",
|
||||
"nxp_ucans32k146_canbootloader",
|
||||
"nxp_ucans32k146_default",
|
||||
"omnibus_f4sd_default",
|
||||
@@ -164,7 +169,7 @@ pipeline {
|
||||
}
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '5', artifactDaysToKeepStr: '14'))
|
||||
timeout(time: 90, unit: 'MINUTES')
|
||||
timeout(time: 120, unit: 'MINUTES')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -12,7 +12,7 @@ pipeline {
|
||||
stage("build cubepilot_cubeorange_test") {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
image 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ pipeline {
|
||||
stage("build cuav_x7pro_test") {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
image 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ pipeline {
|
||||
stage("build px4_fmu-v4_test") {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
image 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
@@ -238,7 +238,7 @@ pipeline {
|
||||
stage("build px4_fmu-v4pro_test") {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
image 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
@@ -312,7 +312,7 @@ pipeline {
|
||||
stage("build px4_fmu-v5_debug") {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
image 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
@@ -362,7 +362,7 @@ pipeline {
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_stress"'
|
||||
|
||||
// test dataman
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman" --ignore-stdout-errors'
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests file" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests"'
|
||||
@@ -403,7 +403,7 @@ pipeline {
|
||||
stage("build px4_fmu-v5_stackcheck") {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
image 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
@@ -449,7 +449,7 @@ pipeline {
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests latency_test" || true'
|
||||
|
||||
// test dataman
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman" --ignore-stdout-errors'
|
||||
}
|
||||
}
|
||||
stage("status") {
|
||||
@@ -486,7 +486,7 @@ pipeline {
|
||||
stage("build px4_fmu-v5_test") {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
image 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
@@ -560,7 +560,7 @@ pipeline {
|
||||
stage("build nxp_fmuk66-v3_test") {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
image 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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-09-08",
|
||||
"image": "px4io/px4-dev-nuttx-focal:2022-08-12",
|
||||
|
||||
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: 🐛 Bug report
|
||||
description: Create a report to help us improve
|
||||
title: "[Bug]: "
|
||||
title: "[Bug] "
|
||||
labels: ["bug-report"]
|
||||
body:
|
||||
- type: textarea
|
||||
@@ -44,14 +44,13 @@ body:
|
||||
- Share the link to the log (Copy and paste the URL of the log)
|
||||
placeholder: |
|
||||
# PASTE HERE THE LINK TO THE LOG
|
||||
render: txt
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
# Setup / Versions
|
||||
## Setup
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
@@ -60,7 +59,6 @@ body:
|
||||
Which version of PX4 are you using?
|
||||
placeholder: |
|
||||
# If you don't know the version, paste the output of `ver all` in the MAVLink Shell of QGC
|
||||
render: txt
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
name: 🚀 Feature Request
|
||||
description: Suggest an idea for this project
|
||||
labels: [feature-request"]
|
||||
labels: ["feature-request"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Please note that feature requests are not 'fire and forget'.**
|
||||
## Please note that feature requests are not 'fire and forget'
|
||||
It is a lot more likely that the feature you would like to have will be implemented if you keep watching your feature request, and provide more details to developers looking into implementing your feature, and help them with testing.
|
||||
|
||||
- type: textarea
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20">
|
||||
<linearGradient id="smooth" x2="0" y2="100%">
|
||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||
<stop offset="1" stop-opacity=".1"/>
|
||||
</linearGradient>
|
||||
|
||||
<mask id="round">
|
||||
<rect width="90" height="20" rx="3" fill="#fff"/>
|
||||
</mask>
|
||||
|
||||
<g mask="url(#round)">
|
||||
<rect width="42" height="20" fill="#555"/>
|
||||
<rect x="42" width="48" height="20" fill="#E01563"/>
|
||||
<rect width="90" height="20" fill="url(#smooth)"/>
|
||||
</g>
|
||||
|
||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||
<text x="22" y="15" fill="#010101" fill-opacity=".3">slack</text>
|
||||
<text x="22" y="14">slack</text>
|
||||
<text x="65" y="15" fill="#010101" fill-opacity=".3">Join us!</text>
|
||||
<text x="65" y="14">Join us!</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 894 B |
@@ -1,15 +0,0 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 90
|
||||
# Number of days of inactivity before a stale issue is closed, or `false` to disable
|
||||
daysUntilClose: false
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. Thank you for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
"parameters_metadata",
|
||||
]
|
||||
container:
|
||||
image: px4io/px4-dev-nuttx-focal:2021-09-08
|
||||
image: px4io/px4-dev-nuttx-focal:2022-08-12
|
||||
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
name: Linux Targets
|
||||
name: Compile Linux Targets
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'stable'
|
||||
- 'beta'
|
||||
- 'release/*'
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
@@ -11,7 +14,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-armhf:2021-09-08
|
||||
container: px4io/px4-dev-armhf:2023-06-26
|
||||
strategy:
|
||||
matrix:
|
||||
config: [
|
||||
@@ -24,7 +27,8 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
token: ${{secrets.ACCESS_TOKEN}}
|
||||
|
||||
- name: ownership workaround
|
||||
run: git config --system --add safe.directory '*'
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_timestamp
|
||||
shell: cmake -P {0}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
name: Linux ARM64 Targets
|
||||
name: Compile Linux ARM64 Targets
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'stable'
|
||||
- 'beta'
|
||||
- 'release/*'
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
@@ -11,7 +14,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-aarch64:2021-09-08
|
||||
container: px4io/px4-dev-aarch64:2022-08-12
|
||||
strategy:
|
||||
matrix:
|
||||
config: [
|
||||
|
||||
@@ -10,13 +10,12 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-10.15
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
config: [
|
||||
px4_fmu-v5_default,
|
||||
px4_sitl
|
||||
#tests, # includes px4_sitl
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
name: Nuttx Targets
|
||||
name: Compile Nuttx Targets
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'stable'
|
||||
- 'beta'
|
||||
- 'release/*'
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
@@ -11,7 +14,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-nuttx-focal:2021-09-08
|
||||
container: px4io/px4-dev-nuttx-focal:2022-08-12
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -24,12 +24,15 @@ jobs:
|
||||
needs: enumerate_targets
|
||||
strategy:
|
||||
matrix: ${{fromJson(needs.enumerate_targets.outputs.matrix)}}
|
||||
container: px4io/px4-dev-${{ matrix.container }}:2021-09-08
|
||||
container: ${{ matrix.container }}
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
token: ${{secrets.ACCESS_TOKEN}}
|
||||
|
||||
- name: ownership workaround
|
||||
run: git config --system --add safe.directory '*'
|
||||
|
||||
- name: make ${{matrix.target}}
|
||||
run: make ${{matrix.target}}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
"failsafe_web",
|
||||
]
|
||||
container:
|
||||
image: px4io/px4-dev-nuttx-focal:2021-09-08
|
||||
image: px4io/px4-dev-nuttx-focal:2022-08-12
|
||||
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
@@ -103,7 +103,7 @@ jobs:
|
||||
|
||||
uorb_graph:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-nuttx-focal:2021-09-08
|
||||
container: px4io/px4-dev-nuttx-focal:2022-08-12
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: 'Close stale issues and PRs'
|
||||
name: 'Handle stale issues and PRs'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
@@ -7,14 +7,10 @@ jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v4.1.1
|
||||
- uses: actions/stale@v8
|
||||
with:
|
||||
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
|
||||
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
|
||||
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
|
||||
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
|
||||
days-before-issue-stale: 30
|
||||
days-before-pr-stale: 45
|
||||
days-before-issue-close: 5
|
||||
days-before-pr-close: 10
|
||||
debug-only: true
|
||||
days-before-stale: 30
|
||||
days-before-close: -1
|
||||
stale-issue-label: 'stale'
|
||||
stale-pr-label: 'stale'
|
||||
remove-stale-when-updated: true
|
||||
|
||||
Vendored
+2
-2
@@ -94,7 +94,7 @@ pipeline {
|
||||
|
||||
stage('failsafe docs') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-nuttx-focal:2021-08-18' }
|
||||
docker { image 'px4io/px4-dev-nuttx-focal:2022-08-12' }
|
||||
}
|
||||
steps {
|
||||
sh '''#!/bin/bash -l
|
||||
@@ -125,7 +125,7 @@ pipeline {
|
||||
stage('uORB graphs') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-08-18'
|
||||
image 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name 6DoF Omnicopter SITL
|
||||
#
|
||||
# @type Quadrotor Wide
|
||||
#
|
||||
# @maintainer Jaeyoung Lim <jalim@ethz.ch>
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
PX4_SIMULATOR=${PX4_SIMULATOR:=gz}
|
||||
PX4_GZ_WORLD=${PX4_GZ_WORLD:=default}
|
||||
PX4_SIM_MODEL=${PX4_SIM_MODEL:=omnicopter}
|
||||
|
||||
param set-default CA_AIRFRAME 0
|
||||
|
||||
param set-default CA_ROTOR_COUNT 8
|
||||
param set-default CA_R_REV 255
|
||||
|
||||
param set-default CA_ROTOR0_PX 0.14435
|
||||
param set-default CA_ROTOR0_PY -0.14435
|
||||
param set-default CA_ROTOR0_PZ -0.14435
|
||||
param set-default CA_ROTOR0_KM 0.05 # CCW
|
||||
param set-default CA_ROTOR0_AX -0.788675
|
||||
param set-default CA_ROTOR0_AY -0.211325
|
||||
param set-default CA_ROTOR0_AZ -0.57735
|
||||
|
||||
param set-default CA_ROTOR1_PX -0.14435
|
||||
param set-default CA_ROTOR1_PY -0.14435
|
||||
param set-default CA_ROTOR1_PZ -0.14435
|
||||
param set-default CA_ROTOR1_KM 0.05
|
||||
param set-default CA_ROTOR1_AX 0.211325
|
||||
param set-default CA_ROTOR1_AY -0.788675
|
||||
param set-default CA_ROTOR1_AZ 0.57735
|
||||
|
||||
param set-default CA_ROTOR2_PX 0.14435
|
||||
param set-default CA_ROTOR2_PY 0.14435
|
||||
param set-default CA_ROTOR2_PZ -0.14435
|
||||
param set-default CA_ROTOR2_KM 0.05
|
||||
param set-default CA_ROTOR2_AX -0.211325
|
||||
param set-default CA_ROTOR2_AY 0.788675
|
||||
param set-default CA_ROTOR2_AZ 0.57735
|
||||
|
||||
param set-default CA_ROTOR3_PX -0.14435
|
||||
param set-default CA_ROTOR3_PY 0.14435
|
||||
param set-default CA_ROTOR3_PZ -0.14435
|
||||
param set-default CA_ROTOR3_KM 0.05
|
||||
param set-default CA_ROTOR3_AX 0.788675
|
||||
param set-default CA_ROTOR3_AY 0.211325
|
||||
param set-default CA_ROTOR3_AZ -0.57735
|
||||
|
||||
param set-default CA_ROTOR4_PX 0.14435
|
||||
param set-default CA_ROTOR4_PY -0.14435
|
||||
param set-default CA_ROTOR4_PZ 0.14435
|
||||
param set-default CA_ROTOR4_KM 0.05
|
||||
param set-default CA_ROTOR4_AX 0.788675
|
||||
param set-default CA_ROTOR4_AY 0.211325
|
||||
param set-default CA_ROTOR4_AZ -0.57735
|
||||
|
||||
param set-default CA_ROTOR5_PX -0.14435
|
||||
param set-default CA_ROTOR5_PY -0.14435
|
||||
param set-default CA_ROTOR5_PZ 0.14435
|
||||
param set-default CA_ROTOR5_KM 0.05
|
||||
param set-default CA_ROTOR5_AX -0.211325
|
||||
param set-default CA_ROTOR5_AY 0.788675
|
||||
param set-default CA_ROTOR5_AZ 0.57735
|
||||
|
||||
param set-default CA_ROTOR6_PX 0.14435
|
||||
param set-default CA_ROTOR6_PY 0.14435
|
||||
param set-default CA_ROTOR6_PZ 0.14435
|
||||
param set-default CA_ROTOR6_KM 0.05
|
||||
param set-default CA_ROTOR6_AX 0.211325
|
||||
param set-default CA_ROTOR6_AY -0.788675
|
||||
param set-default CA_ROTOR6_AZ 0.57735
|
||||
|
||||
param set-default CA_ROTOR7_PX -0.14435
|
||||
param set-default CA_ROTOR7_PY 0.14435
|
||||
param set-default CA_ROTOR7_PZ 0.14435
|
||||
param set-default CA_ROTOR7_KM 0.05
|
||||
param set-default CA_ROTOR7_AX -0.788675
|
||||
param set-default CA_ROTOR7_AY -0.211325
|
||||
param set-default CA_ROTOR7_AZ -0.57735
|
||||
|
||||
param set-default SIM_GZ_EN 1
|
||||
param set-default SENS_EN_GPSSIM 1
|
||||
param set-default SENS_EN_BAROSIM 0
|
||||
param set-default SENS_EN_MAGSIM 1
|
||||
|
||||
param set-default SIM_GZ_EC_FUNC1 101
|
||||
param set-default SIM_GZ_EC_FUNC2 102
|
||||
param set-default SIM_GZ_EC_FUNC3 103
|
||||
param set-default SIM_GZ_EC_FUNC4 104
|
||||
param set-default SIM_GZ_EC_FUNC5 105
|
||||
param set-default SIM_GZ_EC_FUNC6 106
|
||||
param set-default SIM_GZ_EC_FUNC7 107
|
||||
param set-default SIM_GZ_EC_FUNC8 108
|
||||
|
||||
param set-default SIM_GZ_EC_MIN1 0
|
||||
param set-default SIM_GZ_EC_MIN2 0
|
||||
param set-default SIM_GZ_EC_MIN3 0
|
||||
param set-default SIM_GZ_EC_MIN4 0
|
||||
param set-default SIM_GZ_EC_MIN5 0
|
||||
param set-default SIM_GZ_EC_MIN6 0
|
||||
param set-default SIM_GZ_EC_MIN7 0
|
||||
param set-default SIM_GZ_EC_MIN8 0
|
||||
|
||||
param set-default SIM_GZ_EC_MAX1 1100
|
||||
param set-default SIM_GZ_EC_MAX2 1100
|
||||
param set-default SIM_GZ_EC_MAX3 1100
|
||||
param set-default SIM_GZ_EC_MAX4 1100
|
||||
param set-default SIM_GZ_EC_MAX5 1100
|
||||
param set-default SIM_GZ_EC_MAX6 1100
|
||||
param set-default SIM_GZ_EC_MAX7 1100
|
||||
param set-default SIM_GZ_EC_MAX8 1100
|
||||
# disable MC desaturation which improves attitude tracking
|
||||
param set-default CA_METHOD 0
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
|
||||
@@ -81,6 +81,8 @@ px4_add_romfs_files(
|
||||
6011_gazebo-classic_typhoon_h480
|
||||
6011_gazebo-classic_typhoon_h480.post
|
||||
|
||||
8011_gz_omnicopter
|
||||
|
||||
10015_gazebo-classic_iris
|
||||
10016_none_iris
|
||||
10017_jmavsim_iris
|
||||
@@ -94,4 +96,6 @@ px4_add_romfs_files(
|
||||
|
||||
17001_flightgear_tf-g1
|
||||
17002_flightgear_tf-g2
|
||||
|
||||
# [22000, 22999] Reserve for custom models
|
||||
)
|
||||
|
||||
@@ -59,7 +59,7 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" -eq "1" ]; th
|
||||
fi
|
||||
|
||||
# look for running ${gz_command} gazebo world
|
||||
gz_world=$( ${gz_command} topic -l | grep -m 1 -e "/world/.*/clock" | sed 's/\/world\///g; s/\/clock//g' )
|
||||
gz_world=$( ${gz_command} topic -l | grep -m 1 -e "^/world/.*/clock" | sed 's/\/world\///g; s/\/clock//g' )
|
||||
|
||||
# shellcheck disable=SC2153
|
||||
if [ -z "${gz_world}" ] && [ -n "${PX4_GZ_WORLDS}" ] && [ -n "${PX4_GZ_WORLD}" ]; then
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
# @maintainer Andreas Antener <andreas@uaventure.com>
|
||||
#
|
||||
# @board bitcraze_crazyflie exclude
|
||||
# @board diatone_mamba-f405-mk2 exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
@@ -34,9 +34,9 @@ param set-default CA_ROTOR3_PX -0.25
|
||||
param set-default CA_ROTOR3_PY 0.25
|
||||
param set-default CA_ROTOR3_KM -0.05
|
||||
|
||||
param set-default PWM_AUX_FUNC1 101
|
||||
param set-default PWM_AUX_FUNC2 102
|
||||
param set-default PWM_AUX_FUNC3 103
|
||||
param set-default PWM_AUX_FUNC4 104
|
||||
param set-default PWM_AUX_TIM0 -4
|
||||
param set-default PWM_MAIN_FUNC1 101
|
||||
param set-default PWM_MAIN_FUNC2 102
|
||||
param set-default PWM_MAIN_FUNC3 103
|
||||
param set-default PWM_MAIN_FUNC4 104
|
||||
param set-default PWM_MAIN_TIM0 -4
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# @board px4_fmu-v4pro exclude
|
||||
# @board px4_fmu-v5 exclude
|
||||
# @board px4_fmu-v5x exclude
|
||||
# @board diatone_mamba-f405-mk2 exclude
|
||||
#
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# @board px4_fmu-v4pro exclude
|
||||
# @board px4_fmu-v5 exclude
|
||||
# @board px4_fmu-v5x exclude
|
||||
# @board diatone_mamba-f405-mk2 exclude
|
||||
#
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
|
||||
@@ -255,6 +255,7 @@ else
|
||||
rgbled start -X -q
|
||||
rgbled_ncp5623c start -X -q
|
||||
rgbled_lp5562 start -X -q
|
||||
rgbled_is31fl3195 start -X -q
|
||||
|
||||
#
|
||||
# Override parameters from user configuration file.
|
||||
@@ -329,6 +330,12 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# PPS capture driver
|
||||
if param greater -s INPUT_CAP_ENABLE 0
|
||||
then
|
||||
input_capture start
|
||||
fi
|
||||
|
||||
#
|
||||
# Sensors System (start before Commander so Preflight checks are properly run).
|
||||
# Commander needs to be this early for in-air-restarts.
|
||||
|
||||
@@ -39,7 +39,7 @@ def print_line(line):
|
||||
print('{0}'.format(line), end='')
|
||||
|
||||
|
||||
def do_nsh_cmd(port_url, baudrate, cmd):
|
||||
def do_nsh_cmd(port_url, baudrate, cmd, ignore_stdout_errors=False):
|
||||
ser = serial.serial_for_url(url=port_url, baudrate=baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1, xonxoff=False, rtscts=False, dsrdtr=False, inter_byte_timeout=1)
|
||||
|
||||
timeout_start = time.monotonic()
|
||||
@@ -106,7 +106,7 @@ def do_nsh_cmd(port_url, baudrate, cmd):
|
||||
if success_cmd in serial_line:
|
||||
sys.exit(return_code)
|
||||
else:
|
||||
if "ERROR " in serial_line:
|
||||
if "ERROR " in serial_line and not ignore_stdout_errors:
|
||||
return_code = -1
|
||||
|
||||
print_line(serial_line)
|
||||
@@ -148,6 +148,8 @@ def main():
|
||||
parser.add_argument('--device', "-d", nargs='?', default=default_device, help='', required=device_required)
|
||||
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int, help="serial port baud rate (default=57600)", default=57600)
|
||||
parser.add_argument("--cmd", "-c", dest="cmd", help="Command to run")
|
||||
parser.add_argument('--ignore-stdout-errors', action='store_true',
|
||||
help='Ignore errors printed to stdout')
|
||||
args = parser.parse_args()
|
||||
|
||||
tmp_file = "{0}/pyserial_spy_file.txt".format(tempfile.gettempdir())
|
||||
@@ -155,7 +157,7 @@ def main():
|
||||
|
||||
print("pyserial url: {0}".format(port_url))
|
||||
|
||||
do_nsh_cmd(port_url, args.baudrate, args.cmd)
|
||||
do_nsh_cmd(port_url, args.baudrate, args.cmd, args.ignore_stdout_errors)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
+5
-5
@@ -4,16 +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-09-08"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2022-08-12"
|
||||
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-08-18"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2023-06-26"
|
||||
elif [[ $@ =~ .*pilotpi.arm64 ]]; then
|
||||
# scumaker_pilotpi_arm64
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-aarch64:latest"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-aarch64:2022-08-12"
|
||||
elif [[ $@ =~ .*navio2.* ]] || [[ $@ =~ .*raspberry.* ]] || [[ $@ =~ .*bebop.* ]]; then
|
||||
# posix_rpi_cross, posix_bebop_default
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2021-08-18"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2023-06-26"
|
||||
elif [[ $@ =~ .*clang.* ]] || [[ $@ =~ .*scan-build.* ]]; then
|
||||
# clang tools
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-clang:2021-02-04"
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# otherwise default to nuttx
|
||||
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-09-08"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2022-08-12"
|
||||
fi
|
||||
|
||||
# docker hygiene
|
||||
|
||||
@@ -56,11 +56,14 @@ def perform_imu_checks(
|
||||
# perform the vibration check
|
||||
imu_status['imu_vibration_check'] = 'Pass'
|
||||
for imu_vibr_metric in ['imu_coning', 'imu_hfgyro', 'imu_hfaccel']:
|
||||
mean_metric = '{:s}_mean'.format(imu_vibr_metric)
|
||||
peak_metric = '{:s}_peak'.format(imu_vibr_metric)
|
||||
if imu_metrics[mean_metric] > check_levels['{:s}_warn'.format(mean_metric)] \
|
||||
or imu_metrics[peak_metric] > check_levels['{:s}_warn'.format(peak_metric)]:
|
||||
imu_status['imu_vibration_check'] = 'Warning'
|
||||
mean_metric = '{:s}_mean_warn'.format(imu_vibr_metric)
|
||||
peak_metric = '{:s}_peak_warn'.format(imu_vibr_metric)
|
||||
mean_key = '{:s}_mean'.format(imu_vibr_metric)
|
||||
peak_key = '{:s}_peak'.format(imu_vibr_metric)
|
||||
if mean_key in imu_metrics and peak_key in imu_metrics:
|
||||
if imu_metrics[mean_key] > check_levels[mean_metric] \
|
||||
or imu_metrics[peak_key] > check_levels[peak_metric]:
|
||||
imu_status['imu_vibration_check'] = 'Warning'
|
||||
|
||||
if imu_status['imu_vibration_check'] == 'Warning':
|
||||
print('IMU vibration check warning.')
|
||||
|
||||
@@ -104,9 +104,9 @@ def calculate_innov_fail_metrics(
|
||||
|
||||
# calculate innovation check fail metrics
|
||||
for signal_id, signal, result in [('posv', 'reject_ver_pos', 'hgt_fail_percentage'),
|
||||
('magx', 'reject_mag_x', 'magx_fail_percentage'),
|
||||
('magy', 'reject_mag_y', 'magy_fail_percentage'),
|
||||
('magz', 'reject_mag_z', 'magz_fail_percentage'),
|
||||
('magx', 'fs_bad_mag_x', 'magx_fail_percentage'),
|
||||
('magy', 'fs_bad_mag_y', 'magy_fail_percentage'),
|
||||
('magz', 'fs_bad_mag_z', 'magz_fail_percentage'),
|
||||
('yaw', 'reject_yaw', 'yaw_fail_percentage'),
|
||||
('velh', 'reject_hor_vel', 'vel_fail_percentage'),
|
||||
('velv', 'reject_ver_vel', 'vel_fail_percentage'),
|
||||
|
||||
@@ -222,7 +222,7 @@ def create_pdf_report(ulog: ULog, multi_instance: int, output_plot_filename: str
|
||||
data_plot = CheckFlagsPlot(
|
||||
status_flags_time, estimator_status_flags, [['reject_hor_vel', 'reject_hor_pos'], ['reject_ver_vel', 'reject_ver_pos',
|
||||
'reject_hagl'],
|
||||
['reject_mag_x', 'reject_mag_y', 'reject_mag_z',
|
||||
['fs_bad_mag_x', 'fs_bad_mag_y', 'fs_bad_mag_z',
|
||||
'reject_yaw'], ['reject_airspeed'], ['reject_sideslip'],
|
||||
['reject_optflow_x',
|
||||
'reject_optflow_y']], x_label='time (sec)',
|
||||
|
||||
@@ -61,18 +61,19 @@ def process_target(px4board_file, target_name):
|
||||
|
||||
if platform not in excluded_platforms:
|
||||
# get the container based on the platform and toolchain
|
||||
container = platform
|
||||
if platform == 'posix':
|
||||
container = 'base-focal'
|
||||
container = 'px4io/px4-dev-base-focal:2021-09-08'
|
||||
if toolchain:
|
||||
if toolchain.startswith('aarch64'):
|
||||
container = 'aarch64'
|
||||
container = 'px4io/px4-dev-aarch64:2022-08-12'
|
||||
elif toolchain == 'arm-linux-gnueabihf':
|
||||
container = 'armhf'
|
||||
container = 'px4io/px4-dev-armhf:2023-06-26'
|
||||
else:
|
||||
if verbose: print(f'possibly unmatched toolchain: {toolchain}')
|
||||
if verbose: print(f'unmatched toolchain: {toolchain}')
|
||||
elif platform == 'nuttx':
|
||||
container = 'nuttx-focal'
|
||||
container = 'px4io/px4-dev-nuttx-focal:2022-08-12'
|
||||
else:
|
||||
if verbose: print(f'unmatched platform: {platform}')
|
||||
|
||||
ret = {'target': target_name, 'container': container}
|
||||
|
||||
@@ -113,4 +114,3 @@ extra_args = {}
|
||||
if args.pretty:
|
||||
extra_args['indent'] = 2
|
||||
print(json.dumps(github_action_config, **extra_args))
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
symforce>=0.5.0
|
||||
symforce>=0.9.0
|
||||
|
||||
Submodule Tools/simulation/gazebo-classic/sitl_gazebo-classic updated: 0d53638452...20ded0757b
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0"?>
|
||||
<model>
|
||||
<name>Omnicopter</name>
|
||||
<version>1.0</version>
|
||||
<sdf version='1.9'>model.sdf</sdf>
|
||||
|
||||
<author>
|
||||
<name>Jaeyoung Lim</name>
|
||||
<email>jalim@ethz.ch</email>
|
||||
</author>
|
||||
|
||||
<description>
|
||||
Omnicopter model for over actuated system
|
||||
</description>
|
||||
</model>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sdf version='1.9'>
|
||||
<include>
|
||||
<name>omnicopter</name>
|
||||
<pose>0 0 0 0 0 0</pose>
|
||||
<uri>https://fuel.gazebosim.org/1.0/PX4/models/Omnicopter</uri>
|
||||
</include>
|
||||
</sdf>
|
||||
@@ -11,6 +11,7 @@
|
||||
<plugin name='gz::sim::systems::Contact' filename='gz-sim-contact-system'/>
|
||||
<plugin name='gz::sim::systems::Imu' filename='gz-sim-imu-system'/>
|
||||
<plugin name='gz::sim::systems::AirPressure' filename='gz-sim-air-pressure-system'/>
|
||||
<plugin name='gz::sim::systems::ApplyLinkWrench' filename='gz-sim-apply-link-wrench-system'/>
|
||||
<plugin name='gz::sim::systems::Sensors' filename='gz-sim-sensors-system'>
|
||||
<render_engine>ogre2</render_engine>
|
||||
</plugin>
|
||||
|
||||
@@ -291,7 +291,6 @@ CONFIG_UART4_RXBUFSIZE=600
|
||||
CONFIG_UART4_TXBUFSIZE=1500
|
||||
CONFIG_UART5_IFLOWCONTROL=y
|
||||
CONFIG_UART5_OFLOWCONTROL=y
|
||||
CONFIG_UART7_RXBUFSIZE=1500
|
||||
CONFIG_UART5_RXDMA=y
|
||||
CONFIG_UART5_TXBUFSIZE=10000
|
||||
CONFIG_UART5_TXDMA=y
|
||||
|
||||
@@ -140,15 +140,7 @@
|
||||
|
||||
#define PX4_PWM_ALTERNATE_RANGES
|
||||
#define PWM_LOWEST_MIN 0
|
||||
#define PWM_MOTOR_OFF 0
|
||||
#define PWM_SERVO_STOP 0
|
||||
#define PWM_DEFAULT_MIN 20
|
||||
#define PWM_HIGHEST_MIN 0
|
||||
#define PWM_HIGHEST_MAX 255
|
||||
#define PWM_DEFAULT_MAX 255
|
||||
#define PWM_LOWEST_MAX 255
|
||||
#define PWM_DEFAULT_TRIM 1500
|
||||
|
||||
|
||||
/* High-resolution timer */
|
||||
#define HRT_TIMER 8 /* use timer8 for the HRT */
|
||||
|
||||
@@ -141,15 +141,7 @@
|
||||
|
||||
#define PX4_PWM_ALTERNATE_RANGES
|
||||
#define PWM_LOWEST_MIN 0
|
||||
#define PWM_MOTOR_OFF 0
|
||||
#define PWM_SERVO_STOP 0
|
||||
#define PWM_DEFAULT_MIN 20
|
||||
#define PWM_HIGHEST_MIN 0
|
||||
#define PWM_HIGHEST_MAX 255
|
||||
#define PWM_DEFAULT_MAX 255
|
||||
#define PWM_LOWEST_MAX 255
|
||||
#define PWM_DEFAULT_TRIM 1500
|
||||
|
||||
|
||||
/* High-resolution timer */
|
||||
#define HRT_TIMER 8 /* use timer8 for the HRT */
|
||||
|
||||
@@ -23,6 +23,8 @@ CONFIG_MODULES_COMMANDER=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
CONFIG_MODULES_DATAMAN=y
|
||||
CONFIG_MODULES_EKF2=y
|
||||
# CONFIG_EKF2_GNSS_YAW is not set
|
||||
# CONFIG_EKF2_SIDESLIP is not set
|
||||
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
@@ -36,7 +38,6 @@ CONFIG_MODULES_NAVIGATOR=y
|
||||
CONFIG_MODULES_RC_UPDATE=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
CONFIG_SYSTEMCMDS_DMESG=y
|
||||
CONFIG_SYSTEMCMDS_MFT=y
|
||||
CONFIG_SYSTEMCMDS_MTD=y
|
||||
CONFIG_SYSTEMCMDS_NSHTERM=y
|
||||
CONFIG_SYSTEMCMDS_PARAM=y
|
||||
|
||||
@@ -10,8 +10,10 @@ CONFIG_BOARD_SERIAL_RC="/dev/ttyS4"
|
||||
CONFIG_DRIVERS_ADC_BOARD_ADC=y
|
||||
CONFIG_DRIVERS_BAROMETER_BMP280=y
|
||||
CONFIG_DRIVERS_DSHOT=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y
|
||||
CONFIG_DRIVERS_OSD_ATXXXX=y
|
||||
CONFIG_DRIVERS_PWM_OUT=y
|
||||
CONFIG_DRIVERS_RC_INPUT=y
|
||||
CONFIG_DRIVERS_TELEMETRY_FRSKY_TELEMETRY=y
|
||||
@@ -31,5 +33,6 @@ CONFIG_MODULES_MC_RATE_CONTROL=y
|
||||
CONFIG_MODULES_NAVIGATOR=y
|
||||
CONFIG_MODULES_RC_UPDATE=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
CONFIG_MODULES_UXRCE_DDS_CLIENT=y
|
||||
CONFIG_SYSTEMCMDS_DMESG=y
|
||||
CONFIG_SYSTEMCMDS_PARAM=y
|
||||
CONFIG_SYSTEMCMDS_TOP=y
|
||||
|
||||
@@ -113,6 +113,7 @@
|
||||
/* RC Serial port */
|
||||
|
||||
#define RC_SERIAL_PORT "/dev/ttyS4"
|
||||
#define RC_SERIAL_SINGLEWIRE
|
||||
|
||||
#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5)
|
||||
|
||||
@@ -129,6 +130,8 @@
|
||||
GPIO_RSSI_IN, \
|
||||
}
|
||||
|
||||
#define BOARD_ENABLE_CONSOLE_BUFFER
|
||||
|
||||
#define BOARD_NUM_IO_TIMERS 4
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
@@ -252,9 +252,5 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
#endif
|
||||
|
||||
/* Configure the HW based on the manifest */
|
||||
|
||||
px4_platform_configure();
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -14,10 +14,6 @@ CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
|
||||
CONFIG_COMMON_DISTANCE_SENSOR=y
|
||||
CONFIG_DRIVERS_DSHOT=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
# CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
|
||||
# CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y
|
||||
# CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y
|
||||
# CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
|
||||
CONFIG_DRIVERS_IRLOCK=y
|
||||
CONFIG_COMMON_LIGHT=y
|
||||
@@ -29,13 +25,11 @@ CONFIG_DRIVERS_POWER_MONITOR_INA226=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y
|
||||
CONFIG_DRIVERS_PWM_OUT=y
|
||||
CONFIG_DRIVERS_RC_INPUT=y
|
||||
CONFIG_DRIVERS_RPM=y
|
||||
CONFIG_COMMON_TELEMETRY=y
|
||||
CONFIG_DRIVERS_UAVCAN=y
|
||||
CONFIG_BOARD_UAVCAN_INTERFACES=1
|
||||
CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE=2
|
||||
CONFIG_MODULES_AIRSPEED_SELECTOR=y
|
||||
# CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
|
||||
CONFIG_MODULES_CAMERA_FEEDBACK=y
|
||||
CONFIG_MODULES_COMMANDER=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
@@ -54,7 +48,6 @@ CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
# CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOGGER=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_MANUAL_CONTROL=y
|
||||
|
||||
@@ -32,6 +32,7 @@ CONFIG_DRIVERS_SMART_BATTERY_BATMON=y
|
||||
CONFIG_COMMON_TELEMETRY=y
|
||||
CONFIG_DRIVERS_TONE_ALARM=y
|
||||
CONFIG_DRIVERS_UAVCAN=y
|
||||
CONFIG_DRIVERS_UWB_UWB_SR150=y
|
||||
CONFIG_MODULES_AIRSPEED_SELECTOR=y
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
|
||||
CONFIG_MODULES_BATTERY_STATUS=y
|
||||
|
||||
@@ -22,7 +22,7 @@ CONFIG_DRIVERS_PWM_OUT=y
|
||||
CONFIG_DRIVERS_RC_INPUT=y
|
||||
CONFIG_DRIVERS_SAFETY_BUTTON=y
|
||||
CONFIG_DRIVERS_TONE_ALARM=y
|
||||
CONFIG_COMMON_UWB=y
|
||||
CONFIG_DRIVERS_UWB_UWB_SR150=y
|
||||
CONFIG_MODULES_BATTERY_STATUS=y
|
||||
CONFIG_MODULES_CAMERA_FEEDBACK=y
|
||||
CONFIG_MODULES_COMMANDER=y
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
# CONFIG_BOARD_ROMFSROOT is not set
|
||||
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1"
|
||||
CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS4"
|
||||
CONFIG_BOARD_SERIAL_RC="/dev/ttyS5"
|
||||
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2"
|
||||
CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3"
|
||||
CONFIG_BOARD_UAVCAN_INTERFACES=1
|
||||
CONFIG_COMMON_LIGHT=y
|
||||
CONFIG_CYPHAL_BMS_SUBSCRIBER=y
|
||||
CONFIG_DRIVERS_ADC_BOARD_ADC=y
|
||||
CONFIG_DRIVERS_CYPHAL=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_IRLOCK=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_LIS3MDL=y
|
||||
CONFIG_DRIVERS_RC_INPUT=y
|
||||
CONFIG_DRIVERS_SAFETY_BUTTON=y
|
||||
CONFIG_DRIVERS_UAVCAN=y
|
||||
CONFIG_EXAMPLES_FAKE_GPS=y
|
||||
CONFIG_MODULES_AIRSPEED_SELECTOR=y
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
|
||||
CONFIG_MODULES_BATTERY_STATUS=y
|
||||
CONFIG_MODULES_CAMERA_FEEDBACK=y
|
||||
CONFIG_MODULES_COMMANDER=y
|
||||
CONFIG_MODULES_ESC_BATTERY=y
|
||||
|
||||
@@ -17,6 +17,17 @@ param set-default MAV_1_UDP_PRT 14550
|
||||
param set-default SENS_EXT_I2C_PRB 0
|
||||
param set-default CYPHAL_ENABLE 0
|
||||
|
||||
if ver hwtypecmp MR-CANHUBK3-ADAP
|
||||
then
|
||||
param set-default GPS_1_CONFIG 202
|
||||
param set-default RC_PORT_CONFIG 104
|
||||
param set-default SENS_INT_BARO_EN 0
|
||||
param set-default SYS_HAS_BARO 0
|
||||
# MR-CANHUBK3-ADAP voltage divider
|
||||
param set-default BAT1_V_DIV 13.158
|
||||
safety_button start
|
||||
fi
|
||||
|
||||
if param greater -s UAVCAN_ENABLE 0
|
||||
then
|
||||
ifup can0
|
||||
|
||||
@@ -2,22 +2,31 @@
|
||||
#
|
||||
# NXP MR-CANHUBK3 specific board sensors init
|
||||
#------------------------------------------------------------------------------
|
||||
if ver hwtypecmp MR-CANHUBK3-ADAP
|
||||
then
|
||||
icm42688p -c 2 -b 3 -R 0 -S -f 15000 start
|
||||
# Internal magnetometer on I2c on ADAP
|
||||
bmm150 -X -a 18 start
|
||||
ist8310 -X -b 1 -R 10 start
|
||||
# ADC for voltage input sensing
|
||||
board_adc start
|
||||
|
||||
#board_adc start FIXME no ADC drivers
|
||||
# External SPI bus ICM20649
|
||||
icm20649 -b 4 -S -R 10 start
|
||||
|
||||
#FMUv5Xbase board orientation
|
||||
# External SPI bus ICM42688p
|
||||
icm42688p -c 1 -b 3 -R 10 -S -f 15000 start
|
||||
else
|
||||
bmm150 -X start
|
||||
# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer)
|
||||
ist8310 -X -b 2 -R 10 start
|
||||
|
||||
# Internal SPI bus ICM20649
|
||||
icm20649 -s -R 6 start
|
||||
# External SPI bus ICM20649
|
||||
icm20649 -b 4 -S -R 6 start
|
||||
|
||||
# Internal SPI bus ICM42688p
|
||||
icm42688p -R 6 -s start
|
||||
|
||||
# Internal magnetometer on I2c
|
||||
bmm150 -I start
|
||||
|
||||
# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer)
|
||||
ist8310 -X -b 2 -R 10 start
|
||||
# External SPI bus ICM42688p
|
||||
icm42688p -c 1 -b 3 -R 6 -S -f 15000 start
|
||||
fi
|
||||
|
||||
# External compass on GPS1/I2C1 (the 3rd external bus): Drotek RTK GPS with LIS3MDL Compass
|
||||
lis3mdl -X -b 2 -R 2 start
|
||||
@@ -25,5 +34,5 @@ lis3mdl -X -b 2 -R 2 start
|
||||
# Disable startup of internal baros if param is set to false
|
||||
if param compare SENS_INT_BARO_EN 1
|
||||
then
|
||||
bmp388 -I -a 0x77 start
|
||||
bmp388 -X -a 0x77 start
|
||||
fi
|
||||
|
||||
@@ -152,6 +152,18 @@
|
||||
#define PIN_LPUART1_RX (PIN_LPUART1_RX_3 | PIN_INPUT_PULLUP) /* PTC6 */
|
||||
#define PIN_LPUART1_TX PIN_LPUART1_TX_3 /* PTC7 */
|
||||
|
||||
|
||||
/* LPUART4 /dev/ttyS3 P8B 3X7 Pin 3 Single wire RC UART */
|
||||
|
||||
#define PIN_LPUART4_RX PIN_LPUART4_TX_3 /* Dummy since it's Single Wire TX-only */
|
||||
#define PIN_LPUART4_TX PIN_LPUART4_TX_3 /* PTE11 */
|
||||
|
||||
|
||||
/* LPUART7 /dev/ttyS4 P8B 3X7 Pin 3 and Pin 8 */
|
||||
|
||||
#define PIN_LPUART7_RX (PIN_LPUART7_RX_3 | PIN_INPUT_PULLUP) /* PTE0 */
|
||||
#define PIN_LPUART7_TX PIN_LPUART7_TX_3 /* PTE1 */
|
||||
|
||||
/* LPUART9 P24 UART connector */
|
||||
|
||||
#define PIN_LPUART9_RX (PIN_LPUART9_RX_1 | PIN_INPUT_PULLUP) /* PTB2 */
|
||||
@@ -209,7 +221,8 @@
|
||||
#define PIN_LPSPI4_PCS0 PIN_LPSPI4_PCS0_1 /* PTB8 */
|
||||
#define PIN_LPSPI4_PCS3 PIN_LPSPI4_PCS3_1 /* PTA16 */
|
||||
|
||||
#define PIN_LPSPI4_PCS (PIN_PTA16 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE) /* PTA16 */
|
||||
#define PIN_LPSPI4_CS_P26 (PIN_PTA16 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE) /* PTA16 */
|
||||
#define PIN_LPSPI4_CS_P8B (PIN_PTB8 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE) /* PTB8 */
|
||||
|
||||
/* LPSPI5 P26 external IMU connector */
|
||||
|
||||
|
||||
@@ -245,6 +245,8 @@ CONFIG_S32K3XX_LPUART13=y
|
||||
CONFIG_S32K3XX_LPUART14=y
|
||||
CONFIG_S32K3XX_LPUART1=y
|
||||
CONFIG_S32K3XX_LPUART2=y
|
||||
CONFIG_S32K3XX_LPUART4=y
|
||||
CONFIG_S32K3XX_LPUART7=y
|
||||
CONFIG_S32K3XX_LPUART9=y
|
||||
CONFIG_S32K3XX_LPUART_INVERT=y
|
||||
CONFIG_S32K3XX_LPUART_SINGLEWIRE=y
|
||||
|
||||
@@ -38,6 +38,7 @@ if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader")
|
||||
clockconfig.c
|
||||
periphclocks.c
|
||||
timer_config.cpp
|
||||
hw_rev_ver_canhubk3.c
|
||||
)
|
||||
|
||||
target_link_libraries(drivers_board
|
||||
@@ -65,6 +66,8 @@ else()
|
||||
spi.cpp
|
||||
timer_config.cpp
|
||||
s32k3xx_userleds.c
|
||||
hw_rev_ver_canhubk3.c
|
||||
manifest.c
|
||||
)
|
||||
|
||||
target_link_libraries(drivers_board
|
||||
|
||||
@@ -88,7 +88,7 @@ __BEGIN_DECLS
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
|
||||
#define RC_SERIAL_PORT "/dev/ttyS5"
|
||||
#define RC_SERIAL_SINGLEWIRE
|
||||
#define RC_SERIAL_SINGLEWIRE_FORCE
|
||||
#define RC_SERIAL_INVERT_RX_ONLY
|
||||
|
||||
#define BOARD_ENABLE_CONSOLE_BUFFER
|
||||
@@ -110,6 +110,40 @@ __BEGIN_DECLS
|
||||
/* Reboot and ulog we store on a wear-level filesystem */
|
||||
#define HARDFAULT_REBOOT_PATH "/mnt/progmem/reboot"
|
||||
|
||||
/* To detect MR-CANHUBK3-ADAP board */
|
||||
#define BOARD_HAS_HW_VERSIONING 1
|
||||
#define CANHUBK3_ADAP_DETECT (PIN_PTA12 | GPIO_INPUT | GPIO_PULLUP)
|
||||
|
||||
|
||||
/*
|
||||
* ADC channels
|
||||
*
|
||||
* These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4
|
||||
* Firmware in the adc driver. ADC1 has 32 channels, with some a/b selection overlap
|
||||
* in the AD4-AD7 range on the same ADC.
|
||||
*
|
||||
* Only ADC1 is used
|
||||
* Bits 31:0 are ADC1 channels 31:0
|
||||
*/
|
||||
|
||||
#define ADC1_CH(c) (((c) & 0x1f)) /* Define ADC number Channel number */
|
||||
|
||||
/* ADC defines to be used in sensors.cpp to read from a particular channel */
|
||||
|
||||
#define ADC_BATTERY_VOLTAGE_CHANNEL ADC1_CH(0) /* BAT_VSENS 85 PTB4 ADC1_SE10 */
|
||||
#define ADC_BATTERY_CURRENT_CHANNEL ADC1_CH(1) /* Non-existant but needed for compilation */
|
||||
|
||||
|
||||
/* Mask use to initialize the ADC driver */
|
||||
|
||||
#define ADC_CHANNELS ((1 << ADC_BATTERY_VOLTAGE_CHANNEL))
|
||||
|
||||
/* Safety Switch
|
||||
* TBD
|
||||
*/
|
||||
#define GPIO_LED_SAFETY (PIN_PTE26 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO)
|
||||
#define GPIO_BTN_SAFETY (PIN_PTA11 | GPIO_INPUT | GPIO_PULLDOWN)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2023 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 hw_rev_ver_canhubk3.c
|
||||
* CANHUBK3 Hardware Revision and Version ID API
|
||||
*/
|
||||
#include <drivers/drv_adc.h>
|
||||
#include <px4_arch/adc.h>
|
||||
#include <px4_platform_common/micro_hal.h>
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform/board_determine_hw_info.h>
|
||||
#include <stdio.h>
|
||||
#include <board_config.h>
|
||||
|
||||
#include <systemlib/px4_macros.h>
|
||||
|
||||
#if defined(BOARD_HAS_HW_VERSIONING)
|
||||
|
||||
|
||||
#define HW_INFO_SIZE HW_INFO_VER_DIGITS + HW_INFO_REV_DIGITS
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
static int is_adap_connected = 0;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
/************************************************************************************
|
||||
* Name: board_get_hw_type
|
||||
*
|
||||
* Description:
|
||||
* Optional returns a 0 terminated string defining the HW type.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* a 0 terminated string defining the HW type. This my be a 0 length string ""
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
__EXPORT const char *board_get_hw_type_name()
|
||||
{
|
||||
if (is_adap_connected) {
|
||||
return (const char *)"MR-CANHUBK3-ADAP";
|
||||
|
||||
} else {
|
||||
return (const char *)"MR-CANHUBK344";
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_get_hw_version
|
||||
*
|
||||
* Description:
|
||||
* Optional returns a integer HW version
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* An integer value of this boards hardware version.
|
||||
* A value of -1 is the default for boards not supporting the BOARD_HAS_VERSIONING API.
|
||||
* A value of 0 is the default for boards supporting the API but not having version.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
__EXPORT int board_get_hw_version()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_get_hw_revision
|
||||
*
|
||||
* Description:
|
||||
* Optional returns a integer HW revision
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* An integer value of this boards hardware revision.
|
||||
* A value of -1 is the default for boards not supporting the BOARD_HAS_VERSIONING API.
|
||||
* A value of 0 is the default for boards supporting the API but not having revision.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
__EXPORT int board_get_hw_revision()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_determine_hw_info
|
||||
*
|
||||
* Description:
|
||||
* Uses GPIO to detect MR-CANHUBK3-ADAP
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
int board_determine_hw_info()
|
||||
{
|
||||
s32k3xx_pinconfig(CANHUBK3_ADAP_DETECT);
|
||||
is_adap_connected = !s32k3xx_gpioread(CANHUBK3_ADAP_DETECT);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -34,6 +34,6 @@
|
||||
#include <px4_arch/i2c_hw_description.h>
|
||||
|
||||
constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
|
||||
initI2CBusInternal(PX4_BUS_NUMBER_TO_PX4(0)),
|
||||
initI2CBusExternal(PX4_BUS_NUMBER_TO_PX4(1)),
|
||||
initI2CBusExternal(PX4_BUS_NUMBER_TO_PX4(0)),
|
||||
initI2CBusInternal(PX4_BUS_NUMBER_TO_PX4(1)),
|
||||
};
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "board_config.h"
|
||||
|
||||
#include <px4_platform_common/init.h>
|
||||
#include <px4_platform/board_determine_hw_info.h>
|
||||
|
||||
#if defined(CONFIG_S32K3XX_LPSPI1) && defined(CONFIG_MMCSD)
|
||||
#include <nuttx/mmcsd.h>
|
||||
@@ -96,6 +97,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
int rv;
|
||||
|
||||
board_determine_hw_info();
|
||||
|
||||
|
||||
#if defined(CONFIG_S32K3XX_LPSPI1) && defined(CONFIG_MMCSD)
|
||||
/* LPSPI1 *****************************************************************/
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2023 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 manifest.c
|
||||
*
|
||||
* This module supplies the interface to the manifest of hardware that is
|
||||
* optional and dependent on the HW REV and HW VER IDs
|
||||
*
|
||||
* The manifest allows the system to know whether a hardware option
|
||||
* say for example the PX4IO is an no-pop option vs it is broken.
|
||||
*
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <stdbool.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "systemlib/px4_macros.h"
|
||||
#include "px4_log.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_query_manifest
|
||||
*
|
||||
* Description:
|
||||
* Optional returns manifest item.
|
||||
*
|
||||
* Input Parameters:
|
||||
* manifest_id - the ID for the manifest item to retrieve
|
||||
*
|
||||
* Returned Value:
|
||||
* 0 - item is not in manifest => assume legacy operations
|
||||
* pointer to a manifest item
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id)
|
||||
{
|
||||
return px4_hw_mft_unsupported;
|
||||
}
|
||||
@@ -107,6 +107,9 @@ int s32k3xx_bringup(void)
|
||||
s32k3xx_spidev_initialize();
|
||||
#endif
|
||||
|
||||
s32k3xx_pinconfig(GPIO_LED_SAFETY);
|
||||
s32k3xx_pinconfig(GPIO_BTN_SAFETY);
|
||||
|
||||
#ifdef CONFIG_INPUT_BUTTONS
|
||||
/* Register the BUTTON driver */
|
||||
|
||||
|
||||
@@ -168,6 +168,22 @@ const struct peripheral_clock_config_s g_peripheral_clockconfig0[] = {
|
||||
.clkgate = true,
|
||||
#else
|
||||
.clkgate = false,
|
||||
#endif
|
||||
},
|
||||
{
|
||||
.clkname = LPUART4_CLK,
|
||||
#ifdef CONFIG_S32K3XX_LPUART4
|
||||
.clkgate = true,
|
||||
#else
|
||||
.clkgate = false,
|
||||
#endif
|
||||
},
|
||||
{
|
||||
.clkname = LPUART7_CLK,
|
||||
#ifdef CONFIG_S32K3XX_LPUART7
|
||||
.clkgate = true,
|
||||
#else
|
||||
.clkgate = false,
|
||||
#endif
|
||||
},
|
||||
{
|
||||
@@ -258,6 +274,10 @@ const struct peripheral_clock_config_s g_peripheral_clockconfig0[] = {
|
||||
.clkname = EMIOS0_CLK,
|
||||
.clkgate = true,
|
||||
},
|
||||
{
|
||||
.clkname = ADC2_CLK,
|
||||
.clkgate = true,
|
||||
}
|
||||
};
|
||||
|
||||
unsigned int const num_of_peripheral_clocks_0 =
|
||||
|
||||
@@ -70,11 +70,12 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
|
||||
initSPIBus(SPI::Bus::SPI3, { // SPI3 is ignored only used for FS26 by a NuttX driver
|
||||
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin17})
|
||||
}),
|
||||
initSPIBus(SPI::Bus::SPI4, {
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortA, GPIO::Pin16}, SPI::DRDY{PIN_WKPU20})
|
||||
initSPIBusExternal(SPI::Bus::SPI4, {
|
||||
initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin16}, SPI::DRDY{PIN_WKPU20}),
|
||||
initSPIConfigExternal(SPI::CS{GPIO::PortB, GPIO::Pin8}, SPI::DRDY{PIN_WKPU56})
|
||||
}),
|
||||
initSPIBus(SPI::Bus::SPI5, {
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortA, GPIO::Pin14}, SPI::DRDY{PIN_WKPU4})
|
||||
initSPIBusExternal(SPI::Bus::SPI5, {
|
||||
initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin14}, SPI::DRDY{PIN_WKPU4})
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -337,7 +338,14 @@ void s32k3xx_lpspi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
spiinfo("devid: %" PRId32 ", CS: %s\n", devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
|
||||
s32k3xx_gpiowrite(PIN_LPSPI4_PCS, !selected);
|
||||
devid = ((devid) & 0xF);
|
||||
|
||||
if (devid == 0) {
|
||||
s32k3xx_gpiowrite(PIN_LPSPI4_CS_P26, !selected);
|
||||
|
||||
} else if (devid == 1) {
|
||||
s32k3xx_gpiowrite(PIN_LPSPI4_CS_P8B, !selected);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t s32k3xx_lpspi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
|
||||
@@ -28,6 +28,7 @@ CONFIG_UAVCANNODE_RTK_DATA=y
|
||||
CONFIG_UAVCANNODE_SERVO_ARRAY_COMMAND=y
|
||||
CONFIG_UAVCANNODE_STATIC_PRESSURE=y
|
||||
CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y
|
||||
CONFIG_DRIVERS_UWB_UWB_SR150=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
|
||||
|
||||
@@ -54,7 +54,6 @@ CONFIG_MODULES_FW_POS_CONTROL=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_CAMERA_CAPTURE=n
|
||||
CONFIG_DRIVERS_CAMERA_TRIGGER=n
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
|
||||
@@ -28,7 +28,6 @@ CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=n
|
||||
CONFIG_MODULES_TEMPERATURE_COMPENSATION=n
|
||||
CONFIG_MODULES_UUV_ATT_CONTROL=n
|
||||
CONFIG_MODULES_UUV_POS_CONTROL=n
|
||||
CONFIG_SYSTEMCMDS_SERIAL_TEST=n
|
||||
CONFIG_BOARD_CONSTRAINED_FLASH=y
|
||||
CONFIG_BOARD_TESTING=y
|
||||
CONFIG_DRIVERS_BAROMETER_MS5611=y
|
||||
@@ -45,3 +44,4 @@ CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_RM3100=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_VTRANTECH_VCM1193L=y
|
||||
CONFIG_DRIVERS_TEST_PPM=y
|
||||
CONFIG_SYSTEMCMDS_SD_STRESS=y
|
||||
|
||||
@@ -22,6 +22,7 @@ CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
|
||||
CONFIG_DRIVERS_INPUT_CAPTURE=y
|
||||
CONFIG_DRIVERS_IRLOCK=y
|
||||
CONFIG_COMMON_LIGHT=y
|
||||
CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y
|
||||
@@ -98,8 +99,6 @@ CONFIG_SYSTEMCMDS_PERF=y
|
||||
CONFIG_SYSTEMCMDS_REBOOT=y
|
||||
CONFIG_SYSTEMCMDS_REFLECT=y
|
||||
CONFIG_SYSTEMCMDS_SD_BENCH=y
|
||||
CONFIG_SYSTEMCMDS_SD_STRESS=y
|
||||
CONFIG_SYSTEMCMDS_SERIAL_TEST=y
|
||||
CONFIG_SYSTEMCMDS_SYSTEM_TIME=y
|
||||
CONFIG_SYSTEMCMDS_TOP=y
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set
|
||||
CONFIG_COMMON_HYGROMETERS=n
|
||||
CONFIG_COMMON_OSD=n
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_BATT_SMBUS=n
|
||||
CONFIG_DRIVERS_CAMERA_CAPTURE=n
|
||||
CONFIG_DRIVERS_CAMERA_TRIGGER=n
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
|
||||
CONFIG_DRIVERS_UAVCAN=n
|
||||
CONFIG_EXAMPLES_FAKE_GPS=n
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
|
||||
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=n
|
||||
@@ -11,3 +18,5 @@ CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=n
|
||||
CONFIG_BOARD_TESTING=y
|
||||
CONFIG_DRIVERS_TEST_PPM=y
|
||||
CONFIG_SYSTEMCMDS_MICROBENCH=y
|
||||
CONFIG_SYSTEMCMDS_SD_STRESS=y
|
||||
CONFIG_SYSTEMCMDS_SERIAL_TEST=y
|
||||
|
||||
@@ -17,6 +17,7 @@ CONFIG_DRIVERS_CAMERA_TRIGGER=y
|
||||
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
|
||||
CONFIG_COMMON_DISTANCE_SENSOR=y
|
||||
CONFIG_DRIVERS_DSHOT=y
|
||||
CONFIG_DRIVERS_GPIO_MCP23009=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_HEATER=y
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y
|
||||
|
||||
@@ -19,3 +19,14 @@ param set-default SENS_EN_INA226 1
|
||||
param set-default SYS_USE_IO 1
|
||||
|
||||
safety_button start
|
||||
|
||||
# GPIO Expander driver on external I2C3
|
||||
if ver hwtypecmp V5X009000 V5X009001
|
||||
then
|
||||
# No USB
|
||||
mcp23009 start -b 3 -X -D 0xf0 -O 0xf0 -P 0x0f -U 10
|
||||
fi
|
||||
if ver hwtypecmp V5X00a000 V5X00a001 V5X008000 V5X008001
|
||||
then
|
||||
mcp23009 start -b 3 -X -D 0xf1 -O 0xf0 -P 0x0f -U 10
|
||||
fi
|
||||
|
||||
@@ -7,4 +7,7 @@ if ver hwtypecmp V5X009000 V5X009001 V5X00a000 V5X00a001 V5X008000 V5X008001 V5X
|
||||
then
|
||||
# Start MAVLink on the UART connected to the mission computer
|
||||
mavlink start -d /dev/ttyS4 -b 3000000 -r 290000 -m onboard_low_bandwidth -x -z
|
||||
|
||||
# Ensure nothing else starts on TEL2 (ttyS4)
|
||||
set PRT_TEL2_ 1
|
||||
fi
|
||||
|
||||
@@ -250,8 +250,8 @@
|
||||
#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13)
|
||||
|
||||
/* MCP23009 GPIO expander */
|
||||
#define BOARD_GPIO_VDD_5V_COMP_VALID "/dev/gpin4"
|
||||
#define BOARD_GPIO_VDD_5V_CAN1_GPS1_VALID "/dev/gpin5"
|
||||
#define BOARD_GPIO_VDD_5V_COMP_VALID "/dev/gpio4"
|
||||
#define BOARD_GPIO_VDD_5V_CAN1_GPS1_VALID "/dev/gpio5"
|
||||
|
||||
/* Spare GPIO */
|
||||
|
||||
|
||||
@@ -264,8 +264,9 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
led_on(LED_RED);
|
||||
}
|
||||
|
||||
int ret;
|
||||
#ifdef CONFIG_MMCSD
|
||||
int ret = stm32_sdio_initialize();
|
||||
ret = stm32_sdio_initialize();
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
@@ -274,30 +275,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
#endif /* CONFIG_MMCSD */
|
||||
|
||||
int hw_version = board_get_hw_version();
|
||||
ret = mcp23009_register_gpios(3, 0x25);
|
||||
|
||||
if (hw_version == 0x9 || hw_version == 0xa) {
|
||||
static MCP23009 mcp23009{3, 0x25};
|
||||
|
||||
// No USB
|
||||
if (hw_version == 0x9) {
|
||||
// < P8
|
||||
ret = mcp23009.init(0xf0, 0xf0, 0x0f);
|
||||
// >= P8
|
||||
//ret = mcp23009.init(0xf1, 0xf0, 0x0f);
|
||||
}
|
||||
|
||||
if (hw_version == 0xa) {
|
||||
// < P6
|
||||
//ret = mcp23009.init(0xf0, 0xf0, 0x0f);
|
||||
// >= P6
|
||||
ret = mcp23009.init(0xf1, 0xf0, 0x0f);
|
||||
}
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
return ret;
|
||||
}
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -2,6 +2,8 @@ CONFIG_COMMON_DISTANCE_SENSOR=n
|
||||
CONFIG_COMMON_INS=n
|
||||
CONFIG_COMMON_TELEMETRY=n
|
||||
CONFIG_DRIVERS_ADC_ADS1115=n
|
||||
CONFIG_DRIVERS_CAMERA_CAPTURE=n
|
||||
CONFIG_DRIVERS_CAMERA_TRIGGER=n
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
|
||||
CONFIG_DRIVERS_IRLOCK=n
|
||||
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=n
|
||||
|
||||
@@ -7,11 +7,11 @@ CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS6"
|
||||
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4"
|
||||
CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS1"
|
||||
CONFIG_BOARD_SERIAL_EXT2="/dev/ttyS3"
|
||||
CONFIG_DRIVERS_ADC_ADS1115=y
|
||||
CONFIG_DRIVERS_ADC_BOARD_ADC=y
|
||||
CONFIG_DRIVERS_BAROMETER_BMP388=y
|
||||
CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP201XX=y
|
||||
CONFIG_DRIVERS_BAROMETER_MS5611=y
|
||||
CONFIG_DRIVERS_BATT_SMBUS=y
|
||||
CONFIG_DRIVERS_CAMERA_CAPTURE=y
|
||||
CONFIG_DRIVERS_CAMERA_TRIGGER=y
|
||||
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
|
||||
@@ -41,6 +41,7 @@ CONFIG_DRIVERS_TONE_ALARM=y
|
||||
CONFIG_DRIVERS_UAVCAN=y
|
||||
CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE=2
|
||||
CONFIG_MODULES_AIRSPEED_SELECTOR=y
|
||||
CONFIG_MODULES_BATTERY_STATUS=y
|
||||
CONFIG_MODULES_CAMERA_FEEDBACK=y
|
||||
CONFIG_MODULES_COMMANDER=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# PX4 FMUv6X specific board MAVLink startup script.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# if skynode base board is detected start Mavlink on Telem2
|
||||
if ver hwtypecmp V6X009010 V6X010010
|
||||
then
|
||||
mavlink start -d /dev/ttyS4 -b 3000000 -r 290000 -m onboard_low_bandwidth -x -z
|
||||
|
||||
# Ensure nothing else starts on TEL2 (ttyS4)
|
||||
set PRT_TEL2_ 1
|
||||
fi
|
||||
@@ -291,7 +291,6 @@ CONFIG_UART4_RXBUFSIZE=600
|
||||
CONFIG_UART4_TXBUFSIZE=1500
|
||||
CONFIG_UART5_IFLOWCONTROL=y
|
||||
CONFIG_UART5_OFLOWCONTROL=y
|
||||
CONFIG_UART7_RXBUFSIZE=1500
|
||||
CONFIG_UART5_RXDMA=y
|
||||
CONFIG_UART5_TXBUFSIZE=10000
|
||||
CONFIG_UART5_TXDMA=y
|
||||
|
||||
+9
-3
@@ -60,6 +60,8 @@ set(msg_files
|
||||
CollisionReport.msg
|
||||
ControlAllocatorStatus.msg
|
||||
Cpuload.msg
|
||||
DatamanRequest.msg
|
||||
DatamanResponse.msg
|
||||
DebugArray.msg
|
||||
DebugKeyValue.msg
|
||||
DebugValue.msg
|
||||
@@ -90,6 +92,7 @@ set(msg_files
|
||||
FollowTargetStatus.msg
|
||||
GeneratorStatus.msg
|
||||
GeofenceResult.msg
|
||||
GimbalControls.msg
|
||||
GimbalDeviceAttitudeStatus.msg
|
||||
GimbalDeviceInformation.msg
|
||||
GimbalDeviceSetAttitude.msg
|
||||
@@ -97,14 +100,18 @@ set(msg_files
|
||||
GimbalManagerSetAttitude.msg
|
||||
GimbalManagerSetManualControl.msg
|
||||
GimbalManagerStatus.msg
|
||||
GpioConfig.msg
|
||||
GpioIn.msg
|
||||
GpioOut.msg
|
||||
GpioRequest.msg
|
||||
GpsDump.msg
|
||||
GpsInjectData.msg
|
||||
GimbalControls.msg
|
||||
Gripper.msg
|
||||
HealthReport.msg
|
||||
HeaterStatus.msg
|
||||
HomePosition.msg
|
||||
HoverThrustEstimate.msg
|
||||
InputCapture.msg
|
||||
InputRc.msg
|
||||
InternalCombustionEngineStatus.msg
|
||||
IridiumsbdStatus.msg
|
||||
@@ -174,6 +181,7 @@ set(msg_files
|
||||
SensorSelection.msg
|
||||
SensorsStatus.msg
|
||||
SensorsStatusImu.msg
|
||||
SensorUwb.msg
|
||||
SystemPower.msg
|
||||
TakeoffStatus.msg
|
||||
TaskStackInfo.msg
|
||||
@@ -190,8 +198,6 @@ set(msg_files
|
||||
UavcanParameterValue.msg
|
||||
UlogStream.msg
|
||||
UlogStreamAck.msg
|
||||
UwbDistance.msg
|
||||
UwbGrid.msg
|
||||
VehicleAcceleration.msg
|
||||
VehicleAirData.msg
|
||||
VehicleAngularAccelerationSetpoint.msg
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
uint8 client_id
|
||||
uint8 request_type # id/read/write/clear
|
||||
uint8 item # dm_item_t
|
||||
uint32 index
|
||||
uint8[56] data
|
||||
uint32 data_length
|
||||
@@ -0,0 +1,15 @@
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
uint8 client_id
|
||||
uint8 request_type # id/read/write/clear
|
||||
uint8 item # dm_item_t
|
||||
uint32 index
|
||||
uint8[56] data
|
||||
|
||||
uint8 STATUS_SUCCESS = 0
|
||||
uint8 STATUS_FAILURE_ID_ERR = 1
|
||||
uint8 STATUS_FAILURE_NO_DATA = 2
|
||||
uint8 STATUS_FAILURE_READ_FAILED = 3
|
||||
uint8 STATUS_FAILURE_WRITE_FAILED = 4
|
||||
uint8 STATUS_FAILURE_CLEAR_FAILED = 5
|
||||
uint8 status
|
||||
@@ -127,3 +127,8 @@ uint32 mag_device_id
|
||||
# legacy local position estimator (LPE) flags
|
||||
uint8 health_flags # Bitmask to indicate sensor health states (vel, pos, hgt)
|
||||
uint8 timeout_flags # Bitmask to indicate timeout flags (vel, pos, hgt)
|
||||
|
||||
float32 mag_inclination_deg
|
||||
float32 mag_inclination_ref_deg
|
||||
float32 mag_strength_gs
|
||||
float32 mag_strength_ref_gs
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# GPIO configuration
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint32 device_id # Device id
|
||||
|
||||
uint32 mask # Pin mask
|
||||
uint32 state # Initial pin output state
|
||||
|
||||
# Configuration Mask
|
||||
# Bit 0-3: Direction: 0=Input, 1=Output
|
||||
# Bit 4-7: Input Config: 0=Floating, 1=PullUp, 2=PullDown
|
||||
# Bit 8-12: Output Config: 0=PushPull, 1=OpenDrain
|
||||
# Bit 13-31: Reserved
|
||||
uint32 INPUT = 0 # 0x0000
|
||||
uint32 OUTPUT = 1 # 0x0001
|
||||
uint32 PULLUP = 16 # 0x0010
|
||||
uint32 PULLDOWN = 32 # 0x0020
|
||||
uint32 OPENDRAIN = 256 # 0x0100
|
||||
|
||||
uint32 INPUT_FLOATING = 0 # 0x0000
|
||||
uint32 INPUT_PULLUP = 16 # 0x0010
|
||||
uint32 INPUT_PULLDOWN = 32 # 0x0020
|
||||
|
||||
uint32 OUTPUT_PUSHPULL = 0 # 0x0000
|
||||
uint32 OUTPUT_OPENDRAIN = 256 # 0x0100
|
||||
uint32 OUTPUT_OPENDRAIN_PULLUP = 272 # 0x0110
|
||||
|
||||
uint32 config
|
||||
@@ -0,0 +1,6 @@
|
||||
# GPIO mask and state
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint32 device_id # Device id
|
||||
|
||||
uint32 state # pin state mask
|
||||
@@ -0,0 +1,7 @@
|
||||
# GPIO mask and state
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint32 device_id # Device id
|
||||
|
||||
uint32 mask # pin mask
|
||||
uint32 state # pin state mask
|
||||
@@ -0,0 +1,4 @@
|
||||
# Request GPIO mask to be read
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint32 device_id # Device id
|
||||
@@ -0,0 +1,5 @@
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint64 timestamp_sample # the timestamp of the raw data (microseconds)
|
||||
uint32 seq # Capture sequence number
|
||||
|
||||
uint32 ORB_QUEUE_LENGTH = 2
|
||||
@@ -3,3 +3,7 @@ uint8 dataman_id # default 0, there are two offboard storage places in the datam
|
||||
|
||||
uint16 count # count of the missions stored in the dataman
|
||||
int32 current_seq # default -1, start at the one changed latest
|
||||
|
||||
int16 mission_update_counter # indicates updates to the mission, reload from dataman if increased
|
||||
int16 geofence_update_counter # indicates updates to the geofence, reload from dataman if increased
|
||||
int16 safe_points_update_counter # indicates updates to the safe points, reload from dataman if increased
|
||||
|
||||
+4
-4
@@ -5,10 +5,10 @@ uint64 timestamp_sample
|
||||
|
||||
uint32 device_id # unique device ID for the sensor that does not change between power cycles
|
||||
|
||||
int32 lat # Latitude in 1E-7 degrees
|
||||
int32 lon # Longitude in 1E-7 degrees
|
||||
int32 alt # Altitude in 1E-3 meters above MSL, (millimetres)
|
||||
int32 alt_ellipsoid # Altitude in 1E-3 meters bove Ellipsoid, (millimetres)
|
||||
float64 latitude_deg # Latitude in degrees, allows centimeter level RTK precision
|
||||
float64 longitude_deg # Longitude in degrees, allows centimeter level RTK precision
|
||||
float64 altitude_msl_m # Altitude above MSL, meters
|
||||
float64 altitude_ellipsoid_m # Altitude above Ellipsoid, meters
|
||||
|
||||
float32 s_variance_m_s # GPS speed accuracy estimate, (metres/sec)
|
||||
float32 c_variance_rad # GPS course accuracy estimate, (radians)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# UWB distance contains the distance information measured by an ultra-wideband positioning system,
|
||||
# such as Pozyx or NXP Rddrone.
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
uint32 sessionid # UWB SessionID
|
||||
uint32 time_offset # Time between Ranging Rounds in ms
|
||||
uint32 counter # Number of Ranges since last Start of Ranging
|
||||
uint16 mac # MAC adress of Initiator (controller)
|
||||
|
||||
uint16 mac_dest # MAC adress of Responder (Controlee)
|
||||
uint16 status # status feedback #
|
||||
uint8 nlos # None line of site condition y/n
|
||||
float32 distance # distance in m to the UWB receiver
|
||||
|
||||
|
||||
#Angle of arrival, Angle in Degree -60..+60; FOV in both axis is 120 degrees
|
||||
float32 aoa_azimuth_dev # Angle of arrival of first incomming RX msg
|
||||
float32 aoa_elevation_dev # Angle of arrival of first incomming RX msg
|
||||
float32 aoa_azimuth_resp # Angle of arrival of first incomming RX msg at the responder
|
||||
float32 aoa_elevation_resp # Angle of arrival of first incomming RX msg at the responder
|
||||
|
||||
# Figure of merit for the angle measurements
|
||||
uint8 aoa_azimuth_fom # AOA Azimuth FOM
|
||||
uint8 aoa_elevation_fom # AOA Elevation FOM
|
||||
uint8 aoa_dest_azimuth_fom # AOA Azimuth FOM
|
||||
uint8 aoa_dest_elevation_fom # AOA Elevation FOM
|
||||
|
||||
# Initiator physical configuration
|
||||
uint8 orientation # Direction the sensor faces from MAV_SENSOR_ORIENTATION enum
|
||||
# Standard configuration is Antennas facing down and azimuth aligened in forward direction
|
||||
float32 offset_x # UWB initiator offset in X axis (NED drone frame)
|
||||
float32 offset_y # UWB initiator offset in Y axis (NED drone frame)
|
||||
float32 offset_z # UWB initiator offset in Z axis (NED drone frame)
|
||||
@@ -1,15 +0,0 @@
|
||||
# UWB distance contains the distance information measured by an ultra-wideband positioning system,
|
||||
# such as Pozyx or NXP Rddrone.
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint32 time_uwb_ms # Time of UWB device in ms
|
||||
uint32 counter # Number of Ranges since last Start of Ranging
|
||||
uint32 sessionid # UWB SessionID
|
||||
uint32 time_offset # Time between Ranging Rounds in ms
|
||||
uint16 status # status feedback #
|
||||
|
||||
uint16[12] anchor_distance # distance in cm to each UWB Anchor (UWB Device which takes part in Ranging)
|
||||
bool[12] nlos # Visual line of sight yes/no
|
||||
float32[12] aoafirst # Angle of arrival of first incoming RX msg
|
||||
|
||||
float32[3] position # Position of the Landing point in relation to the Drone (x,y,z in Meters NED)
|
||||
@@ -1,25 +0,0 @@
|
||||
# UWB report message contains the grid information measured by an ultra-wideband positioning system,
|
||||
# such as Pozyx or NXP Rddrone.
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint16 initator_time # time to synchronize clocks (microseconds)
|
||||
uint8 num_anchors # Number of anchors
|
||||
|
||||
float64[4] target_gps # GPS position of target of the UWB system (Lat / Lon / Alt / Yaw Offset to true North)
|
||||
|
||||
# Grid position information
|
||||
# Position in x,y,z in (x,y,z in centimeters NED)
|
||||
# staring with POI and Anchor 0 up to Anchor 11
|
||||
int16[3] target_pos # Point of Interest, mostly landing Target x,y,z
|
||||
int16[3] anchor_pos_0
|
||||
int16[3] anchor_pos_1
|
||||
int16[3] anchor_pos_2
|
||||
int16[3] anchor_pos_3
|
||||
int16[3] anchor_pos_4
|
||||
int16[3] anchor_pos_5
|
||||
int16[3] anchor_pos_6
|
||||
int16[3] anchor_pos_7
|
||||
int16[3] anchor_pos_8
|
||||
int16[3] anchor_pos_9
|
||||
int16[3] anchor_pos_10
|
||||
int16[3] anchor_pos_11
|
||||
@@ -6,13 +6,8 @@ uint64 armed_time # Arming timestamp (microseconds)
|
||||
uint64 takeoff_time # Takeoff timestamp (microseconds)
|
||||
|
||||
uint8 arming_state
|
||||
uint8 ARMING_STATE_INIT = 0
|
||||
uint8 ARMING_STATE_STANDBY = 1
|
||||
uint8 ARMING_STATE_ARMED = 2
|
||||
uint8 ARMING_STATE_STANDBY_ERROR = 3
|
||||
uint8 ARMING_STATE_SHUTDOWN = 4
|
||||
uint8 ARMING_STATE_IN_AIR_RESTORE = 5
|
||||
uint8 ARMING_STATE_MAX = 6
|
||||
uint8 ARMING_STATE_DISARMED = 1
|
||||
uint8 ARMING_STATE_ARMED = 2
|
||||
|
||||
uint8 latest_arming_reason
|
||||
uint8 latest_disarming_reason
|
||||
@@ -121,4 +116,3 @@ bool rc_calibration_in_progress
|
||||
bool calibration_enabled
|
||||
|
||||
bool pre_flight_checks_pass # true if all checks necessary to arm pass
|
||||
|
||||
|
||||
@@ -440,6 +440,8 @@ __BEGIN_DECLS
|
||||
|
||||
#if defined(RC_SERIAL_SINGLEWIRE)
|
||||
static inline bool board_rc_singlewire(const char *device) { return strcmp(device, RC_SERIAL_PORT) == 0; }
|
||||
#elif defined(RC_SERIAL_SINGLEWIRE_FORCE)
|
||||
static inline bool board_rc_singlewire(const char *device) { return true; }
|
||||
#else
|
||||
static inline bool board_rc_singlewire(const char *device) { return false; }
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Multi-EKF (off by default)
|
||||
param set-default EKF2_MULTI_IMU 0
|
||||
param set-default -s EKF2_MULTI_IMU 0
|
||||
param set-default SENS_IMU_MODE 1
|
||||
|
||||
set LOGGER_BUF 8
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Multi-EKF (off by default)
|
||||
param set-default EKF2_MULTI_IMU 0
|
||||
param set-default -s EKF2_MULTI_IMU 0
|
||||
param set-default SENS_IMU_MODE 1
|
||||
|
||||
set LOGGER_BUF 8
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Multi-EKF (across IMUs only)
|
||||
param set-default EKF2_MULTI_IMU 3
|
||||
param set-default -s EKF2_MULTI_IMU 3
|
||||
param set-default SENS_IMU_MODE 0
|
||||
|
||||
param set-default -s IMU_GYRO_FFT_EN 1
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Multi-EKF
|
||||
param set-default EKF2_MULTI_IMU 3
|
||||
param set-default -s EKF2_MULTI_IMU 3
|
||||
param set-default SENS_IMU_MODE 0
|
||||
|
||||
param set-default -s IMU_GYRO_FFT_EN 1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2020 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2023 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
|
||||
@@ -31,182 +31,142 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/ioexpander/gpio.h>
|
||||
#include <drivers/drv_sensor.h>
|
||||
#include <px4_platform/gpio/mcp23009.hpp>
|
||||
#include "mcp23009_registers.hpp"
|
||||
#include <lib/drivers/device/Device.hpp>
|
||||
#include <uORB/topics/gpio_config.h>
|
||||
#include <uORB/topics/gpio_in.h>
|
||||
#include <uORB/topics/gpio_out.h>
|
||||
#include <uORB/topics/gpio_request.h>
|
||||
#include <uORB/Publication.hpp>
|
||||
#include <uORB/SubscriptionCallback.hpp>
|
||||
|
||||
using namespace Microchip_MCP23009;
|
||||
|
||||
const struct gpio_operations_s MCP23009::gpio_ops = {
|
||||
go_read : MCP23009::go_read,
|
||||
go_write : MCP23009::go_write,
|
||||
go_attach : nullptr,
|
||||
go_enable : nullptr,
|
||||
go_setpintype : MCP23009::go_setpintype,
|
||||
static uint32_t DEVID{0};
|
||||
struct mcp23009_gpio_dev_s {
|
||||
struct gpio_dev_s gpio;
|
||||
uint8_t mask;
|
||||
};
|
||||
|
||||
MCP23009::MCP23009(int bus, int address, int first_minor, int bus_frequency) :
|
||||
I2C(DRV_GPIO_DEVTYPE_MCP23009, "MCP23009", bus, address, bus_frequency),
|
||||
_first_minor(first_minor)
|
||||
/* Copy the read input data */
|
||||
class ReadCallback : public uORB::SubscriptionCallback
|
||||
{
|
||||
}
|
||||
public:
|
||||
using SubscriptionCallback::SubscriptionCallback;
|
||||
|
||||
MCP23009::~MCP23009()
|
||||
{
|
||||
/* set all as input & unregister */
|
||||
for (int i = 0; i < num_gpios; ++i) {
|
||||
go_setpintype(i, GPIO_INPUT_PIN);
|
||||
gpio_pin_unregister(&_gpio[i].gpio, _first_minor + i);
|
||||
}
|
||||
}
|
||||
void call() override
|
||||
{
|
||||
px4::msg::GpioIn new_input;
|
||||
|
||||
int MCP23009::go_read(struct gpio_dev_s *dev, bool *value)
|
||||
{
|
||||
mcp23009_gpio_dev_s *gpio = (struct mcp23009_gpio_dev_s *)dev;
|
||||
return gpio->obj->go_read(gpio->id, value);
|
||||
}
|
||||
if (update(&new_input) && new_input.device_id == DEVID) {
|
||||
input = new_input.state;
|
||||
}
|
||||
|
||||
int MCP23009::go_write(struct gpio_dev_s *dev, bool value)
|
||||
{
|
||||
mcp23009_gpio_dev_s *gpio = (struct mcp23009_gpio_dev_s *)dev;
|
||||
return gpio->obj->go_write(gpio->id, value);
|
||||
}
|
||||
|
||||
int MCP23009::go_setpintype(struct gpio_dev_s *dev, enum gpio_pintype_e pintype)
|
||||
{
|
||||
mcp23009_gpio_dev_s *gpio = (struct mcp23009_gpio_dev_s *)dev;
|
||||
return gpio->obj->go_setpintype(gpio->id, pintype);
|
||||
}
|
||||
|
||||
|
||||
int MCP23009::read_reg(Register address, uint8_t &data)
|
||||
{
|
||||
return transfer((uint8_t *)&address, 1, &data, 1);
|
||||
}
|
||||
|
||||
int MCP23009::write_reg(Register address, uint8_t value)
|
||||
{
|
||||
uint8_t data[2] = {(uint8_t)address, value};
|
||||
return transfer(data, sizeof(data), nullptr, 0);
|
||||
}
|
||||
|
||||
int MCP23009::init(uint8_t direction, uint8_t intital, uint8_t pull_up)
|
||||
{
|
||||
/* do I2C init (and probe) first */
|
||||
int ret = I2C::init();
|
||||
|
||||
if (ret != PX4_OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Use this state as the out puts */
|
||||
uint8_t input;
|
||||
};
|
||||
|
||||
ret = write_reg(Register::OLAT, intital);
|
||||
ret |= write_reg(Register::IODIR, direction);
|
||||
ret |= write_reg(Register::GPPU, pull_up);
|
||||
static uORB::Publication<px4::msg::GpioRequest> toGpioRequest{ORB_ID(gpio_request)};
|
||||
static ReadCallback fromGpioIn{ORB_ID(gpio_in)};
|
||||
static int mcp23009_read(struct gpio_dev_s *dev, bool *value)
|
||||
{
|
||||
mcp23009_gpio_dev_s *gpio = (struct mcp23009_gpio_dev_s *)dev;
|
||||
*value = fromGpioIn.input & gpio->mask;
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (ret != PX4_OK) {
|
||||
return ret;
|
||||
static uORB::Publication<gpio_out_s> toGpioOut{ORB_ID(gpio_out)};
|
||||
static int mcp23009_write(struct gpio_dev_s *dev, bool value)
|
||||
{
|
||||
mcp23009_gpio_dev_s *gpio = (struct mcp23009_gpio_dev_s *)dev;
|
||||
gpio_out_s msg{
|
||||
hrt_absolute_time(),
|
||||
DEVID,
|
||||
gpio->mask, // clear mask
|
||||
value ? gpio->mask : 0u, // set mask
|
||||
};
|
||||
return toGpioOut.publish(msg) ? OK : -ETIMEDOUT;
|
||||
}
|
||||
|
||||
static uORB::Publication<gpio_config_s> toGpioConfig{ORB_ID(gpio_config)};
|
||||
static int mcp23009_setpintype(struct gpio_dev_s *dev, enum gpio_pintype_e pintype)
|
||||
{
|
||||
mcp23009_gpio_dev_s *gpio = (struct mcp23009_gpio_dev_s *)dev;
|
||||
gpio_config_s msg{
|
||||
hrt_absolute_time(),
|
||||
DEVID,
|
||||
gpio->mask,
|
||||
};
|
||||
|
||||
switch (pintype) {
|
||||
case GPIO_INPUT_PIN:
|
||||
msg.config = gpio_config_s::INPUT;
|
||||
break;
|
||||
|
||||
case GPIO_INPUT_PIN_PULLUP:
|
||||
msg.config = gpio_config_s::INPUT_PULLUP;
|
||||
break;
|
||||
|
||||
case GPIO_OUTPUT_PIN:
|
||||
msg.config = gpio_config_s::OUTPUT;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* register the pins */
|
||||
for (int i = 0; i < num_gpios; ++i) {
|
||||
_gpio[i].gpio.gp_pintype = GPIO_INPUT_PIN;
|
||||
_gpio[i].gpio.gp_ops = &gpio_ops;
|
||||
_gpio[i].id = i;
|
||||
_gpio[i].obj = this;
|
||||
ret = gpio_pin_register(&_gpio[i].gpio, _first_minor + i);
|
||||
return toGpioConfig.publish(msg) ? OK : -ETIMEDOUT;
|
||||
}
|
||||
|
||||
if (ret != PX4_OK) {
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
static const struct gpio_operations_s mcp23009_gpio_ops {
|
||||
mcp23009_read,
|
||||
mcp23009_write,
|
||||
nullptr,
|
||||
nullptr,
|
||||
mcp23009_setpintype,
|
||||
};
|
||||
|
||||
static constexpr uint8_t NUM_GPIOS = 8;
|
||||
static mcp23009_gpio_dev_s _gpio[NUM_GPIOS] {
|
||||
{ {GPIO_INPUT_PIN, {}, &mcp23009_gpio_ops}, (1u << 0) },
|
||||
{ {GPIO_INPUT_PIN, {}, &mcp23009_gpio_ops}, (1u << 1) },
|
||||
{ {GPIO_INPUT_PIN, {}, &mcp23009_gpio_ops}, (1u << 2) },
|
||||
{ {GPIO_INPUT_PIN, {}, &mcp23009_gpio_ops}, (1u << 3) },
|
||||
{ {GPIO_INPUT_PIN, {}, &mcp23009_gpio_ops}, (1u << 4) },
|
||||
{ {GPIO_INPUT_PIN, {}, &mcp23009_gpio_ops}, (1u << 5) },
|
||||
{ {GPIO_INPUT_PIN, {}, &mcp23009_gpio_ops}, (1u << 6) },
|
||||
{ {GPIO_INPUT_PIN, {}, &mcp23009_gpio_ops}, (1u << 7) }
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
int mcp23009_register_gpios(uint8_t i2c_bus, uint8_t i2c_addr, int first_minor)
|
||||
{
|
||||
const auto device_id = device::Device::DeviceId{
|
||||
device::Device::DeviceBusType_I2C, i2c_bus, i2c_addr, DRV_GPIO_DEVTYPE_MCP23009};
|
||||
DEVID = device_id.devid;
|
||||
|
||||
for (int i = 0; i < NUM_GPIOS; ++i) {
|
||||
int ret = gpio_pin_register(&_gpio[i].gpio, first_minor + i);
|
||||
|
||||
if (ret != OK) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
fromGpioIn.registerCallback();
|
||||
return OK;
|
||||
}
|
||||
|
||||
int MCP23009::probe()
|
||||
int mcp23009_unregister_gpios(int first_minor)
|
||||
{
|
||||
// no whoami, try to read IOCON
|
||||
uint8_t data;
|
||||
return read_reg(Register::IOCON, data);
|
||||
}
|
||||
|
||||
int MCP23009::go_read(int id, bool *value)
|
||||
{
|
||||
|
||||
uint8_t data;
|
||||
int ret = read_reg(Register::GPIO, data);
|
||||
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
*value = data & (1 << id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MCP23009::go_write(int id, bool value)
|
||||
{
|
||||
uint8_t data;
|
||||
int ret = read_reg(Register::GPIO, data);
|
||||
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (value) {
|
||||
data |= (1 << id);
|
||||
|
||||
} else {
|
||||
data &= ~(1 << id);
|
||||
}
|
||||
|
||||
return write_reg(Register::GPIO, data);
|
||||
}
|
||||
|
||||
int MCP23009::go_setpintype(int id, enum gpio_pintype_e pintype)
|
||||
{
|
||||
uint8_t direction;
|
||||
int ret = read_reg(Register::IODIR, direction);
|
||||
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint8_t pullup;
|
||||
ret = read_reg(Register::GPPU, pullup);
|
||||
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch (pintype) {
|
||||
case GPIO_INPUT_PIN:
|
||||
direction |= (1 << id);
|
||||
pullup &= ~(1 << id);
|
||||
break;
|
||||
|
||||
case GPIO_INPUT_PIN_PULLUP:
|
||||
direction |= (1 << id);
|
||||
pullup |= (1 << id);
|
||||
break;
|
||||
|
||||
case GPIO_OUTPUT_PIN:
|
||||
direction &= ~(1 << id);
|
||||
break;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
_gpio[id].gpio.gp_pintype = pintype;
|
||||
|
||||
ret = write_reg(Register::GPPU, pullup);
|
||||
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return write_reg(Register::IODIR, direction);
|
||||
for (int i = 0; i < NUM_GPIOS; ++i) {
|
||||
mcp23009_setpintype(&_gpio[i].gpio, GPIO_INPUT_PIN);
|
||||
gpio_pin_unregister(&_gpio[i].gpio, first_minor + i);
|
||||
}
|
||||
|
||||
fromGpioIn.unregisterCallback();
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2020 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2023 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
|
||||
@@ -33,49 +33,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <drivers/device/i2c.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <nuttx/ioexpander/gpio.h>
|
||||
|
||||
using namespace time_literals;
|
||||
|
||||
namespace Microchip_MCP23009
|
||||
{
|
||||
enum class Register : uint8_t;
|
||||
}
|
||||
|
||||
class MCP23009 : public device::I2C
|
||||
{
|
||||
public:
|
||||
MCP23009(int bus, int address, int first_minor = 0, int bus_frequency = 400000);
|
||||
virtual ~MCP23009();
|
||||
|
||||
int init(uint8_t direction, uint8_t intital = 0, uint8_t pull_up = 0);
|
||||
|
||||
protected:
|
||||
int probe() override;
|
||||
|
||||
private:
|
||||
static constexpr int num_gpios = 8;
|
||||
static const gpio_operations_s gpio_ops;
|
||||
|
||||
struct mcp23009_gpio_dev_s {
|
||||
struct gpio_dev_s gpio;
|
||||
uint8_t id;
|
||||
MCP23009 *obj;
|
||||
};
|
||||
|
||||
static int go_read(struct gpio_dev_s *dev, bool *value);
|
||||
static int go_write(struct gpio_dev_s *dev, bool value);
|
||||
static int go_setpintype(struct gpio_dev_s *dev, enum gpio_pintype_e pintype);
|
||||
|
||||
int go_read(int id, bool *value);
|
||||
int go_write(int id, bool value);
|
||||
int go_setpintype(int id, enum gpio_pintype_e pintype);
|
||||
|
||||
int read_reg(Microchip_MCP23009::Register address, uint8_t &data);
|
||||
int write_reg(Microchip_MCP23009::Register address, uint8_t data);
|
||||
|
||||
const int _first_minor;
|
||||
mcp23009_gpio_dev_s _gpio[num_gpios] {};
|
||||
};
|
||||
int mcp23009_register_gpios(uint8_t i2c_bus, uint8_t i2c_addr, int first_minor = 0);
|
||||
int mcp23009_unregister_gpios(int first_minor = 0);
|
||||
|
||||
@@ -163,7 +163,7 @@ int px4_platform_init()
|
||||
#if defined(CONFIG_FS_PROCFS)
|
||||
int ret_mount_procfs = mount(nullptr, "/proc", "procfs", 0, nullptr);
|
||||
|
||||
if (ret < 0) {
|
||||
if (ret_mount_procfs < 0) {
|
||||
syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret_mount_procfs);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,144 +38,76 @@
|
||||
|
||||
#include <nuttx/analog/adc.h>
|
||||
|
||||
#include <hardware/s32k1xx_sim.h>
|
||||
|
||||
//todo S32K add ADC fior now steal the kinetis one
|
||||
#include <kinetis.h>
|
||||
#include <hardware/kinetis_adc.h>
|
||||
|
||||
|
||||
#define _REG(_addr) (*(volatile uint32_t *)(_addr))
|
||||
|
||||
/* ADC register accessors */
|
||||
|
||||
#define REG(a, _reg) _REG(KINETIS_ADC##a##_BASE + (_reg))
|
||||
|
||||
#define rSC1A(adc) REG(adc, KINETIS_ADC_SC1A_OFFSET) /* ADC status and control registers 1 */
|
||||
#define rSC1B(adc) REG(adc, KINETIS_ADC_SC1B_OFFSET) /* ADC status and control registers 1 */
|
||||
#define rCFG1(adc) REG(adc, KINETIS_ADC_CFG1_OFFSET) /* ADC configuration register 1 */
|
||||
#define rCFG2(adc) REG(adc, KINETIS_ADC_CFG2_OFFSET) /* Configuration register 2 */
|
||||
#define rRA(adc) REG(adc, KINETIS_ADC_RA_OFFSET) /* ADC data result register */
|
||||
#define rRB(adc) REG(adc, KINETIS_ADC_RB_OFFSET) /* ADC data result register */
|
||||
#define rCV1(adc) REG(adc, KINETIS_ADC_CV1_OFFSET) /* Compare value registers */
|
||||
#define rCV2(adc) REG(adc, KINETIS_ADC_CV2_OFFSET) /* Compare value registers */
|
||||
#define rSC2(adc) REG(adc, KINETIS_ADC_SC2_OFFSET) /* Status and control register 2 */
|
||||
#define rSC3(adc) REG(adc, KINETIS_ADC_SC3_OFFSET) /* Status and control register 3 */
|
||||
#define rOFS(adc) REG(adc, KINETIS_ADC_OFS_OFFSET) /* ADC offset correction register */
|
||||
#define rPG(adc) REG(adc, KINETIS_ADC_PG_OFFSET) /* ADC plus-side gain register */
|
||||
#define rMG(adc) REG(adc, KINETIS_ADC_MG_OFFSET) /* ADC minus-side gain register */
|
||||
#define rCLPD(adc) REG(adc, KINETIS_ADC_CLPD_OFFSET) /* ADC plus-side general calibration value register */
|
||||
#define rCLPS(adc) REG(adc, KINETIS_ADC_CLPS_OFFSET) /* ADC plus-side general calibration value register */
|
||||
#define rCLP4(adc) REG(adc, KINETIS_ADC_CLP4_OFFSET) /* ADC plus-side general calibration value register */
|
||||
#define rCLP3(adc) REG(adc, KINETIS_ADC_CLP3_OFFSET) /* ADC plus-side general calibration value register */
|
||||
#define rCLP2(adc) REG(adc, KINETIS_ADC_CLP2_OFFSET) /* ADC plus-side general calibration value register */
|
||||
#define rCLP1(adc) REG(adc, KINETIS_ADC_CLP1_OFFSET) /* ADC plus-side general calibration value register */
|
||||
#define rCLP0(adc) REG(adc, KINETIS_ADC_CLP0_OFFSET) /* ADC plus-side general calibration value register */
|
||||
#define rCLMD(adc) REG(adc, KINETIS_ADC_CLMD_OFFSET) /* ADC minus-side general calibration value register */
|
||||
#define rCLMS(adc) REG(adc, KINETIS_ADC_CLMS_OFFSET) /* ADC minus-side general calibration value register */
|
||||
#define rCLM4(adc) REG(adc, KINETIS_ADC_CLM4_OFFSET) /* ADC minus-side general calibration value register */
|
||||
#define rCLM3(adc) REG(adc, KINETIS_ADC_CLM3_OFFSET) /* ADC minus-side general calibration value register */
|
||||
#define rCLM2(adc) REG(adc, KINETIS_ADC_CLM2_OFFSET) /* ADC minus-side general calibration value register */
|
||||
#define rCLM1(adc) REG(adc, KINETIS_ADC_CLM1_OFFSET) /* ADC minus-side general calibration value register */
|
||||
#define rCLM0(adc) REG(adc, KINETIS_ADC_CLM0_OFFSET) /* ADC minus-side general calibration value register */
|
||||
#include <hardware/s32k3xx_adc.h>
|
||||
#include <hardware/s32k344_pinmux.h>
|
||||
|
||||
int px4_arch_adc_init(uint32_t base_address)
|
||||
{
|
||||
/* Input is Buss Clock 56 Mhz We will use /8 for 7 Mhz */
|
||||
uint32_t regval;
|
||||
|
||||
irqstate_t flags = px4_enter_critical_section();
|
||||
/* Configure and perform calibration */
|
||||
putreg32(ADC_MCR_ADCLKSEL_DIV4, S32K3XX_ADC2_MCR);
|
||||
|
||||
_REG(KINETIS_SIM_SCGC3) |= SIM_SCGC3_ADC1;
|
||||
rCFG1(1) = ADC_CFG1_ADICLK_BUSCLK | ADC_CFG1_MODE_1213BIT | ADC_CFG1_ADIV_DIV8;
|
||||
rCFG2(1) = 0;
|
||||
rSC2(1) = ADC_SC2_REFSEL_DEFAULT;
|
||||
regval = getreg32(S32K3XX_ADC2_AMSIO);
|
||||
regval |= ADC_AMSIO_HSEN_MASK;
|
||||
putreg32(regval, S32K3XX_ADC2_AMSIO);
|
||||
|
||||
px4_leave_critical_section(flags);
|
||||
regval = getreg32(S32K3XX_ADC2_CAL2);
|
||||
regval &= ~ADC_CAL2_ENX;
|
||||
putreg32(regval, S32K3XX_ADC2_CAL2);
|
||||
|
||||
/* Clear the CALF and begin the calibration */
|
||||
regval = getreg32(S32K3XX_ADC2_CALBISTREG);
|
||||
regval &= ~(ADC_CALBISTREG_TEST_EN | ADC_CALBISTREG_AVG_EN | ADC_CALBISTREG_NR_SMPL_MASK |
|
||||
ADC_CALBISTREG_CALSTFUL | ADC_CALBISTREG_TSAMP_MASK | ADC_CALBISTREG_RESN_MASK);
|
||||
regval |= ADC_CALBISTREG_TEST_EN | ADC_CALBISTREG_AVG_EN | ADC_CALBISTREG_NR_SMPL_4SMPL |
|
||||
ADC_CALBISTREG_CALSTFUL | ADC_CALBISTREG_RESN_14BIT;
|
||||
putreg32(regval, S32K3XX_ADC2_CALBISTREG);
|
||||
|
||||
rSC3(1) = ADC_SC3_CAL | ADC_SC3_CALF;
|
||||
while (getreg32(S32K3XX_ADC2_CALBISTREG) & ADC_CALBISTREG_C_T_BUSY) {};
|
||||
|
||||
while ((rSC1A(1) & ADC_SC1_COCO) == 0) {
|
||||
usleep(100);
|
||||
putreg32(ADC_MCR_PWDN, S32K3XX_ADC2_MCR);
|
||||
|
||||
if (rSC3(1) & ADC_SC3_CALF) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
putreg32(22, S32K3XX_ADC2_CTR0);
|
||||
|
||||
/* dummy read to clear COCO of calibration */
|
||||
putreg32(22, S32K3XX_ADC2_CTR1);
|
||||
|
||||
int32_t r = rRA(1);
|
||||
putreg32(0, S32K3XX_ADC2_DMAE);
|
||||
|
||||
/* Check the state of CALF at the end of calibration */
|
||||
putreg32(ADC_MCR_ADCLKSEL_DIV4 | ADC_MCR_AVGS_32CONV | ADC_MCR_AVGEN | ADC_MCR_BCTU_MODE | ADC_MCR_MODE,
|
||||
S32K3XX_ADC2_MCR);
|
||||
|
||||
if (rSC3(1) & ADC_SC3_CALF) {
|
||||
return -1;
|
||||
}
|
||||
putreg32(0x10, S32K3XX_ADC2_NCMR0);
|
||||
|
||||
/* Calculate the calibration values for single ended positive */
|
||||
putreg32(0x10, S32K3XX_ADC2_NCMR1);
|
||||
|
||||
r = rCLP0(1) + rCLP1(1) + rCLP2(1) + rCLP3(1) + rCLP4(1) + rCLPS(1) ;
|
||||
r = 0x8000U | (r >> 1U);
|
||||
rPG(1) = r;
|
||||
regval = getreg32(S32K3XX_ADC2_MCR);
|
||||
|
||||
/* Calculate the calibration values for double ended Negitive */
|
||||
regval |= ADC_MCR_NSTART;
|
||||
|
||||
r = rCLM0(1) + rCLM1(1) + rCLM2(1) + rCLM3(1) + rCLM4(1) + rCLMS(1) ;
|
||||
r = 0x8000U | (r >> 1U);
|
||||
rMG(1) = r;
|
||||
|
||||
/* kick off a sample and wait for it to complete */
|
||||
hrt_abstime now = hrt_absolute_time();
|
||||
|
||||
rSC1A(1) = ADC_SC1_ADCH(ADC_SC1_ADCH_TEMP);
|
||||
|
||||
while (!(rSC1A(1) & ADC_SC1_COCO)) {
|
||||
|
||||
/* don't wait for more than 500us, since that means something broke - should reset here if we see this */
|
||||
if ((hrt_absolute_time() - now) > 500) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
putreg32(regval, S32K3XX_ADC2_MCR);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void px4_arch_adc_uninit(uint32_t base_address)
|
||||
{
|
||||
irqstate_t flags = px4_enter_critical_section();
|
||||
_REG(KINETIS_SIM_SCGC3) &= ~SIM_SCGC3_ADC1;
|
||||
px4_leave_critical_section(flags);
|
||||
}
|
||||
|
||||
uint32_t px4_arch_adc_sample(uint32_t base_address, unsigned channel)
|
||||
{
|
||||
irqstate_t flags = px4_enter_critical_section();
|
||||
uint32_t result = 0;
|
||||
|
||||
/* clear any previous COCC */
|
||||
rRA(1);
|
||||
if (channel == 0) {
|
||||
result = getreg32(S32K3XX_ADC2_PCDR4);
|
||||
|
||||
/* run a single conversion right now - should take about 35 cycles (5 microseconds) max */
|
||||
rSC1A(1) = ADC_SC1_ADCH(channel);
|
||||
if ((result & ADC_PCDR_VALID) == ADC_PCDR_VALID) {
|
||||
result = result & 0xFFFF;
|
||||
|
||||
/* wait for the conversion to complete */
|
||||
const hrt_abstime now = hrt_absolute_time();
|
||||
|
||||
while (!(rSC1A(1) & ADC_SC1_COCO)) {
|
||||
|
||||
/* don't wait for more than 10us, since that means something broke - should reset here if we see this */
|
||||
if ((hrt_absolute_time() - now) > 10) {
|
||||
px4_leave_critical_section(flags);
|
||||
return 0xffff;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* read the result and clear EOC */
|
||||
uint32_t result = rRA(1);
|
||||
|
||||
px4_leave_critical_section(flags);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -186,10 +118,10 @@ float px4_arch_adc_reference_v()
|
||||
|
||||
uint32_t px4_arch_adc_temp_sensor_mask()
|
||||
{
|
||||
return 1 << (ADC_SC1_ADCH_TEMP >> ADC_SC1_ADCH_SHIFT);
|
||||
return 0; // No temp sensor
|
||||
}
|
||||
|
||||
uint32_t px4_arch_adc_dn_fullcount()
|
||||
{
|
||||
return 1 << 12; // 12 bit ADC
|
||||
return 1 << 15; // 15 bit conversion data
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user