mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-06 11:40:05 +08:00
Compare commits
141 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2eb2b2a17f | |||
| bba589ece2 | |||
| ad827fc806 | |||
| 606cfba407 | |||
| 598e7e65b7 | |||
| c83e1eb175 | |||
| ba9b23c2d1 | |||
| 38fc86cf3b | |||
| a3d0ca9800 | |||
| 34b9dc880f | |||
| 04e08c5edb | |||
| 2668510295 | |||
| 5388f7f911 | |||
| a20483ed11 | |||
| 9ed861e0a3 | |||
| f7ff0a9961 | |||
| 38c02ea29a | |||
| 26190a7799 | |||
| e6eed43648 | |||
| 97f632a408 | |||
| d6488fafc3 | |||
| 32ca7ad706 | |||
| 21cb0ef50f | |||
| 6a0f394d46 | |||
| e512d77b89 | |||
| 85a621303d | |||
| 32c6ec061e | |||
| c9c62b860c | |||
| 3ffc37d988 | |||
| ab58717313 | |||
| 607c53e873 | |||
| 4dabc8b7ed | |||
| 70e95812e7 | |||
| ecdade3638 | |||
| 05133aed27 | |||
| 65a587e56a | |||
| a41a0e7e80 | |||
| 9efadad06a | |||
| a7f573e150 | |||
| e6e27e694e | |||
| 0f1f6daa1a | |||
| d160229f47 | |||
| b0c979f745 | |||
| 4fee059696 | |||
| f254b55523 | |||
| e3e067d640 | |||
| 026bd073b5 | |||
| d6fb1114ff | |||
| 1ec62c4063 | |||
| 2f3cb97872 | |||
| e5be0e776e | |||
| 8ccd8fbed1 | |||
| 8f8615e6c2 | |||
| 67107f4978 | |||
| 84b0a889a4 | |||
| f22dc80ecc | |||
| ea136e73be | |||
| cd66a262ee | |||
| 089fbdccc9 | |||
| 47aaa38d5f | |||
| 14df1ee917 | |||
| 2ece92abd0 | |||
| ace80e2b9d | |||
| 1603883dc9 | |||
| a110032dc0 | |||
| 413ce8a3c4 | |||
| de3ac12ecd | |||
| 26cb55ec2c | |||
| 121cc1fce8 | |||
| 694d36050a | |||
| 888e72661f | |||
| c60b215574 | |||
| 4953fdd1ab | |||
| 6612d4696d | |||
| d73b2e8625 | |||
| 7283cd7c9d | |||
| 8f5b274e72 | |||
| c98153e044 | |||
| 9fab914687 | |||
| 217efcb12d | |||
| ceb432aacb | |||
| 4b0a8565fe | |||
| 41b0a6c62c | |||
| d1aca4032d | |||
| 87e09ad9f5 | |||
| f962399ba1 | |||
| 39453405a0 | |||
| ed14151734 | |||
| 1a513153be | |||
| e5e74f65d7 | |||
| 1e0235d87b | |||
| 69bc5d37bc | |||
| b4e066f056 | |||
| 67b0f5e07e | |||
| 81d6fdfe8c | |||
| 7e12f6ba5a | |||
| ec02413387 | |||
| a12e40b1d8 | |||
| 1782f9cd3e | |||
| 63e4ea23b7 | |||
| c447064596 | |||
| 5648deb5a1 | |||
| 2d5f1a5c6b | |||
| 721131a135 | |||
| fcee314646 | |||
| 4d3f05479d | |||
| 7c6ce436ca | |||
| 5241f016f7 | |||
| 73010cc69b | |||
| eed073887d | |||
| ddeca2538c | |||
| 8cc6d02af3 | |||
| f9b8ca1326 | |||
| 1e55b69fdb | |||
| c71cc5b815 | |||
| 077547f31e | |||
| 768565ed6f | |||
| ea4a1bfb6a | |||
| c5f72fb5d9 | |||
| e66683a059 | |||
| 1a620b450d | |||
| a2f83269e9 | |||
| ac209c2e78 | |||
| 9886660862 | |||
| 5f953fd1da | |||
| e99da22cbe | |||
| de74f45e2d | |||
| fb455c8f4b | |||
| 19b9b052ab | |||
| a73efd9c4f | |||
| fe22167512 | |||
| a23cb111b7 | |||
| b7d6e646cc | |||
| c2f5ffdfcd | |||
| 92cdff6798 | |||
| b57d3c6d74 | |||
| 6dbea21ef5 | |||
| c05e0f076b | |||
| cae7e1b88b | |||
| 461d0561b8 | |||
| 226b8a6f90 |
+10
-2
@@ -1,11 +1,17 @@
|
||||
---
|
||||
Checks: '*,
|
||||
-*-avoid-c-arrays,
|
||||
-*-uppercase-literal-suffix,
|
||||
-*-magic-numbers,
|
||||
-altera-id-dependent-backward-branch,
|
||||
-altera-unroll-loops,
|
||||
-android*,
|
||||
-bugprone-integer-division,
|
||||
-cert-dcl50-cpp,
|
||||
-cert-env33-c,
|
||||
-cert-err34-c,
|
||||
-cert-err58-cpp,
|
||||
-cert-flp30-c,
|
||||
-cert-msc30-c,
|
||||
-cert-msc50-cpp,
|
||||
-clang-analyzer-core.CallAndMessage,
|
||||
@@ -18,6 +24,7 @@ Checks: '*,
|
||||
-clang-analyzer-deadcode.DeadStores,
|
||||
-clang-analyzer-optin.cplusplus.VirtualCall,
|
||||
-clang-analyzer-optin.performance.Padding,
|
||||
-clang-analyzer-security.FloatLoopCounter,
|
||||
-clang-analyzer-security.insecureAPI.strcpy,
|
||||
-clang-analyzer-unix.API,
|
||||
-clang-analyzer-unix.cstring.BadSizeArg,
|
||||
@@ -37,8 +44,7 @@ Checks: '*,
|
||||
-cppcoreguidelines-pro-type-union-access,
|
||||
-cppcoreguidelines-pro-type-vararg,
|
||||
-cppcoreguidelines-special-member-functions,
|
||||
-fuchsia-default-arguments,
|
||||
-fuchsia-overloaded-operator,
|
||||
-fuchsia-*,
|
||||
-google-build-using-namespace,
|
||||
-google-explicit-constructor,
|
||||
-google-global-names-in-headers,
|
||||
@@ -62,6 +68,7 @@ Checks: '*,
|
||||
-hicpp-use-equals-delete,
|
||||
-hicpp-use-override,
|
||||
-hicpp-vararg,
|
||||
-llvmlibc-*,
|
||||
-llvm-header-guard,
|
||||
-llvm-include-order,
|
||||
-llvm-namespace-comment,
|
||||
@@ -84,6 +91,7 @@ Checks: '*,
|
||||
-modernize-use-override,
|
||||
-modernize-use-trailing-return-type,
|
||||
-modernize-use-using,
|
||||
-modernize-use-trailing-return-type,
|
||||
-performance-inefficient-string-concatenation,
|
||||
-readability-avoid-const-params-in-decls,
|
||||
-readability-container-size-empty,
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
name: docker-dev
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: file_changes
|
||||
uses: trilom/file-changes-action@v1.2.3
|
||||
- name: test
|
||||
run: |
|
||||
echo '${{ steps.file_changes.outputs.files}}'
|
||||
echo '${{ steps.file_changes.outputs.files_modified}}'
|
||||
echo '${{ steps.file_changes.outputs.files_added}}'
|
||||
echo '${{ steps.file_changes.outputs.files_removed}}'
|
||||
@@ -175,6 +175,12 @@ include(kconfig)
|
||||
message(STATUS "PX4 config: ${PX4_CONFIG}")
|
||||
message(STATUS "PX4 platform: ${PX4_PLATFORM}")
|
||||
|
||||
if($ENV{CLION_IDE})
|
||||
# CLion automatically executes some compiler commands after configuring the
|
||||
# project. This would fail on NuttX, as visibility.h tries to (indirectly)
|
||||
# include nuttx/config.h, which at that point does not exist yet
|
||||
add_definitions(-DPX4_DISABLE_GCC_POISON)
|
||||
endif()
|
||||
|
||||
if(${PX4_PLATFORM} STREQUAL "posix")
|
||||
if(ENABLE_LOCKSTEP_SCHEDULER)
|
||||
|
||||
@@ -6,38 +6,38 @@
|
||||
|
||||
[](https://join.slack.com/t/px4/shared_invite/zt-si4xo5qs-R4baYFmMjlrT4rQK5yUnaA)
|
||||
|
||||
This repository holds the [PX4](http://px4.io) flight control solution for drones, with the main applications located in the [src/modules](https://github.com/PX4/PX4-Autopilot/tree/master/src/modules) directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
|
||||
This repository holds the [PX4](http://px4.io) flight control solution for drones, with the main applications located in the [src/modules](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules) directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
|
||||
|
||||
PX4 is highly portable, OS-independent and supports Linux, NuttX and MacOS out of the box.
|
||||
|
||||
* Official Website: http://px4.io (License: BSD 3-clause, [LICENSE](https://github.com/PX4/PX4-Autopilot/blob/master/LICENSE))
|
||||
* [Supported airframes](https://docs.px4.io/master/en/airframes/airframe_reference.html) ([portfolio](http://px4.io/#airframes)):
|
||||
* [Multicopters](https://docs.px4.io/master/en/frames_multicopter/)
|
||||
* [Fixed wing](https://docs.px4.io/master/en/frames_plane/)
|
||||
* [VTOL](https://docs.px4.io/master/en/frames_vtol/)
|
||||
* [Autogyro](https://docs.px4.io/master/en/frames_autogyro/)
|
||||
* [Rover](https://docs.px4.io/master/en/frames_rover/)
|
||||
* [Supported airframes](https://docs.px4.io/main/en/airframes/airframe_reference.html) ([portfolio](http://px4.io/#airframes)):
|
||||
* [Multicopters](https://docs.px4.io/main/en/frames_multicopter/)
|
||||
* [Fixed wing](https://docs.px4.io/main/en/frames_plane/)
|
||||
* [VTOL](https://docs.px4.io/main/en/frames_vtol/)
|
||||
* [Autogyro](https://docs.px4.io/main/en/frames_autogyro/)
|
||||
* [Rover](https://docs.px4.io/main/en/frames_rover/)
|
||||
* many more experimental types (Blimps, Boats, Submarines, High altitude balloons, etc)
|
||||
* Releases: [Downloads](https://github.com/PX4/PX4-Autopilot/releases)
|
||||
|
||||
|
||||
## Building a PX4 based drone, rover, boat or robot
|
||||
|
||||
The [PX4 User Guide](https://docs.px4.io/master/en/) explains how to assemble [supported vehicles](https://docs.px4.io/master/en/airframes/airframe_reference.html) and fly drones with PX4.
|
||||
See the [forum and chat](https://docs.px4.io/master/en/#support) if you need help!
|
||||
The [PX4 User Guide](https://docs.px4.io/main/en/) explains how to assemble [supported vehicles](https://docs.px4.io/main/en/airframes/airframe_reference.html) and fly drones with PX4.
|
||||
See the [forum and chat](https://docs.px4.io/main/en/#getting-help) if you need help!
|
||||
|
||||
|
||||
## Changing code and contributing
|
||||
|
||||
This [Developer Guide](https://docs.px4.io/master/en/development/development.html) is for software developers who want to modify the flight stack and middleware (e.g. to add new flight modes), hardware integrators who want to support new flight controller boards and peripherals, and anyone who wants to get PX4 working on a new (unsupported) airframe/vehicle.
|
||||
This [Developer Guide](https://docs.px4.io/main/en/development/development.html) is for software developers who want to modify the flight stack and middleware (e.g. to add new flight modes), hardware integrators who want to support new flight controller boards and peripherals, and anyone who wants to get PX4 working on a new (unsupported) airframe/vehicle.
|
||||
|
||||
Developers should read the [Guide for Contributions](https://docs.px4.io/master/en/contribute/).
|
||||
See the [forum and chat](https://dev.px4.io/master/en/#support) if you need help!
|
||||
Developers should read the [Guide for Contributions](https://docs.px4.io/main/en/contribute/).
|
||||
See the [forum and chat](https://docs.px4.io/main/en/#getting-help) if you need help!
|
||||
|
||||
|
||||
### Weekly Dev Call
|
||||
|
||||
The PX4 Dev Team syncs up on a [weekly dev call](https://dev.px4.io/master/en/contribute/#dev_call).
|
||||
The PX4 Dev Team syncs up on a [weekly dev call](https://docs.px4.io/main/en/contribute/).
|
||||
|
||||
> **Note** The dev call is open to all interested developers (not just the core dev team). This is a great opportunity to meet the team and contribute to the ongoing development of the platform. It includes a QA session for newcomers. All regular calls are listed in the [Dronecode calendar](https://www.dronecode.org/calendar/).
|
||||
|
||||
@@ -88,35 +88,43 @@ This repository contains code supporting Pixhawk standard boards (best supported
|
||||
* FMUv6X and FMUv6U (STM32H7, 2021)
|
||||
* Various vendors will provide FMUv6X and FMUv6U based designs Q3/2021
|
||||
* FMUv5 and FMUv5X (STM32F7, 2019/20)
|
||||
* [Pixhawk 4 (FMUv5)](https://docs.px4.io/master/en/flight_controller/pixhawk4.html)
|
||||
* [Pixhawk 4 mini (FMUv5)](https://docs.px4.io/master/en/flight_controller/pixhawk4_mini.html)
|
||||
* [CUAV V5+ (FMUv5)](https://docs.px4.io/master/en/flight_controller/cuav_v5_plus.html)
|
||||
* [CUAV V5 nano (FMUv5)](https://docs.px4.io/master/en/flight_controller/cuav_v5_nano.html)
|
||||
* [Auterion Skynode (FMUv5X)](https://docs.px4.io/master/en/flight_controller/auterion_skynode.html)
|
||||
* [Pixhawk 4 (FMUv5)](https://docs.px4.io/main/en/flight_controller/pixhawk4.html)
|
||||
* [Pixhawk 4 mini (FMUv5)](https://docs.px4.io/main/en/flight_controller/pixhawk4_mini.html)
|
||||
* [CUAV V5+ (FMUv5)](https://docs.px4.io/main/en/flight_controller/cuav_v5_plus.html)
|
||||
* [CUAV V5 nano (FMUv5)](https://docs.px4.io/main/en/flight_controller/cuav_v5_nano.html)
|
||||
* [Auterion Skynode (FMUv5X)](https://docs.auterion.com/skynode)
|
||||
* FMUv4 (STM32F4, 2015)
|
||||
* [Pixracer](https://docs.px4.io/master/en/flight_controller/pixracer.html)
|
||||
* [Pixhawk 3 Pro](https://docs.px4.io/master/en/flight_controller/pixhawk3_pro.html)
|
||||
* [Pixracer](https://docs.px4.io/main/en/flight_controller/pixracer.html)
|
||||
* [Pixhawk 3 Pro](https://docs.px4.io/main/en/flight_controller/pixhawk3_pro.html)
|
||||
* FMUv3 (STM32F4, 2014)
|
||||
* [Pixhawk 2](https://docs.px4.io/master/en/flight_controller/pixhawk-2.html)
|
||||
* [Pixhawk Mini](https://docs.px4.io/master/en/flight_controller/pixhawk_mini.html)
|
||||
* [CUAV Pixhack v3](https://docs.px4.io/master/en/flight_controller/pixhack_v3.html)
|
||||
* [Pixhawk 2](https://docs.px4.io/main/en/flight_controller/pixhawk-2.html)
|
||||
* [Pixhawk Mini](https://docs.px4.io/main/en/flight_controller/pixhawk_mini.html)
|
||||
* [CUAV Pixhack v3](https://docs.px4.io/main/en/flight_controller/pixhack_v3.html)
|
||||
* FMUv2 (STM32F4, 2013)
|
||||
* [Pixhawk](https://docs.px4.io/master/en/flight_controller/pixhawk.html)
|
||||
* [Pixfalcon](https://docs.px4.io/master/en/flight_controller/pixfalcon.html)
|
||||
* [Pixhawk](https://docs.px4.io/main/en/flight_controller/pixhawk.html)
|
||||
* [Pixfalcon](https://docs.px4.io/main/en/flight_controller/pixfalcon.html)
|
||||
|
||||
### Manufacturer and Community supported
|
||||
* [Holybro Durandal](https://docs.px4.io/master/en/flight_controller/durandal.html)
|
||||
* [Hex Cube Orange](https://docs.px4.io/master/en/flight_controller/cubepilot_cube_orange.html)
|
||||
* [Hex Cube Yellow](https://docs.px4.io/master/en/flight_controller/cubepilot_cube_yellow.html)
|
||||
* [Holybro Durandal](https://docs.px4.io/main/en/flight_controller/durandal.html)
|
||||
* [Hex Cube Orange](https://docs.px4.io/main/en/flight_controller/cubepilot_cube_orange.html)
|
||||
* [Hex Cube Yellow](https://docs.px4.io/main/en/flight_controller/cubepilot_cube_yellow.html)
|
||||
* [Airmind MindPX V2.8](http://www.mindpx.net/assets/accessories/UserGuide_MindPX.pdf)
|
||||
* [Airmind MindRacer V1.2](http://mindpx.net/assets/accessories/mindracer_user_guide_v1.2.pdf)
|
||||
* [Bitcraze Crazyflie 2.0](https://docs.px4.io/master/en/complete_vehicles/crazyflie2.html)
|
||||
* [Omnibus F4 SD](https://docs.px4.io/master/en/flight_controller/omnibus_f4_sd.html)
|
||||
* [Holybro Kakute F7](https://docs.px4.io/master/en/flight_controller/kakutef7.html)
|
||||
* [Raspberry PI with Navio 2](https://docs.px4.io/master/en/flight_controller/raspberry_pi_navio2.html)
|
||||
* [Bitcraze Crazyflie 2.0](https://docs.px4.io/main/en/complete_vehicles/crazyflie2.html)
|
||||
* [Omnibus F4 SD](https://docs.px4.io/main/en/flight_controller/omnibus_f4_sd.html)
|
||||
* [Holybro Kakute F7](https://docs.px4.io/main/en/flight_controller/kakutef7.html)
|
||||
* [Raspberry PI with Navio 2](https://docs.px4.io/main/en/flight_controller/raspberry_pi_navio2.html)
|
||||
|
||||
Additional information about supported hardware can be found in [PX4 user Guide > Autopilot Hardware](https://docs.px4.io/master/en/flight_controller/).
|
||||
Additional information about supported hardware can be found in [PX4 user Guide > Autopilot Hardware](https://docs.px4.io/main/en/flight_controller/).
|
||||
|
||||
## Project Roadmap
|
||||
|
||||
A high level project roadmap is available [here](https://github.com/orgs/PX4/projects/25).
|
||||
|
||||
## Project Governance
|
||||
|
||||
The PX4 Autopilot project including all of its trademarks is hosted under [Dronecode](https://www.dronecode.org/), part of the Linux Foundation.
|
||||
|
||||
<a href="https://www.dronecode.org/" style="padding:20px" ><img src="https://mavlink.io/assets/site/logo_dronecode.png" alt="Dronecode Logo" width="110px"/></a>
|
||||
<a href="https://www.linuxfoundation.org/projects" style="padding:20px;"><img src="https://mavlink.io/assets/site/logo_linux_foundation.png" alt="Linux Foundation Logo" width="80px" /></a>
|
||||
<div style="padding:10px"> </div>
|
||||
|
||||
@@ -10,7 +10,6 @@ param set-default EKF2_MAG_YAWLIM 0
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1
|
||||
param set-default FW_LND_ANG 8
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
|
||||
param set-default FW_L1_PERIOD 12
|
||||
|
||||
@@ -29,7 +28,7 @@ param set-default FW_SPOILERS_LND 0.4
|
||||
|
||||
param set-default FW_THR_MAX 0.6
|
||||
param set-default FW_THR_MIN 0.05
|
||||
param set-default FW_THR_CRUISE 0.25
|
||||
param set-default FW_THR_TRIM 0.25
|
||||
|
||||
param set-default FW_T_CLMB_MAX 8
|
||||
param set-default FW_T_SINK_MAX 2.7
|
||||
|
||||
@@ -7,12 +7,9 @@
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1.1
|
||||
param set-default FW_LND_ANG 5
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
param set-default FW_LND_HHDIST 30
|
||||
param set-default FW_LND_FL_PMIN 9.5
|
||||
param set-default FW_LND_FL_PMAX 20
|
||||
param set-default FW_LND_FLALT 5
|
||||
param set-default FW_LND_TLALT 15
|
||||
|
||||
param set-default FW_L1_PERIOD 25
|
||||
|
||||
@@ -38,7 +35,6 @@ param set-default NAV_DLL_ACT 2
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default RWTO_MAX_PITCH 20
|
||||
param set-default RWTO_MAX_ROLL 10
|
||||
|
||||
param set-default RWTO_PSP 8
|
||||
param set-default RWTO_AIRSPD_SCL 1.8
|
||||
|
||||
@@ -7,12 +7,9 @@
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1.1
|
||||
param set-default FW_LND_ANG 5
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
param set-default FW_LND_HHDIST 30
|
||||
param set-default FW_LND_FL_PMIN 9.5
|
||||
param set-default FW_LND_FL_PMAX 20
|
||||
param set-default FW_LND_FLALT 5
|
||||
param set-default FW_LND_TLALT 15
|
||||
|
||||
param set-default FW_L1_PERIOD 25
|
||||
|
||||
@@ -38,7 +35,6 @@ param set-default NAV_DLL_ACT 2
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default RWTO_MAX_PITCH 20
|
||||
param set-default RWTO_MAX_ROLL 10
|
||||
|
||||
param set-default RWTO_PSP 8
|
||||
param set-default RWTO_AIRSPD_SCL 1.8
|
||||
|
||||
@@ -10,7 +10,6 @@ param set-default EKF2_MAG_YAWLIM 0
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1
|
||||
param set-default FW_LND_ANG 8
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
|
||||
param set-default FW_L1_PERIOD 15
|
||||
|
||||
|
||||
@@ -7,12 +7,9 @@
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1.1
|
||||
param set-default FW_LND_ANG 5
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
param set-default FW_LND_HHDIST 30
|
||||
param set-default FW_LND_FL_PMIN 9.5
|
||||
param set-default FW_LND_FL_PMAX 20
|
||||
param set-default FW_LND_FLALT 5
|
||||
param set-default FW_LND_TLALT 15
|
||||
|
||||
param set-default FW_L1_PERIOD 25
|
||||
|
||||
@@ -37,7 +34,6 @@ param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
param set-default RWTO_MAX_PITCH 20
|
||||
param set-default RWTO_MAX_ROLL 10
|
||||
param set-default RWTO_PSP 8
|
||||
param set-default RWTO_AIRSPD_SCL 1.8
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ param set-default EKF2_MAG_YAWLIM 0
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1
|
||||
param set-default FW_LND_ANG 8
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
|
||||
param set-default FW_L1_PERIOD 12
|
||||
|
||||
@@ -27,7 +26,7 @@ param set-default FW_RR_P 0.3
|
||||
|
||||
param set-default FW_THR_MAX 0.6
|
||||
param set-default FW_THR_MIN 0.05
|
||||
param set-default FW_THR_CRUISE 0.25
|
||||
param set-default FW_THR_TRIM 0.25
|
||||
|
||||
param set-default FW_T_ALT_TC 2
|
||||
param set-default FW_T_CLMB_MAX 8
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
|
||||
. ${R}etc/init.d-posix/airframes/1030_plane
|
||||
|
||||
param set-default FW_THR_CRUISE 0.0
|
||||
param set-default FW_THR_TRIM 0.0
|
||||
param set-default RWTO_TKOFF 0
|
||||
|
||||
@@ -57,7 +57,7 @@ param set-default FW_P_LIM_MAX 32
|
||||
param set-default FW_P_LIM_MIN -15
|
||||
param set-default FW_RR_FF 0.1
|
||||
param set-default FW_RR_P 0.3
|
||||
param set-default FW_THR_CRUISE 0.25
|
||||
param set-default FW_THR_TRIM 0.25
|
||||
param set-default FW_THR_MAX 0.6
|
||||
param set-default FW_THR_MIN 0.05
|
||||
param set-default FW_T_CLMB_MAX 8
|
||||
|
||||
@@ -51,7 +51,7 @@ param set-default FW_PSP_OFF 2
|
||||
param set-default FW_P_LIM_MAX 32
|
||||
param set-default FW_P_LIM_MIN -15
|
||||
param set-default FW_RR_P 0.2
|
||||
param set-default FW_THR_CRUISE 0.33
|
||||
param set-default FW_THR_TRIM 0.33
|
||||
param set-default FW_THR_MAX 0.6
|
||||
param set-default FW_THR_MIN 0.05
|
||||
param set-default FW_T_ALT_TC 2
|
||||
|
||||
@@ -64,7 +64,7 @@ param set-default FW_P_LIM_MAX 32
|
||||
param set-default FW_P_LIM_MIN -15
|
||||
param set-default FW_RR_FF 0.1
|
||||
param set-default FW_RR_P 0.3
|
||||
param set-default FW_THR_CRUISE 0.38
|
||||
param set-default FW_THR_TRIM 0.38
|
||||
param set-default FW_THR_MAX 0.6
|
||||
param set-default FW_THR_MIN 0.05
|
||||
param set-default FW_T_CLMB_MAX 8
|
||||
|
||||
@@ -16,7 +16,7 @@ param set-default FW_P_LIM_MAX 32
|
||||
param set-default FW_P_LIM_MIN -15
|
||||
param set-default FW_RR_FF 0.1
|
||||
param set-default FW_RR_P 0.3
|
||||
param set-default FW_THR_CRUISE 0.25
|
||||
param set-default FW_THR_TRIM 0.25
|
||||
param set-default FW_THR_MAX 0.6
|
||||
param set-default FW_THR_MIN 0.05
|
||||
param set-default FW_T_ALT_TC 2
|
||||
|
||||
@@ -41,7 +41,7 @@ param set-default FW_R_LIM 30
|
||||
param set-default FW_MAN_P_MAX 30.0
|
||||
param set-default FW_MAN_R_MAX 30.0
|
||||
|
||||
param set-default FW_THR_CRUISE 0.8
|
||||
param set-default FW_THR_TRIM 0.8
|
||||
param set-default FW_THR_IDLE 0
|
||||
param set-default COM_DISARM_PRFLT 0
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name ThunderFly TF-G2
|
||||
# ThunderFly TF-G2 autogyro airframe. Only for FlightGear simulator
|
||||
#
|
||||
# @type Autogyro
|
||||
# @class Autogyro
|
||||
#
|
||||
# @url https://github.com/ThunderFly-aerospace/TF-G2/
|
||||
#
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
param set-default FW_AIRSPD_STALL 5
|
||||
|
||||
param set-default FW_P_RMAX_NEG 20.0
|
||||
param set-default FW_W_RMAX 10
|
||||
param set-default FW_W_EN 1
|
||||
|
||||
param set-default FW_RR_P 0.08
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 50
|
||||
param set-default MIS_TAKEOFF_ALT 7
|
||||
|
||||
param set-default NAV_ACC_RAD 20
|
||||
param set-default NAV_DLL_ACT 2
|
||||
param set-default NAV_LOITER_RAD 50
|
||||
|
||||
param set-default RWTO_TKOFF 0
|
||||
# Parameters related to autogyro takeoff PR
|
||||
#param set-default AG_TKOFF 1
|
||||
#param set-default AG_PROT_TYPE 1
|
||||
#param set-default AG_PROT_MIN_RPM 50.0
|
||||
#param set-default AG_PROT_TRG_RPM 900.0
|
||||
#param set-defoult AG_ROTOR_RPM 900.0
|
||||
|
||||
param set-default FW_ARSP_SCALE_EN 0
|
||||
|
||||
param set-default FW_AIRSPD_MAX 35
|
||||
param set-default FW_AIRSPD_MIN 7
|
||||
|
||||
param set-default FW_P_LIM_MAX 25
|
||||
param set-default FW_P_LIM_MIN -5
|
||||
param set-default FW_R_LIM 30
|
||||
|
||||
param set-default FW_MAN_P_MAX 30.0
|
||||
param set-default FW_MAN_R_MAX 30.0
|
||||
|
||||
param set-default FW_THR_CRUISE 0.8
|
||||
param set-default FW_THR_IDLE 0
|
||||
param set-default COM_DISARM_PRFLT 0
|
||||
|
||||
set MIXER_FILE etc/mixers-sitl/autogyro_sitl.main.mix
|
||||
set MIXER custom
|
||||
@@ -78,6 +78,7 @@ px4_add_romfs_files(
|
||||
3010_quadrotor_x
|
||||
3011_hexarotor_x
|
||||
17001_tf-g1
|
||||
17002_tf-g2
|
||||
2507_cloudship
|
||||
6011_typhoon_h480
|
||||
6011_typhoon_h480.post
|
||||
|
||||
@@ -29,9 +29,6 @@ param set-default FW_L1_DAMPING 0.74
|
||||
param set-default FW_L1_PERIOD 16
|
||||
param set-default FW_LND_ANG 15
|
||||
param set-default FW_LND_FLALT 5
|
||||
param set-default FW_LND_HVIRT 13
|
||||
param set-default FW_LND_TLALT 5
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
param set-default FW_PR_FF 0.35
|
||||
param set-default FW_PR_P 0.2
|
||||
param set-default FW_RR_FF 0.6
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name Generic Quadplane VTOL
|
||||
# @name Generic Standard VTOL
|
||||
#
|
||||
# @type Standard VTOL
|
||||
# @class VTOL
|
||||
#
|
||||
# @maintainer
|
||||
#
|
||||
# @output MAIN1 motor 1
|
||||
# @output MAIN2 motor 2
|
||||
# @output MAIN3 motor 3
|
||||
# @output MAIN4 motor 4
|
||||
# @output AUX1 Aileron 1
|
||||
# @output AUX2 Aileron 2
|
||||
# @output AUX3 Elevator
|
||||
# @output AUX4 Rudder
|
||||
# @output AUX5 Throttle
|
||||
#
|
||||
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
# @board holybro_kakutef7 exclude
|
||||
@@ -24,21 +12,21 @@
|
||||
|
||||
. ${R}etc/init.d/rc.vtol_defaults
|
||||
|
||||
param set-default SYS_CTRL_ALLOC 1
|
||||
param set-default CA_AIRFRAME 2
|
||||
param set-default CA_ROTOR_COUNT 5
|
||||
param set-default CA_ROTOR0_PX 0.15
|
||||
param set-default CA_ROTOR0_PY 0.15
|
||||
param set-default CA_ROTOR1_PX -0.15
|
||||
param set-default CA_ROTOR1_PY -0.15
|
||||
param set-default CA_ROTOR2_PX 0.15
|
||||
param set-default CA_ROTOR2_PY -0.15
|
||||
param set-default CA_ROTOR0_PX 1
|
||||
param set-default CA_ROTOR0_PY 1
|
||||
param set-default CA_ROTOR1_PX -1
|
||||
param set-default CA_ROTOR1_PY -1
|
||||
param set-default CA_ROTOR2_PX 1
|
||||
param set-default CA_ROTOR2_PY -1
|
||||
param set-default CA_ROTOR2_KM -0.05
|
||||
param set-default CA_ROTOR3_PX -0.15
|
||||
param set-default CA_ROTOR3_PY 0.15
|
||||
param set-default CA_ROTOR3_PX -1
|
||||
param set-default CA_ROTOR3_PY 1
|
||||
param set-default CA_ROTOR3_KM -0.05
|
||||
param set-default CA_ROTOR4_AX 1.0
|
||||
param set-default CA_ROTOR4_AZ 0.0
|
||||
param set-default CA_ROTOR4_PX 0.2
|
||||
param set-default CA_SV_CS_COUNT 4
|
||||
param set-default CA_SV_CS0_TYPE 1
|
||||
param set-default CA_SV_CS0_TRQ_R -0.5
|
||||
@@ -48,16 +36,5 @@ param set-default CA_SV_CS2_TYPE 3
|
||||
param set-default CA_SV_CS2_TRQ_P 1.0
|
||||
param set-default CA_SV_CS3_TRQ_Y 1.0
|
||||
param set-default CA_SV_CS3_TYPE 4
|
||||
|
||||
param set-default PWM_AUX_DIS5 950
|
||||
|
||||
param set-default VT_TYPE 2
|
||||
param set-default VT_MOT_ID 1234
|
||||
param set-default VT_FW_MOT_OFFID 1234
|
||||
|
||||
param set-default MAV_TYPE 22
|
||||
|
||||
set MIXER quad_x
|
||||
set MIXER_AUX vtol_AAERT
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
@@ -43,7 +43,7 @@ param set-default MPC_YAWRAUTO_MAX 40
|
||||
param set-default FW_PR_I 0.02
|
||||
param set-default FW_RR_FF 0.6
|
||||
param set-default FW_RR_I 0.01
|
||||
param set-default FW_THR_CRUISE 0.75
|
||||
param set-default FW_THR_TRIM 0.75
|
||||
|
||||
param set-default VT_ARSP_BLEND 6
|
||||
param set-default VT_ARSP_TRANS 12
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
. ${R}etc/init.d/rc.vtol_defaults
|
||||
|
||||
|
||||
param set-default FW_THR_CRUISE 65
|
||||
param set-default FW_THR_TRIM 65
|
||||
param set-default FW_RR_FF 0.6
|
||||
|
||||
param set-default MIS_YAW_TMT 10
|
||||
|
||||
@@ -53,7 +53,7 @@ param set-default FW_T_CLMB_MAX 3
|
||||
param set-default FW_T_SINK_MAX 3
|
||||
param set-default FW_T_SINK_MIN 1
|
||||
param set-default FW_T_VERT_ACC 6
|
||||
param set-default FW_THR_CRUISE 0.70
|
||||
param set-default FW_THR_TRIM 0.70
|
||||
param set-default FW_THR_SLEW_MAX 1
|
||||
param set-default FW_MAN_P_MAX 30
|
||||
param set-default FW_P_LIM_MAX 15
|
||||
|
||||
@@ -39,7 +39,7 @@ param set-default FW_RLL_TO_YAW_FF 0.1
|
||||
param set-default FW_RR_P 0.08
|
||||
param set-default FW_R_LIM 45
|
||||
param set-default FW_R_RMAX 50
|
||||
param set-default FW_THR_CRUISE 0.65
|
||||
param set-default FW_THR_TRIM 0.65
|
||||
param set-default FW_THR_MIN 0.3
|
||||
param set-default FW_THR_SLEW_MAX 0.6
|
||||
param set-default FW_T_HRATE_FF 0
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name Generic Tiltrotor VTOL
|
||||
#
|
||||
# @type VTOL Tiltrotor
|
||||
# @class VTOL
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.vtol_defaults
|
||||
|
||||
param set-default SYS_CTRL_ALLOC 1
|
||||
|
||||
param set-default CA_AIRFRAME 3
|
||||
param set-default CA_ROTOR_COUNT 4
|
||||
param set-default CA_ROTOR0_PX 1
|
||||
param set-default CA_ROTOR0_PY 1
|
||||
param set-default CA_ROTOR0_TILT 2
|
||||
param set-default CA_ROTOR1_PX -1
|
||||
param set-default CA_ROTOR1_PY -1
|
||||
param set-default CA_ROTOR2_PX 1
|
||||
param set-default CA_ROTOR2_PY -1
|
||||
param set-default CA_ROTOR2_TILT 1
|
||||
param set-default CA_ROTOR2_KM -0.05
|
||||
param set-default CA_ROTOR3_PX -1
|
||||
param set-default CA_ROTOR3_PY 1
|
||||
param set-default CA_ROTOR3_KM -0.05
|
||||
param set-default CA_SV_CS_COUNT 4
|
||||
param set-default CA_SV_CS0_TYPE 1
|
||||
param set-default CA_SV_CS0_TRQ_R -0.5
|
||||
param set-default CA_SV_CS1_TYPE 2
|
||||
param set-default CA_SV_CS1_TRQ_R 0.5
|
||||
param set-default CA_SV_CS2_TYPE 7
|
||||
param set-default CA_SV_CS2_TRQ_P 0.5
|
||||
param set-default CA_SV_CS2_TRQ_Y 0.5
|
||||
param set-default CA_SV_CS3_TYPE 8
|
||||
param set-default CA_SV_CS3_TRQ_P 0.5
|
||||
param set-default CA_SV_CS3_TRQ_Y -0.5
|
||||
param set-default CA_SV_TL_COUNT 2
|
||||
|
||||
param set-default MAV_TYPE 21
|
||||
param set-default VT_TYPE 1
|
||||
@@ -1,17 +1,10 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name Generic Tailsitter
|
||||
# @name Generic VTOL Tailsitter
|
||||
#
|
||||
# @type VTOL Duo Tailsitter
|
||||
# @type VTOL Tailsitter
|
||||
# @class VTOL
|
||||
#
|
||||
# @output MAIN1 motor right
|
||||
# @output MAIN2 motor left
|
||||
# @output MAIN5 elevon right
|
||||
# @output MAIN6 elevon left
|
||||
#
|
||||
# @maintainer Roman Bapst <roman@px4.io>
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
# @board holybro_kakutef7 exclude
|
||||
@@ -19,18 +12,13 @@
|
||||
|
||||
. ${R}etc/init.d/rc.vtol_defaults
|
||||
|
||||
param set-default MAV_TYPE 19
|
||||
|
||||
param set-default VT_ELEV_MC_LOCK 0
|
||||
param set-default VT_MOT_COUNT 2
|
||||
param set-default VT_TYPE 0
|
||||
|
||||
param set-default SYS_CTRL_ALLOC 1
|
||||
param set-default CA_AIRFRAME 4
|
||||
param set-default CA_ROTOR_COUNT 2
|
||||
param set-default CA_ROTOR0_KM -0.05
|
||||
param set-default CA_ROTOR0_PY 0.2
|
||||
param set-default CA_ROTOR1_KM -0.05
|
||||
param set-default CA_ROTOR1_PY -0.2
|
||||
param set-default CA_ROTOR0_PY -0.2
|
||||
param set-default CA_ROTOR1_KM 0.05
|
||||
param set-default CA_ROTOR1_PY 0.2
|
||||
param set-default CA_SV_CS_COUNT 2
|
||||
param set-default CA_SV_CS0_TRQ_P 0.5
|
||||
param set-default CA_SV_CS0_TRQ_Y 0.5
|
||||
@@ -39,6 +27,6 @@ param set-default CA_SV_CS1_TRQ_P 0.5
|
||||
param set-default CA_SV_CS1_TRQ_Y -0.5
|
||||
param set-default CA_SV_CS1_TYPE 6
|
||||
|
||||
set MIXER vtol_tailsitter_duo
|
||||
|
||||
set PWM_OUT 1234
|
||||
param set-default MAV_TYPE 19
|
||||
param set-default VT_TYPE 0
|
||||
param set-default VT_ELEV_MC_LOCK 0
|
||||
|
||||
@@ -37,7 +37,7 @@ param set-default SENS_BOARD_ROT 8
|
||||
param set-default FW_AIRSPD_MAX 20
|
||||
param set-default FW_AIRSPD_MIN 7
|
||||
param set-default FW_AIRSPD_TRIM 13
|
||||
param set-default FW_THR_CRUISE 0.8
|
||||
param set-default FW_THR_TRIM 0.8
|
||||
|
||||
param set-default FW_MAN_P_MAX 25
|
||||
param set-default FW_MAN_R_MAX 25
|
||||
|
||||
@@ -32,7 +32,7 @@ param set-default SENS_BOARD_ROT 4
|
||||
param set-default FW_AIRSPD_MAX 20
|
||||
param set-default FW_AIRSPD_MIN 7
|
||||
param set-default FW_AIRSPD_TRIM 13
|
||||
param set-default FW_THR_CRUISE 0.8
|
||||
param set-default FW_THR_TRIM 0.8
|
||||
|
||||
param set-default FW_MAN_P_MAX 25
|
||||
param set-default FW_MAN_R_MAX 25
|
||||
|
||||
@@ -1,28 +1,16 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name Standard Plane
|
||||
# @name Generic Standard Plane
|
||||
#
|
||||
# @type Standard Plane
|
||||
# @class Plane
|
||||
#
|
||||
# @output MAIN1 aileron
|
||||
# @output MAIN2 elevator
|
||||
# @output MAIN3 throttle
|
||||
# @output MAIN4 rudder
|
||||
# @output MAIN5 flaps
|
||||
# @output MAIN6 gear
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
# @board bitcraze_crazyflie exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
param set-default SYS_CTRL_ALLOC 1
|
||||
param set-default CA_AIRFRAME 1
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
@@ -34,11 +22,3 @@ param set-default CA_SV_CS2_TRQ_P 1.0
|
||||
param set-default CA_SV_CS2_TYPE 3
|
||||
param set-default CA_SV_CS3_TRQ_Y 1.0
|
||||
param set-default CA_SV_CS3_TYPE 4
|
||||
|
||||
param set-default PWM_AUX_RATE 50
|
||||
param set-default PWM_MAIN_RATE 50
|
||||
|
||||
set MIXER AETRFG
|
||||
|
||||
# Rate must be set by group (see pwm info).
|
||||
# Throttle is in the same group as servos.
|
||||
|
||||
@@ -5,19 +5,20 @@
|
||||
# @type Flying Wing
|
||||
# @class Plane
|
||||
#
|
||||
# @output MAIN1 left aileron
|
||||
# @output MAIN2 right aileron
|
||||
# @output MAIN4 throttle
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer
|
||||
#
|
||||
# @board bitcraze_crazyflie exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
set MIXER fw_generic_wing
|
||||
param set-default SYS_CTRL_ALLOC 1
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.15
|
||||
param set-default CA_SV_CS_COUNT 2
|
||||
param set-default CA_SV_CS0_TYPE 5
|
||||
param set-default CA_SV_CS0_TRQ_P 0.5
|
||||
param set-default CA_SV_CS0_TRQ_R -0.5
|
||||
param set-default CA_SV_CS1_TYPE 6
|
||||
param set-default CA_SV_CS1_TRQ_P 0.5
|
||||
param set-default CA_SV_CS1_TRQ_R 0.5
|
||||
|
||||
@@ -30,9 +30,6 @@ param set-default FW_L1_DAMPING 0.74
|
||||
param set-default FW_L1_PERIOD 16
|
||||
param set-default FW_LND_ANG 15
|
||||
param set-default FW_LND_FLALT 5
|
||||
param set-default FW_LND_HVIRT 13
|
||||
param set-default FW_LND_TLALT 5
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
param set-default FW_PR_FF 0.35
|
||||
param set-default FW_RR_FF 0.6
|
||||
param set-default FW_RR_P 0.04
|
||||
|
||||
@@ -32,9 +32,6 @@ param set-default FW_L1_DAMPING 0.74
|
||||
param set-default FW_L1_PERIOD 16
|
||||
param set-default FW_LND_ANG 15
|
||||
param set-default FW_LND_FLALT 5
|
||||
param set-default FW_LND_HVIRT 13
|
||||
param set-default FW_LND_TLALT 5
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
param set-default FW_PR_FF 0.35
|
||||
param set-default FW_RR_FF 0.6
|
||||
param set-default FW_RR_P 0.04
|
||||
|
||||
@@ -27,9 +27,6 @@ param set-default FW_AIRSPD_TRIM 16.5
|
||||
param set-default FW_L1_PERIOD 15
|
||||
param set-default FW_LND_ANG 15
|
||||
param set-default FW_LND_FLALT 8
|
||||
param set-default FW_LND_HVIRT 13
|
||||
param set-default FW_LND_TLALT 10
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
param set-default FW_P_LIM_MAX 20
|
||||
param set-default FW_P_LIM_MIN -30
|
||||
param set-default FW_R_LIM 45
|
||||
@@ -40,7 +37,7 @@ param set-default FW_RR_P 0.013
|
||||
param set-default FW_P_RMAX_NEG 70
|
||||
param set-default FW_P_RMAX_POS 70
|
||||
param set-default FW_R_RMAX 70
|
||||
param set-default FW_THR_CRUISE 0.55
|
||||
param set-default FW_THR_TRIM 0.55
|
||||
|
||||
param set-default LNDFW_AIRSPD_MAX 6
|
||||
param set-default LNDFW_XYACC_MAX 4
|
||||
|
||||
@@ -124,6 +124,7 @@ px4_add_romfs_files(
|
||||
13007_vtol_AAVVT_quad
|
||||
13008_QuadRanger
|
||||
13009_vtol_spt_ranger
|
||||
13100_generic_vtol_tiltrotor
|
||||
13012_convergence
|
||||
13013_deltaquad
|
||||
13014_vtol_babyshark
|
||||
|
||||
@@ -5,7 +5,7 @@ Tailsitter duo mixer
|
||||
This file defines a mixer for a generic duo tailsitter VTOL (eg TBS Caipirinha tailsitter edition). This vehicle
|
||||
has two motors in total, one attached to each wing. It also has two elevons which
|
||||
are located in the slipstream of the propellers. This mixer generates 4 PWM outputs
|
||||
on the main PWM ouput port, two at 400Hz for the motors, and two at 50Hz for the
|
||||
on the main PWM output port, two at 400Hz for the motors, and two at 50Hz for the
|
||||
elevon servos. Channels 1-4 are configured to run at 400Hz, while channels 5-8 run
|
||||
at the default rate of 50Hz. Note that channels 3 and 4 are assigned but not used.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Tailsitter duo mixer
|
||||
This file defines a mixer for a generic duo tailsitter VTOL (eg TBS Caipirinha tailsitter edition). This vehicle
|
||||
has two motors in total, one attached to each wing. It also has two elevons which
|
||||
are located in the slipstream of the propellers. This mixer generates 4 PWM outputs
|
||||
on the main PWM ouput port, two at 400Hz for the motors, and two at 50Hz for the
|
||||
on the main PWM output port, two at 400Hz for the motors, and two at 50Hz for the
|
||||
elevon servos. Channels 1-4 are configured to run at 400Hz, while channels 5-8 run
|
||||
at the default rate of 50Hz. Note that channels 3 and 4 are assigned but not used.
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ exec find boards msg src platforms test \
|
||||
-path src/lib/crypto/monocypher -prune -o \
|
||||
-path src/lib/events/libevents -prune -o \
|
||||
-path src/lib/parameters/uthash -prune -o \
|
||||
-path src/lib/wind_estimator/python/generated -prune -o \
|
||||
-path src/modules/ekf2/EKF -prune -o \
|
||||
-path src/modules/gyro_fft/CMSIS_5 -prune -o \
|
||||
-path src/modules/mavlink/mavlink -prune -o \
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -z "${DOCKER_TAG}" ]]; then
|
||||
# the default tag for docker images
|
||||
# follows the pattern below, and we recommend
|
||||
# that any images pushed to the registry continue
|
||||
# to use the pattern for consistency
|
||||
TAG_NAME="`date +"%Y-%m-%d"`"
|
||||
else
|
||||
TAG_NAME="${DOCKER_TAG}"
|
||||
fi
|
||||
|
||||
PX4_DOCKER_REPO="ghcr.io/px4/px4-dev:$TAG_NAME"
|
||||
PWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
SRC_DIR=$PWD/../
|
||||
|
||||
echo "[docker_build.sh]: Building [$PX4_DOCKER_REPO]"
|
||||
|
||||
docker build \
|
||||
-t ${PX4_DOCKER_REPO} \
|
||||
-f Tools/setup/Dockerfile "${SRC_DIR}"
|
||||
+19
-57
@@ -1,67 +1,29 @@
|
||||
#! /bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
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"
|
||||
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"
|
||||
elif [[ $@ =~ .*pilotpi.arm64 ]]; then
|
||||
# scumaker_pilotpi_arm64
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-aarch64:latest"
|
||||
elif [[ $@ =~ .*navio2.* ]] || [[ $@ =~ .*raspberry.* ]] || [[ $@ =~ .*bebop.* ]]; then
|
||||
# posix_rpi_cross, posix_bebop_default
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2021-08-18"
|
||||
elif [[ $@ =~ .*clang.* ]] || [[ $@ =~ .*scan-build.* ]]; then
|
||||
# clang tools
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-clang:2021-02-04"
|
||||
elif [[ $@ =~ .*tests* ]]; then
|
||||
# run all tests with simulation
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-simulation-bionic:2021-12-11"
|
||||
fi
|
||||
if [[ -z "${DOCKER_TAG}" ]]; then
|
||||
# The default tag name should be hardcoded
|
||||
# to whatever we are currently using in CI on this branch
|
||||
TAG_NAME="2022-08-16"
|
||||
else
|
||||
echo "PX4_DOCKER_REPO is set to '$PX4_DOCKER_REPO'";
|
||||
TAG_NAME="${DOCKER_TAG}"
|
||||
fi
|
||||
|
||||
# otherwise default to nuttx
|
||||
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-09-08"
|
||||
fi
|
||||
PX4_DOCKER_REPO="ghcr.io/px4/px4-dev:$TAG_NAME"
|
||||
|
||||
# docker hygiene
|
||||
|
||||
#Delete all stopped containers (including data-only containers)
|
||||
#docker rm $(docker ps -a -q)
|
||||
|
||||
#Delete all 'untagged/dangling' (<none>) images
|
||||
#docker rmi $(docker images -q -f dangling=true)
|
||||
|
||||
echo "PX4_DOCKER_REPO: $PX4_DOCKER_REPO";
|
||||
echo "[docker_run.sh]: Running '$PX4_DOCKER_REPO'"
|
||||
|
||||
PWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
SRC_DIR=$PWD/../
|
||||
|
||||
CCACHE_DIR=${HOME}/.ccache
|
||||
mkdir -p "${CCACHE_DIR}"
|
||||
|
||||
docker run -it --rm -w "${SRC_DIR}" \
|
||||
--env=AWS_ACCESS_KEY_ID \
|
||||
--env=AWS_SECRET_ACCESS_KEY \
|
||||
--env=BRANCH_NAME \
|
||||
--env=CCACHE_DIR="${CCACHE_DIR}" \
|
||||
--env=CI \
|
||||
--env=CODECOV_TOKEN \
|
||||
--env=COVERALLS_REPO_TOKEN \
|
||||
--env=LOCAL_USER_ID="$(id -u)" \
|
||||
--env=PX4_ASAN \
|
||||
--env=PX4_MSAN \
|
||||
--env=PX4_TSAN \
|
||||
--env=PX4_UBSAN \
|
||||
--env=TRAVIS_BRANCH \
|
||||
--env=TRAVIS_BUILD_ID \
|
||||
--publish 14556:14556/udp \
|
||||
--volume=${CCACHE_DIR}:${CCACHE_DIR}:rw \
|
||||
--volume=${SRC_DIR}:${SRC_DIR}:rw \
|
||||
${PX4_DOCKER_REPO} /bin/bash -c "$1 $2 $3"
|
||||
--env=LOCAL_USER_ID="$(id -u)" \
|
||||
--env=AWS_ACCESS_KEY_ID \
|
||||
--env=AWS_SECRET_ACCESS_KEY \
|
||||
--env=BRANCH_NAME \
|
||||
--env=CCACHE_DIR="${CCACHE_DIR}" \
|
||||
--env=CI \
|
||||
--publish 14556:14556/udp \
|
||||
--volume=/tmp/.X11-unix:/tmp/.X11-unix \
|
||||
--volume=/tmp:/tmp:rw \
|
||||
--volume=${SRC_DIR}:${SRC_DIR}:rw \
|
||||
${PX4_DOCKER_REPO} /bin/bash -c "$1 $2 $3"
|
||||
|
||||
@@ -3019,7 +3019,7 @@ class MAVLink(object):
|
||||
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
|
||||
press_abs : Absolute pressure (hectopascal) (float)
|
||||
press_diff : Differential pressure 1 (hectopascal) (float)
|
||||
temperature : Temperature measurement (0.01 degrees celsius) (int16_t)
|
||||
temperature : Temperature measurement (0.01 degrees Celsius) (int16_t)
|
||||
|
||||
'''
|
||||
msg = MAVLink_scaled_pressure_message(time_boot_ms, press_abs, press_diff, temperature)
|
||||
@@ -3035,7 +3035,7 @@ class MAVLink(object):
|
||||
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
|
||||
press_abs : Absolute pressure (hectopascal) (float)
|
||||
press_diff : Differential pressure 1 (hectopascal) (float)
|
||||
temperature : Temperature measurement (0.01 degrees celsius) (int16_t)
|
||||
temperature : Temperature measurement (0.01 degrees Celsius) (int16_t)
|
||||
|
||||
'''
|
||||
return self.send(self.scaled_pressure_encode(time_boot_ms, press_abs, press_diff, temperature))
|
||||
@@ -4879,7 +4879,7 @@ class MAVLink(object):
|
||||
abs_pressure : Absolute pressure in millibar (float)
|
||||
diff_pressure : Differential pressure in millibar (float)
|
||||
pressure_alt : Altitude calculated from pressure (float)
|
||||
temperature : Temperature in degrees celsius (float)
|
||||
temperature : Temperature in degrees Celsius (float)
|
||||
fields_updated : Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature (uint16_t)
|
||||
|
||||
'''
|
||||
@@ -4904,7 +4904,7 @@ class MAVLink(object):
|
||||
abs_pressure : Absolute pressure in millibar (float)
|
||||
diff_pressure : Differential pressure in millibar (float)
|
||||
pressure_alt : Altitude calculated from pressure (float)
|
||||
temperature : Temperature in degrees celsius (float)
|
||||
temperature : Temperature in degrees Celsius (float)
|
||||
fields_updated : Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature (uint16_t)
|
||||
|
||||
'''
|
||||
|
||||
@@ -14,12 +14,14 @@ class MarkdownOutput():
|
||||
|
||||
result = """
|
||||
# Modules & Commands Reference
|
||||
The following pages document the PX4 modules, drivers and commands. They
|
||||
describe the provided functionality, high-level implementation overview and how
|
||||
|
||||
The following pages document the PX4 modules, drivers and commands.
|
||||
They describe the provided functionality, high-level implementation overview and how
|
||||
to use the command-line interface.
|
||||
|
||||
> **Note** **This is auto-generated from the source code** and contains the
|
||||
> most recent modules documentation.
|
||||
:::note
|
||||
**This is auto-generated from the source code** and contains the most recent modules documentation.
|
||||
:::
|
||||
|
||||
It is not a complete list and NuttX provides some additional commands
|
||||
as well (such as `free`). Use `help` on the console to get a list of all
|
||||
@@ -29,6 +31,7 @@ Since this is generated from source, errors must be reported/fixed
|
||||
in the [PX4-Autopilot](https://github.com/PX4/PX4-Autopilot) repository.
|
||||
The documentation pages can be generated by running the following command from
|
||||
the root of the PX4-Autopilot directory:
|
||||
|
||||
```
|
||||
make module_documentation
|
||||
```
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# PX4 base development environment
|
||||
#
|
||||
|
||||
FROM ubuntu:20.04
|
||||
LABEL maintainer="Daniel Agar <daniel@agar.ca>, Ramon Roche <mrpollo@gmail.com>"
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
|
||||
# Installing required utilities
|
||||
RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
|
||||
ca-certificates \
|
||||
gnupg \
|
||||
lsb-core \
|
||||
lsb-release \
|
||||
sudo \
|
||||
software-properties-common \
|
||||
wget \
|
||||
gosu \
|
||||
;
|
||||
|
||||
# Install PX4 Requirements
|
||||
COPY Tools/setup/requirements.txt /tmp/requirements.txt
|
||||
COPY Tools/setup/ubuntu.sh /tmp/ubuntu.sh
|
||||
# The PATH env is set within ubuntu.sh, but given how we
|
||||
# are running the image using `gosu` to avoid read-only problems
|
||||
# with the filesystem the env variable does not persist
|
||||
ENV PATH="/opt/gcc-arm-none-eabi-9-2020-q2-update/bin:$PATH"
|
||||
|
||||
RUN bash /tmp/ubuntu.sh --from-docker
|
||||
|
||||
ENV DISPLAY :99
|
||||
|
||||
ENV FASTRTPSGEN_DIR="/usr/local/bin/"
|
||||
ENV TERM=xterm
|
||||
ENV TZ=UTC
|
||||
|
||||
# SITL UDP PORTS
|
||||
EXPOSE 14556/udp
|
||||
EXPOSE 14557/udp
|
||||
|
||||
# create user with id 1001 (jenkins docker workflow default)
|
||||
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user
|
||||
|
||||
# create and start as LOCAL_USER_ID
|
||||
COPY Tools/setup/docker-entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "[docker-entrypoint.sh] Starting entrypoint"
|
||||
# Start virtual X server in the background
|
||||
# - DISPLAY default is :99, set in dockerfile
|
||||
# - Users can override with `-e DISPLAY=` in `docker run` command to avoid
|
||||
# running Xvfb and attach their screen
|
||||
if [[ -x "$(command -v Xvfb)" && "$DISPLAY" == ":99" ]]; then
|
||||
echo "[docker-entrypoint.sh] Starting Xvfb"
|
||||
Xvfb :99 -screen 0 1600x1200x24+32 &
|
||||
fi
|
||||
|
||||
# Check if the ROS_DISTRO is passed and use it
|
||||
# to source the ROS environment
|
||||
if [ -n "${ROS_DISTRO}" ]; then
|
||||
source "/opt/ros/$ROS_DISTRO/setup.bash"
|
||||
fi
|
||||
|
||||
# Use the LOCAL_USER_ID if passed in at runtime
|
||||
if [ -n "${LOCAL_USER_ID}" ]; then
|
||||
echo "[docker-entrypoint.sh] Starting with UID : $LOCAL_USER_ID"
|
||||
# modify existing user's id
|
||||
usermod -u $LOCAL_USER_ID user
|
||||
|
||||
# run as user
|
||||
exec gosu user "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
@@ -26,3 +26,5 @@ requests
|
||||
setuptools>=39.2.0
|
||||
six>=1.12.0
|
||||
toml>=0.9
|
||||
symforce>=0.5.0
|
||||
sympy>=1.10.1
|
||||
|
||||
+123
-72
@@ -2,20 +2,18 @@
|
||||
|
||||
set -e
|
||||
|
||||
## Bash script to setup PX4 development environment on Ubuntu LTS (20.04, 18.04, 16.04).
|
||||
## Bash script to setup PX4 development environment on Ubuntu LTS (20.04, 18.04).
|
||||
## Can also be used in docker.
|
||||
##
|
||||
## Installs:
|
||||
## - Common dependencies and tools for nuttx, jMAVSim, Gazebo
|
||||
## - Common dependencies and tools for NuttX, and Gazebo
|
||||
## - NuttX toolchain (omit with arg: --no-nuttx)
|
||||
## - jMAVSim and Gazebo9 simulator (omit with arg: --no-sim-tools)
|
||||
##
|
||||
## Not Installs:
|
||||
## - FastRTPS and FastCDR
|
||||
## - Gazebo simulator (omit with arg: --no-sim-tools)
|
||||
|
||||
INSTALL_NUTTX="true"
|
||||
INSTALL_SIM="true"
|
||||
INSTALL_ARCH=`uname -m`
|
||||
INSIDE_DOCKER="false"
|
||||
|
||||
# Parse arguments
|
||||
for arg in "$@"
|
||||
@@ -28,19 +26,22 @@ do
|
||||
INSTALL_SIM="false"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
# detect if running in docker
|
||||
if [ -f /.dockerenv ]; then
|
||||
echo "Running within docker, installing initial dependencies";
|
||||
apt-get --quiet -y update && DEBIAN_FRONTEND=noninteractive apt-get --quiet -y install \
|
||||
ca-certificates \
|
||||
gnupg \
|
||||
lsb-core \
|
||||
sudo \
|
||||
wget \
|
||||
;
|
||||
fi
|
||||
if [[ $arg == "--from-docker" ]]; then
|
||||
INSIDE_DOCKER="true"
|
||||
fi
|
||||
|
||||
if [[ $arg == "--help" ]]; then
|
||||
echo "#⚡️ PX4 Dependency Installer for Ubuntu"
|
||||
echo "# Options:
|
||||
#
|
||||
# --no-nuttx boolean
|
||||
# --no-sim-tools boolean"
|
||||
echo "#"
|
||||
exit
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
# script directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
@@ -69,9 +70,22 @@ elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
||||
echo "Ubuntu 20.04"
|
||||
fi
|
||||
|
||||
VERBOSE_BAR="####################"
|
||||
echo
|
||||
echo $VERBOSE_BAR
|
||||
echo "#⚡️ Starting PX4 Dependency Installer for Ubuntu ${UBUNTU_RELEASE} (${INSTALL_ARCH})"
|
||||
echo "# Options:
|
||||
#
|
||||
# - Install NuttX = ${INSTALL_NUTTX}
|
||||
# - Install Simulation = ${INSTALL_SIM}"
|
||||
echo $VERBOSE_BAR
|
||||
echo
|
||||
|
||||
echo
|
||||
echo "Installing PX4 general dependencies"
|
||||
echo $VERBOSE_BAR
|
||||
echo "🍻 Installing System Dependencies"
|
||||
echo $VERBOSE_BAR
|
||||
echo
|
||||
|
||||
sudo apt-get update -y --quiet
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
@@ -85,6 +99,7 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends i
|
||||
gdb \
|
||||
git \
|
||||
lcov \
|
||||
libssl-dev \
|
||||
libxml2-dev \
|
||||
libxml2-utils \
|
||||
make \
|
||||
@@ -100,32 +115,42 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends i
|
||||
zip \
|
||||
;
|
||||
|
||||
# Python3 dependencies
|
||||
# Python 3 dependencies
|
||||
echo
|
||||
echo "Installing PX4 Python3 dependencies"
|
||||
echo $VERBOSE_BAR
|
||||
echo "🍻 Installing Python dependencies"
|
||||
echo $VERBOSE_BAR
|
||||
echo
|
||||
|
||||
if [ -n "$VIRTUAL_ENV" ]; then
|
||||
# virtual envrionments don't allow --user option
|
||||
# virtual environments don't allow --user option
|
||||
python -m pip install -r ${DIR}/requirements.txt
|
||||
else
|
||||
# older versions of Ubuntu require --user option
|
||||
python3 -m pip install --user -r ${DIR}/requirements.txt
|
||||
if [[ $INSIDE_DOCKER == "true" ]]; then
|
||||
# when running inside a docker container we don't need to install
|
||||
# under --user since the installer user is root
|
||||
# its best to install packages globaly for any user to find
|
||||
python3 -m pip install -r /tmp/requirements.txt
|
||||
else
|
||||
python3 -m pip install --user -r ${DIR}/requirements.txt
|
||||
fi
|
||||
fi
|
||||
|
||||
# NuttX toolchain (arm-none-eabi-gcc)
|
||||
if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||
|
||||
echo
|
||||
echo "Installing NuttX dependencies"
|
||||
echo $VERBOSE_BAR
|
||||
echo "🍻 Installing NuttX dependencies"
|
||||
echo $VERBOSE_BAR
|
||||
echo
|
||||
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
automake \
|
||||
binutils-dev \
|
||||
bison \
|
||||
build-essential \
|
||||
flex \
|
||||
g++-multilib \
|
||||
gcc-multilib \
|
||||
gdb-multiarch \
|
||||
genromfs \
|
||||
gettext \
|
||||
gperf \
|
||||
@@ -145,7 +170,12 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||
u-boot-tools \
|
||||
util-linux \
|
||||
vim-common \
|
||||
g++-arm-linux-gnueabihf \
|
||||
gcc-arm-linux-gnueabihf \
|
||||
g++-aarch64-linux-gnu \
|
||||
gcc-aarch64-linux-gnu \
|
||||
;
|
||||
|
||||
if [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
kconfig-frontends \
|
||||
@@ -158,32 +188,47 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||
sudo usermod -a -G dialout $USER
|
||||
fi
|
||||
|
||||
# arm-none-eabi-gcc
|
||||
NUTTX_GCC_VERSION="9-2020-q2-update"
|
||||
NUTTX_GCC_VERSION_SHORT="9-2020q2"
|
||||
echo
|
||||
echo $VERBOSE_BAR
|
||||
echo "🍻 Verifying proper gcc version (${NUTTX_GCC_VERSION}), and installing if not found"
|
||||
echo
|
||||
|
||||
source $HOME/.profile # load changed path for the case the script is reran before relogin
|
||||
if [ $(which arm-none-eabi-gcc) ]; then
|
||||
GCC_VER_STR=$(arm-none-eabi-gcc --version)
|
||||
GCC_FOUND_VER=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}")
|
||||
GCC_VER_FOUND=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}")
|
||||
fi
|
||||
|
||||
if [[ "$GCC_FOUND_VER" == "1" ]]; then
|
||||
echo "arm-none-eabi-gcc-${NUTTX_GCC_VERSION} found, skipping installation"
|
||||
if [[ $(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}") == "1" ]]; then
|
||||
echo "📌 Skipping installation, the arm cross compiler was found"
|
||||
echo $VERBOSE_BAR
|
||||
echo
|
||||
|
||||
else
|
||||
echo "Installing arm-none-eabi-gcc-${NUTTX_GCC_VERSION}";
|
||||
wget -O /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/${NUTTX_GCC_VERSION_SHORT}/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-${INSTALL_ARCH}-linux.tar.bz2 && \
|
||||
sudo tar -jxf /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 -C /opt/;
|
||||
echo "📌 The arm cross compiler was not found";
|
||||
echo " * Installing arm-none-eabi-gcc-${NUTTX_GCC_VERSION}";
|
||||
COMPILER_NAME="gcc-arm-none-eabi-${NUTTX_GCC_VERSION}"
|
||||
COMPILER_PATH="/tmp/$COMPILER_NAME-linux.tar.bz2"
|
||||
wget -O $COMPILER_PATH https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/${NUTTX_GCC_VERSION_SHORT}/${COMPILER_NAME}-${INSTALL_ARCH}-linux.tar.bz2
|
||||
sudo tar -jxf $COMPILER_PATH -C /opt/;
|
||||
|
||||
# add arm-none-eabi-gcc to user's PATH
|
||||
exportline="export PATH=/opt/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}/bin:\$PATH"
|
||||
|
||||
if grep -Fxq "$exportline" $HOME/.profile; then
|
||||
exportline="export PATH=\"/opt/${COMPILER_NAME}/bin:\$PATH\""
|
||||
if [[ $INSIDE_DOCKER == "true" ]]; then
|
||||
# when running on a docker container its best to set the environment globally
|
||||
# since we don't know which user is going to be running commands on the container
|
||||
touch /etc/profile.d/px4env.sh
|
||||
echo $exportline >> /etc/profile.d/px4env.sh
|
||||
elif grep -Fxq "$exportline" $HOME/.profile; then
|
||||
echo "${NUTTX_GCC_VERSION} path already set.";
|
||||
else
|
||||
echo $exportline >> $HOME/.profile;
|
||||
fi
|
||||
echo " * arm-none-eabi-gcc (${NUTTX_GCC_VERSION}) Installed Succesful to /opt/${COMPILER_NAME}/bin"
|
||||
echo $VERBOSE_BAR
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -191,45 +236,32 @@ fi
|
||||
if [[ $INSTALL_SIM == "true" ]]; then
|
||||
|
||||
echo
|
||||
echo "Installing PX4 simulation dependencies"
|
||||
echo $VERBOSE_BAR
|
||||
echo "🍻 Installing PX4 Simulation Tools"
|
||||
echo
|
||||
|
||||
# default and Ubuntu 20.04
|
||||
gazebo_version=11
|
||||
gazebo_packages="gazebo$gazebo_version libgazebo$gazebo_version-dev"
|
||||
if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
|
||||
gazebo_version=9
|
||||
elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then
|
||||
gazebo_version=11
|
||||
gazebo_packages="gazebo libgazebo-dev"
|
||||
fi
|
||||
|
||||
echo " * Gazebo Version $gazebo_version"
|
||||
echo $VERBOSE_BAR
|
||||
|
||||
# General simulation dependencies
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
bc \
|
||||
;
|
||||
|
||||
if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
|
||||
java_version=11
|
||||
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
||||
java_version=13
|
||||
elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then
|
||||
java_version=11
|
||||
else
|
||||
java_version=14
|
||||
fi
|
||||
# Java (jmavsim or fastrtps)
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
ant \
|
||||
openjdk-$java_version-jre \
|
||||
openjdk-$java_version-jdk \
|
||||
libvecmath-java \
|
||||
;
|
||||
|
||||
# Set Java 11 as default
|
||||
sudo update-alternatives --set java $(update-alternatives --list java | grep "java-$java_version")
|
||||
|
||||
# Gazebo
|
||||
if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
|
||||
gazebo_version=9
|
||||
gazebo_packages="gazebo$gazebo_version libgazebo$gazebo_version-dev"
|
||||
elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then
|
||||
gazebo_packages="gazebo libgazebo-dev"
|
||||
else
|
||||
# default and Ubuntu 20.04
|
||||
gazebo_version=11
|
||||
gazebo_packages="gazebo$gazebo_version libgazebo$gazebo_version-dev"
|
||||
fi
|
||||
|
||||
# Installing Gazebo and dependencies
|
||||
# Setup OSRF Gazebo repository
|
||||
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
|
||||
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
|
||||
# Update list, since new gazebo-stable.list has been added
|
||||
@@ -257,7 +289,26 @@ if [[ $INSTALL_SIM == "true" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||
echo
|
||||
echo "Relogin or reboot computer before attempting to build NuttX targets"
|
||||
if [[ $INSIDE_DOCKER == "true" ]]; then
|
||||
# cleanup installation
|
||||
rm -rf /tmp/
|
||||
fi
|
||||
|
||||
if [[ $INSIDE_DOCKER == "false" ]] && [[ $INSTALL_NUTTX == "true" ]]; then
|
||||
echo
|
||||
echo $VERBOSE_BAR
|
||||
echo "💡 We recommend you relogin/reboot before attempting to build NuttX targets"
|
||||
echo $VERBOSE_BAR
|
||||
echo
|
||||
fi
|
||||
|
||||
echo
|
||||
echo
|
||||
echo $VERBOSE_BAR
|
||||
echo "#⚡️ PX4 Dependency Installer Ended Succesfully
|
||||
#
|
||||
# For more information on PX4 Autopilot check out our docs
|
||||
# at docs.px4.io, if you find a bug please file an issue
|
||||
# on GitHub https://github.com/px4/px4-autopilot"
|
||||
echo $VERBOSE_BAR
|
||||
echo
|
||||
|
||||
@@ -13,6 +13,7 @@ CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
|
||||
CONFIG_COMMON_DISTANCE_SENSOR=y
|
||||
CONFIG_DRIVERS_DSHOT=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_IMU_BOSCH_BMI085=y
|
||||
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y
|
||||
@@ -38,6 +39,7 @@ CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
|
||||
CONFIG_MODULES_BATTERY_STATUS=y
|
||||
CONFIG_MODULES_CAMERA_FEEDBACK=y
|
||||
CONFIG_MODULES_COMMANDER=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
CONFIG_MODULES_DATAMAN=y
|
||||
CONFIG_MODULES_EKF2=y
|
||||
CONFIG_MODULES_ESC_BATTERY=y
|
||||
@@ -46,6 +48,7 @@ CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
|
||||
CONFIG_MODULES_FW_ATT_CONTROL=y
|
||||
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_FW_POS_CONTROL_L1=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
@@ -61,7 +64,6 @@ CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
|
||||
CONFIG_MODULES_MC_POS_CONTROL=y
|
||||
CONFIG_MODULES_MC_RATE_CONTROL=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
CONFIG_MODULES_NAVIGATOR=y
|
||||
CONFIG_MODULES_RC_UPDATE=y
|
||||
CONFIG_MODULES_ROVER_POS_CONTROL=y
|
||||
@@ -70,10 +72,9 @@ CONFIG_MODULES_SIH=y
|
||||
CONFIG_MODULES_TEMPERATURE_COMPENSATION=y
|
||||
CONFIG_MODULES_UUV_ATT_CONTROL=y
|
||||
CONFIG_MODULES_UUV_POS_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_VTOL_ATT_CONTROL=y
|
||||
CONFIG_SYSTEMCMDS_BL_UPDATE=y
|
||||
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
|
||||
CONFIG_SYSTEMCMDS_BL_UPDATE=y
|
||||
CONFIG_SYSTEMCMDS_DMESG=y
|
||||
CONFIG_SYSTEMCMDS_DUMPFILE=y
|
||||
CONFIG_SYSTEMCMDS_GPIO=y
|
||||
|
||||
@@ -8,8 +8,14 @@ board_adc start
|
||||
icm20602 -s -b 1 -R 8 start
|
||||
|
||||
# Internal SPI bus BMI088 accel & gyro
|
||||
bmi088 -A -s -b 5 -R 8 start
|
||||
bmi088 -G -s -b 5 -R 8 start
|
||||
if bmi088 -A -s -b 5 -R 8 start
|
||||
then
|
||||
bmi088 -G -s -b 5 -R 8 start
|
||||
else
|
||||
# otherwise try BMI085
|
||||
bmi085 -A -s -b 5 -R 8 start
|
||||
bmi085 -G -s -b 5 -R 8 start
|
||||
fi
|
||||
|
||||
# Internal ICM-20948 (with magnetometer)
|
||||
icm20948 -s -b 1 -R 8 -M start
|
||||
|
||||
@@ -47,6 +47,8 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
|
||||
initSPIBus(SPI::Bus::SPI5, {
|
||||
initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}),
|
||||
initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}),
|
||||
initSPIDevice(DRV_GYR_DEVTYPE_BMI085, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}),
|
||||
initSPIDevice(DRV_ACC_DEVTYPE_BMI085, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}),
|
||||
}),
|
||||
initSPIBusExternal(SPI::Bus::SPI6, {
|
||||
initSPIConfigExternal(SPI::CS{GPIO::PortG, GPIO::Pin9}),
|
||||
|
||||
@@ -110,7 +110,7 @@ __EXPORT void board_spi_reset(int ms, int bus_mask)
|
||||
VDD_3V3_SENSORS_EN(true);
|
||||
up_mdelay(2);
|
||||
|
||||
/* Restore all the CS to ouputs inactive */
|
||||
/* Restore all the CS to outputs inactive */
|
||||
|
||||
for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) {
|
||||
if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) {
|
||||
|
||||
@@ -124,7 +124,7 @@ __EXPORT void board_spi_reset(int ms, int bus_mask)
|
||||
VDD_3V3_SENSORS_EN(true);
|
||||
up_mdelay(2);
|
||||
|
||||
/* Restore all the CS to ouputs inactive */
|
||||
/* Restore all the CS to outputs inactive */
|
||||
|
||||
for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) {
|
||||
if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/* The FMURT1062 has 8MiB of QSPI FLASH beginning at address,
|
||||
* 0x0060:0000, Upto 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM
|
||||
* 0x0060:0000, Up to 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM
|
||||
* beginning at 0x2020:0000. Neither DTCM or SDRAM are used in this
|
||||
* configuration.
|
||||
*
|
||||
@@ -43,7 +43,7 @@
|
||||
* 256Kib to OCRRAM, 128Kib ITCM and 128Kib DTCM.
|
||||
* This can be changed by using a dcd by minipulating
|
||||
* IOMUX GPR16 and GPR17.
|
||||
* The configuartion we will use is 384Kib to OCRRAM, 0Kib ITCM and
|
||||
* The configuration we will use is 384Kib to OCRRAM, 0Kib ITCM and
|
||||
* 128Kib DTCM.
|
||||
*
|
||||
* This is the OCRAM inker script.
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/* The FMURT1062 has 8MiB of QSPI FLASH beginning at address,
|
||||
* 0x0060:0000, Upto 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM
|
||||
* 0x0060:0000, Up to 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM
|
||||
* beginning at 0x2020:0000. Neither DTCM or SDRAM are used in this
|
||||
* configuratin.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
CONFIG_DRIVERS_CYPHAL=y
|
||||
CONFIG_CYPHAL_CLIENT=y
|
||||
CONFIG_CYPHAL_APP_DESCRIPTOR=y
|
||||
CONFIG_CYPHAL_UORB_SENSOR_GPS_PUBLISHER=y
|
||||
@@ -4,14 +4,14 @@ CONFIG_BOARD_ROMFSROOT="cannode"
|
||||
CONFIG_BOARD_CONSTRAINED_MEMORY=y
|
||||
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1"
|
||||
CONFIG_DRIVERS_BOOTLOADERS=y
|
||||
CONFIG_DRIVERS_DISTANCE_SENSOR_TFMINI=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y
|
||||
CONFIG_DRIVERS_PWM_OUT=y
|
||||
CONFIG_DRIVERS_CYPHAL=y
|
||||
CONFIG_CYPHAL_CLIENT=y
|
||||
CONFIG_CYPHAL_APP_DESCRIPTOR=y
|
||||
CONFIG_CYPHAL_UORB_SENSOR_GPS_PUBLISHER=y
|
||||
CONFIG_BOARD_UAVCAN_INTERFACES=1
|
||||
CONFIG_DRIVERS_UAVCANNODE=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
|
||||
CONFIG_SYSTEMCMDS_I2CDETECT=y
|
||||
CONFIG_SYSTEMCMDS_LED_CONTROL=y
|
||||
CONFIG_SYSTEMCMDS_MFT=y
|
||||
@@ -23,5 +23,6 @@ CONFIG_SYSTEMCMDS_REBOOT=y
|
||||
CONFIG_SYSTEMCMDS_SYSTEM_TIME=y
|
||||
CONFIG_SYSTEMCMDS_TOP=y
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
|
||||
CONFIG_SYSTEMCMDS_UORB=y
|
||||
CONFIG_SYSTEMCMDS_VER=y
|
||||
CONFIG_SYSTEMCMDS_WORK_QUEUE=y
|
||||
|
||||
@@ -6,4 +6,9 @@
|
||||
pwm_out mode_pwm1 start
|
||||
|
||||
ifup can0
|
||||
cyphal start
|
||||
|
||||
# Start Cyphal when enabled
|
||||
if param compare -s CYPHAL_ENABLE 1
|
||||
then
|
||||
cyphal start
|
||||
fi
|
||||
|
||||
@@ -112,6 +112,6 @@ CONFIG_SYMTAB_ORDEREDBYNAME=y
|
||||
CONFIG_SYSTEM_I2CTOOL=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_SYSTEM_SPITOOL=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_USERMAIN_STACKSIZE=2176
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_WATCHDOG=y
|
||||
|
||||
@@ -93,7 +93,7 @@ __EXPORT void board_spi_reset(int ms, int bus_mask)
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore all the CS to ouputs inactive */
|
||||
/* Restore all the CS to outputs inactive */
|
||||
for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) {
|
||||
if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) {
|
||||
for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) {
|
||||
|
||||
@@ -12,6 +12,7 @@ fi
|
||||
if param compare -s ADC_ADS1115_EN 1
|
||||
then
|
||||
ads1115 start -X
|
||||
board_adc start -n
|
||||
else
|
||||
board_adc start
|
||||
fi
|
||||
|
||||
@@ -4,6 +4,7 @@ CONFIG_DRIVERS_OSD=n
|
||||
CONFIG_EXAMPLES_FAKE_GPS=n
|
||||
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=n
|
||||
CONFIG_SYSTEMCMDS_DUMPFILE=n
|
||||
CONFIG_SYSTEMCMDS_GPIO=n
|
||||
CONFIG_SYSTEMCMDS_MOTOR_TEST=n
|
||||
CONFIG_SYSTEMCMDS_REFLECT=n
|
||||
CONFIG_SYSTEMCMDS_SD_BENCH=n
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <px4_platform_common/tasks.h>
|
||||
#include <board_config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(BOARD_HAS_POWER_CONTROL)
|
||||
int board_register_power_state_notification_cb(power_button_state_notification_t cb)
|
||||
|
||||
@@ -68,7 +68,7 @@ class MavrosOffboardAttctlTest(MavrosTestCommon):
|
||||
self.att_setpoint_pub = rospy.Publisher(
|
||||
'mavros/setpoint_raw/attitude', AttitudeTarget, queue_size=1)
|
||||
|
||||
# send setpoints in seperate thread to better prevent failsafe
|
||||
# send setpoints in separate thread to better prevent failsafe
|
||||
self.att_thread = Thread(target=self.send_att, args=())
|
||||
self.att_thread.daemon = True
|
||||
self.att_thread.start()
|
||||
|
||||
@@ -73,7 +73,7 @@ class MavrosOffboardPosctlTest(MavrosTestCommon):
|
||||
self.pos_setpoint_pub = rospy.Publisher(
|
||||
'mavros/setpoint_position/local', PoseStamped, queue_size=1)
|
||||
|
||||
# send setpoints in seperate thread to better prevent failsafe
|
||||
# send setpoints in separate thread to better prevent failsafe
|
||||
self.pos_thread = Thread(target=self.send_pos, args=())
|
||||
self.pos_thread.daemon = True
|
||||
self.pos_thread.start()
|
||||
|
||||
@@ -66,7 +66,7 @@ class MavrosOffboardYawrateTest(MavrosTestCommon):
|
||||
self.att_setpoint_pub = rospy.Publisher(
|
||||
'mavros/setpoint_raw/attitude', AttitudeTarget, queue_size=1)
|
||||
|
||||
# send setpoints in seperate thread to better prevent failsafe
|
||||
# send setpoints in separate thread to better prevent failsafe
|
||||
self.att_thread = Thread(target=self.send_att, args=())
|
||||
self.att_thread.daemon = True
|
||||
self.att_thread.start()
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ float32 indicated_airspeed_m_s # indicated airspeed in m/s
|
||||
|
||||
float32 true_airspeed_m_s # true filtered airspeed in m/s
|
||||
|
||||
float32 air_temperature_celsius # air temperature in degrees celsius, -1000 if unknown
|
||||
float32 air_temperature_celsius # air temperature in degrees Celsius, -1000 if unknown
|
||||
|
||||
float32 confidence # confidence value from 0 to 1 for this sensor
|
||||
|
||||
@@ -21,7 +21,7 @@ uint16 capacity # actual capacity of the battery
|
||||
uint16 cycle_count # number of discharge cycles the battery has experienced
|
||||
uint16 average_time_to_empty # predicted remaining battery capacity based on the average rate of discharge in min
|
||||
uint16 serial_number # serial number of the battery pack
|
||||
uint16 manufacture_date # manufacture date, part of serial number of the battery pack. formated as: Day + Month×32 + (Year–1980)×512
|
||||
uint16 manufacture_date # manufacture date, part of serial number of the battery pack. Formatted as: Day + Month×32 + (Year–1980)×512
|
||||
uint16 state_of_health # state of health. FullChargeCapacity/DesignCapacity, 0-100%.
|
||||
uint16 max_error # max error, expected margin of error in % in the state-of-charge calculation with a range of 1 to 100%
|
||||
uint8 id # ID number of a battery. Should be unique and consistent for the lifetime of a vehicle. 1-indexed.
|
||||
|
||||
@@ -17,7 +17,7 @@ uint8 CELLULAR_STATUS_FLAG_CONNECTED=12 # One or more packet data bearers is ac
|
||||
uint8 CELLULAR_NETWORK_FAILED_REASON_NONE=0 # No error
|
||||
uint8 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN=1 # Error state is unknown
|
||||
uint8 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING=2 # SIM is required for the modem but missing
|
||||
uint8 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR=3 # SIM is available, but not usuable for connection
|
||||
uint8 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR=3 # SIM is available, but not usable for connection
|
||||
|
||||
uint16 status # Status bitmap 1: Roaming is active
|
||||
uint8 failure_reason #Failure reason when status in in CELLUAR_STATUS_FAILED
|
||||
|
||||
@@ -5,6 +5,6 @@ uint32 device_id # unique device ID for the sensor that does
|
||||
|
||||
float32 differential_pressure_pa # differential pressure reading in Pascals (may be negative)
|
||||
|
||||
float32 temperature # Temperature provided by sensor in celcius, NAN if unknown
|
||||
float32 temperature # Temperature provided by sensor in degrees Celsius, NAN if unknown
|
||||
|
||||
uint32 error_count # Number of errors detected by driver
|
||||
|
||||
@@ -30,7 +30,7 @@ bool gps_data_stopped_using_alternate # 3 - true when the gps data has stoppe
|
||||
bool height_sensor_timeout # 4 - true when the height sensor has not been used to correct the state estimates for a significant time period
|
||||
bool stopping_navigation # 5 - true when the filter has insufficient data to estimate velocity and position and is falling back to an attitude, height and height rate mode of operation
|
||||
bool invalid_accel_bias_cov_reset # 6 - true when the filter has detected bad acceerometer bias state esitmstes and has reset the corresponding covariance matrix elements
|
||||
bool bad_yaw_using_gps_course # 7 - true when the fiter has detected an invalid yaw esitmate and has reset the yaw angle to the GPS ground course
|
||||
bool bad_yaw_using_gps_course # 7 - true when the filter has detected an invalid yaw estimate and has reset the yaw angle to the GPS ground course
|
||||
bool stopping_mag_use # 8 - true when the filter has detected bad magnetometer data and is stopping further use of the magnetomer data
|
||||
bool vision_data_stopped # 9 - true when the vision system data has stopped for a significant time period
|
||||
bool emergency_yaw_reset_mag_stopped # 10 - true when the filter has detected bad magnetometer data, has reset the yaw to anothter source of data and has stopped further use of the magnetomer data
|
||||
|
||||
@@ -18,8 +18,8 @@ float32 rng_vpos # range sensor height innovation (m) and innovation variance (m
|
||||
float32 baro_vpos # barometer height innovation (m) and innovation variance (m**2)
|
||||
|
||||
# Auxiliary velocity
|
||||
float32[2] aux_hvel # horizontal auxiliar velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
|
||||
float32 aux_vvel # vertical auxiliar velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
|
||||
float32[2] aux_hvel # horizontal auxiliary velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
|
||||
float32 aux_vvel # vertical auxiliary velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
|
||||
|
||||
# Optical flow
|
||||
float32[2] flow # flow innvoation (rad/sec) and innovation variance ((rad/sec)**2)
|
||||
|
||||
@@ -9,7 +9,7 @@ bool cs_yaw_align # 1 - true if the filter yaw alignment is complet
|
||||
bool cs_gps # 2 - true if GPS measurement fusion is intended
|
||||
bool cs_opt_flow # 3 - true if optical flow measurements fusion is intended
|
||||
bool cs_mag_hdg # 4 - true if a simple magnetic yaw heading fusion is intended
|
||||
bool cs_mag_3d # 5 - true if 3-axis magnetometer measurement fusion is inteded
|
||||
bool cs_mag_3d # 5 - true if 3-axis magnetometer measurement fusion is intended
|
||||
bool cs_mag_dec # 6 - true if synthetic magnetic declination measurements fusion is intended
|
||||
bool cs_in_air # 7 - true when the vehicle is airborne
|
||||
bool cs_wind # 8 - true when wind velocity is being estimated
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
uint8 instance # Instance of GNSS reciever
|
||||
uint8 instance # Instance of GNSS receiver
|
||||
|
||||
uint8 len # length of data, MSB bit set = message to the gps device,
|
||||
# clear = message from the device
|
||||
|
||||
@@ -2,8 +2,10 @@ uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
uint32 device_id # unique device ID for the sensor that does not change between power cycles
|
||||
|
||||
uint8 len # length of data
|
||||
uint16 len # length of data
|
||||
uint8 flags # LSB: 1=fragmented
|
||||
uint8[300] data # data to write to GPS device (RTCM message)
|
||||
|
||||
uint8 ORB_QUEUE_LENGTH = 8
|
||||
|
||||
uint8 MAX_INSTANCES = 2
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ int32 rssi # receive signal strength indicator (RSSI): < 0: Undefined, 0: no
|
||||
bool rc_failsafe # explicit failsafe flag: true on TX failure or TX out of range , false otherwise. Only the true state is reliable, as there are some (PPM) receivers on the market going into failsafe without telling us explicitly.
|
||||
bool rc_lost # RC receiver connection status: True,if no frame has arrived in the expected time, false otherwise. True usually means that the receiver has been disconnected, but can also indicate a radio link loss on "stupid" systems. Will remain false, if a RX with failsafe option continues to transmit frames after a link loss.
|
||||
|
||||
uint16 rc_lost_frame_count # Number of lost RC frames. Note: intended purpose: observe the radio link quality if RSSI is not available. This value must not be used to trigger any failsafe-alike funtionality.
|
||||
uint16 rc_total_frame_count # Number of total RC frames. Note: intended purpose: observe the radio link quality if RSSI is not available. This value must not be used to trigger any failsafe-alike funtionality.
|
||||
uint16 rc_lost_frame_count # Number of lost RC frames. Note: intended purpose: observe the radio link quality if RSSI is not available. This value must not be used to trigger any failsafe-alike functionality.
|
||||
uint16 rc_total_frame_count # Number of total RC frames. Note: intended purpose: observe the radio link quality if RSSI is not available. This value must not be used to trigger any failsafe-alike functionality.
|
||||
uint16 rc_ppm_frame_length # Length of a single PPM frame. Zero for non-PPM systems
|
||||
|
||||
uint8 input_source # Input source
|
||||
|
||||
@@ -4,7 +4,7 @@ uint16 tx_buf_write_index # current size of the tx buffer
|
||||
uint16 rx_buf_read_index # the rx buffer is parsed up to that index
|
||||
uint16 rx_buf_end_index # current size of the rx buffer
|
||||
uint16 failed_sbd_sessions # number of failed sbd sessions
|
||||
uint16 successful_sbd_sessions # number of successfull sbd sessions
|
||||
uint16 successful_sbd_sessions # number of successful sbd sessions
|
||||
uint16 num_tx_buf_reset # number of times the tx buffer was reset
|
||||
uint8 signal_quality # current signal quality, 0 is no signal, 5 the best
|
||||
uint8 state # current state of the driver, see the satcom_state of IridiumSBD.h for the definition
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ uint8 MODE_BLINK_FAST = 5
|
||||
uint8 MODE_BREATHE = 6 # continuously increase & decrease brightness (solid color if driver does not support it)
|
||||
uint8 MODE_FLASH = 7 # two fast blinks (on/off) with timing as in MODE_BLINK_FAST and then off for a while
|
||||
|
||||
uint8 MAX_PRIORITY = 2 # maxium priority (minimum is 0)
|
||||
uint8 MAX_PRIORITY = 2 # maximum priority (minimum is 0)
|
||||
|
||||
|
||||
uint8 led_mask # bitmask which LED(s) to control, set to 0xff for all
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
uint64 timestamp # [us] time since system start
|
||||
float32 lateral_touchdown_offset # [m] lateral touchdown position offset manually commanded during landing
|
||||
bool flaring # true if the aircraft is flaring
|
||||
|
||||
float32 horizontal_slope_displacement
|
||||
# abort status is:
|
||||
# 0 if not aborted
|
||||
# >0 if aborted, with the singular abort criterion which triggered the landing abort enumerated by the following abort reasons
|
||||
uint8 abort_status
|
||||
|
||||
float32 slope_angle_rad
|
||||
|
||||
float32 flare_length
|
||||
|
||||
bool abort_landing # true if landing should be aborted
|
||||
# abort reasons
|
||||
# after the manual operator abort, corresponds to individual bits of param FW_LND_ABORT
|
||||
uint8 NOT_ABORTED = 0
|
||||
uint8 ABORTED_BY_OPERATOR = 1
|
||||
uint8 TERRAIN_NOT_FOUND = 2 # FW_LND_ABORT (1 << 0)
|
||||
uint8 TERRAIN_TIMEOUT = 3 # FW_LND_ABORT (1 << 1)
|
||||
uint8 UNKNOWN_ABORT_CRITERION = 4
|
||||
|
||||
@@ -40,6 +40,7 @@ int8 loiter_direction # loiter direction: 1 = CW, -1 = CCW
|
||||
float32 acceptance_radius # navigation acceptance_radius if we're doing waypoint navigation
|
||||
|
||||
float32 cruising_speed # the generally desired cruising speed (not a hard constraint)
|
||||
float32 cruising_throttle # the generally desired cruising throttle (not a hard constraint)
|
||||
bool gliding_enabled # commands the vehicle to glide if the capability is available (fixed wing only)
|
||||
float32 cruising_throttle # the generally desired cruising throttle (not a hard constraint), only has an effect for rover
|
||||
|
||||
bool disable_weather_vane # VTOL: disable (in auto mode) the weather vane feature that turns the nose into the wind
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
float32 indicated_frequency_rpm # indicated rotor Frequency in Revolution per minute
|
||||
float32 estimated_accurancy_rpm # estimated accurancy in Revolution per minute
|
||||
float32 estimated_accurancy_rpm # estimated accuracy in Revolution per minute
|
||||
|
||||
@@ -46,4 +46,7 @@ float32 heading # heading angle of XYZ body frame rel to NED. Set to NaN if no
|
||||
float32 heading_offset # heading offset of dual antenna array in body frame. Set to NaN if not applicable. (rad, [-PI, PI])
|
||||
float32 heading_accuracy # heading accuracy (rad, [0, 2PI])
|
||||
|
||||
float32 rtcm_injection_rate # RTCM message injection rate Hz
|
||||
uint8 selected_rtcm_instance # uorb instance that is being used for RTCM corrections
|
||||
|
||||
# TOPICS sensor_gps vehicle_gps_position
|
||||
|
||||
@@ -3,6 +3,6 @@ uint64 timestamp_sample
|
||||
|
||||
uint32 device_id # unique device ID for the sensor that does not change between power cycles
|
||||
|
||||
float32 temperature # Temperature provided by sensor (Celcius)
|
||||
float32 temperature # Temperature provided by sensor (Celsius)
|
||||
|
||||
float32 humidity # Humidity provided by sensor
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Status of the takeoff state machine currently just availble for multicopters
|
||||
# Status of the takeoff state machine currently just available for multicopters
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
@@ -11,4 +11,4 @@ uint8 TAKEOFF_STATE_FLIGHT = 5
|
||||
|
||||
uint8 takeoff_state
|
||||
|
||||
float32 tilt_limit # limited tilt feasability during takeoff, contains maximum tilt otherwise
|
||||
float32 tilt_limit # limited tilt feasibility during takeoff, contains maximum tilt otherwise
|
||||
|
||||
@@ -40,5 +40,6 @@ float32 pitch_integ
|
||||
|
||||
float32 throttle_sp
|
||||
float32 pitch_sp_rad
|
||||
float32 throttle_trim # estimated throttle value [0,1] required to fly level at equivalent_airspeed_sp in the current atmospheric conditions
|
||||
|
||||
uint8 mode
|
||||
|
||||
@@ -253,10 +253,14 @@ void micrortps_start_topics(const uint32_t &datarate, struct timespec &begin, ui
|
||||
|
||||
while (!_should_exit_task) {
|
||||
@[if recv_topics]@
|
||||
while (0 < (read = transport_node->read(&topic_ID, data_buffer, BUFFER_SIZE))) {
|
||||
|
||||
read = transport_node->read();
|
||||
if (read > 0) {
|
||||
total_rcvd += read;
|
||||
rx_last_sec_read += read;
|
||||
}
|
||||
|
||||
while (transport_node->parse(&topic_ID, data_buffer, BUFFER_SIZE)) {
|
||||
uint64_t read_time = hrt_absolute_time();
|
||||
|
||||
switch (topic_ID) {
|
||||
|
||||
@@ -364,10 +364,14 @@ int main(int argc, char **argv)
|
||||
if (!receiving) { start = std::chrono::steady_clock::now(); }
|
||||
|
||||
// Publish messages received from UART
|
||||
if (0 < (length = transport_node->read(&topic_ID, data_buffer, BUFFER_SIZE))) {
|
||||
length = transport_node->read();
|
||||
if (length > 0) {
|
||||
total_read += length;
|
||||
}
|
||||
|
||||
while (transport_node->parse(&topic_ID, data_buffer, BUFFER_SIZE)) {
|
||||
topics->publish(topic_ID, data_buffer, sizeof(data_buffer));
|
||||
++received;
|
||||
total_read += length;
|
||||
receiving = true;
|
||||
end = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
@@ -113,14 +113,8 @@ uint16_t Transport_node::crc16(uint8_t const *buffer, size_t len)
|
||||
return crc;
|
||||
}
|
||||
|
||||
ssize_t Transport_node::read(uint8_t *topic_id, char out_buffer[], size_t buffer_len)
|
||||
ssize_t Transport_node::read()
|
||||
{
|
||||
if (nullptr == out_buffer || nullptr == topic_id || !fds_OK()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
*topic_id = 255;
|
||||
|
||||
ssize_t len = node_read((void *)(_rx_buffer + _rx_buff_pos), sizeof(_rx_buffer) - _rx_buff_pos);
|
||||
|
||||
if (len < 0) {
|
||||
@@ -143,85 +137,141 @@ ssize_t Transport_node::read(uint8_t *topic_id, char out_buffer[], size_t buffer
|
||||
|
||||
_rx_buff_pos += len;
|
||||
|
||||
// We read some
|
||||
size_t header_size = sizeof(struct Header);
|
||||
return len;
|
||||
}
|
||||
|
||||
// but not enough
|
||||
if (_rx_buff_pos < header_size) {
|
||||
return 0;
|
||||
#ifndef PX4_DEBUG
|
||||
|
||||
void Transport_node::print_buffer_debug()
|
||||
{
|
||||
for (uint32_t i = 0; i < BUFFER_SIZE; ++i) {
|
||||
if (i >= _rx_buff_pos) {
|
||||
printf(".");
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("%" PRIi8, _rx_buffer[i]);
|
||||
|
||||
if (_rx_buffer[i] == '>') {
|
||||
printf("(X)");
|
||||
}
|
||||
|
||||
printf(" ");
|
||||
}
|
||||
|
||||
uint32_t msg_start_pos = 0;
|
||||
printf("\n_rx_buff_pos: %" PRIu32 "\n", _rx_buff_pos);
|
||||
}
|
||||
|
||||
for (msg_start_pos = 0; msg_start_pos <= _rx_buff_pos - header_size; ++msg_start_pos) {
|
||||
if ('>' == _rx_buffer[msg_start_pos] && memcmp(_rx_buffer + msg_start_pos, ">>>", 3) == 0) {
|
||||
#endif /* PX4_DEBUG */
|
||||
|
||||
bool Transport_node::parse(
|
||||
uint8_t *topic_id, char out_buffer[], size_t buffer_len)
|
||||
{
|
||||
if (nullptr == out_buffer || nullptr == topic_id || !fds_OK()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
*topic_id = 255;
|
||||
|
||||
static constexpr size_t header_size = sizeof(struct Header);
|
||||
|
||||
// No need to look for a message if not even a header fits into the buffer.
|
||||
if (_rx_buff_pos < header_size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Try to find the start of a message using the magic start sequence of '>>>'.
|
||||
int32_t msg_start_pos = -1;
|
||||
|
||||
for (uint32_t i = 0; i <= _rx_buff_pos; ++i) {
|
||||
if ('>' == _rx_buffer[i] && memcmp(_rx_buffer + i, ">>>", 3) == 0) {
|
||||
msg_start_pos = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Start not found
|
||||
if (msg_start_pos > (_rx_buff_pos - header_size)) {
|
||||
auto DropDataBeforeIndex = [&](uint32_t index) {
|
||||
if (index == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (index > _rx_buff_pos) {
|
||||
index = _rx_buff_pos;
|
||||
|
||||
#ifndef PX4_DEBUG
|
||||
|
||||
if (_debug) { printf("\033[1;33m[ micrortps_transport ]\t (↓↓ %" PRIu32 ")\033[0m\n", msg_start_pos); }
|
||||
if (_debug) { printf("\033[0;31m[ micrortps_transport ]\t clamped index from %" PRIu32 " to %" PRIu32 "\033[0m\n", index, _rx_buff_pos); }
|
||||
|
||||
#else
|
||||
|
||||
if (_debug) { PX4_DEBUG(" (↓↓ %" PRIu32 ")", msg_start_pos); }
|
||||
if (_debug) { PX4_ERR("ERROR: clamped index from %" PRIu32 " to %" PRIu32 "\n", index, _rx_buff_pos); }
|
||||
|
||||
#endif /* PX4_DEBUG */
|
||||
}
|
||||
|
||||
// All we've checked so far is garbage, drop it - but save unchecked bytes
|
||||
memmove(_rx_buffer, _rx_buffer + msg_start_pos, _rx_buff_pos - msg_start_pos);
|
||||
_rx_buff_pos -= msg_start_pos;
|
||||
return -1;
|
||||
memmove(_rx_buffer, _rx_buffer + index, _rx_buff_pos - index);
|
||||
_rx_buff_pos -= index;
|
||||
};
|
||||
|
||||
// No start sequence has been found in the buffer. We can drop all data up to
|
||||
// 2 characters before the end (to account for a non-complete start sequence).
|
||||
if (msg_start_pos == -1) {
|
||||
// Note, _rx_buff_pos should always be larger than 2 as we enforce a min.
|
||||
// buffer content corresponding to a header length some lines above.
|
||||
int32_t drop_before_idx = _rx_buff_pos - 2;
|
||||
DropDataBeforeIndex(drop_before_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
// [>,>,>,topic_id,sys_id,seq,payload_length_H,payload_length_L,CRCHigh,CRCLow,payloadStart, ... ,payloadEnd]
|
||||
struct Header *header = (struct Header *)&_rx_buffer[msg_start_pos];
|
||||
uint32_t payload_len = ((uint32_t)header->payload_len_h << 8) | header->payload_len_l;
|
||||
// A start sequence has been found. We can drop everything before this index
|
||||
// in the buffer. This could happen at the startup when syncing to the
|
||||
// stream or with noise on the data stream.
|
||||
DropDataBeforeIndex(msg_start_pos);
|
||||
|
||||
// We have found a start sequence. Let's check if the header is in the buffer.
|
||||
// [>,>,>,topic_id,sys_id,seq,payload_length_H,payload_length_L,CRCHigh,CRCLow,payloadStart,
|
||||
// ... ,payloadEnd]
|
||||
if (header_size > _rx_buff_pos) {
|
||||
// Header not yet in the buffer.
|
||||
return false;
|
||||
}
|
||||
|
||||
struct Header *header = (struct Header *)&_rx_buffer[0];
|
||||
|
||||
uint32_t payload_len =
|
||||
((uint32_t)header->payload_len_h << 8) | header->payload_len_l;
|
||||
|
||||
// The message won't fit the output or processing buffer. This could happen
|
||||
// with a corrupted header or by an actual message that is too large for our
|
||||
// buffers. Let's drop it.
|
||||
uint32_t message_length = header_size + payload_len;
|
||||
|
||||
if (message_length > buffer_len || (message_length + 3) > BUFFER_SIZE) {
|
||||
DropDataBeforeIndex(3 + header_size);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Let's check if all payload data according to the message length in the
|
||||
// header is already in the buffer.
|
||||
if ((header_size + payload_len) > _rx_buff_pos) {
|
||||
// The buffer does not yet contain the full message. We need to wait for
|
||||
// more data.
|
||||
return false;
|
||||
}
|
||||
|
||||
// The received message comes from this system. Discard it.
|
||||
// This might happen when:
|
||||
// 1. The same UDP port is being used to send a rcv packets or
|
||||
// 2. The same topic on the agent is being used for outgoing and incoming data
|
||||
// 2. The same topic on the agent is being used for outgoing and incoming
|
||||
// data
|
||||
if (header->sys_id == _sys_id) {
|
||||
// Drop the message and continue with the read buffer
|
||||
memmove(_rx_buffer, _rx_buffer + msg_start_pos + 1, _rx_buff_pos - (msg_start_pos + 1));
|
||||
_rx_buff_pos -= (msg_start_pos + 1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// The message won't fit the buffer.
|
||||
if (buffer_len < header_size + payload_len) {
|
||||
// Drop the message and continue with the read buffer
|
||||
memmove(_rx_buffer, _rx_buffer + msg_start_pos + 1, _rx_buff_pos - (msg_start_pos + 1));
|
||||
_rx_buff_pos -= (msg_start_pos + 1);
|
||||
return -EMSGSIZE;
|
||||
}
|
||||
|
||||
// We do not have a complete message yet
|
||||
if (msg_start_pos + header_size + payload_len > _rx_buff_pos) {
|
||||
// If there's garbage at the beginning, drop it
|
||||
if (msg_start_pos > 0) {
|
||||
#ifndef PX4_DEBUG
|
||||
|
||||
if (_debug) { printf("\033[1;33m[ micrortps_transport ]\t (↓ %" PRIu32 ")\033[0m\n", msg_start_pos); }
|
||||
|
||||
#else
|
||||
|
||||
if (_debug) { PX4_DEBUG(" (↓ %" PRIu32 ")", msg_start_pos); }
|
||||
|
||||
#endif /* PX4_DEBUG */
|
||||
memmove(_rx_buffer, _rx_buffer + msg_start_pos, _rx_buff_pos - msg_start_pos);
|
||||
_rx_buff_pos -= msg_start_pos;
|
||||
}
|
||||
|
||||
return 0;
|
||||
DropDataBeforeIndex(3);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check the CRC of the message.
|
||||
uint16_t read_crc = ((uint16_t)header->crc_h << 8) | header->crc_l;
|
||||
uint16_t calc_crc = crc16((uint8_t *)_rx_buffer + msg_start_pos + header_size, payload_len);
|
||||
uint16_t calc_crc = crc16((uint8_t *)_rx_buffer + header_size, payload_len);
|
||||
|
||||
if (read_crc != calc_crc) {
|
||||
#ifndef PX4_DEBUG
|
||||
@@ -234,26 +284,16 @@ ssize_t Transport_node::read(uint8_t *topic_id, char out_buffer[], size_t buffer
|
||||
|
||||
#endif /* PX4_DEBUG */
|
||||
|
||||
// Drop garbage up just beyond the start of the message
|
||||
memmove(_rx_buffer, _rx_buffer + (msg_start_pos + 1), _rx_buff_pos);
|
||||
|
||||
// If there is a CRC error, the payload len cannot be trusted
|
||||
_rx_buff_pos -= (msg_start_pos + 1);
|
||||
|
||||
len = -1;
|
||||
|
||||
} else {
|
||||
// copy message to outbuffer and set other return values
|
||||
memmove(out_buffer, _rx_buffer + msg_start_pos + header_size, payload_len);
|
||||
*topic_id = header->topic_id;
|
||||
len = payload_len + header_size;
|
||||
|
||||
// discard message from _rx_buffer
|
||||
_rx_buff_pos -= msg_start_pos + header_size + payload_len;
|
||||
memmove(_rx_buffer, _rx_buffer + msg_start_pos + header_size + payload_len, _rx_buff_pos);
|
||||
DropDataBeforeIndex(3);
|
||||
return false;
|
||||
}
|
||||
|
||||
return len;
|
||||
// Copy message to output buffer and drop it from the buffer.
|
||||
memmove(out_buffer, _rx_buffer + header_size, payload_len);
|
||||
*topic_id = header->topic_id;
|
||||
|
||||
DropDataBeforeIndex(header_size + payload_len);
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t Transport_node::get_header_length()
|
||||
|
||||
@@ -56,7 +56,9 @@ public:
|
||||
|
||||
virtual int init() {return 0;}
|
||||
virtual uint8_t close() {return 0;}
|
||||
ssize_t read(uint8_t *topic_id, char out_buffer[], size_t buffer_len);
|
||||
|
||||
ssize_t read();
|
||||
bool parse(uint8_t *topic_id, char out_buffer[], size_t buffer_len);
|
||||
|
||||
/**
|
||||
* write a buffer
|
||||
@@ -76,6 +78,10 @@ public:
|
||||
size_t get_header_length();
|
||||
|
||||
private:
|
||||
#ifndef PX4_DEBUG
|
||||
void print_buffer_debug();
|
||||
#endif /* PX4_DEBUG */
|
||||
|
||||
struct __attribute__((packed)) Header {
|
||||
char marker[3];
|
||||
uint8_t topic_id;
|
||||
|
||||
@@ -413,7 +413,7 @@ def convert_dir(format_idx, inputdir, outputdir, package, templatedir):
|
||||
def copy_changed(inputdir, outputdir, prefix='', quiet=False):
|
||||
"""
|
||||
Copies files from inputdir to outputdir if they don't exist in
|
||||
ouputdir or if their content changed
|
||||
outputdir or if their content changed
|
||||
"""
|
||||
|
||||
# Make sure output directory exists:
|
||||
|
||||
@@ -8,8 +8,8 @@ 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 wich takes part in Ranging)
|
||||
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 incomming RX msg
|
||||
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)
|
||||
|
||||
@@ -99,7 +99,7 @@ uint16 VEHICLE_CMD_FIXED_MAG_CAL_YAW = 42006 # Magnetometer calibrati
|
||||
|
||||
# PX4 vehicle commands (beyond 16 bit mavlink commands)
|
||||
uint32 VEHICLE_CMD_PX4_INTERNAL_START = 65537 # start of PX4 internal only vehicle commands (> UINT16_MAX)
|
||||
uint32 VEHICLE_CMD_SET_GPS_GLOBAL_ORIGIN = 100000 # Sets the GPS co-ordinates of the vehicle local origin (0,0,0) position. |Empty|Empty|Empty|Empty|Latitude|Longitude|Altitude|
|
||||
uint32 VEHICLE_CMD_SET_GPS_GLOBAL_ORIGIN = 100000 # Sets the GPS coordinates of the vehicle local origin (0,0,0) position. |Empty|Empty|Empty|Empty|Latitude|Longitude|Altitude|
|
||||
|
||||
uint8 VEHICLE_MOUNT_MODE_RETRACT = 0 # Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization |
|
||||
uint8 VEHICLE_MOUNT_MODE_NEUTRAL = 1 # Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. |
|
||||
|
||||
@@ -64,6 +64,8 @@ float32 epv # Standard deviation of vertical position error, (metres)
|
||||
float32 evh # Standard deviation of horizontal velocity error, (metres/sec)
|
||||
float32 evv # Standard deviation of horizontal velocity error, (metres/sec)
|
||||
|
||||
bool dead_reckoning # True if this position is estimated through dead-reckoning
|
||||
|
||||
# estimator specified vehicle limits
|
||||
float32 vxy_max # maximum horizontal speed - set to 0 when limiting not required (meters/sec)
|
||||
float32 vz_max # maximum vertical speed - set to 0 when limiting not required (meters/sec)
|
||||
|
||||
@@ -32,7 +32,7 @@ float32 y # East position
|
||||
float32 z # Down position
|
||||
|
||||
# Orientation quaternion. First value NaN if invalid/unknown
|
||||
float32[4] q # Quaternion rotation from FRD body frame to refernce frame
|
||||
float32[4] q # Quaternion rotation from FRD body frame to reference frame
|
||||
float32[4] q_offset # Quaternion rotation from odometry reference frame to navigation frame
|
||||
|
||||
# Row-major representation of 6x6 pose cross-covariance matrix URT.
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
float32 roll # body angular rates in NED frame
|
||||
float32 pitch # body angular rates in NED frame
|
||||
float32 yaw # body angular rates in NED frame
|
||||
# body angular rates in NED frame
|
||||
float32 roll # [rad/s] roll rate setpoint
|
||||
float32 pitch # [rad/s] pitch rate setpoint
|
||||
float32 yaw # [rad/s] yaw rate setpoint
|
||||
|
||||
# For clarification: For multicopters thrust_body[0] and thrust[1] are usually 0 and thrust[2] is the negative throttle demand.
|
||||
# For fixed wings thrust_x is the throttle demand and thrust_y, thrust_z will usually be zero.
|
||||
|
||||
+86
-92
@@ -1,5 +1,11 @@
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
# Encodes the system state of the vehicle published by commander
|
||||
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
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
|
||||
@@ -8,93 +14,8 @@ uint8 ARMING_STATE_SHUTDOWN = 4
|
||||
uint8 ARMING_STATE_IN_AIR_RESTORE = 5
|
||||
uint8 ARMING_STATE_MAX = 6
|
||||
|
||||
# FailureDetector status
|
||||
uint16 FAILURE_NONE = 0
|
||||
uint16 FAILURE_ROLL = 1 # (1 << 0)
|
||||
uint16 FAILURE_PITCH = 2 # (1 << 1)
|
||||
uint16 FAILURE_ALT = 4 # (1 << 2)
|
||||
uint16 FAILURE_EXT = 8 # (1 << 3)
|
||||
uint16 FAILURE_ARM_ESC = 16 # (1 << 4)
|
||||
uint16 FAILURE_BATTERY = 32 # (1 << 5)
|
||||
uint16 FAILURE_IMBALANCED_PROP = 64 # (1 << 6)
|
||||
uint16 FAILURE_MOTOR = 128 # (1 << 7)
|
||||
|
||||
# HIL
|
||||
uint8 HIL_STATE_OFF = 0
|
||||
uint8 HIL_STATE_ON = 1
|
||||
|
||||
# Navigation state, i.e. "what should vehicle do".
|
||||
uint8 NAVIGATION_STATE_MANUAL = 0 # Manual mode
|
||||
uint8 NAVIGATION_STATE_ALTCTL = 1 # Altitude control mode
|
||||
uint8 NAVIGATION_STATE_POSCTL = 2 # Position control mode
|
||||
uint8 NAVIGATION_STATE_AUTO_MISSION = 3 # Auto mission mode
|
||||
uint8 NAVIGATION_STATE_AUTO_LOITER = 4 # Auto loiter mode
|
||||
uint8 NAVIGATION_STATE_AUTO_RTL = 5 # Auto return to launch mode
|
||||
uint8 NAVIGATION_STATE_UNUSED3 = 8 # Free slot
|
||||
uint8 NAVIGATION_STATE_UNUSED = 9 # Free slot
|
||||
uint8 NAVIGATION_STATE_ACRO = 10 # Acro mode
|
||||
uint8 NAVIGATION_STATE_UNUSED1 = 11 # Free slot
|
||||
uint8 NAVIGATION_STATE_DESCEND = 12 # Descend mode (no position control)
|
||||
uint8 NAVIGATION_STATE_TERMINATION = 13 # Termination mode
|
||||
uint8 NAVIGATION_STATE_OFFBOARD = 14
|
||||
uint8 NAVIGATION_STATE_STAB = 15 # Stabilized mode
|
||||
uint8 NAVIGATION_STATE_UNUSED2 = 16 # Free slot
|
||||
uint8 NAVIGATION_STATE_AUTO_TAKEOFF = 17 # Takeoff
|
||||
uint8 NAVIGATION_STATE_AUTO_LAND = 18 # Land
|
||||
uint8 NAVIGATION_STATE_AUTO_FOLLOW_TARGET = 19 # Auto Follow
|
||||
uint8 NAVIGATION_STATE_AUTO_PRECLAND = 20 # Precision land with landing target
|
||||
uint8 NAVIGATION_STATE_ORBIT = 21 # Orbit in a circle
|
||||
uint8 NAVIGATION_STATE_AUTO_VTOL_TAKEOFF = 22 # Takeoff, transition, establish loiter
|
||||
uint8 NAVIGATION_STATE_MAX = 23
|
||||
|
||||
uint8 VEHICLE_TYPE_UNKNOWN = 0
|
||||
uint8 VEHICLE_TYPE_ROTARY_WING = 1
|
||||
uint8 VEHICLE_TYPE_FIXED_WING = 2
|
||||
uint8 VEHICLE_TYPE_ROVER = 3
|
||||
uint8 VEHICLE_TYPE_AIRSHIP = 4
|
||||
|
||||
# state machine / state of vehicle.
|
||||
# Encodes the complete system state and is set by the commander app.
|
||||
|
||||
uint8 nav_state # set navigation state machine to specified value
|
||||
uint64 nav_state_timestamp # time when current nav_state activated
|
||||
uint8 arming_state # current arming state
|
||||
uint8 hil_state # current hil state
|
||||
bool failsafe # true if system is in failsafe state (e.g.:RTL, Hover, Terminate, ...)
|
||||
uint64 failsafe_timestamp # time when failsafe was activated
|
||||
|
||||
uint8 system_type # system type, contains mavlink MAV_TYPE
|
||||
uint8 system_id # system id, contains MAVLink's system ID field
|
||||
uint8 component_id # subsystem / component id, contains MAVLink's component ID field
|
||||
|
||||
uint8 vehicle_type # Type of vehicle (rotary wing/fixed-wing/rover/airship, see above)
|
||||
# If the vehicle is a VTOL, then this value will be VEHICLE_TYPE_ROTARY_WING while flying as a multicopter,
|
||||
# and VEHICLE_TYPE_FIXED_WING when flying as a fixed-wing
|
||||
|
||||
bool is_vtol # True if the system is VTOL capable
|
||||
bool is_vtol_tailsitter # True if the system performs a 90° pitch down rotation during transition from MC to FW
|
||||
bool in_transition_mode # True if VTOL is doing a transition
|
||||
bool in_transition_to_fw # True if VTOL is doing a transition from MC to FW
|
||||
|
||||
bool rc_signal_lost # true if RC reception lost
|
||||
|
||||
bool data_link_lost # datalink to GCS lost
|
||||
uint8 data_link_lost_counter # counts unique data link lost events
|
||||
|
||||
bool high_latency_data_link_lost # Set to true if the high latency data link (eg. RockBlock Iridium 9603 telemetry module) is lost
|
||||
|
||||
bool mission_failure # Set to true if mission could not continue/finish
|
||||
bool geofence_violated
|
||||
|
||||
uint16 failure_detector_status # Bitmask containing FailureDetector status [0, 0, 0, 0, 0, FAILURE_ALT, FAILURE_PITCH, FAILURE_ROLL]
|
||||
|
||||
# see SYS_STATUS mavlink message for the following
|
||||
# lower 32 bits are for the base flags, higher 32 bits are or the extended flags
|
||||
uint64 onboard_control_sensors_present
|
||||
uint64 onboard_control_sensors_enabled
|
||||
uint64 onboard_control_sensors_health
|
||||
|
||||
|
||||
uint8 latest_arming_reason
|
||||
uint8 latest_disarming_reason
|
||||
uint8 ARM_DISARM_REASON_TRANSITION_TO_STANDBY = 0
|
||||
uint8 ARM_DISARM_REASON_RC_STICK = 1
|
||||
uint8 ARM_DISARM_REASON_RC_SWITCH = 2
|
||||
@@ -110,12 +31,85 @@ uint8 ARM_DISARM_REASON_FAILURE_DETECTOR = 11
|
||||
uint8 ARM_DISARM_REASON_SHUTDOWN = 12
|
||||
uint8 ARM_DISARM_REASON_UNIT_TEST = 13
|
||||
|
||||
uint8 latest_arming_reason
|
||||
uint8 latest_disarming_reason
|
||||
uint64 nav_state_timestamp # time when current nav_state activated
|
||||
|
||||
uint64 armed_time # Arming timestamp (microseconds)
|
||||
# Navigation state "what should vehicle do"
|
||||
uint8 nav_state
|
||||
uint8 NAVIGATION_STATE_MANUAL = 0 # Manual mode
|
||||
uint8 NAVIGATION_STATE_ALTCTL = 1 # Altitude control mode
|
||||
uint8 NAVIGATION_STATE_POSCTL = 2 # Position control mode
|
||||
uint8 NAVIGATION_STATE_AUTO_MISSION = 3 # Auto mission mode
|
||||
uint8 NAVIGATION_STATE_AUTO_LOITER = 4 # Auto loiter mode
|
||||
uint8 NAVIGATION_STATE_AUTO_RTL = 5 # Auto return to launch mode
|
||||
uint8 NAVIGATION_STATE_UNUSED3 = 8 # Free slot
|
||||
uint8 NAVIGATION_STATE_UNUSED = 9 # Free slot
|
||||
uint8 NAVIGATION_STATE_ACRO = 10 # Acro mode
|
||||
uint8 NAVIGATION_STATE_UNUSED1 = 11 # Free slot
|
||||
uint8 NAVIGATION_STATE_DESCEND = 12 # Descend mode (no position control)
|
||||
uint8 NAVIGATION_STATE_TERMINATION = 13 # Termination mode
|
||||
uint8 NAVIGATION_STATE_OFFBOARD = 14
|
||||
uint8 NAVIGATION_STATE_STAB = 15 # Stabilized mode
|
||||
uint8 NAVIGATION_STATE_UNUSED2 = 16 # Free slot
|
||||
uint8 NAVIGATION_STATE_AUTO_TAKEOFF = 17 # Takeoff
|
||||
uint8 NAVIGATION_STATE_AUTO_LAND = 18 # Land
|
||||
uint8 NAVIGATION_STATE_AUTO_FOLLOW_TARGET = 19 # Auto Follow
|
||||
uint8 NAVIGATION_STATE_AUTO_PRECLAND = 20 # Precision land with landing target
|
||||
uint8 NAVIGATION_STATE_ORBIT = 21 # Orbit in a circle
|
||||
uint8 NAVIGATION_STATE_AUTO_VTOL_TAKEOFF = 22 # Takeoff, transition, establish loiter
|
||||
uint8 NAVIGATION_STATE_MAX = 23
|
||||
|
||||
uint64 takeoff_time # Takeoff timestamp (microseconds)
|
||||
# Bitmask of detected failures
|
||||
uint16 failure_detector_status
|
||||
uint16 FAILURE_NONE = 0
|
||||
uint16 FAILURE_ROLL = 1 # (1 << 0)
|
||||
uint16 FAILURE_PITCH = 2 # (1 << 1)
|
||||
uint16 FAILURE_ALT = 4 # (1 << 2)
|
||||
uint16 FAILURE_EXT = 8 # (1 << 3)
|
||||
uint16 FAILURE_ARM_ESC = 16 # (1 << 4)
|
||||
uint16 FAILURE_BATTERY = 32 # (1 << 5)
|
||||
uint16 FAILURE_IMBALANCED_PROP = 64 # (1 << 6)
|
||||
uint16 FAILURE_MOTOR = 128 # (1 << 7)
|
||||
|
||||
uint8 hil_state
|
||||
uint8 HIL_STATE_OFF = 0
|
||||
uint8 HIL_STATE_ON = 1
|
||||
|
||||
# If it's a VTOL, then the value will be VEHICLE_TYPE_ROTARY_WING while flying as a multicopter, and VEHICLE_TYPE_FIXED_WING when flying as a fixed-wing
|
||||
uint8 vehicle_type
|
||||
uint8 VEHICLE_TYPE_UNKNOWN = 0
|
||||
uint8 VEHICLE_TYPE_ROTARY_WING = 1
|
||||
uint8 VEHICLE_TYPE_FIXED_WING = 2
|
||||
uint8 VEHICLE_TYPE_ROVER = 3
|
||||
uint8 VEHICLE_TYPE_AIRSHIP = 4
|
||||
|
||||
bool failsafe # true if system is in failsafe state (e.g.:RTL, Hover, Terminate, ...)
|
||||
uint64 failsafe_timestamp # time when failsafe was activated
|
||||
|
||||
# Link loss
|
||||
bool rc_signal_lost # true if RC reception lost
|
||||
bool data_link_lost # datalink to GCS lost
|
||||
uint8 data_link_lost_counter # counts unique data link lost events
|
||||
bool high_latency_data_link_lost # Set to true if the high latency data link (eg. RockBlock Iridium 9603 telemetry module) is lost
|
||||
|
||||
# VTOL flags
|
||||
bool is_vtol # True if the system is VTOL capable
|
||||
bool is_vtol_tailsitter # True if the system performs a 90° pitch down rotation during transition from MC to FW
|
||||
bool in_transition_mode # True if VTOL is doing a transition
|
||||
bool in_transition_to_fw # True if VTOL is doing a transition from MC to FW
|
||||
|
||||
bool mission_failure # Set to true if mission could not continue/finish
|
||||
bool geofence_violated
|
||||
|
||||
# MAVLink identification
|
||||
uint8 system_type # system type, contains mavlink MAV_TYPE
|
||||
uint8 system_id # system id, contains MAVLink's system ID field
|
||||
uint8 component_id # subsystem / component id, contains MAVLink's component ID field
|
||||
|
||||
# see SYS_STATUS mavlink message for the following
|
||||
# lower 32 bits are for the base flags, higher 32 bits are or the extended flags
|
||||
uint64 onboard_control_sensors_present
|
||||
uint64 onboard_control_sensors_enabled
|
||||
uint64 onboard_control_sensors_health
|
||||
|
||||
bool safety_button_available # Set to true if a safety button is connected
|
||||
bool safety_off # Set to true if safety is off
|
||||
|
||||
@@ -29,7 +29,6 @@ bool circuit_breaker_engaged_power_check
|
||||
bool circuit_breaker_engaged_airspd_check
|
||||
bool circuit_breaker_flight_termination_disabled
|
||||
bool circuit_breaker_engaged_usb_check
|
||||
bool circuit_breaker_engaged_posfailure_check # set to true when the position valid checks have been disabled
|
||||
bool circuit_breaker_vtol_fw_arming_check # set to true if for VTOLs arming in fixed-wing mode should be allowed
|
||||
|
||||
bool offboard_control_signal_lost
|
||||
|
||||
@@ -854,7 +854,7 @@ __EXPORT void board_get_uuid32(uuid_uint32_t uuid_words); // DEPRICATED use boar
|
||||
*
|
||||
* Input Parameters:
|
||||
* format_buffer - A pointer to a bufferer of at least PX4_CPU_UUID_WORD32_FORMAT_SIZE
|
||||
* that will contain a 0 terminated string formated as described
|
||||
* that will contain a 0 terminated string formatted as described
|
||||
* the format string and optional separator.
|
||||
* size - The size of the buffer (should be atleaset PX4_CPU_UUID_WORD32_FORMAT_SIZE)
|
||||
* format - The fort mat specifier for the hex digit see CPU_UUID_FORMAT
|
||||
@@ -870,7 +870,7 @@ __EXPORT void board_get_uuid32(uuid_uint32_t uuid_words); // DEPRICATED use boar
|
||||
* 3238333641203833355110
|
||||
*
|
||||
* Returned Value:
|
||||
* The format buffer is populated with a 0 terminated string formated as described.
|
||||
* The format buffer is populated with a 0 terminated string formatted as described.
|
||||
* Zero (OK) is returned on success;
|
||||
*
|
||||
************************************************************************************/
|
||||
@@ -907,7 +907,7 @@ int board_get_mfguid(mfguid_t mfgid);
|
||||
*
|
||||
* Input Parameters:
|
||||
* format_buffer - A pointer to a bufferer of at least PX4_CPU_MFGUID_FORMAT_SIZE
|
||||
* that will contain a 0 terminated string formated as 0 prefixed
|
||||
* that will contain a 0 terminated string formatted as 0 prefixed
|
||||
* lowercase hex. 2 charaters per digit of the mfguid_t.
|
||||
*
|
||||
* Returned Value:
|
||||
@@ -964,7 +964,7 @@ int board_get_px4_guid(px4_guid_t guid);
|
||||
* manufactures Unique ID or define BOARD_OVERRIDE_PX4_GUID
|
||||
*
|
||||
* Input Parameters:
|
||||
* format_buffer - A buffer to receive the 0 terminated formated px4
|
||||
* format_buffer - A buffer to receive the 0 terminated formatted px4
|
||||
* guid string.
|
||||
* size - Size of the buffer provided. Normally this would
|
||||
* be PX4_GUID_FORMAT_SIZE.
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
/**
|
||||
* @file log.h
|
||||
* Platform dependant logging/debug implementation
|
||||
* Platform dependent logging/debug implementation
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2022 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
// minimal cmath
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdlib>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
#if !defined(FLT_EPSILON)
|
||||
#define FLT_EPSILON __FLT_EPSILON__
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef isfinite
|
||||
#undef isfinite
|
||||
#endif // isfinite
|
||||
|
||||
inline bool isfinite(float value) { return __builtin_isfinite(value); }
|
||||
inline bool isfinite(double value) { return __builtin_isfinite(value); }
|
||||
inline bool isfinite(long double value) { return __builtin_isfinite(value); }
|
||||
|
||||
|
||||
#ifdef isnan
|
||||
#undef isnan
|
||||
#endif // isnan
|
||||
|
||||
inline bool isnan(float value) { return __builtin_isnan(value); }
|
||||
inline bool isnan(double value) { return __builtin_isnan(value); }
|
||||
inline bool isnan(long double value) { return __builtin_isnan(value); }
|
||||
|
||||
|
||||
#ifdef isinf
|
||||
#undef isinf
|
||||
#endif // isinf
|
||||
|
||||
inline bool isinf(float value) { return __builtin_isinf_sign(value); }
|
||||
inline bool isinf(double value) { return __builtin_isinf_sign(value); }
|
||||
inline bool isinf(long double value) { return __builtin_isinf_sign(value); }
|
||||
|
||||
/*
|
||||
* NuttX has no usable C++ math library, so we need to provide the needed definitions here manually.
|
||||
*/
|
||||
#define NUTTX_WRAP_MATH_FUN_UNARY(name) \
|
||||
inline float name(float x) { return ::name##f(x); } \
|
||||
inline double name(double x) { return ::name(x); } \
|
||||
inline long double name(long double x) { return ::name##l(x); }
|
||||
|
||||
#define NUTTX_WRAP_MATH_FUN_BINARY(name) \
|
||||
inline float name(float x, float y) { return ::name##f(x, y); } \
|
||||
inline double name(double x, double y) { return ::name(x, y); } \
|
||||
inline long double name(long double x, long double y) { return ::name##l(x, y); }
|
||||
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(fabs)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(log)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(log10)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(exp)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(sqrt)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(sin)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(cos)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(tan)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(asin)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(acos)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(atan)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(sinh)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(cosh)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(tanh)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(ceil)
|
||||
NUTTX_WRAP_MATH_FUN_UNARY(floor)
|
||||
|
||||
NUTTX_WRAP_MATH_FUN_BINARY(pow)
|
||||
NUTTX_WRAP_MATH_FUN_BINARY(atan2)
|
||||
|
||||
}
|
||||
@@ -38,10 +38,10 @@
|
||||
* and hardfault log support
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
|
||||
#include <board_config.h>
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <board_config.h>
|
||||
|
||||
#if defined(CONFIG_SYSTEM_CDCACM)
|
||||
__BEGIN_DECLS
|
||||
#include <arch/board/board.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user