Compare commits

..

167 Commits

Author SHA1 Message Date
Hamish Willee 0087ea1ee8 docs: Fix tool to make enum id anchor not link 2026-02-26 12:30:20 +11:00
PX4BuildBot 106276978d docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-26 01:01:26 +00:00
Hamish Willee 539b1def78 docs: Numerous spelling and grammer fixes in flight controller section (#26582) 2026-02-26 11:53:44 +11:00
PX4BuildBot 3c961de3fe docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-25 23:59:31 +00:00
Julian Oes ce564b4448 lightware_grf_serial: disable flow control (#26575)
* lightware_grf_serial: disable flow control

This might fix serial comms with the Lightware sensor.

* update sf45 to disable hw flow control

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

---------

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
Co-authored-by: dirksavage88 <dirksavage88@gmail.com>
2026-02-25 18:51:49 -05:00
PX4BuildBot 4a4c15765c docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-25 14:47:25 +00:00
bresch 5395b3823a ekf2: disable heading update in drag fusion 2026-02-25 15:40:01 +01:00
PX4BuildBot c1938b8a32 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-25 07:37:42 +00:00
Hamish Willee 8a8496d57e mavlink:COMMAND_INT - reject invalid frame (#26408)
* mavlink:COMMAND_INT - reject invalid frame

* Add msg version for new command and use

* Delete msg/px4_msgs_old/msg/VehicleCommandAck.msg:Zone.Identifier

* Fix up translation

* fix: translation_node build

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>

---------

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-02-25 20:29:59 +13:00
PX4BuildBot 48525073aa docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-25 07:15:42 +00:00
Hamish Willee cf51a72846 docs:hide non-functional search from home page (#26576) 2026-02-25 20:08:25 +13:00
PX4BuildBot fef12c9038 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-25 02:45:51 +00:00
Hamish Willee 8fbe4a4f7d docs: Fixup uorb doc tool to strip even more space (#26565) 2026-02-25 13:38:30 +11:00
PX4BuildBot 50c2055efe docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-24 23:52:56 +00:00
Hamish Willee b0b6771118 docs: Markup board specific parameters (#26527) 2026-02-25 10:45:45 +11:00
Hamish Willee 4226b7d4ec docs: Manual control updates to reflect prioritised selection (#25835) 2026-02-25 10:43:19 +11:00
Ege Kural 04f4ca8966 CI: enable clang-tidy bugprone-unsafe-functions / cert-msc24-c (#26573)
Signed-off-by: kuralme <kuralme@protonmail.com>
2026-02-24 13:43:03 -09:00
PX4BuildBot 54c1d121e4 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-24 22:23:55 +00:00
Ege Kural a5c67b90a9 CI: enable clang-tidy bugprone-incorrect-roundings (#26574)
switched to lroundf and included cmath in all



removed std namespace - quick tested

Signed-off-by: kuralme <kuralme@protonmail.com>
2026-02-24 13:16:33 -09:00
PX4BuildBot 4a0e257fc9 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-24 16:56:26 +00:00
Eric Katzfey bd76832f34 voxl2: Added components to the board build that are in the ModalAI fork but missing in mainline 2026-02-24 09:48:33 -07:00
PX4BuildBot 6e418096b7 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-24 07:47:18 +00:00
Eric Katzfey b0b99de767 voxl2: Add support for the new M0197 board variant. Uses bmi270 IMU and dps310 barometer and GPS on apps proc. 2026-02-23 23:18:12 -08:00
PX4BuildBot 55d35ddf37 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-24 04:28:50 +00:00
Ege Kural 207456fd35 CI: enable clang-tidy cppcoreguidelines-virtual-class-destructor (#26559)
* CI: enable clang-tidy cppcoreguidelines-virtual-class-destructor

Signed-off-by: kuralme <kuralme@protonmail.com>

* format fix

Signed-off-by: kuralme <kuralme@protonmail.com>

---------

Signed-off-by: kuralme <kuralme@protonmail.com>
2026-02-23 19:21:20 -09:00
PX4BuildBot a4f9786c3d docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-24 02:02:09 +00:00
Ege Kural 8fd3d3268a CI: enable clang-tidy readability-duplicate-include (#26554)
Signed-off-by: kuralme <kuralme@protonmail.com>
2026-02-23 16:54:36 -09:00
James af25a31861 uavcannode: Fix VCS Version Reporting in Node Info for UAVCAN Nodes (#26567)
long is a 32-bit signed integer, which means the maximum it will hold is 0x7FFFFFFF.

strtol is overflowing, resulting in clamping the value to LONG_MAX (or 0x7FFFFFFF) and returns that instead.

Fixes by using strtoul, which corrects the returned value.

Can be tested by building a UAVCAN Node on the tag v1.16.1, flashing and checking the value displayed in dronecan_gui_tool. Screenshot added for convenience.
2026-02-23 16:47:38 -09:00
PX4BuildBot 77a3ab7aad docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-23 21:19:00 +00:00
Matthias Grob 51be1e3fb9 uavcan rgbled: overhaul color functions 2026-02-23 22:11:35 +01:00
Claudio Chies 637cece115 Added support for colored navigation lights and hybrid light functions.
add functionality for Status or Off
2026-02-23 22:11:35 +01:00
PX4BuildBot d965df930c docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-23 18:34:11 +00:00
Eric Katzfey 845a7efd58 voxl2: add system reboot support 2026-02-23 11:25:13 -07:00
Hamish Willee 30cbf84fd8 docs: uorb msg generation - fix up anchors (#26562) 2026-02-23 18:29:52 +11:00
Eric Katzfey 76fbac4dee QURT: Fix task management bugs
Fix return value bug in px4_task_spawn_internal returning the arg-parsing
loop variable instead of the task index. Add pthread_attr_destroy calls
to prevent resource leaks on task creation failure, deletion, and exit.
Fix race condition in px4_task_delete by unlocking the mutex before
pthread_join and properly joining after pthread_cancel. Fix mutex unlock
placement in px4_task_exit to only unlock when the mutex was acquired.
2026-02-22 17:16:21 -07:00
PX4BuildBot 24833f41e5 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-22 16:43:21 +00:00
Eric Katzfey 8d352cd8e0 ms4525do: Fix logic error in probe function 2026-02-22 09:36:15 -07:00
PX4BuildBot e2708705a8 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-22 03:32:05 +00:00
Cavan O'Horo 039ac8c4c1 Fix double-promotion warning in gz_msgs on macOS (#26548)
Protobuf-generated code in gz_msgs triggers -Wdouble-promotion warnings
from the Abseil library. Since this is external code we cannot modify,
disable the warning for this specific target.

Fixes #26533
2026-02-21 18:25:00 -09:00
PX4BuildBot 4880bd5d8c docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-21 06:53:04 +00:00
Tim 8f870a1346 BlueROV2 Height control Altitude Mode (#26364)
* removed commented out parts

* changed the height controller to work in Altitude mode and moved the controller to the uuv_pos_control.hpp instead of uuv_att_control.hpp

* Updated format changes etc. Removed one parameter, that is not used anymore(UUV_HGT_MODE) added my correct email

* added a rotation to the thrust, that with different roll and pitch values, x y z thrust is still working as if roll/pitch is zero.

* fixed constant roll/pitch to be 0.0 again

* added parameter for maximum distance between controlled des height and current height.
Added state observation to reset the desired height to current height when altitude mode is turned on.

* added first short descriptions of manual modes.

* update descriptions

* removed vector dependency

* feat: updated gz submodule

* fix: newline

* fix: gz submodule

---------

Co-authored-by: Pedro Roque <roque@caltech.edu>
2026-02-20 22:46:12 -08:00
Ramon Roche 9048a40277 msg_docs: fix IndexError crash and camel_to_snake regex (#26546)
Fix generate_msg_docs.py IndexError when a .msg file declares a single
topic that does not match the camel_to_snake default (e.g.
AuxGlobalPosition.msg). The error message referenced self.topics[1]
(out of bounds) instead of self.topics[0].

Fix camel_to_snake() regex to correctly convert names like
"AuxGlobalPosition" to "aux_global_position". The previous regex
produced "aux_globalposition" because it failed to insert an underscore
between a lowercase letter and an uppercase letter mid-word.

Also remove stderr redirection (2>&1) from all make targets in
metadata_sync.sh so that errors are visible in CI logs even in
non-verbose mode, making failures easier to diagnose.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-20 22:24:21 -08:00
Eric Katzfey 9fb0ff0e80 voxl2: added 32768 Hz external clock option for icm42688p driver start 2026-02-20 11:02:00 -08:00
Marco Hauswirth 7297364484 fix ros-test-config for multi-APG 2026-02-20 17:43:45 +01:00
Marco Hauswirth 9e796daee8 add translation for aux_global_position 2026-02-20 17:43:45 +01:00
Marco Hauswirth 17242bc1a4 simulation: update sensor_agp_sim for AuxGlobalPosition message
Update the AGP simulator to publish the new AuxGlobalPosition message
type with the required source ID field.
2026-02-20 17:43:45 +01:00
Marco Hauswirth 8a9be9a8f0 ekf2: update logger, mavlink, DDS, and replay for AuxGlobalPosition
Update integrations to use the new AuxGlobalPosition message instead
of the VehicleGlobalPosition-based aux_global_position topic.
2026-02-20 17:43:45 +01:00
Marco Hauswirth b346fcfa00 ekf2: implement multi-instance AGP fusion
Refactor auxiliary global position fusion to support multiple AGP
sources. Add AgpSourceControl manager class that routes AGP messages
to the correct AgpSource instance based on configured source IDs.
Only instantiate AgpSource slots that have a configured ID on boot.
Move AGP subscriptions to manager class for correct message routing.
2026-02-20 17:43:45 +01:00
Marco Hauswirth 1d852907a2 ekf2: add multi-instance AGP parameters
Add per-instance parameters for auxiliary global position sources,
allowing configuration of up to 4 AGP slots with individual source IDs.
2026-02-20 17:43:45 +01:00
Marco Hauswirth dd177ac8cf uorb: add AuxGlobalPosition message
Add dedicated AuxGlobalPosition uORB message to replace the previous
approach of reusing VehicleGlobalPosition for auxiliary global position
sources.
2026-02-20 17:43:45 +01:00
PX4BuildBot 68b533f79f docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-20 15:49:36 +00:00
Eric Katzfey 7daac63809 muorb: A couple of minor tweaks to make initialization reliable 2026-02-20 08:42:04 -07:00
PX4BuildBot 2ef5b0a20f docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-20 15:26:50 +00:00
Silvan Fuhrer 2e2067173a PCA9685: add PWM_CENTER to auto generated params (#26543)
Signed-off-by: Silvan <silvan@auterion.com>
2026-02-20 16:20:35 +01:00
PX4BuildBot 93f06f6a23 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-20 14:24:00 +00:00
Matthias Grob ca0dec5a33 uavcan esc handling review suggestions 2026-02-20 15:16:43 +01:00
ttechnick 790c2d3369 uavcan: optimization 2026-02-20 15:16:43 +01:00
ttechnick 8478503349 uavcan: remove redundant loop 2026-02-20 15:16:43 +01:00
ttechnick 6a18fd045f uavcan: cleanup & node_status fix
uavcan: esc fault handling review suggestions

uavcan: fix node status & cleanup
2026-02-20 15:16:43 +01:00
ttechnick 06942bbfcc add vendor specific error handling
Vendor specific failure handling: IQ_Motion
2026-02-20 15:16:43 +01:00
ttechnick 89c4980e55 get node health and info 2026-02-20 15:16:43 +01:00
ttechnick e756574420 use generic name for can devices
But still ensure backcompability of DeviceInformation (for now)
2026-02-20 15:16:43 +01:00
PX4BuildBot df00901bfa docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-20 13:59:20 +00:00
Balduin 918efc8f97 navigator: RTL: fix idle setpoint on activation (#26537)
When switching modes, navigator resets the position setpoint triplet to
idle. In the case of entering RTL, it is not replaced immediately by the
correct triplet, but published once and only corrected a split second
later. This causes zero thrust to come from control_idle in
FixedWingModeManager

Fix by calling run(true) on the appropriate sub-mode at the end of
RTL::on_activation(), same as in the on_active just below.

The submode is in inactive at that point, but run(true) triggers:
 - on_activation of the submode
 - set_rtl_item, which calls:
     - mission_item_to_position_setpoint
     - _navigator->set_position_setpoint_triplet_updated

and therefore the navigator publishes the position setpoint triplet
immediately (which was already being correctly set).

Navigator: RTL: also update subs on actiavation

Navigator: RTL: also disable mission RTL if direct RTL

matching the logic in on_active exactly
2026-02-20 14:51:51 +01:00
PX4BuildBot 8602849847 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-20 00:40:13 +00:00
Jacob Dahl d564c5b4c2 mag: calibration: bump default earth field strength from 0.2 to 0.4 (#26528) 2026-02-19 17:32:40 -07:00
PX4BuildBot 245ae58264 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-19 22:05:53 +00:00
Eric Katzfey 996060f581 muorb: Added statistics and status reporting. Improved aggregator send performance. 2026-02-19 14:57:17 -07:00
PX4BuildBot a120773793 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-19 21:01:07 +00:00
fakerror 6cf8d80bdd rover: guard computeMaxSpeedFromDistance against disabled decel/jerk limits (#26452)
Co-authored-by: Andrew Brahim <35986980+dirksavage88@users.noreply.github.com>
2026-02-19 15:52:41 -05:00
PX4BuildBot b4601278db docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-19 20:28:33 +00:00
Matthias Grob 0d66981dcc Remove MPC_USE_HTE and always use hover thrust for altitude control (#24751)
* Remove `MPC_USE_HTE` and always use hover thrust for altitude control

Note the separate module can still be not run but I have not seen a case where the hover thrust estimate is not useful for altitude control hence I don't expect anyone to have the parameter disabled or planning on not running the module.

This parameter was used to experimentally introduce the hover thrust estimator. First it was just logging its status and you could opt in to use it:
f9794e99f8
but soon after it became the default and you had to opt out of using it:
a8063ac948
AFAIK we haven't seen problems requiring to disable it in the last 5 years and hence I suggest to remove the parameter to reduce the configuration space.

* Update src/modules/land_detector/MulticopterLandDetector.cpp

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>

* undo docs changes

* change redundant update() calls to copy()

---------

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-02-19 11:17:57 -09:00
Matthias Grob 62f5f5267e Land detector: Remove LNDMC_TRIG_TIME parameter (#25251)
* LandDetector: remove unused LNDMC_TRIG_TIME parameter

* LandDetector: remove unnecessarily complicated global set_hysteresis_factor() function

* Apply suggestions from code review

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Apply suggestions from code review

* remove param

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-02-19 11:17:03 -09:00
Hamish Willee fd7edaa4fe Minor tweak to markup instructions for docs (#26168) 2026-02-19 17:27:43 +11:00
PX4BuildBot b343eb6a11 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-19 03:28:23 +00:00
Alex Klimaj b8877c4cfc Battery add configurable filter params (#26524)
* ark fpv board_config: update battery ADC current filter time constant to 0.5s

* battery: add configurable voltage and current filter time constants

---------

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2026-02-18 18:20:50 -09:00
Hamish Willee 64e996b475 docs: GNSS-Denied Configuration (#25955) 2026-02-19 14:14:12 +11:00
Alex Klimaj 1d45f699be boards: add arkv6x zenoh config (#25887)
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2026-02-18 17:56:52 -09:00
PX4BuildBot be126454c0 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-19 02:24:43 +00:00
Jacob Dahl ce3e62841f module_base: remove CRTP template pattern to reduce flash bloat (#26476)
* module_base: claude rewrite to remove CRTP bloat

* module_base: apply to all drivers/modules

* format

* fix build errors

* fix missing syntax

* remove reference to module.h in files that need module_base.h

* remove old ModuleBase<T>

* add module_base.cpp to px4_protected_layers.cmake

* fix IridiumSBD can_stop()

* fix IridiumSBD.cpp

* clang-tidy: downcast static cast

* get_instance() template accessor, revert clang-tidy global

* rename module_base.h to module.h

* revert changes in zenoh/Kconfig.topics
2026-02-19 15:17:17 +13:00
Jacob Dahl 657854ae1b ark boards: remove GPIO_FMU output init (default float) (#26525)
* ark boards: change GPIO_FMU output init from PULLDOWN to PULLUP

* remove fmu output gpio init
2026-02-18 16:43:48 -09:00
PX4BuildBot 5613313107 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-18 23:48:18 +00:00
Farhang eafb6c396b [Docs] macOS Dev environment installation (#25204)
* Initial changes

* index fix

* gz index fix2

* gz index fix 3

* updates

* Run prettier

* zsh env
removed gz classic

* Corrections 2

* Cleanups

* Update docs/en/dev_setup/dev_env_mac.md

* Apply suggestions from code review

* Minor subedit and prettier

* small correction

* cleanups gz harmonic brew formula

* fix(macos.sh): invert px4-sim install condition for --sim-tools

The condition checked if px4-sim WAS installed before running
brew install, meaning it would never install on a fresh system.
Add the missing negation so it installs when NOT already present.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* docs: rewrite macOS dev environment setup guide

- Add Xcode Command Line Tools as prerequisite
- Default to ~/.zshrc (macOS default since Catalina)
- Explain why ulimit change is needed and why in startup file
- Add reminder to open new terminal after shell config changes
- Remove broken pip3 alias workaround
- Split git clone into clone + submodule update (canonical form)
- Recommend --sim-tools flag since first build uses gz_x500
- Document what macos.sh installs and its --reinstall flag
- Clarify Gazebo comes from --sim-tools / px4-sim formula
- Add XQuartz requirement for Gazebo display
- Add verification section with key tool checks and smoke test
- Remove outdated video guide comment block

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* conventions

---------

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
2026-02-18 18:40:53 -05:00
PX4BuildBot 2ebfd40bba docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-18 20:07:32 +00:00
Eric Katzfey 368dd362c5 muorb: implemented a basic keepalive mechanism 2026-02-18 12:59:45 -07:00
PX4BuildBot 7332f264f0 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-18 18:57:21 +00:00
Silvan Fuhrer 06d6c31614 Allocation: fix flaperons and spoilerons (symmetric ailerons up/down) (#26514)
Signed-off-by: Silvan <silvan@auterion.com>
2026-02-18 10:49:26 -08:00
PX4BuildBot d9448f3e99 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-18 17:08:47 +00:00
Farhang 50a42680d7 Update GZ Plugin OpticalFlow CMake configuration for library paths (#25957)
* Update OpticalFlow CMake configuration for library paths
2026-02-18 11:53:52 -05:00
PX4BuildBot 70a84a0c1b docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-18 16:45:17 +00:00
Claudio Chies 05de941399 Add Traffic Avoidance System (ADSB/FLARM) Arming Check (#26390)
* Add traffic avoidance system checks

* Update msg/px4_msgs_old/msg/VehicleStatusV1.msg

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>

* docs: add arming check for traffic avoidance systems in ADS-B/FLARM documentation

* fix formating

* trafficAvoidanceCheck: switch case for configuration options

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2026-02-18 17:37:03 +01:00
Matthias Grob adc9a6d35d Report nav_state of mission executor via MAVLink 2026-02-18 17:37:03 +01:00
PX4BuildBot fe91ace0bb docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-18 16:12:28 +00:00
Matthias Grob 977777f40a FlightTaskAuto: refactor triplet subscription naming 2026-02-18 17:05:03 +01:00
Matthias Grob 4afdf38378 FlightTaskAuto: remove second internall triplet states 2026-02-18 17:05:03 +01:00
Matthias Grob d0004403a3 FlightTaskAuto: remove offtrack logic
It was added at a time where the triplet target was directly fed as position setpoint to the controller.

Since the smoothing improvements to FlightTaskAuto(SmoothVel) and removing the previous "aggressive" FlightTaskAuto variant there should be no need anymore for this logic. It can sometimes lead to unexpected sideffects. E.g. the vehicle would suddenly change direction when exceeding some arbitrary threshold.
2026-02-18 17:05:03 +01:00
PX4BuildBot 2e651117e8 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-18 05:52:51 +00:00
PX4 Build Bot 18c176beef New Crowdin translations - ko (#26487)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-02-18 16:44:57 +11:00
PX4 Build Bot 602add3ec1 New Crowdin translations - uk (#26432)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-02-18 16:44:45 +11:00
PX4 Build Bot 47d5971f42 New Crowdin translations - zh-CN (#26488)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-02-18 16:44:34 +11:00
PX4BuildBot 7ef57f6262 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-18 00:23:31 +00:00
Victor Nan Fernandez-Ayala 2a0b795760 fix: set UXRCE_DDS_AG_IP in UUV airframe, remove from defaults (#26485) 2026-02-17 16:15:45 -08:00
PX4BuildBot 911fc81c59 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-17 23:17:55 +00:00
Jacob Dahl b2fc5993cc range_finder_consistency_check: fix consistency check timeout units (#26497)
* range_finder_consistency_check: fix consistency check timeout units

* explicit float

* format
2026-02-17 14:10:04 -09:00
Jacob Dahl d5ddc9135d clang-tidy: fix issues (#26498) 2026-02-17 14:09:43 -09:00
PX4BuildBot 6b67ccb0ad docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-17 20:02:19 +00:00
Alex Klimaj 0e6b904e80 LightwareLaser: add SF1XX rotation parameter (#26428)
* Add SF1XX rotation parameter and update orientation in LightwareLaser driver

* remove rotation opt arg, update docs about supported lightware

---------

Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-02-17 10:54:38 -09:00
Ramon Roche 864df9fc7b CI: disable VTOL and tailsitter SITL tests
Persistent flaky failures (timeouts, erratic transitions) make these
tests unreliable in CI. Commented out from the workflow matrix so they
can be re-enabled once the test infrastructure is stabilized. The test
definitions in sitl.json are preserved for local use.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-17 09:30:18 -08:00
PX4BuildBot d17a5b2c26 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-17 13:41:39 +00:00
Balduin d46a9266ce Failsafe docs: document COM_POS_LOW_EPH, COM_POS_LOW_ACT (#26508)
* Failsafe docs: document COM_POS_LOW_EPH, COM_POS_LOW_ACT

* Failsafe docs: address review
2026-02-17 14:34:44 +01:00
PX4BuildBot 3a6f566e80 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-17 09:15:19 +00:00
Jacob Dahl d84903d520 init.d-posix/airframes/4004_gz_standard_vtol: param set-default VT_PITCH_MIN -5 (#26507) 2026-02-17 00:06:29 -09:00
PX4BuildBot 4331f880f5 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-17 08:37:39 +00:00
Silvan Fuhrer 11007dc893 FW auto launch: Add option to lock selected surfaces before/during launch (#25799)
* FWModeManager: add option to set flag for disabling actuators during launch

Signed-off-by: Silvan <silvan@auterion.com>

* Allocation: add option to each control surface to be locked for launch

Signed-off-by: Silvan <silvan@auterion.com>

* FW rate control: reset integral while control surfaces are locked

Signed-off-by: Silvan <silvan@auterion.com>

---------

Signed-off-by: Silvan <silvan@auterion.com>
Co-authored-by: mahima-yoga <mahima@auterion.com>
2026-02-17 09:26:38 +01:00
Ramon Roche fd4b958790 ci: add geninfo negative error ignore to tests_coverage (#26506) 2026-02-16 20:04:18 -09:00
Ramon Roche a06f062bf7 nuttx: add nuttx_context dependency to jlink-nuttx build (#26505) 2026-02-16 20:04:06 -09:00
PX4BuildBot 79bf7810d4 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-16 21:41:55 +00:00
Aaron1356 066e8f7fea Adding Light Ware GRF Serial Driver (#26404)
* Creating a base for grf lidar

* Serial Drive is working, need to work out distance publish

* WIP Getting Range Data in cm

* Working Rand Distance Values for GRF 250 and GRF500

* Review Changes

* Compiler fixes

* Update to date

* small update

* Fix typo and remover unused libs

* removing unused enum

* Update to the Documentation

* Fiving scaling issue

* update to the logic

* [Feature] Adding I2C driver for the GRF250 and GRF500 models (#26425)

* Adding the GRF I2C driver

* I2C Driver Working

* Removing a lot of unnecessary code

* fixing names

* Changing the i2c Driver to be in the lightware laser

* remove the old driver

* formatting fix

* Adding Ligthware GRF to documentation

* Update to the Documentation

* Ensuring sample_perf ends

* Updating Docs

* uavcannode: implement hardpoint commands (#26334)

* implement cannode hardpoint commands

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* Update src/drivers/uavcannode/Subscribers/HardpointCommand.hpp

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Update src/drivers/uavcannode/Subscribers/HardpointCommand.hpp

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* add hardpoint sub to ark cannode, simplify handling of hardpoint broadcast

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

---------

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* voxl_esc: Limit frequency of UART passthru writes to 20Hz

* voxl2_io: Added UART passthru

* docs: update link for px4 ros2 interface lib python api docs

* estimator_interface: remove unused getter

* gnss_checks: always run strict checks on ground

With the goal to never take off if the GNSS solution is not fullfilling the configured requirements still not stopping to use it in case it degrades mid air.

* ekf2 unit-tests: adapt to strict GNSS checks on ground

* escCheck: rework online check to properly report offline ESCs

previous to this
09d79b221f
set `esc_online_flags` e.g. for UAVCAN ESCs which specific one is online and that then got compared to a mask where the first `esc_count` bits were set.

So if only ESC 5 is mapped and online you get the message "ESC 156 offline" because `esc_online_flags = 0b1000` gets compared to `online_bitmask = 0b1` based on `esc_count = 1` and the motor index is `esc[0].actuator_function = 0` wrapped using `0 - actuator_motors_s::ACTUATOR_FUNCTION_MOTOR1 + 1 = 156`.

* FailureDetector: consistent timestamp naming

* FailureDetector: rework motor status check

* FailureDetector: implement upper and lower current limit with offset

* Update src/modules/commander/failure_detector/FailureDetector.cpp

Prevent Buffer overflow

* Update Format

* Subedit

* Shrink and rename image

* Apply suggestion from @hamishwillee

Sounds good

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>

* Apply suggestion from @hamishwillee

More universal approach

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>

* Update to the Documentation

* FailureDetector: rework motor status check

* FailureDetector: implement upper and lower current limit with offset

* Subedit

* docs: update parameter reference metadata

* Remove pregenerated files - that should all be tidied up next time this runs

* remover GRF parameters

* Documentation updates

* Fixing Merge Conflicts

* remove @

* Undo Changes to parameter_reference

* remove the code that will be autogen-ed

* Update the Camake File

---------

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
Co-authored-by: Andrew Brahim <35986980+dirksavage88@users.noreply.github.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Eric Katzfey <eric.katzfey@modalai.com>
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
Co-authored-by: Marco Hauswirth <marco.hauswirth@auterion.com>
Co-authored-by: Nick <145654544+ttechnick@users.noreply.github.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
2026-02-16 16:34:48 -05:00
PX4BuildBot 08dc2a776e docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-16 20:33:01 +00:00
ljarvela 061fe4806e uavcan: add warning about CAN error counter reading issue (#26492)
Add warning message in print_info() to alert users that CAN error counter
values may increase during the function call due to internal counter reading
implementation. Users should not fully trust these counters until the
underlying issue is fixed.

Co-authored-by: ljarvela <lasse.jarvela@iceye.com>
2026-02-16 11:25:30 -09:00
PX4BuildBot 4bebbbae93 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-16 17:47:30 +00:00
Claudio Chies e52ce5c43b UAVCAN: Configurable LED Light Control with Flexible Addressing (#26253)
* feat: implement UAVCAN LED control for individual light control and assignment

* uavcan led: nit-picks from review

* uavcan led: reduce maximum number of lights

to avoid unused parameters

* uavcan led: simplify anticolision on check

* uavcan led: correctly map 8-bit RGB to rgb565

* Trim param name character arrays to 17

16 characters + \0 termination

* uavcan led: final nit-picks

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2026-02-16 18:39:48 +01:00
Ramon Roche 32c94bd3b1 ci: fix S3 upload so tags don't overwrite stable firmware
Remove the step that uploaded every version tag to the stable/ S3
directory, which caused QGC users selecting "stable" to receive
pre-release firmware (#26340). The stable/ and beta/ directories
are now controlled exclusively by their respective branch pushes,
while version tags only upload to their versioned archive directory
(e.g., v1.16.1/). Pre-release tags are also correctly marked on
GitHub Releases.

Co-authored-by: Julian Oes <julian@oes.ch>

Fixes #26340

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-13 06:29:13 -08:00
PX4BuildBot b08fefa903 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-13 13:14:35 +00:00
nlsxp 302d0601bf Smoothen external flight mode GotoControl to Mission transitions (#26254) 2026-02-13 14:06:47 +01:00
PX4BuildBot c90811a277 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-13 12:49:48 +00:00
Balduin 79a7ef2869 RtlTimeEstimator: Consider minimum ground speed (#26405)
* RtlTimeEstimator: Consider minimum ground speed

This fixes an issue seen when the wind is faster than the trim airspeed,
but not faster than the max airspeed.

In that case the RTL time estimator currently assumes that we always fly
at trim airspeed and are thus unable to cover ground in the upwind
direction. The result is a very large RTL time estimate, resulting in
RTL if configured by COM_FLTT_LOW_ACT.

By considering the FW_GND_SPD_MIN parameter, we correct this wrong
assumption. The RTL remaining time estimate now becomes realistic in
this situation.

* RtlTimeEstimator: assume min ground speed of 5 if param unavailable
2026-02-13 13:42:17 +01:00
Jaeyoung Lim b9f4de0b51 Fix TECS throttle integrator runaway (#26472) 2026-02-13 04:41:27 -08:00
Matthias Grob 14cbcee49f CI: replace all usage of addnab/docker-run-action
It's unmaintained and the docker version it uses is not supported anymore.
2026-02-13 13:39:50 +01:00
cuav-chen2 f38aba3c5b cuav_fmu-v6x: Adjust the startup sequence of the sensors 2026-02-12 22:16:32 -08:00
PX4BuildBot 84933cfbdf docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-13 05:28:01 +00:00
Ramon Roche be3e1fb2ef fix(build): restore smbus/smbus_sbs for Linux board targets
The previous commit (6b8fd11) gated smbus and smbus_sbs behind
PX4_PLATFORM=="nuttx" to prevent clang-tidy errors on SITL, but these
libraries depend on device::I2C which has a POSIX implementation
(posix/I2C.cpp). Linux boards like bluerobotics_navigator (armhf) and
emlid_navio2 (aarch64) enable CONFIG_DRIVERS_BATT_SMBUS, which depends
on drivers__smbus — causing CMake to fail with "non-existent target".

Move smbus and smbus_sbs back to unconditional add_subdirectory() so
they are available on all platforms. Keep mcp_common gated behind NuttX
since it includes px4_platform/gpio/mcp.hpp (NuttX-only GPIO headers).

Re-add src/lib/drivers/smbus to the Makefile clang-tidy exclude list
since the SITL compilation database lacks the I2C platform headers
needed for analysis.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 82850cb149 clang-tidy: exclude emscripten Unity build path from analysis
The failsafe_test target uses CMake Unity Builds (UNITY_BUILD ON),
which merges emscripten.cpp, failsafe.cpp, and framework.cpp into a
single generated file at:
  build/.../failsafe_test.dir/Unity/unity_0_cxx.cxx

The run-clang-tidy.py exclude regex operates on compile_commands.json
paths, which reference this generated unity file — not the original
source path. The previous exclude (src/modules/commander/failsafe/
emscripten) only matched the source path and missed the unity file,
causing clang-diagnostic-error: 'emscripten/emscripten.h' not found.

Add failsafe_test\.dir to the exclude regex to catch the unity build
path in addition to the source path.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 3d457528d2 clang-tidy: gate NuttX-only driver libs by platform instead of exclude list
The clang-tidy CI target builds against the SITL (px4_sitl_default-clang)
compilation database. Three libraries in src/lib/drivers/ were
unconditionally added via add_subdirectory(), causing them to appear in
compile_commands.json despite requiring NuttX-only headers:

- mcp_common: includes px4_platform/gpio/mcp.hpp (NuttX platform GPIO)
- smbus: extends device::I2C which resolves to the NuttX I2C driver
- smbus_sbs: includes smbus/SMBus.hpp, same I2C dependency chain

When clang-tidy analyzed these files it failed on clang-diagnostic-error
(fatal: header not found) since the platform headers don't exist in SITL.

The previous commit worked around this by adding the paths to
CLANG_TIDY_EXCLUDE_EXTRA in the Makefile, but the proper fix is to prevent
these libraries from entering the compilation database at all.

Gate mcp_common, smbus, and smbus_sbs behind
if(PX4_PLATFORM STREQUAL "nuttx") in src/lib/drivers/CMakeLists.txt.
This follows the established pattern already used by the device/ library
in the same directory, which conditionally includes NuttX-specific sources
(CDev.cpp, I2C.cpp, SPI.cpp) while compiling posix stubs for SITL.

The other libraries in the directory (accelerometer, gyroscope, led,
magnetometer, rangefinder) are pure abstractions over uORB topics and
internal utilities with no platform-specific hardware dependencies, so
they compile fine on all platforms without any gating.

Remove the now-unnecessary mcp_common and smbus paths from
CLANG_TIDY_EXCLUDE_EXTRA, keeping only the emscripten failsafe exclusion
(requires the emscripten SDK, not a platform build issue).

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche d74007dc87 clang-tidy: exclude NuttX-only drivers and emscripten from SITL analysis
These files depend on platform headers (px4_platform/gpio/mcp.hpp,
device::I2C, emscripten/emscripten.h) that are unavailable in the
SITL/clang build, causing clang-tidy to report compiler errors:

- src/lib/drivers/mcp_common (NuttX GPIO)
- src/drivers/gpio (MCP23009, MCP23017)
- src/lib/drivers/smbus (I2C bus driver)
- src/modules/commander/failsafe/emscripten (emscripten SDK)

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 47b3f5f6f9 docker-entrypoint.sh: consolidate startup output into single useful line
Replace the two separate echo lines ("Starting" and "(arch)") with a
single line showing architecture and UTC timestamp:

  [docker-entrypoint.sh] aarch64 | 2026-02-09T15:23:45Z

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 6d8441dc89 docker_run.sh: modernize image and clean up stale CI references
Update the local Docker convenience script to use the unified
px4io/px4-dev image instead of the retired per-toolchain images
(px4-dev-clang, px4-dev-simulation-bionic).

Usage:
  ./Tools/docker_run.sh make px4_sitl_default
  ./Tools/docker_run.sh make tests TESTFILTER=ULogMessages
  PX4_DOCKER_REPO="px4io/px4-dev:custom" ./Tools/docker_run.sh make px4_fmu-v6x_default

Changes:
- Default to px4io/px4-dev:v1.17.0-beta1, remove conditional image
  guessing for clang/tests targets
- Remove stale env passthrough (Travis CI, AWS, Codecov, Coveralls)
- Keep CCACHE_DIR and sanitizer flags (PX4_ASAN/MSAN/TSAN/UBSAN)
- Fix $PWD shadowing by renaming to SCRIPT_DIR
- Use "$@" instead of "$1 $2 $3" for proper argument forwarding

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche f29afe1342 logger: expand ULog unit tests to cover all message types
Rename ULogMessageInfoTest to ULogMessagesTest and add struct-level
coverage for every message type in the ULog spec:

- File header: magic bytes, size, field offsets
- Flag Bits ('B'): size, field offsets, flag masks
- Format ('F'): size, serialization
- Info ('I'): string, int32_t, and float value layouts
- Info Multiple ('M'): string layout, continuation flag, field offsets
- Parameter ('P'): int32_t and float value layouts
- Default Parameter ('Q'): size, type bits, field offsets
- Subscription ('A'): size, field offsets, serialization
- Unsubscription ('R'): size, serialization
- Data ('D'): size, field offset
- Logging ('L'): size, field offsets, serialization
- Logging Tagged ('C'): size, field offsets
- Sync ('S'): size, magic bytes
- Dropout ('O'): size, default msg_size, serialization
- Message header: size, field offsets, ULOG_MSG_HEADER_LEN
- Enum values: all 13 ULogMessageType codes

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 9849d90877 gps: add null check for path in GPS constructor
Guard the strncpy call with a null check to prevent undefined behavior
if the constructor is ever called with a null path pointer.

Fixes clang-analyzer-core.NonNullParamChecker diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 497704f3b9 fw_mode_manager: pass FigureEightPatternPoints by const reference
The 48-byte struct (6 Vector2f) is only read inside initializePattern,
so passing by value creates an unnecessary copy.

Fixes performance-unnecessary-value-param clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche b60aa5dd2b ekf2, fw_mode_manager, fw_rate_control: remove unused using declarations
Remove using-declarations for math::constrain, math::max, and
math::min that are never used — all call sites use the fully-qualified
form (e.g. math::constrain()).

Fixes misc-unused-using-decls clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 5d151c54a4 flight_mode_manager: call direct parent instead of grandparent
FlightTaskManualAcceleration and FlightTaskOrbit both inherit from
FlightTaskManualAltitudeSmoothVel but were calling FlightTask and
FlightTaskManualAltitude respectively, skipping the intermediate
parent's overrides (smoothing velocity init, parameter chain).

Fix the DEFINE_PARAMETERS_CUSTOM_PARENT macro argument and the
activate() call to use FlightTaskManualAltitudeSmoothVel.

Fixes bugprone-parent-virtual-call clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 83a4d648e3 logger: copy null terminator in write_info memcpy
clang-tidy flags the memcpy of vlen bytes as
bugprone-not-null-terminated-result because the destination buffer
region is left unterminated in memory.

Copy vlen + 1 bytes (including the source null terminator) so the
buffer is null-terminated in memory. The ULog msg_size is not
incremented for the extra byte — the null sits in the struct's
key_value_str padding and is never written to the log file, preserving
the ULog wire format which does not include a null terminator for
string values.

The bounds check (vlen < sizeof(msg) - msg_size) guarantees at least
one byte of headroom beyond vlen, so vlen + 1 is always within the
struct.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 0646fa6c9d logger: add unit test for ULog INFO message serialization
Add a gtest that validates the exact binary layout of INFO and
INFO_MULTIPLE messages against the ULog spec. This exercises the same
packing logic as write_info/write_info_multiple and will catch any
accidental changes to the wire format (e.g. including a null terminator
in msg_size).

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche d9b3e48ec5 CI: improve clang-tidy workflow naming and use standard cache actions
Rename workflow to "Static Analysis" with job name "Clang-Tidy" for
clearer GitHub Checks UI. Use Title Case action-verb step names.
Switch from runs-on/cache to actions/cache since the runs-on Magic
Cache sidecar transparently handles S3 backing.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 29fefeeada CI: fix ccache key to use branch name instead of merge ref
github.ref_name resolves to '26367/merge' for pull_request events,
causing cache misses. Use github.head_ref (PR source branch) with
fallback to github.ref_name for push events.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 618a6aa98f CI: add explicit permissions block to clang-tidy workflow
Set minimal permissions (contents: read) as flagged by CodeQL.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 8a007d38e7 CI: split ccache into restore/save so cache persists on failure
Use separate cache/restore and cache/save steps with if: always()
on the save step, matching the build_all_targets pattern.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche e831c66ae1 CI: add ccache and S3 caching to clang-tidy workflow
- Switch from addnab/docker-run-action to native container directive
- Use runs-on 16-core runner with S3 cache (extras=s3-cache)
- Add ccache setup matching build_all_targets pattern
- Run clang-tidy with -j16 to leverage all cores

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 021eee0c5c CI: use 16-core runs-on runner for clang-tidy workflow
The free GitHub runner (4 vCPUs) takes ~22 minutes. Switch to a
16-core runs-on runner and bump parallelism to -j16 to reduce
clang-tidy analysis time.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 385450ca37 CI: pin clang-tidy workflow to px4-dev:v1.17.0-beta1 container
Pin the container image to v1.17.0-beta1 which includes clang-tidy 18
and all required clang dependencies pre-installed. This removes the
need to install clang-tidy via apt on each workflow run.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 23c9af20da clang-tidy: disable new checks for v18 compatibility
Update .clang-tidy configuration to maintain compatibility with
clang-tidy 18 in the new px4io/px4-dev:v1.17.0-alpha1 container.

The previous CI container used clang-tidy 6.0 (2018) with ~213 checks.
The new container has clang-tidy 18 (2024) with ~537 checks - adding
~324 new checks that would fail without configuration changes.

This commit disables the new checks to preserve the existing code
quality baseline. The disabled checks can be evaluated and enabled
incrementally in future PRs as the codebase is updated to comply.

New checks disabled (partial list):
- bugprone-assignment-in-if-condition
- bugprone-casting-through-void
- bugprone-multi-level-implicit-pointer-conversion
- cppcoreguidelines-avoid-do-while
- cppcoreguidelines-avoid-goto
- cppcoreguidelines-avoid-non-const-global-variables
- misc-definitions-in-headers
- misc-header-include-cycle
- misc-no-recursion
- modernize-macro-to-enum
- modernize-type-traits
- performance-enum-size
- readability-avoid-nested-conditional-operator
- readability-convert-member-functions-to-static
- readability-redundant-string-init
- readability-simplify-boolean-expr
- (and ~35 more)

See full list in .clang-tidy. Each check is prefixed with '-' to
disable it while keeping WarningsAsErrors: '*' active for enabled
checks.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche d196d37ef2 clang-tidy: auto-exclude submodules and third-party code
Automatically generate the clang-tidy exclusion list from .gitmodules
so new submodules are excluded without manual intervention.

Changes:
- Makefile: Generate CLANG_TIDY_SUBMODULES from .gitmodules paths
- Makefile: Add CLANG_TIDY_EXCLUDE_EXTRA for manual exclusions:
  - src/systemcmds/tests (test code, looser style allowed)
  - src/examples (educational code, not production)
  - src/modules/gyro_fft/CMSIS_5 (vendored ARM DSP library)
- Delete src/systemcmds/tests/.clang-tidy (stale since 2019)
- Delete src/modules/gyro_fft/CMSIS_5/.clang-tidy (redundant)

Rationale: Submodules and vendored code should be linted in their
upstream repositories, not here. This reduces noise and focuses
clang-tidy on code that PX4 maintainers actually edit.

Contributors adding vendored (non-submodule) third-party code should
add their path to CLANG_TIDY_EXCLUDE_EXTRA in the Makefile.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche dc4aa749d3 Tools/run-clang-tidy: add -exclude argument for file filtering
Add regex-based file exclusion to the clang-tidy runner script.
This allows excluding paths (submodules, vendored code, tests) from
static analysis without modifying .clang-tidy files in each directory.

The -exclude argument accepts a regex pattern that is matched against
file paths from the compilation database. Matching files are skipped.

Example: -exclude="src/lib/foo|src/modules/bar"

This prepares for the clang-tidy v6 to v18 migration where we need
to exclude external code that we consume but don't maintain.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche 767eb75662 gyro_fft: fix clang build error on Linux arm64
Extend the -Wno-asm-operand-widths workaround to include Linux aarch64
in addition to Apple Silicon. CMSIS DSP contains ARM Cortex-M specific
assembly that clang (but not gcc) warns about on 64-bit ARM platforms.

The assembly code is unused on POSIX builds - only the C fallback
implementations are executed in SITL.

This fixes clang-tidy CI failing on arm64 runners.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Marco Hauswirth c29630f6ae adjust clang-tidy checks and workflow 2026-02-12 21:20:27 -08:00
cuav-chen2 c511e72d4f cuav_nora: 5V power overcurrent detection pin default to pull-up 2026-02-12 19:57:37 -08:00
PX4BuildBot a235b5c87f docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-13 03:30:17 +00:00
Matthias Grob 87163c1578 uavcan esc: initializers cosmetics (#26470) 2026-02-12 18:22:19 -09:00
PX4BuildBot 841fccf6b9 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-13 02:35:53 +00:00
Ramon Roche 8a3e227dc0 docs: address review feedback on build docs
- Update "Failed to import Python packages" section to reference
  gz_x500 instead of jmavsim, and point to Tools/setup/requirements.txt
  instead of listing individual packages
- Fix :::info admonition spacing in Ubuntu dev env docs

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Hamish Willee ad0b6bdc6b Subedit 2026-02-12 18:28:49 -08:00
Ramon Roche aecd1461d7 docs: document px4-dev as the recommended container
The new px4-dev container replaces the old per-distro container
hierarchy from PX4/PX4-containers. It is:

- Multi-architecture (linux/amd64 + linux/arm64)
- Based on Ubuntu 24.04
- Built from the in-tree Dockerfile via GitHub Actions
- Published to both ghcr.io and Docker Hub
- Tagged with PX4 versions (e.g. px4-dev:v1.16.0)

Mark the legacy per-distro containers (px4-dev-nuttx-jammy,
px4-dev-ros2-humble, etc.) as deprecated, note that px4-sim
is planned for simulation workflows.

Update all examples to use px4-dev instead of legacy containers.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Ramon Roche 8017baa6e6 docs: remove outdated Ubuntu/Gazebo Classic references
docker.md:
- Update container hierarchy from focal to jammy
- Replace ROS Noetic/Foxy references with ROS 2 Humble
- Update docker run example to use humble container
- Update SITL example from gazebo-classic to gz_x500
- Update VM tested version from Ubuntu 14.04 to 22.04

vscode.md:
- Remove "Ubuntu 18.04" from inotify troubleshooting header
  (this issue is not Ubuntu-version-specific)

dev_env_linux_centos.md:
- Update GCC warning to reference current Ubuntu LTS toolchain
  instead of old Focal Docker file

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Ramon Roche 103a61450e docs: update Ubuntu dev env to reflect supported LTS versions
- Replace "older version" collapsible with info block stating
  supported versions: Ubuntu 24.04 (primary) and 22.04
- Remove Gazebo Classic references (Ubuntu 22.04 section, install step)
- Note that GCC version comes from Ubuntu package manager
- Clarify that GCC version depends on Ubuntu release

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Ramon Roche df242827d2 docs: remove outdated Ubuntu/GCC references from build instructions
- Remove Ubuntu 18.04 troubleshooting sections (compile errors,
  VSCode inotify) — Ubuntu 18.04 is no longer supported
- Remove Gazebo Classic SITL dropdown from first build section
- Update FMUv2 flash warning to reference gcc-arm-none-eabi from
  current Ubuntu LTS instead of vague "CI/docker" reference
- Update flash overflow guidance to point at Ubuntu LTS toolchain
- Simplify "too many open files" error example (remove old GCC 7.2.1
  path from 2017)

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Ramon Roche d9996742be setup: drop Ubuntu 18.04/20.04 support from ubuntu.sh
Remove Gazebo Classic installation branches for Ubuntu 18.04 and 20.04.
The script now only supports Ubuntu 22.04 and 24.04 with Gazebo Harmonic.

Supported Ubuntu LTS versions going forward:
- Ubuntu 24.04 (primary, used in CI and release builds)
- Ubuntu 22.04 (secondary, still supported)

When Ubuntu 26.04 LTS releases we will bump to 26.04/24.04.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
1716 changed files with 51132 additions and 11619 deletions
+78
View File
@@ -105,6 +105,84 @@ Checks: '*,
-readability-redundant-declaration,
-readability-static-accessed-through-instance,
-readability-static-definition-in-anonymous-namespace,
-altera-struct-pack-align,
-bugprone-easily-swappable-parameters,
-concurrency-mt-unsafe,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-non-private-member-variables-in-classes,
-hicpp-uppercase-literal-suffix,
-llvm-qualified-auto,
-misc-non-private-member-variables-in-classes,
-misc-use-anonymous-namespace,
-modernize-concat-nested-namespaces,
-readability-const-return-type,
-readability-identifier-length,
-readability-isolate-declaration,
-readability-qualified-auto,
-readability-redundant-access-specifiers,
-cppcoreguidelines-avoid-do-while,
-misc-include-cleaner,
-misc-const-correctness,
-llvm-else-after-return,
-readability-function-cognitive-complexity,
-cppcoreguidelines-init-variables,
-bugprone-reserved-identifier,
-cert-dcl37-c,
-cert-dcl51-cpp,
-modernize-use-nodiscard,
-misc-confusable-identifiers,
-cert-err33-c,
-readability-redundant-inline-specifier,
-readability-uppercase-literal-suffix,
-bugprone-narrowing-conversions,
-cppcoreguidelines-narrowing-conversions,
-bugprone-switch-missing-default-case,
-cppcoreguidelines-avoid-goto,
-hicpp-avoid-goto,
-bugprone-branch-clone,
-bugprone-unhandled-self-assignment,
-cert-oop54-cpp,
-performance-enum-size,
-readability-avoid-nested-conditional-operator,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-explicit-virtual-functions,
-readability-convert-member-functions-to-static,
-readability-make-member-function-const,
-bugprone-assignment-in-if-condition,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-bugprone-multi-level-implicit-pointer-conversion,
-bugprone-signed-char-misuse,
-bugprone-too-small-loop-variable,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-use-default-member-init,
-hicpp-multiway-paths-covered,
-hicpp-named-parameter,
-misc-header-include-cycle,
-misc-no-recursion,
-performance-no-int-to-ptr,
-readability-avoid-return-with-void-value,
-readability-avoid-unconditional-preprocessor-if,
-readability-delete-null-pointer,
-readability-redundant-casting,
-readability-redundant-member-init,
-readability-reference-to-constructed-temporary,
-readability-simplify-boolean-expr,
-cert-msc32-c,
-cert-msc33-c,
-cert-msc51-cpp,
-cert-str34-c,
-cppcoreguidelines-macro-to-enum,
-modernize-macro-to-enum,
-abseil-string-find-str-contains,
-bugprone-suspicious-include,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-clang-analyzer-optin.core.EnumCastOutOfRange,
-modernize-type-traits,
-misc-definitions-in-headers,
-bugprone-casting-through-void,
-readability-redundant-string-init,
'
WarningsAsErrors: '*'
CheckOptions:
+3 -1
View File
@@ -21,8 +21,10 @@ applyTo: "docs/en/**"
- Do not apply bold or italic styling inside a heading.
- **Formatting:**
- **Bold:** Only for UI elements (buttons, menu items).
- **Italics (Emphasis):** For tool names (e.g., *QGroundControl*).
- **Inline Code:** Use backticks for file paths, parameters, and CLI commands (e.g., `prettier`).
Backticks are optional for hyperlinked CLI commands and tool names.
- **Italics (Emphasis):** Use for application names (e.g., *QGroundControl*).
Emphasis is optional for hyperlinked applications.
- **Structure:** End every line at the end of a sentence (Semantic Line Breaks).
## Linking & Navigation
+50 -27
View File
@@ -2,6 +2,37 @@
# - If you want to keep the tests running in GitHub Actions you need to uncomment the "runs-on: ubuntu-latest" lines
# and comment the "runs-on: [runs-on,runner=..." lines.
# - If you would like to duplicate this setup try setting up "RunsOn" on your own AWS account try https://runs-on.com
#
# ===================================================================================
# RELEASE UPLOAD LOGIC
# ===================================================================================
# This workflow handles building firmware and uploading to S3 + GitHub Releases.
#
# S3 Bucket Structure (s3://px4-travis/Firmware/):
# - master/ <- Latest main branch build (for QGC compatibility)
# - stable/ <- Latest stable release, controlled by 'stable' branch
# - beta/ <- Latest pre-release, controlled by 'beta' branch
# - vX.Y.Z/ <- Archived stable release
# - vX.Y.Z-beta1/ <- Archived pre-release
#
# Trigger Behavior:
# - Tag v1.16.1 -> Upload to: v1.16.1/ only (versioned archive)
# - Tag v1.17.0-beta1 -> Upload to: v1.17.0-beta1/ only (versioned archive)
# - Branch main -> Upload to: master/ (for QGC compatibility)
# - Branch stable -> Upload to: stable/ (QGC stable firmware)
# - Branch beta -> Upload to: beta/ (QGC beta firmware)
# - Branch release/** -> Build only, no S3 upload (CI validation)
# - Pull requests -> Build only, no S3 upload (CI validation)
#
# GitHub Releases:
# - All version tags create a draft GitHub Release
# - Pre-releases (alpha/beta/rc suffixes) are automatically marked as such
#
# IMPORTANT: Version tags do NOT upload to stable/ or beta/. Only the
# corresponding branch pushes control those directories. This prevents
# pre-release tags from accidentally overwriting stable firmware (#26340)
# and avoids race conditions between tag and branch builds.
# ===================================================================================
name: Build all targets
@@ -163,6 +194,13 @@ jobs:
path: ~/.ccache
key: ${{ steps.cc_restore.outputs.cache-primary-key }}
# ===========================================================================
# ARTIFACT UPLOAD JOB
# ===========================================================================
# Uploads build artifacts to S3 and creates GitHub Releases.
# Runs for version tags (v*), main, stable, and beta branch pushes.
# See header comments for full upload logic documentation.
# ===========================================================================
artifacts:
name: Upload Artifacts
# runs-on: ubuntu-latest
@@ -181,31 +219,31 @@ jobs:
- name: Choose Upload Location
id: upload-location
run: |
# Determine upload location based on branch or tag with the following considerations:
# Destination: AWS S3 bucket px4-travis in folder Firmware/
# - If branch is main -> upload to master/
# - Older versions of QGC are hardocded to look for master/
# - If branch is stable or beta -> upload to stable/ or beta/
# - If a tag vX.Y.Z -> upload to vX.Y.Z/
# - Also update stable/ to point to the same version
#. - Older versions of QGC are hardocded to look for stable/
# - If a pull request -> do not upload
set -euo pipefail
ref="${GITHUB_REF}"
branch=${{ needs.group_targets.outputs.branchname }}
location="$branch"
is_prerelease="false"
# Main branch uploads to "master" for QGC backward compatibility
if [[ "$branch" == "main" ]]; then
location="master"
fi
# Version tags: upload to versioned directory (e.g., v1.16.1/)
if [[ "$ref" == refs/tags/v[0-9]* ]]; then
tag="${ref#refs/tags/}"
location="$tag"
# Pre-release tags contain -alpha, -beta, or -rc suffix
if [[ "$tag" =~ -(alpha|beta|rc) ]]; then
is_prerelease="true"
fi
fi
echo "uploadlocation=$location" >> $GITHUB_OUTPUT
echo "is_prerelease=$is_prerelease" >> $GITHUB_OUTPUT
- name: Uploading Artifacts to S3 [${{ steps.upload-location.outputs.uploadlocation }}]
uses: jakejarvis/s3-sync-action@master
@@ -219,28 +257,13 @@ jobs:
SOURCE_DIR: artifacts/
DEST_DIR: Firmware/${{ steps.upload-location.outputs.uploadlocation }}/
# if we are uploading artifacts to a versioned folder
# we should also update the stable folder in the s3 bucket
- name: Uploading Artifacts to S3 [stable]
uses: jakejarvis/s3-sync-action@master
if: startsWith(github.ref, 'refs/tags/v')
with:
args: --acl public-read
env:
AWS_S3_BUCKET: 'px4-travis'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1'
SOURCE_DIR: artifacts/
DEST_DIR: Firmware/stable/
# if build is a release triggered by a versioned tag then create a github release
# and upload the build artifacts. A draft release is created so that the release
# can be reviewed before publishing
# Create a draft GitHub Release for all version tags
# Pre-releases are automatically marked as such
- name: Upload Artifacts to GitHub Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
prerelease: ${{ steps.upload-location.outputs.is_prerelease == 'true' }}
files: artifacts/*.px4
name: ${{ steps.upload-location.outputs.uploadlocation }}
+9 -8
View File
@@ -19,6 +19,10 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
container:
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
strategy:
fail-fast: false
matrix:
@@ -35,20 +39,17 @@ jobs:
"px4_sitl_allyes",
"module_documentation",
]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Building [${{ matrix.check }}]
uses: addnab/docker-run-action@v3
with:
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
options: -v ${{ github.workspace }}:/workspace
run: |
cd /workspace
git config --global --add safe.directory /workspace
make ${{ matrix.check }}
run: |
cd "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
make ${{ matrix.check }}
- name: Uploading Coverage to Codecov.io
if: contains(matrix.check, 'coverage')
+50 -11
View File
@@ -1,4 +1,4 @@
name: Clang Tidy
name: Static Analysis
on:
push:
@@ -11,20 +11,59 @@ on:
- '**'
paths-ignore:
- 'docs/**'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
clang_tidy:
name: Clang-Tidy
runs-on: [runs-on, runner=16cpu-linux-x64, "run-id=${{ github.run_id }}", "extras=s3-cache"]
container:
image: px4io/px4-dev:v1.17.0-beta1
steps:
- uses: runs-on/action@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Testing (clang-tidy)
uses: addnab/docker-run-action@v3
- name: Configure Git Safe Directory
run: git config --system --add safe.directory '*'
- name: Restore Compiler Cache
id: cc_restore
uses: actions/cache/restore@v4
with:
image: px4io/px4-dev-clang:2021-09-08
options: -v ${{ github.workspace }}:/workspace
run: |
cd /workspace
git config --global --add safe.directory /workspace
make clang-tidy
path: ~/.ccache
key: ccache-clang-tidy-${{ github.head_ref || github.ref_name }}
restore-keys: |
ccache-clang-tidy-${{ github.head_ref || github.ref_name }}-
ccache-clang-tidy-main-
ccache-clang-tidy-
- name: Configure Compiler Cache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 120M" >> ~/.ccache/ccache.conf
echo "hash_dir = false" >> ~/.ccache/ccache.conf
echo "compiler_check = content" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: Run Clang-Tidy Analysis
run: make -j16 clang-tidy
- name: Compiler Cache Stats
if: always()
run: ccache -s
- name: Save Compiler Cache
if: always()
uses: actions/cache/save@v4
with:
path: ~/.ccache
key: ${{ steps.cc_restore.outputs.cache-primary-key }}
@@ -15,21 +15,21 @@ concurrency:
jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: main test
uses: addnab/docker-run-action@v3
with:
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
options: -v ${{ github.workspace }}:/workspace
container:
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: main test
run: |
cd /workspace
git config --global --add safe.directory /workspace
cd "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
make tests TESTFILTER=EKF
- name: Check if there is a functional change
run: git diff --exit-code
working-directory: src/modules/ekf2/test/change_indication
- name: Check if there is a functional change
run: git diff --exit-code
working-directory: src/modules/ekf2/test/change_indication
@@ -8,40 +8,47 @@ on:
jobs:
unit_tests:
runs-on: ubuntu-latest
container:
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
env:
GIT_COMMITTER_EMAIL: bot@px4.io
GIT_COMMITTER_NAME: PX4BuildBot
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: main test
uses: addnab/docker-run-action@v3
with:
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
options: -v ${{ github.workspace }}:/workspace
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: main test
run: |
cd /workspace
git config --global --add safe.directory /workspace
cd "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
make tests TESTFILTER=EKF
- name: Check if there exists diff and save result in variable
id: diff-check
run: echo "CHANGE_INDICATED=$(git diff --exit-code --output=/dev/null || echo $?)" >> $GITHUB_OUTPUT
working-directory: src/modules/ekf2/test/change_indication
- name: Check if there exists diff and save result in variable
id: diff-check
working-directory: src/modules/ekf2/test/change_indication
run: |
if git diff --quiet; then
echo "CHANGE_INDICATED=false" >> $GITHUB_OUTPUT
else
echo "CHANGE_INDICATED=true" >> $GITHUB_OUTPUT
fi
- name: auto-commit any changes to change indication
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: 'src/modules/ekf2/test/change_indication/*.csv'
commit_user_name: ${GIT_COMMITTER_NAME}
commit_user_email: ${GIT_COMMITTER_EMAIL}
commit_message: |
'[AUTO COMMIT] update change indication'
- name: auto-commit any changes to change indication
if: steps.diff-check.outputs.CHANGE_INDICATED == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: 'src/modules/ekf2/test/change_indication/*.csv'
commit_user_name: ${{ env.GIT_COMMITTER_NAME }}
commit_user_email: ${{ env.GIT_COMMITTER_EMAIL }}
commit_message: |
[AUTO COMMIT] update change indication
See .github/workflopws/ekf_update_change_indicator.yml for more details
See .github/workflows/ekf_update_change_indicator.yml for more details
- name: if there is a functional change, fail check
if: ${{ steps.diff-check.outputs.CHANGE_INDICATED }}
run: exit 1
- name: if there is a functional change, fail check
if: steps.diff-check.outputs.CHANGE_INDICATED == 'true'
run: exit 1
+18 -16
View File
@@ -19,25 +19,27 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {vehicle: "iris", mission: "MC_mission_box"}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build SITL and Run Tests
uses: addnab/docker-run-action@v3
with:
image: px4io/px4-dev-ros-melodic:2021-09-08
options: -v ${{ github.workspace }}:/workspace
- name: Build SITL and Run Tests (inside old ROS container)
run: |
cd /workspace
git config --global --add safe.directory /workspace
make px4_sitl_default
make px4_sitl_default sitl_gazebo-classic
./test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=${{matrix.config.mission}} vehicle:=${{matrix.config.vehicle}}
docker run --rm \
-v "${GITHUB_WORKSPACE}:/workspace" \
-w /workspace \
px4io/px4-dev-ros-melodic:2021-09-08 \
bash -c '
git config --global --add safe.directory /workspace
make px4_sitl_default
make px4_sitl_default sitl_gazebo-classic
./test/rostest_px4_run.sh \
mavros_posix_test_mission.test \
mission:=MC_mission_box \
vehicle:=iris
'
+17 -18
View File
@@ -19,27 +19,26 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
strategy:
fail-fast: false
matrix:
config:
- {test_file: "mavros_posix_tests_offboard_posctl.test", vehicle: "iris"}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build PX4 and Run Tests
uses: addnab/docker-run-action@v3
with:
image: px4io/px4-dev-ros-melodic:2021-09-08
options: -v ${{ github.workspace }}:/workspace
- name: Build SITL and Run Tests (inside old ROS container)
run: |
cd /workspace
git config --global --add safe.directory /workspace
make px4_sitl_default
make px4_sitl_default sitl_gazebo-classic
./test/rostest_px4_run.sh ${{matrix.config.test_file}} vehicle:=${{matrix.config.vehicle}}
docker run --rm \
-v "${GITHUB_WORKSPACE}:/workspace" \
-w /workspace \
px4io/px4-dev-ros-melodic:2021-09-08 \
bash -c '
git config --global --add safe.directory /workspace
make px4_sitl_default
make px4_sitl_default sitl_gazebo-classic
./test/rostest_px4_run.sh \
mavros_posix_tests_offboard_posctl.test \
vehicle:=iris
'
+15 -14
View File
@@ -19,27 +19,28 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
container:
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
strategy:
matrix:
config: [
px4_fmu-v5_default,
]
config:
- px4_fmu-v5_default
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build PX4 and Run Test [${{ matrix.config }}]
uses: addnab/docker-run-action@v3
with:
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
options: -v ${{ github.workspace }}:/workspace
- name: Build PX4 and Run Test [${{ matrix.config }}]
run: |
cd /workspace
git config --global --add safe.directory /workspace
export PX4_EXTRA_NUTTX_CONFIG="CONFIG_NSH_LOGIN_PASSWORD=\"test\";CONFIG_NSH_CONSOLE_LOGIN=y"
cd "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
export PX4_EXTRA_NUTTX_CONFIG='CONFIG_NSH_LOGIN_PASSWORD="test";CONFIG_NSH_CONSOLE_LOGIN=y'
echo "PX4_EXTRA_NUTTX_CONFIG: $PX4_EXTRA_NUTTX_CONFIG"
make ${{ matrix.config }} nuttx_context
echo "Check that the config option is set"
grep CONFIG_NSH_LOGIN_PASSWORD build/${{ matrix.config }}/NuttX/nuttx/.config
+4 -2
View File
@@ -33,8 +33,10 @@ jobs:
matrix:
config:
- {model: "iris", latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo" } # Alaska
- {model: "tailsitter" , latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo" } # Florida
- {model: "standard_vtol", latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage" } # Zurich
# VTOL/tailsitter disabled: persistent flaky CI failures (timeouts, erratic
# transitions). Re-enable once the test infrastructure is stabilized.
# - {model: "tailsitter" , latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo" } # Florida
# - {model: "standard_vtol", latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage" } # Zurich
steps:
- uses: actions/checkout@v4
+6
View File
@@ -109,3 +109,9 @@
[submodule "src/lib/rl_tools/rl_tools"]
path = src/lib/rl_tools/rl_tools
url = https://github.com/rl-tools/rl-tools.git
[submodule "libmodal-json"]
path = boards/modalai/voxl2/src/lib/mpa/libmodal-json
url = https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-json.git
[submodule "libmodal-pipe"]
path = boards/modalai/voxl2/src/lib/mpa/libmodal-pipe
url = https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe.git
+19 -3
View File
@@ -412,7 +412,7 @@ tests:
$(call cmake-build,px4_sitl_test)
# work around lcov bug #316; remove once lcov is fixed (see https://github.com/linux-test-project/lcov/issues/316)
LCOBUG = --ignore-errors mismatch
LCOBUG = --ignore-errors mismatch,negative
tests_coverage:
@$(MAKE) clean
@$(MAKE) --no-print-directory tests PX4_CMAKE_BUILD_TYPE=Coverage
@@ -492,13 +492,29 @@ px4_sitl_default-clang:
@cd "$(SRC_DIR)"/build/px4_sitl_default-clang && cmake "$(SRC_DIR)" $(CMAKE_ARGS) -G"$(PX4_CMAKE_GENERATOR)" -DCONFIG=px4_sitl_default -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
@$(PX4_MAKE) -C "$(SRC_DIR)"/build/px4_sitl_default-clang
# Paths to exclude from clang-tidy (auto-generated from .gitmodules + manual additions):
# - All submodules (external code we consume, not edit)
# - Test code (allowed looser style)
# - Example code (educational, not production)
# - Vendored third-party code (e.g., CMSIS_5)
# - NuttX-only drivers excluded at CMake level (mcp_common); I2C-dependent libs excluded here (smbus)
# - GPIO excluded here (NuttX platform headers)
# - Emscripten failsafe web build: source path + Unity build path (failsafe_test.dir)
# because CMake Unity Builds merge sources into a generated .cxx under build/
#
# To add manual exclusions, append to CLANG_TIDY_EXCLUDE_EXTRA below.
# Submodules are automatically excluded - no action needed when adding new ones.
CLANG_TIDY_SUBMODULES := $(shell git config --file .gitmodules --get-regexp path | awk '{print $$2}' | tr '\n' '|' | sed 's/|$$//')
CLANG_TIDY_EXCLUDE_EXTRA := src/systemcmds/tests|src/examples|src/modules/gyro_fft/CMSIS_5|src/lib/drivers/smbus|src/drivers/gpio|src/modules/commander/failsafe/emscripten|failsafe_test\.dir|\.pb\.cc
CLANG_TIDY_EXCLUDE := $(CLANG_TIDY_SUBMODULES)|$(CLANG_TIDY_EXCLUDE_EXTRA)
clang-tidy: px4_sitl_default-clang
@cd "$(SRC_DIR)"/build/px4_sitl_default-clang && "$(SRC_DIR)"/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j_clang_tidy) -p .
@cd "$(SRC_DIR)"/build/px4_sitl_default-clang && "$(SRC_DIR)"/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j_clang_tidy) -exclude="$(CLANG_TIDY_EXCLUDE)" -p .
# to automatically fix a single check at a time, eg modernize-redundant-void-arg
# % run-clang-tidy-4.0.py -fix -j4 -checks=-\*,modernize-redundant-void-arg -p .
clang-tidy-fix: px4_sitl_default-clang
@cd "$(SRC_DIR)"/build/px4_sitl_default-clang && "$(SRC_DIR)"/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j_clang_tidy) -fix -p .
@cd "$(SRC_DIR)"/build/px4_sitl_default-clang && "$(SRC_DIR)"/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j_clang_tidy) -exclude="$(CLANG_TIDY_EXCLUDE)" -fix -p .
# TODO: Fix cppcheck errors then try --enable=warning,performance,portability,style,unusedFunction or --enable=all
cppcheck: px4_sitl_default
@@ -101,6 +101,7 @@ param set-default NAV_ACC_RAD 5
param set-default NAV_DLL_ACT 2
param set-default VT_FWD_THRUST_EN 4
param set-default VT_PITCH_MIN -5
param set-default VT_F_TRANS_THR 1
param set-default VT_TYPE 2
param set-default FD_ESCS_EN 0
@@ -42,23 +42,21 @@ param set-default FD_FAIL_R 0
param set-default CA_ROTOR_COUNT 8
param set-default CA_R_REV 255
param set-default CA_ROTOR0_AX -1
param set-default CA_ROTOR0_AY 1
param set-default CA_ROTOR0_AX 1
param set-default CA_ROTOR0_AY -1
param set-default CA_ROTOR0_AZ 0
param set-default CA_ROTOR0_KM 0
param set-default CA_ROTOR0_PX 0.14
param set-default CA_ROTOR0_PY 0.10
param set-default CA_ROTOR0_PZ 0.06
#param set-default CA_ROTOR0_PZ 0.0
param set-default CA_ROTOR1_AX -1
param set-default CA_ROTOR1_AY -1
param set-default CA_ROTOR1_AX 1
param set-default CA_ROTOR1_AY 1
param set-default CA_ROTOR1_AZ 0
param set-default CA_ROTOR1_KM 0
param set-default CA_ROTOR1_PX 0.14
param set-default CA_ROTOR1_PY -0.10
param set-default CA_ROTOR1_PZ 0.06
#param set-default CA_ROTOR1_PZ 0.0
param set-default CA_ROTOR2_AX 1
param set-default CA_ROTOR2_AY 1
@@ -67,7 +65,6 @@ param set-default CA_ROTOR2_KM 0
param set-default CA_ROTOR2_PX -0.14
param set-default CA_ROTOR2_PY 0.10
param set-default CA_ROTOR2_PZ 0.06
#param set-default CA_ROTOR2_PZ 0.0
param set-default CA_ROTOR3_AX 1
param set-default CA_ROTOR3_AY -1
@@ -79,7 +76,7 @@ param set-default CA_ROTOR3_PZ 0.06
param set-default CA_ROTOR4_AX 0
param set-default CA_ROTOR4_AY 0
param set-default CA_ROTOR4_AZ 1
param set-default CA_ROTOR4_AZ -1
param set-default CA_ROTOR4_KM 0
param set-default CA_ROTOR4_PX 0.12
param set-default CA_ROTOR4_PY 0.22
@@ -103,7 +100,7 @@ param set-default CA_ROTOR6_PZ 0
param set-default CA_ROTOR7_AX 0
param set-default CA_ROTOR7_AY 0
param set-default CA_ROTOR7_AZ 1
param set-default CA_ROTOR7_AZ -1
param set-default CA_ROTOR7_KM 0
param set-default CA_ROTOR7_PX -0.12
param set-default CA_ROTOR7_PY -0.22
@@ -22,6 +22,9 @@
. ${R}etc/init.d/rc.uuv_defaults
# Overwrite DDS AG IP to `192.168.0.1`
param set-default UXRCE_DDS_AG_IP -1062731775
# param set-default MAV_1_CONFIG 102
param set-default BAT1_A_PER_V 37.8798
@@ -10,9 +10,6 @@ set VEHICLE_TYPE uuv
# MAV_TYPE_SUBMARINE 12
param set-default MAV_TYPE 12
# Set micro-dds-client to use ethernet and IP-address 192.168.0.1
param set-default UXRCE_DDS_AG_IP -1062731775
# Disable preflight disarm to not interfere with external launching
param set-default COM_DISARM_PRFLT -1
param set-default CBRK_SUPPLY_CHK 894281
@@ -39,6 +39,8 @@ exec find boards msg src platforms test \
-path src/lib/cdrstream/rosidl -prune -o \
-path src/modules/zenoh/zenoh-pico -prune -o \
-path boards/modalai/voxl2/libfc-sensor-api -prune -o \
-path boards/modalai/voxl2/src/lib/mpa/libmodal-json -prune -o \
-path boards/modalai/voxl2/src/lib/mpa/libmodal-pipe -prune -o \
-path src/drivers/actuators/vertiq_io/iq-module-communication-cpp -prune -o \
-path src/lib/tensorflow_lite_micro/tflite_micro -prune -o \
-path src/drivers/ins/sbgecom/sbgECom -prune -o \
+6 -6
View File
@@ -123,7 +123,7 @@ generate_parameters() {
if [[ "$VERBOSE" == "true" ]]; then
make parameters_metadata
else
make parameters_metadata >/dev/null 2>&1
make parameters_metadata >/dev/null
fi
}
@@ -132,7 +132,7 @@ generate_airframes() {
if [[ "$VERBOSE" == "true" ]]; then
make airframe_metadata
else
make airframe_metadata >/dev/null 2>&1
make airframe_metadata >/dev/null
fi
}
@@ -141,7 +141,7 @@ generate_modules() {
if [[ "$VERBOSE" == "true" ]]; then
make module_documentation
else
make module_documentation >/dev/null 2>&1
make module_documentation >/dev/null
fi
}
@@ -150,7 +150,7 @@ generate_msg_docs() {
if [[ "$VERBOSE" == "true" ]]; then
make msg_docs
else
make msg_docs >/dev/null 2>&1
make msg_docs >/dev/null
fi
}
@@ -159,7 +159,7 @@ generate_uorb_graphs() {
if [[ "$VERBOSE" == "true" ]]; then
make uorb_graphs
else
make uorb_graphs >/dev/null 2>&1
make uorb_graphs >/dev/null
fi
}
@@ -169,7 +169,7 @@ generate_failsafe_web() {
if [[ "$VERBOSE" == "true" ]]; then
make failsafe_web
else
make failsafe_web >/dev/null 2>&1
make failsafe_web >/dev/null
fi
}
+4 -24
View File
@@ -1,47 +1,27 @@
#! /bin/bash
if [ -z ${PX4_DOCKER_REPO+x} ]; then
echo "guessing PX4_DOCKER_REPO based on input";
if [[ $@ =~ .*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
PX4_DOCKER_REPO="px4io/px4-dev:v1.17.0-beta1"
else
echo "PX4_DOCKER_REPO is set to '$PX4_DOCKER_REPO'";
fi
# otherwise default to nuttx
if [ -z ${PX4_DOCKER_REPO+x} ]; then
PX4_DOCKER_REPO="px4io/px4-dev:v1.16.0-rc1-258-g0369abd556"
fi
echo "PX4_DOCKER_REPO: $PX4_DOCKER_REPO";
PWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SRC_DIR=$PWD/../
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SRC_DIR=${SCRIPT_DIR}/../
CCACHE_DIR=${HOME}/.ccache
mkdir -p "${CCACHE_DIR}"
docker run -it --rm -w "${SRC_DIR}" \
--user="$(id -u):$(id -g)" \
--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=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"
${PX4_DOCKER_REPO} /bin/bash -c "$@"
+10 -13
View File
@@ -511,7 +511,7 @@ pageClass: is-wide-page
markdown += "--- | --- | --- |---\n"
for name, command in self.commandConstants.items():
description = f" {command.comment} " if enum.comment else " "
markdown += f'<a href="#{name}"></a> {name} | `{command.type}` | {command.value} |{description}\n'
markdown += f'<a id="#{name}"></a> {name} | `{command.type}` | {command.value} |{description}\n'
"""
for commandConstant in self.commandConstants.values():
#print(commandConstant)
@@ -529,7 +529,7 @@ pageClass: is-wide-page
for enumValueName, enumValue in enum.enumValues.items():
description = f" {enumValue.comment} " if enumValue.comment else " "
markdown += f'<a href="#{enumValueName}"></a> {enumValueName} | `{enumValue.type}` | {enumValue.value} |{description}\n'
markdown += f'<a id="#{enumValueName}"></a> {enumValueName} | `{enumValue.type}` | {enumValue.value} |{description}\n'
# Generate table for constants docs
if len(self.constantFields) > 0:
@@ -538,7 +538,7 @@ pageClass: is-wide-page
markdown += "--- | --- | --- |---\n"
for name, enum in self.constantFields.items():
description = f" {enum.comment} " if enum.comment else " "
markdown += f'<a href="#{name}"></a> {name} | `{enum.type}` | {enum.value} |{description}\n'
markdown += f'<a id="#{name}"></a> {name} | `{enum.type}` | {enum.value} |{description}\n'
@@ -635,8 +635,8 @@ pageClass: is-wide-page
temp = fieldOrConstant.split("=")
value = temp[-1]
typeAndName = temp[0].split(" ")
type = typeAndName[0]
name = typeAndName[1]
type = typeAndName[0].strip()
name = typeAndName[1].strip()
if name.startswith("VEHICLE_CMD_") and parentMessage.name == 'VehicleCommand': #it's a command.
#print(f"DEBUG: startswith VEHICLE_CMD_ {name}")
commandConstant = CommandConstant(name, type, value, comment, line_number, parentMessage)
@@ -729,10 +729,10 @@ pageClass: is-wide-page
# Fix up topics if the topic is empty
def camel_to_snake(name):
# Match upper case not at start of string
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
# Handle cases with multiple capital first letter
return re.sub('([A-Z]+)([A-Z][a-z]*)', r'\1_\2', s1).lower()
# Insert underscore between lowercase/digit and uppercase letter
s1 = re.sub('([a-z0-9])([A-Z])', r'\1_\2', name)
# Insert underscore between consecutive uppercase and uppercase+lowercase
return re.sub('([A-Z]+)([A-Z][a-z])', r'\1_\2', s1).lower()
defaultTopic = camel_to_snake(self.name)
if len(self.topics) == 0:
@@ -745,7 +745,7 @@ pageClass: is-wide-page
error = Error("topic_error", self.filename, "", f"WARNING: TOPIC {defaultTopic} unnecessarily declared for {self.name}")
else:
# Declared topic is not default topic
error = Error("topic_error", self.filename, "", f"NOTE: TOPIC {self.topics[1]}: Only Declared topic is not default topic {defaultTopic} for {self.name}")
error = Error("topic_error", self.filename, "", f"NOTE: TOPIC {self.topics[0]}: Only Declared topic is not default topic {defaultTopic} for {self.name}")
if not "topic_error" in self.errors:
self.errors["topic_error"] = []
self.errors["topic_error"].append(error)
@@ -944,9 +944,6 @@ if __name__ == "__main__":
for msg_file in msg_files:
# Add messages to set of allowed types (compound types)
#msg_type = msg_file.rsplit('/')[-1]
#msg_type = msg_type.rsplit('\\')[-1]
#msg_type = msg_type.rsplit('.')[0]
msg_name = os.path.splitext(os.path.basename(msg_file))[0]
msgTypes.add(msg_name)
+5
View File
@@ -144,6 +144,8 @@ def main():
help='number of tidy instances to be run in parallel.')
parser.add_argument('files', nargs='*', default=['.*'],
help='files to be processed (regex on path)')
parser.add_argument('-exclude', dest='exclude', default=None,
help='regular expression matching files to exclude')
parser.add_argument('-fix', action='store_true', help='apply fix-its')
parser.add_argument('-format', action='store_true', help='Reformat code '
'after applying fixes')
@@ -192,6 +194,7 @@ def main():
# Build up a big regexy filter from all command line arguments.
file_name_re = re.compile('(' + ')|('.join(args.files) + ')')
exclude_re = re.compile(args.exclude) if args.exclude else None
try:
# Spin up a bunch of tidy-launching threads.
@@ -205,6 +208,8 @@ def main():
# Fill the queue with files.
for name in files:
if file_name_re.search(name):
if exclude_re and exclude_re.search(name):
continue
queue.put(name)
# Wait for all threads to be done.
+1 -3
View File
@@ -4,7 +4,7 @@ GREEN='\033[0;32m'
NO_COLOR='\033[0m' # No Color
SCRIPTID="${GREEN}[docker-entrypoint.sh]${NO_COLOR}"
echo -e "$SCRIPTID Starting"
echo -e "$SCRIPTID $( uname -m ) | $(date -u +%FT%TZ)"
# Start virtual X server in the background
# - DISPLAY default is :99, set in dockerfile
@@ -22,6 +22,4 @@ if [ -n "${ROS_DISTRO}" ]; then
source "/opt/ros/$ROS_DISTRO/setup.bash"
fi
echo -e "$SCRIPTID ($( uname -m ))"
exec "$@"
+1 -1
View File
@@ -74,7 +74,7 @@ python3 -m pip install --user -r ${DIR}/requirements.txt
# Optional, but recommended additional simulation tools:
if [[ $INSTALL_SIM == "--sim-tools" ]]; then
if brew ls --versions px4-sim > /dev/null; then
if ! brew ls --versions px4-sim > /dev/null; then
brew install px4-sim
elif [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
brew reinstall px4-sim
+12 -31
View File
@@ -6,9 +6,9 @@ set -e
## Can also be used in docker.
##
## Installs:
## - Common dependencies and tools for nuttx, jMAVSim, Gazebo
## - Common dependencies and tools for nuttx, Gazebo
## - NuttX toolchain (omit with arg: --no-nuttx)
## - jMAVSim and Gazebo9 simulator (omit with arg: --no-sim-tools)
## - Gazebo Harmonic simulator (omit with arg: --no-sim-tools)
##
INSTALL_NUTTX="true"
@@ -207,37 +207,18 @@ if [[ $INSTALL_SIM == "true" ]]; then
bc \
;
# Gazebo / Gazebo classic installation
if [[ "${UBUNTU_RELEASE}" == "18.04" || "${UBUNTU_RELEASE}" == "20.04" ]]; then
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
sudo apt-get update -y --quiet
# Gazebo Harmonic installation (Ubuntu 22.04+)
echo "[ubuntu.sh] Gazebo (Harmonic) will be installed"
# Add Gazebo binary repository
sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt-get update -y --quiet
# Install Gazebo classic
if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
gazebo_classic_version=9
gazebo_packages="gazebo$gazebo_classic_version libgazebo$gazebo_classic_version-dev"
else
# default and Ubuntu 20.04
gazebo_classic_version=11
gazebo_packages="gazebo$gazebo_classic_version libgazebo$gazebo_classic_version-dev"
fi
else
# Expects Ubuntu 22.04 > by default
echo "[ubuntu.sh] Gazebo (Harmonic) will be installed"
echo "[ubuntu.sh] Earlier versions will be removed"
# Add Gazebo binary repository
sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt-get update -y --quiet
# Install Gazebo
gazebo_packages="gz-harmonic libunwind-dev"
# Install Gazebo
gazebo_packages="gz-harmonic libunwind-dev"
if [[ "${UBUNTU_RELEASE}" == "24.04" ]]; then
gazebo_packages="$gazebo_packages cppzmq-dev"
fi
if [[ "${UBUNTU_RELEASE}" == "24.04" ]]; then
gazebo_packages="$gazebo_packages cppzmq-dev"
fi
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
-17
View File
@@ -243,15 +243,6 @@
*/
#define DIRECT_PWM_OUTPUT_CHANNELS 9
#define GPIO_FMU_CH1 /* PI0 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTI|GPIO_PIN0)
#define GPIO_FMU_CH2 /* PH12 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN12)
#define GPIO_FMU_CH3 /* PH11 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN11)
#define GPIO_FMU_CH4 /* PH10 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN10)
#define GPIO_FMU_CH5 /* PD13 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTD|GPIO_PIN13)
#define GPIO_FMU_CH6 /* PD14 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTD|GPIO_PIN14)
#define GPIO_FMU_CH7 /* PH6 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN6)
#define GPIO_FMU_CH8 /* PH9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN9)
#define GPIO_FMU_CAP /* PE11 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN11)
#define GPIO_SPIX_SYNC /* PE9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN9)
@@ -465,14 +456,6 @@
GPIO_SAFETY_SWITCH_IN, \
GPIO_PG6, \
GPIO_nARMED_INIT, \
GPIO_FMU_CH1, \
GPIO_FMU_CH2, \
GPIO_FMU_CH3, \
GPIO_FMU_CH4, \
GPIO_FMU_CH5, \
GPIO_FMU_CH6, \
GPIO_FMU_CH7, \
GPIO_FMU_CH8, \
GPIO_FMU_CAP, \
GPIO_SPIX_SYNC \
}
+5
View File
@@ -0,0 +1,5 @@
# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set
CONFIG_BOARD_CONSTRAINED_FLASH=y
CONFIG_BOARD_CONSTRAINED_MEMORY=y
CONFIG_MODULES_UXRCE_DDS_CLIENT=n
CONFIG_MODULES_ZENOH=y
+2
View File
@@ -26,6 +26,8 @@ then
fi
param set-default BAT1_V_DIV 21.0
param set-default BAT1_V_FILT 0.075
param set-default BAT1_I_FILT 0.5
param set-default RC_CRSF_PRT_CFG 300
param set-default RC_SBUS_PRT_CFG 0
-22
View File
@@ -176,9 +176,6 @@
#define BOARD_BATTERY1_V_DIV (21.0f) // (20k + 1k) / 1k = 21
#define BOARD_BATTERY_ADC_VOLTAGE_FILTER_S 0.075f
#define BOARD_BATTERY_ADC_CURRENT_FILTER_S 0.125f
#define ADC_SCALED_PAYLOAD_SENSE ADC_SCALED_12V_CHANNEL
/* HW has to large of R termination on ADC todo:change when HW value is chosen */
@@ -226,16 +223,6 @@
*/
#define DIRECT_PWM_OUTPUT_CHANNELS 9
#define GPIO_FMU_CH1 /* PI0 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTI|GPIO_PIN0)
#define GPIO_FMU_CH2 /* PH12 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN12)
#define GPIO_FMU_CH3 /* PH11 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN11)
#define GPIO_FMU_CH4 /* PH10 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN10)
#define GPIO_FMU_CH5 /* PI5 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTI|GPIO_PIN5)
#define GPIO_FMU_CH6 /* PI6 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTI|GPIO_PIN6)
#define GPIO_FMU_CH7 /* PI7 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTI|GPIO_PIN7)
#define GPIO_FMU_CH8 /* PI2 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTI|GPIO_PIN2)
#define GPIO_FMU_CH9 /* PD12 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTD|GPIO_PIN12)
#define GPIO_SPIX_SYNC /* PE9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN9)
/* Power supply control and monitoring GPIOs */
@@ -339,15 +326,6 @@
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_nARMED_INIT, \
SPI6_nRESET_EXTERNAL1, \
GPIO_FMU_CH1, \
GPIO_FMU_CH2, \
GPIO_FMU_CH3, \
GPIO_FMU_CH4, \
GPIO_FMU_CH5, \
GPIO_FMU_CH6, \
GPIO_FMU_CH7, \
GPIO_FMU_CH8, \
GPIO_FMU_CH9, \
GPIO_SPIX_SYNC \
}
-17
View File
@@ -206,15 +206,6 @@
*/
#define DIRECT_PWM_OUTPUT_CHANNELS 8
#define GPIO_FMU_CH1 /* PI0 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTI|GPIO_PIN0)
#define GPIO_FMU_CH2 /* PH12 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN12)
#define GPIO_FMU_CH3 /* PH11 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN11)
#define GPIO_FMU_CH4 /* PH10 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN10)
#define GPIO_FMU_CH5 /* PD13 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTD|GPIO_PIN13)
#define GPIO_FMU_CH6 /* PD14 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTD|GPIO_PIN14)
#define GPIO_FMU_CH7 /* PH6 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN6)
#define GPIO_FMU_CH8 /* PH9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN9)
#define GPIO_FMU_CAP /* PE11 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN11)
#define GPIO_SPIX_SYNC /* PE9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN9)
@@ -341,14 +332,6 @@
GPIO_NFC_GPIO, \
GPIO_TONE_ALARM_IDLE, \
GPIO_nARMED_INIT, \
GPIO_FMU_CH1, \
GPIO_FMU_CH2, \
GPIO_FMU_CH3, \
GPIO_FMU_CH4, \
GPIO_FMU_CH5, \
GPIO_FMU_CH6, \
GPIO_FMU_CH7, \
GPIO_FMU_CH8, \
GPIO_FMU_CAP, \
GPIO_SPIX_SYNC \
}
+2 -2
View File
@@ -66,15 +66,15 @@ then
fi
fi
iim42652 -R 6 -s -C 32768 start
bmi088 -A -R 4 -s start
bmi088 -G -R 4 -s start
iim42652 -R 6 -s -C 32768 start
icm45686 -R 2 -s start
rm3100 -I -b 4 start
icp201xx -I -a 0x64 start
bmp581 -b 2 -X -a 0x47 start
icp201xx -I -a 0x64 start
# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer)
ist8310 -X -b 1 -R 10 start
+2 -2
View File
@@ -127,8 +127,8 @@
#define GPIO_VDD_5V_RC_EN /* PG5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN5)
#define GPIO_VDD_3V3_SD_CARD_EN /* PG7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN7)
#define GPIO_VDD_5V_HIPOWER_OC /* PJ3 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTJ|GPIO_PIN3)
#define GPIO_nVDD_5V_PERIPH_OC /* PJ4 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTJ|GPIO_PIN4)
#define GPIO_VDD_5V_HIPOWER_OC /* PJ3 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTJ|GPIO_PIN3)
#define GPIO_nVDD_5V_PERIPH_OC /* PJ4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTJ|GPIO_PIN4)
/* Power switch controls ******************************************************/
#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, (on_true))
@@ -43,6 +43,8 @@
#include <drivers/drv_hrt.h>
#include <drivers/drv_io_heater.h>
ModuleBase::Descriptor Core_Heater::desc{task_spawn, custom_command, print_usage};
# ifndef GPIO_CORE_HEATER_OUTPUT
# error "To use the heater driver, the board_config.h must define and initialize GPIO_CORE_HEATER_OUTPUT"
# endif
@@ -62,7 +64,7 @@ Core_Heater::~Core_Heater()
int Core_Heater::custom_command(int argc, char *argv[])
{
// Check if the driver is running.
if (!is_running()) {
if (!is_running(desc)) {
PX4_INFO("not running");
return PX4_ERROR;
}
@@ -117,7 +119,7 @@ bool Core_Heater::initialize_topics()
void Core_Heater::Run()
{
if (should_exit()) {
exit_and_cleanup();
exit_and_cleanup(desc);
return;
}
@@ -216,8 +218,8 @@ int Core_Heater::task_spawn(int argc, char *argv[])
return PX4_ERROR;
}
_object.store(core_heater);
_task_id = task_id_is_work_queue;
desc.object.store(core_heater);
desc.task_id = task_id_is_work_queue;
core_heater->start();
return 0;
@@ -257,5 +259,5 @@ Background process running periodically on the LP work queue to regulate IMU tem
extern "C" __EXPORT int core_heater_main(int argc, char *argv[])
{
return Core_Heater::main(argc, argv);
return ModuleBase::main(Core_Heater::desc, argc, argv);
}
@@ -56,9 +56,11 @@ using namespace time_literals;
#define CONTROLLER_PERIOD_DEFAULT 10000
#define TEMPERATURE_TARGET_THRESHOLD 2.5f
class Core_Heater : public ModuleBase<Core_Heater>, public ModuleParams, public px4::ScheduledWorkItem
class Core_Heater : public ModuleBase, public ModuleParams, public px4::ScheduledWorkItem
{
public:
static Descriptor desc;
Core_Heater();
virtual ~Core_Heater();
@@ -33,6 +33,8 @@
#include "NavioRGBLed.hpp"
ModuleBase::Descriptor NavioRGBLed::desc{task_spawn, custom_command, print_usage};
NavioRGBLed::NavioRGBLed() :
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default)
{
@@ -130,8 +132,8 @@ int NavioRGBLed::task_spawn(int argc, char *argv[])
NavioRGBLed *instance = new NavioRGBLed();
if (instance) {
_object.store(instance);
_task_id = task_id_is_work_queue;
desc.object.store(instance);
desc.task_id = task_id_is_work_queue;
if (instance->init() == PX4_OK) {
return PX4_OK;
@@ -142,8 +144,8 @@ int NavioRGBLed::task_spawn(int argc, char *argv[])
}
delete instance;
_object.store(nullptr);
_task_id = -1;
desc.object.store(nullptr);
desc.task_id = -1;
return PX4_ERROR;
}
@@ -170,5 +172,5 @@ Emlid Navio2 RGB LED driver.
extern "C" __EXPORT int navio_rgbled_main(int argc, char *argv[])
{
return NavioRGBLed::main(argc, argv);
return ModuleBase::main(NavioRGBLed::desc, argc, argv);
}
@@ -40,9 +40,11 @@
#include <lib/led/led.h>
class NavioRGBLed : public ModuleBase<NavioRGBLed>, public px4::ScheduledWorkItem
class NavioRGBLed : public ModuleBase, public px4::ScheduledWorkItem
{
public:
static Descriptor desc;
NavioRGBLed();
~NavioRGBLed() override;
@@ -5,14 +5,19 @@ CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP101XX=y
CONFIG_DRIVERS_BAROMETER_MS5611=y
CONFIG_DRIVERS_BAROMETER_BMP280=y
CONFIG_DRIVERS_BAROMETER_BMP388=y
CONFIG_DRIVERS_BAROMETER_DPS310=y
CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_MS4525DO=y
CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L0X=y
CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L1X=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_IMU_BOSCH_BMI270=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
CONFIG_DRIVERS_BAROMETER_DPS310=y
CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8308=y
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y
CONFIG_DRIVERS_MAGNETOMETER_ST_IIS2MDC=y
CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y
CONFIG_DRIVERS_QSHELL_QURT=y
CONFIG_DRIVERS_RC_CRSF_RC=y
@@ -26,6 +31,11 @@ CONFIG_MODULES_LOAD_MON=y
CONFIG_MODULES_MANUAL_CONTROL=y
CONFIG_MODULES_MC_ATT_CONTROL=y
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_RATE_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_AIRSPEED_SELECTOR=y
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
CONFIG_MODULES_MC_POS_CONTROL=y
CONFIG_MODULES_MC_RATE_CONTROL=y
+2 -2
View File
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2022 ModalAI, Inc. All rights reserved.
* Copyright (c) 2022-2026 ModalAI, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,7 +39,7 @@
#pragma once
#define BOARD_HAS_NO_RESET
#define CONFIG_BOARDCTL_RESET
#define BOARD_HAS_NO_BOOTLOADER
/*
* I2C buses
@@ -49,6 +49,8 @@
using namespace time_literals;
ModuleBase::Descriptor GhstRc::desc{task_spawn, custom_command, print_usage};
uint32_t GhstRc::baudrate = GHST_BAUDRATE;
GhstRc::GhstRc(const char *device) :
@@ -114,8 +116,8 @@ int GhstRc::task_spawn(int argc, char *argv[])
return PX4_ERROR;
}
_object.store(instance);
_task_id = task_id_is_work_queue;
desc.object.store(instance);
desc.task_id = task_id_is_work_queue;
instance->ScheduleNow();
@@ -174,7 +176,7 @@ void GhstRc::Run()
if (should_exit()) {
ScheduleClear();
_rc_fd = -1;
exit_and_cleanup();
exit_and_cleanup(desc);
return;
}
@@ -308,5 +310,5 @@ This module parses the GHST RC uplink protocol and can generate GHST downlink te
extern "C" __EXPORT int ghst_rc_main(int argc, char *argv[])
{
return GhstRc::main(argc, argv);
return ModuleBase::main(GhstRc::desc, argc, argv);
}
@@ -54,9 +54,11 @@
#define GHST_MAX_NUM_CHANNELS (16)
class GhstRc : public ModuleBase<GhstRc>, public ModuleParams, public px4::ScheduledWorkItem
class GhstRc : public ModuleBase, public ModuleParams, public px4::ScheduledWorkItem
{
public:
static Descriptor desc;
GhstRc(const char *device);
~GhstRc() override;
@@ -59,6 +59,8 @@
#include "rc_controller.hpp"
ModuleBase::Descriptor RC_ControllerModule::desc{task_spawn, custom_command, print_usage};
int RC_ControllerModule::print_status()
{
PX4_INFO("Running");
@@ -69,35 +71,35 @@ int RC_ControllerModule::print_status()
int RC_ControllerModule::custom_command(int argc, char *argv[])
{
if (!is_running()) {
if (!is_running(desc)) {
print_usage("not running");
return 1;
}
if (!strcmp(argv[0], "throttle")) {
uint16_t val = atoi(argv[1]);
get_instance()->set_throttle(val);
get_instance<RC_ControllerModule>(desc)->set_throttle(val);
PX4_INFO("Setting throttle to %u", val);
return 0;
}
if (!strcmp(argv[0], "yaw")) {
uint16_t val = atoi(argv[1]);
get_instance()->set_yaw(val);
get_instance<RC_ControllerModule>(desc)->set_yaw(val);
PX4_INFO("Setting yaw to %u", val);
return 0;
}
if (!strcmp(argv[0], "pitch")) {
uint16_t val = atoi(argv[1]);
get_instance()->set_pitch(val);
get_instance<RC_ControllerModule>(desc)->set_pitch(val);
PX4_INFO("Setting pitch to %u", val);
return 0;
}
if (!strcmp(argv[0], "roll")) {
uint16_t val = atoi(argv[1]);
get_instance()->set_roll(val);
get_instance<RC_ControllerModule>(desc)->set_roll(val);
PX4_INFO("Setting roll to %u", val);
return 0;
}
@@ -106,17 +108,24 @@ int RC_ControllerModule::custom_command(int argc, char *argv[])
}
int RC_ControllerModule::run_trampoline(int argc, char *argv[])
{
return ModuleBase::run_trampoline_impl(desc, [](int ac, char *av[]) -> ModuleBase * {
return RC_ControllerModule::instantiate(ac, av);
}, argc, argv);
}
int RC_ControllerModule::task_spawn(int argc, char *argv[])
{
_task_id = px4_task_spawn_cmd("RC_ControllerModule",
SCHED_DEFAULT,
SCHED_PRIORITY_MAX,
1024,
(px4_main_t)&run_trampoline,
(char *const *)argv);
desc.task_id = px4_task_spawn_cmd("RC_ControllerModule",
SCHED_DEFAULT,
SCHED_PRIORITY_MAX,
1024,
(px4_main_t)&run_trampoline,
(char *const *)argv);
if (_task_id < 0) {
_task_id = -1;
if (desc.task_id < 0) {
desc.task_id = -1;
return -errno;
}
@@ -252,5 +261,5 @@ int RC_ControllerModule::print_usage(const char *reason)
int rc_controller_main(int argc, char *argv[])
{
return RC_ControllerModule::main(argc, argv);
return ModuleBase::main(RC_ControllerModule::desc, argc, argv);
}
@@ -41,9 +41,11 @@
extern "C" __EXPORT int rc_controller_main(int argc, char *argv[]);
class RC_ControllerModule : public ModuleBase<RC_ControllerModule>, public ModuleParams
class RC_ControllerModule : public ModuleBase, public ModuleParams
{
public:
static Descriptor desc;
RC_ControllerModule();
virtual ~RC_ControllerModule() = default;
@@ -51,6 +53,9 @@ public:
/** @see ModuleBase */
static int task_spawn(int argc, char *argv[]);
/** @see ModuleBase */
static int run_trampoline(int argc, char *argv[]);
/** @see ModuleBase */
static RC_ControllerModule *instantiate(int argc, char *argv[]);
+1 -1
View File
@@ -36,5 +36,5 @@
#include <drivers/drv_sensor.h>
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
initSPIBus(1, {initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P), }),
initSPIBus(1, {initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P), initSPIDevice(DRV_IMU_DEVTYPE_BMI270), }),
};
+3
View File
@@ -3,6 +3,8 @@ CONFIG_BOARD_LINUX_TARGET=y
CONFIG_BOARD_TOOLCHAIN="aarch64-linux-gnu"
CONFIG_BOARD_ROOT_PATH="/data/px4"
CONFIG_DRIVERS_ACTUATORS_VOXL_ESC=y
CONFIG_DRIVERS_BAROMETER_DPS310=y
CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP101XX=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_OSD_MSP_OSD=y
CONFIG_DRIVERS_QSHELL_POSIX=y
@@ -25,5 +27,6 @@ CONFIG_SYSTEMCMDS_PERF=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
CONFIG_SYSTEMCMDS_UORB=y
CONFIG_SYSTEMCMDS_VER=y
CONFIG_SYSTEMCMDS_REBOOT=y
CONFIG_ORB_COMMUNICATOR=y
CONFIG_PARAM_PRIMARY=y
@@ -128,6 +128,11 @@ adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-flight_mode_manager"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-imu_server"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-apps_sbus"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-voxl_save_cal_params"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-vehicle_air_data_bridge"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-sensor_baro_bridge"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-dps310"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-icp101xx"
adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-vehicle_local_position_bridge"
# Make sure any required directories exist
adb shell "/bin/mkdir -p /data/px4/param"
+10 -1
View File
@@ -1,6 +1,6 @@
############################################################################
#
# Copyright (c) 2022 ModalAI, Inc. All rights reserved.
# Copyright (c) 2022-2026 ModalAI, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -39,11 +39,20 @@ set(DISABLE_PARAMS_MODULE_SCOPING TRUE PARENT_SCOPE)
add_library(drivers_board
board_config.h
i2c.cpp
init.c
boardctl.c
spi.cpp
)
# Add custom drivers
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/apps_sbus)
# Add custom libraries
add_subdirectory(${PX4_BOARD_DIR}/src/lib/mpa)
# Add custom modules
add_subdirectory(${PX4_BOARD_DIR}/src/modules/voxl_save_cal_params)
add_subdirectory(${PX4_BOARD_DIR}/src/modules/vehicle_air_data_bridge)
add_subdirectory(${PX4_BOARD_DIR}/src/modules/sensor_baro_bridge)
add_subdirectory(${PX4_BOARD_DIR}/src/modules/vehicle_local_position_bridge)
+15 -3
View File
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2022 ModalAI, Inc. All rights reserved.
* Copyright (c) 2022-2026 ModalAI, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,12 +39,24 @@
#pragma once
#define BOARD_HAS_NO_RESET
#define CONFIG_BOARDCTL_RESET
#define BOARD_HAS_NO_BOOTLOADER
// Define this as empty since there are no I2C buses
// Define this as empty since i2c clock init isn't required
#define BOARD_I2C_BUS_CLOCK_INIT
/*
* I2C buses
*/
#define CONFIG_I2C 1
#define PX4_NUMBER_I2C_BUSES 1
/*
* SPI buses
*/
#define CONFIG_SPI 1
#define BOARD_SPI_BUS_MAX_BUS_ITEMS 1
#include <system_config.h>
#include <px4_platform_common/board_common.h>
+46
View File
@@ -0,0 +1,46 @@
/****************************************************************************
*
* Copyright (c) 2025-2026 ModalAI, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include "fc_sensor.h"
int boardctl(unsigned int cmd, uintptr_t arg)
{
fc_sensor_kill_slpi();
sleep(2);
exit(-1);
return 0;
}
+40
View File
@@ -0,0 +1,40 @@
/****************************************************************************
*
* Copyright (C) 2025-2026 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <px4_platform_common/i2c.h>
#include <px4_arch/i2c_hw_description.h>
#include <drivers/drv_sensor.h>
constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
initI2CBusExternal(0)
};
@@ -0,0 +1,44 @@
############################################################################
#
# Copyright (c) 2025-2026 ModalAI, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
px4_add_git_submodule(TARGET git_mpa_libmodal-json PATH "libmodal-json")
px4_add_git_submodule(TARGET git_mpa_libmodal-pipe PATH "libmodal-pipe")
px4_add_library(mpa mpa.cpp)
target_link_libraries(mpa PRIVATE ${CMAKE_DL_LIBS})
target_include_directories(mpa PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/libmodal-json/library/include
${CMAKE_CURRENT_SOURCE_DIR}/libmodal-pipe/library/include
)
+262
View File
@@ -0,0 +1,262 @@
/****************************************************************************
*
* Copyright (c) 2025-2026 ModalAI, inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include "mpa.hpp"
#include <dlfcn.h>
#include <px4_log.h>
#include <string.h>
bool MPA::initialized = false;
void *MPA::handle = nullptr;
int MPA::current_client = 0;
int MPA::current_server = 0;
MPA::pipe_client_set_simple_helper_cb_t MPA::helper_cb = nullptr;
MPA::pipe_client_set_connect_cb_t MPA::connect_cb = nullptr;
MPA::pipe_client_set_disconnect_cb_t MPA::disconnect_cb = nullptr;
MPA::pipe_client_open_t MPA::open_pipe = nullptr;
MPA::pipe_server_create_t MPA::create_pipe = nullptr;
MPA::pipe_server_write_t MPA::write_pipe = nullptr;
MPA::pipe_server_set_control_cb_t MPA::set_control_cb = nullptr;
MPA::pipe_server_close_t MPA::close_pipe = nullptr;
MPA::mpa_data_cb_t MPA::data_cb[MAX_MPA_CLIENTS];
// called whenever we connect or reconnect to the server
void MPA::ConnectCB(__attribute__((unused)) int ch, __attribute__((unused)) void *context)
{
PX4_INFO("vfc status server connected");
return;
}
// called whenever we disconnect from the server
void MPA::DisconnectCB(__attribute__((unused)) int ch, __attribute__((unused)) void *context)
{
PX4_INFO("vfc status server disconnected");
return;
}
void MPA::HelperCB(__attribute__((unused)) int ch, char *data, int bytes, __attribute__((unused)) void *context)
{
// PX4_INFO("Got %d bytes in pipe callback", bytes);
if (data_cb[ch]) { data_cb[ch](data, bytes); }
return;
}
int MPA::PipeClient(const char *pipe_name, int size, mpa_data_cb_t cb)
{
if (!initialized) {
PX4_ERR("Cannot open pipe %s before initialization", pipe_name);
return -1;
}
printf("waiting for server for pipe %s\n", pipe_name);
if (open_pipe(current_client, pipe_name, "px4", EN_PIPE_CLIENT_SIMPLE_HELPER, size * 10) < 0) {
PX4_ERR("Error opening pipe %s", pipe_name);
return -1;
}
data_cb[current_client] = cb;
current_client++;
return current_client - 1;
}
int MPA::PipeCreate(char *pipe_name, int flags)
{
if (!initialized) {
PX4_ERR("Cannot open pipe %s before initialization", pipe_name);
return -1;
}
pipe_info_t server_pipe;
strncpy(server_pipe.name, pipe_name, MODAL_PIPE_MAX_NAME_LEN);
server_pipe.name[MODAL_PIPE_MAX_NAME_LEN - 1] = 0;
server_pipe.location[0] = 0;
server_pipe.type[0] = 0;
strncpy(server_pipe.server_name, "px4_mpa", MODAL_PIPE_MAX_NAME_LEN);
server_pipe.size_bytes = MODAL_PIPE_DEFAULT_PIPE_SIZE;
server_pipe.server_pid = 0;
if (create_pipe(current_server, server_pipe, flags) < 0) {
// remove_pid_file(server_pipe.server_name);
PX4_ERR("Error opening pipe %s", pipe_name);
return -1;
}
current_server++;
return current_server - 1;
}
int MPA::PipeWrite(int ch, const void *data, int bytes)
{
return write_pipe(ch, data, bytes);
}
int MPA::PipeServerSetControlCb(int ch, mpa_control_cb_t cb, void *context)
{
return set_control_cb(ch, cb, context);
}
void MPA::PipeServerClose(int ch)
{
if (close_pipe) {
close_pipe(ch);
}
}
int MPA::Initialize()
{
if (initialized) {
// Already successfully initialized
return 0;
}
char libname[] = "libmodal_pipe.so";
handle = dlopen(libname, RTLD_LAZY | RTLD_GLOBAL);
if (!handle) {
PX4_ERR("Error opening library %s: %s\n", libname, dlerror());
return -1;
} else {
PX4_INFO("Successfully loaded library %s", libname);
}
// set up all our MPA callbacks
char helper_cb_name[] = "pipe_client_set_simple_helper_cb";
helper_cb = (pipe_client_set_simple_helper_cb_t) dlsym(handle, helper_cb_name);
if (!helper_cb) {
PX4_ERR("Error finding symbol %s: %s\n", helper_cb_name, dlerror());
return -1;
} else {
PX4_DEBUG("Successfully loaded function %s", helper_cb_name);
}
helper_cb(0, HelperCB, NULL);
char connect_cb_name[] = "pipe_client_set_connect_cb";
connect_cb = (pipe_client_set_connect_cb_t) dlsym(handle, connect_cb_name);
if (!connect_cb) {
PX4_ERR("Error finding symbol %s: %s", connect_cb_name, dlerror());
return -1;
} else {
PX4_DEBUG("Successfully loaded function %s", connect_cb_name);
}
connect_cb(0, ConnectCB, NULL);
char disconnect_cb_name[] = "pipe_client_set_disconnect_cb";
disconnect_cb = (pipe_client_set_disconnect_cb_t) dlsym(handle, disconnect_cb_name);
if (!disconnect_cb) {
PX4_ERR("Error finding symbol %s: %s", disconnect_cb_name, dlerror());
return -1;
} else {
PX4_DEBUG("Successfully loaded function %s", disconnect_cb_name);
}
disconnect_cb(0, DisconnectCB, NULL);
// request a new pipe from the server
char open_pipe_name[] = "pipe_client_open";
open_pipe = (pipe_client_open_t) dlsym(handle, open_pipe_name);
if (!open_pipe) {
PX4_ERR("Error finding symbol %s: %s", open_pipe_name, dlerror());
return -1;
} else {
PX4_DEBUG("Successfully loaded function %s", open_pipe_name);
}
// Create a new server pipe
char create_pipe_name[] = "pipe_server_create";
create_pipe = (pipe_server_create_t) dlsym(handle, create_pipe_name);
if (!create_pipe) {
PX4_ERR("Error finding symbol %s: %s", create_pipe_name, dlerror());
return -1;
} else {
PX4_DEBUG("Successfully loaded function %s", create_pipe_name);
}
// Write to a server pipe
char write_pipe_name[] = "pipe_server_write";
write_pipe = (pipe_server_write_t) dlsym(handle, write_pipe_name);
if (!write_pipe) {
PX4_ERR("Error finding symbol %s: %s", write_pipe_name, dlerror());
return -1;
} else {
PX4_DEBUG("Successfully loaded function %s", write_pipe_name);
}
// Set control callback for server pipe
char set_control_cb_name[] = "pipe_server_set_control_cb";
set_control_cb = (pipe_server_set_control_cb_t) dlsym(handle, set_control_cb_name);
if (!set_control_cb) {
PX4_ERR("Error finding symbol %s: %s", set_control_cb_name, dlerror());
return -1;
} else {
PX4_DEBUG("Successfully loaded function %s", set_control_cb_name);
}
// Close server pipe
char close_pipe_name[] = "pipe_server_close";
close_pipe = (pipe_server_close_t) dlsym(handle, close_pipe_name);
if (!close_pipe) {
PX4_ERR("Error finding symbol %s: %s", close_pipe_name, dlerror());
return -1;
} else {
PX4_DEBUG("Successfully loaded function %s", close_pipe_name);
}
initialized = true;
return 0;
}
+83
View File
@@ -0,0 +1,83 @@
/****************************************************************************
*
* Copyright (c) 2025-2026 ModalAI, inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <modal_pipe.h>
#pragma once
class MPA
{
public:
static int Initialize();
typedef void (*mpa_data_cb_t)(char *data, int bytes);
typedef void (*mpa_control_cb_t)(int ch, char *data, int bytes, void *context);
static int PipeClient(const char *pipe_name, int size, mpa_data_cb_t cb);
static int PipeCreate(char *pipe_name, int flags = 0);
static int PipeWrite(int ch, const void *data, int bytes);
static int PipeServerSetControlCb(int ch, mpa_control_cb_t cb, void *context);
static void PipeServerClose(int ch);
private:
static void HelperCB(__attribute__((unused)) int ch, char *data, int bytes, __attribute__((unused)) void *context);
static void DisconnectCB(__attribute__((unused)) int ch, __attribute__((unused)) void *context);
static void ConnectCB(__attribute__((unused)) int ch, __attribute__((unused)) void *context);
typedef int (*pipe_client_set_simple_helper_cb_t)(int ch, client_simple_cb *cb, void *context);
typedef int (*pipe_client_set_connect_cb_t)(int ch, client_connect_cb *cb, void *context);
typedef int (*pipe_client_set_disconnect_cb_t)(int ch, client_disc_cb *cb, void *context);
typedef int (*pipe_client_open_t)(int ch, const char *name_or_location, const char *client_name, int flags, int buf_len);
typedef int (*pipe_server_create_t)(int ch, pipe_info_t info, int flags);
typedef int (*pipe_server_write_t)(int ch, const void *data, int bytes);
typedef int (*pipe_server_set_control_cb_t)(int ch, server_control_cb *cb, void *context);
typedef void (*pipe_server_close_t)(int ch);
static pipe_client_set_simple_helper_cb_t helper_cb;
static pipe_client_set_connect_cb_t connect_cb;
static pipe_client_set_disconnect_cb_t disconnect_cb;
static pipe_client_open_t open_pipe;
static pipe_server_create_t create_pipe;
static pipe_server_write_t write_pipe;
static pipe_server_set_control_cb_t set_control_cb;
static pipe_server_close_t close_pipe;
static bool initialized;
static void *handle;
static int current_client;
static int current_server;
static const int MAX_MPA_CLIENTS{8};
static mpa_data_cb_t data_cb[MAX_MPA_CLIENTS];
};
@@ -0,0 +1,43 @@
############################################################################
#
# Copyright (c) 2025-2026 ModalAI, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
px4_add_module(
MODULE modules__sensor_baro_bridge
MAIN sensor_baro_bridge
INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/../../lib/mpa
SRCS
sensor_baro_bridge.cpp
DEPENDS
mpa
)
@@ -0,0 +1,183 @@
/****************************************************************************
*
* Copyright (c) 2025-2026 ModalAI, inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include "mpa.hpp"
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <px4_log.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/module.h>
#include <uORB/uORB.h>
#include <uORB/SubscriptionCallback.hpp>
#include <uORB/topics/sensor_baro.h>
class SensorBaroBridge : public ModuleBase, public px4::WorkItem
{
public:
static Descriptor desc;
SensorBaroBridge();
~SensorBaroBridge() override = default;
/** @see ModuleBase */
static int task_spawn(int argc, char *argv[]);
/** @see ModuleBase */
static int custom_command(int argc, char *argv[]);
/** @see ModuleBase */
static int print_usage(const char *reason = nullptr);
bool init();
private:
void Run() override;
uORB::SubscriptionCallbackWorkItem _sensor_baro_sub{this, ORB_ID(sensor_baro)};
sensor_baro_s _sensor_baro{};
int baro_pipe_ch{0};
};
ModuleBase::Descriptor SensorBaroBridge::desc{task_spawn, custom_command, print_usage};
SensorBaroBridge::SensorBaroBridge() :
WorkItem(MODULE_NAME, px4::wq_configurations::nav_and_controllers)
{
}
bool SensorBaroBridge::init()
{
if (MPA::Initialize() == -1) {
PX4_ERR("MPA init failed");
return false;
}
char baro_pipe_name[] = "px4_sensor_baro";
baro_pipe_ch = MPA::PipeCreate(baro_pipe_name);
if (baro_pipe_ch == -1) {
PX4_ERR("Pipe create failed for %s", baro_pipe_name);
return false;
}
if (!_sensor_baro_sub.registerCallback()) {
PX4_ERR("callback registration failed");
return false;
}
return true;
}
void SensorBaroBridge::Run()
{
if (should_exit()) {
_sensor_baro_sub.unregisterCallback();
exit_and_cleanup(desc);
return;
}
if (_sensor_baro_sub.updated()) {
if (_sensor_baro_sub.update(&_sensor_baro)) {
baro_data_t baro;
memset(&baro, 0, sizeof(baro));
baro.magic_number = BARO_MAGIC_NUMBER;
baro.pressure_pa = _sensor_baro.pressure;
baro.temp_c = _sensor_baro.temperature;
baro.alt_amsl_m = 0.0f; // sensor_baro does not include altitude
baro.timestamp_ns = _sensor_baro.timestamp * 1000; // Convert µs to ns
baro.reserved_1 = 0;
baro.reserved_2 = 0;
if (MPA::PipeWrite(baro_pipe_ch, (void *)&baro, sizeof(baro_data_t)) == -1) {
PX4_ERR("Pipe %d write failed!", baro_pipe_ch);
}
}
}
}
int SensorBaroBridge::custom_command(int argc, char *argv[])
{
return print_usage("unknown command");
}
int SensorBaroBridge::task_spawn(int argc, char *argv[])
{
SensorBaroBridge *instance = new SensorBaroBridge();
if (instance) {
desc.object.store(instance);
desc.task_id = task_id_is_work_queue;
if (instance->init()) {
return PX4_OK;
}
} else {
PX4_ERR("alloc failed");
}
delete instance;
desc.object.store(nullptr);
desc.task_id = -1;
return PX4_ERROR;
}
int SensorBaroBridge::print_usage(const char *reason)
{
if (reason) {
PX4_WARN("%s\n", reason);
}
PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
Sensor baro bridge
)DESCR_STR");
PRINT_MODULE_USAGE_NAME("sensor_baro_bridge", "system");
PRINT_MODULE_USAGE_COMMAND("start");
PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
return 0;
}
extern "C" __EXPORT int sensor_baro_bridge_main(int argc, char *argv[])
{
return ModuleBase::main(SensorBaroBridge::desc, argc, argv);
}
@@ -0,0 +1,43 @@
############################################################################
#
# Copyright (c) 2025-2026 ModalAI, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
px4_add_module(
MODULE modules__vehicle_air_data_bridge
MAIN vehicle_air_data_bridge
INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/../../lib/mpa
SRCS
vehicle_air_data_bridge.cpp
DEPENDS
mpa
)
@@ -0,0 +1,183 @@
/****************************************************************************
*
* Copyright (c) 2025-2026 ModalAI, inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include "mpa.hpp"
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <px4_log.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/module.h>
#include <uORB/uORB.h>
#include <uORB/SubscriptionCallback.hpp>
#include <uORB/topics/vehicle_air_data.h>
class VehicleAirDataBridge : public ModuleBase, public px4::WorkItem
{
public:
static Descriptor desc;
VehicleAirDataBridge();
~VehicleAirDataBridge() override = default;
/** @see ModuleBase */
static int task_spawn(int argc, char *argv[]);
/** @see ModuleBase */
static int custom_command(int argc, char *argv[]);
/** @see ModuleBase */
static int print_usage(const char *reason = nullptr);
bool init();
private:
void Run() override;
uORB::SubscriptionCallbackWorkItem _vehicle_air_data_sub{this, ORB_ID(vehicle_air_data)};
vehicle_air_data_s _vehicle_air_data{};
int baro_pipe_ch{0};
};
ModuleBase::Descriptor VehicleAirDataBridge::desc{task_spawn, custom_command, print_usage};
VehicleAirDataBridge::VehicleAirDataBridge() :
WorkItem(MODULE_NAME, px4::wq_configurations::nav_and_controllers)
{
}
bool VehicleAirDataBridge::init()
{
if (MPA::Initialize() == -1) {
PX4_ERR("MPA init failed");
return false;
}
char baro_pipe_name[] = "px4_vehicle_air_data";
baro_pipe_ch = MPA::PipeCreate(baro_pipe_name);
if (baro_pipe_ch == -1) {
PX4_ERR("Pipe create failed for %s", baro_pipe_name);
return false;
}
if (!_vehicle_air_data_sub.registerCallback()) {
PX4_ERR("callback registration failed");
return false;
}
return true;
}
void VehicleAirDataBridge::Run()
{
if (should_exit()) {
_vehicle_air_data_sub.unregisterCallback();
exit_and_cleanup(desc);
return;
}
if (_vehicle_air_data_sub.updated()) {
if (_vehicle_air_data_sub.update(&_vehicle_air_data)) {
baro_data_t baro;
memset(&baro, 0, sizeof(baro));
baro.magic_number = BARO_MAGIC_NUMBER;
baro.pressure_pa = _vehicle_air_data.baro_pressure_pa;
baro.temp_c = _vehicle_air_data.ambient_temperature;
baro.alt_amsl_m = _vehicle_air_data.baro_alt_meter;
baro.timestamp_ns = _vehicle_air_data.timestamp * 1000; // Convert µs to ns
baro.reserved_1 = 0;
baro.reserved_2 = 0;
if (MPA::PipeWrite(baro_pipe_ch, (void *)&baro, sizeof(baro_data_t)) == -1) {
PX4_ERR("Pipe %d write failed!", baro_pipe_ch);
}
}
}
}
int VehicleAirDataBridge::custom_command(int argc, char *argv[])
{
return print_usage("unknown command");
}
int VehicleAirDataBridge::task_spawn(int argc, char *argv[])
{
VehicleAirDataBridge *instance = new VehicleAirDataBridge();
if (instance) {
desc.object.store(instance);
desc.task_id = task_id_is_work_queue;
if (instance->init()) {
return PX4_OK;
}
} else {
PX4_ERR("alloc failed");
}
delete instance;
desc.object.store(nullptr);
desc.task_id = -1;
return PX4_ERROR;
}
int VehicleAirDataBridge::print_usage(const char *reason)
{
if (reason) {
PX4_WARN("%s\n", reason);
}
PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
Vehicle air data bridge
)DESCR_STR");
PRINT_MODULE_USAGE_NAME("vehicle_air_data_bridge", "system");
PRINT_MODULE_USAGE_COMMAND("start");
PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
return 0;
}
extern "C" __EXPORT int vehicle_air_data_bridge_main(int argc, char *argv[])
{
return ModuleBase::main(VehicleAirDataBridge::desc, argc, argv);
}
@@ -0,0 +1,43 @@
############################################################################
#
# Copyright (c) 2025-2026 ModalAI, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
px4_add_module(
MODULE modules__vehicle_local_position_bridge
MAIN vehicle_local_position_bridge
INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/../../lib/mpa
SRCS
vehicle_local_position_bridge.cpp
DEPENDS
mpa
)
@@ -0,0 +1,238 @@
/****************************************************************************
*
* Copyright (c) 2025-2026 ModalAI, inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include "mpa.hpp"
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <math.h>
#include <px4_log.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/module.h>
#include <uORB/uORB.h>
#include <uORB/SubscriptionCallback.hpp>
#include <uORB/topics/vehicle_local_position.h>
class VehicleLocalPositionBridge : public ModuleBase, public px4::WorkItem
{
public:
static Descriptor desc;
VehicleLocalPositionBridge();
~VehicleLocalPositionBridge() override = default;
/** @see ModuleBase */
static int task_spawn(int argc, char *argv[]);
/** @see ModuleBase */
static int custom_command(int argc, char *argv[]);
/** @see ModuleBase */
static int print_usage(const char *reason = nullptr);
bool init();
private:
void Run() override;
uORB::SubscriptionCallbackWorkItem _vehicle_local_position_sub{this, ORB_ID(vehicle_local_position)};
vehicle_local_position_s _vehicle_local_position{};
int _pipe_ch{0};
};
ModuleBase::Descriptor VehicleLocalPositionBridge::desc{task_spawn, custom_command, print_usage};
VehicleLocalPositionBridge::VehicleLocalPositionBridge() :
WorkItem(MODULE_NAME, px4::wq_configurations::nav_and_controllers)
{
}
bool VehicleLocalPositionBridge::init()
{
if (MPA::Initialize() == -1) {
PX4_ERR("MPA init failed");
return false;
}
char pipe_name[] = "px4_vehicle_local_position";
_pipe_ch = MPA::PipeCreate(pipe_name);
if (_pipe_ch == -1) {
PX4_ERR("Pipe create failed for %s", pipe_name);
return false;
}
if (!_vehicle_local_position_sub.registerCallback()) {
PX4_ERR("callback registration failed");
return false;
}
return true;
}
void VehicleLocalPositionBridge::Run()
{
if (should_exit()) {
_vehicle_local_position_sub.unregisterCallback();
exit_and_cleanup(desc);
return;
}
if (_vehicle_local_position_sub.updated()) {
if (_vehicle_local_position_sub.update(&_vehicle_local_position)) {
// Only publish if we have valid position data
if (!_vehicle_local_position.xy_valid && !_vehicle_local_position.z_valid) {
return;
}
pose_vel_6dof_t pose;
pose.magic_number = POSE_VEL_6DOF_MAGIC_NUMBER;
pose.timestamp_ns = _vehicle_local_position.timestamp * 1000; // Convert µs to ns
// Position (NED frame)
if (_vehicle_local_position.xy_valid) {
pose.T_child_wrt_parent[0] = _vehicle_local_position.x;
pose.T_child_wrt_parent[1] = _vehicle_local_position.y;
} else {
pose.T_child_wrt_parent[0] = NAN;
pose.T_child_wrt_parent[1] = NAN;
}
if (_vehicle_local_position.z_valid) {
pose.T_child_wrt_parent[2] = _vehicle_local_position.z;
} else {
pose.T_child_wrt_parent[2] = NAN;
}
// Rotation matrix from heading (yaw rotation around Z axis)
// R_z(heading) = [cos(h) -sin(h) 0]
// [sin(h) cos(h) 0]
// [0 0 1]
float cos_h = cosf(_vehicle_local_position.heading);
float sin_h = sinf(_vehicle_local_position.heading);
pose.R_child_to_parent[0][0] = cos_h;
pose.R_child_to_parent[0][1] = -sin_h;
pose.R_child_to_parent[0][2] = 0.0f;
pose.R_child_to_parent[1][0] = sin_h;
pose.R_child_to_parent[1][1] = cos_h;
pose.R_child_to_parent[1][2] = 0.0f;
pose.R_child_to_parent[2][0] = 0.0f;
pose.R_child_to_parent[2][1] = 0.0f;
pose.R_child_to_parent[2][2] = 1.0f;
// Velocity (NED frame)
if (_vehicle_local_position.v_xy_valid) {
pose.v_child_wrt_parent[0] = _vehicle_local_position.vx;
pose.v_child_wrt_parent[1] = _vehicle_local_position.vy;
} else {
pose.v_child_wrt_parent[0] = NAN;
pose.v_child_wrt_parent[1] = NAN;
}
if (_vehicle_local_position.v_z_valid) {
pose.v_child_wrt_parent[2] = _vehicle_local_position.vz;
} else {
pose.v_child_wrt_parent[2] = NAN;
}
// Angular velocity not available in vehicle_local_position
pose.w_child_wrt_child[0] = NAN;
pose.w_child_wrt_child[1] = NAN;
pose.w_child_wrt_child[2] = NAN;
if (MPA::PipeWrite(_pipe_ch, (void *)&pose, sizeof(pose_vel_6dof_t)) == -1) {
PX4_ERR("Pipe %d write failed!", _pipe_ch);
}
}
}
}
int VehicleLocalPositionBridge::custom_command(int argc, char *argv[])
{
return print_usage("unknown command");
}
int VehicleLocalPositionBridge::task_spawn(int argc, char *argv[])
{
VehicleLocalPositionBridge *instance = new VehicleLocalPositionBridge();
if (instance) {
desc.object.store(instance);
desc.task_id = task_id_is_work_queue;
if (instance->init()) {
return PX4_OK;
}
} else {
PX4_ERR("alloc failed");
}
delete instance;
desc.object.store(nullptr);
desc.task_id = -1;
return PX4_ERROR;
}
int VehicleLocalPositionBridge::print_usage(const char *reason)
{
if (reason) {
PX4_WARN("%s\n", reason);
}
PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
Vehicle local position bridge - publishes vehicle_local_position to MPA pipe as pose_vel_6dof_t
)DESCR_STR");
PRINT_MODULE_USAGE_NAME("vehicle_local_position_bridge", "system");
PRINT_MODULE_USAGE_COMMAND("start");
PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
return 0;
}
extern "C" __EXPORT int vehicle_local_position_bridge_main(int argc, char *argv[])
{
return ModuleBase::main(VehicleLocalPositionBridge::desc, argc, argv);
}
@@ -41,6 +41,8 @@
using namespace std;
ModuleBase::Descriptor VoxlSaveCalParams::desc{task_spawn, custom_command, print_usage};
static bool debug = false;
VoxlSaveCalParams::VoxlSaveCalParams() :
@@ -145,7 +147,7 @@ VoxlSaveCalParams::Run()
{
if (should_exit()) {
_parameter_primary_set_value_request_sub.unregisterCallback();
exit_and_cleanup();
exit_and_cleanup(desc);
return;
}
@@ -186,8 +188,8 @@ int VoxlSaveCalParams::task_spawn(int argc, char *argv[])
VoxlSaveCalParams *instance = new VoxlSaveCalParams();
if (instance) {
_object.store(instance);
_task_id = task_id_is_work_queue;
desc.object.store(instance);
desc.task_id = task_id_is_work_queue;
if (instance->init()) {
return PX4_OK;
@@ -198,8 +200,8 @@ int VoxlSaveCalParams::task_spawn(int argc, char *argv[])
}
delete instance;
_object.store(nullptr);
_task_id = -1;
desc.object.store(nullptr);
desc.task_id = -1;
return PX4_ERROR;
}
@@ -230,5 +232,5 @@ This implements autosaving of calibration parameters on VOXL2 platform.
extern "C" __EXPORT int voxl_save_cal_params_main(int argc, char *argv[])
{
return VoxlSaveCalParams::main(argc, argv);
return ModuleBase::main(VoxlSaveCalParams::desc, argc, argv);
}
@@ -46,10 +46,12 @@
using namespace time_literals;
class VoxlSaveCalParams : public ModuleBase<VoxlSaveCalParams>, public ModuleParams,
class VoxlSaveCalParams : public ModuleBase, public ModuleParams,
public px4::WorkItem
{
public:
static Descriptor desc;
VoxlSaveCalParams();
~VoxlSaveCalParams() = default;
+40
View File
@@ -0,0 +1,40 @@
/****************************************************************************
*
* Copyright (C) 2025-2026 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <px4_arch/spi_hw_description.h>
#include <px4_platform_common/spi.h>
#include <drivers/drv_sensor.h>
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
initSPIBus(1, {initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, 0), }),
};
+19 -4
View File
@@ -2,10 +2,12 @@
CONFIG_FILE="/etc/modalai/voxl-px4.conf"
AIRFRAME=MULTICOPTER
GPS=NONE
RC=SPEKTRUM
ESC=VOXL_ESC
POWER_MANAGER=VOXLPM
AIRSPEED_SENSOR=NONE
DISTANCE_SENSOR=NONE
OSD=DISABLE
DAEMON_MODE=DISABLE
@@ -39,12 +41,14 @@ else
fi
print_usage() {
echo -e "\nUsage: voxl-px4 [-b (Specify Holybro GPS unit)]"
echo -e "\nUsage: voxl-px4 [-a (Specify Airspeed Sensor)]"
echo " [-b (Specify Holybro GPS unit)]"
echo " [-c delete configuration file and exit]"
echo " [-d start px4 without daemon mode]"
echo " [-f (Use fake rc input instead of from a real transmitter)]"
echo " [-m (Specify Matek GPS unit)]"
echo " [-o (Start OSD module on the apps processor)]"
echo " [-p (Specify Fixed Wing airframe selected)]"
echo " [-r (Specify TBS Crossfire RC receiver, MAVLINK)]"
echo " [-w (Specify TBS Crossfire RC receiver, raw)]"
echo " [-z (Use fake sensor calibration values)]"
@@ -55,10 +59,12 @@ print_usage() {
print_config_settings(){
echo -e "\n*************************"
echo "AIRFRAME=$AIRFRAME"
echo "GPS=$GPS"
echo "RC=$RC"
echo "ESC=$ESC"
echo "POWER MANAGER=$POWER_MANAGER"
echo "AIRSPEED SENSOR=$AIRSPEED_SENSOR"
echo "DISTANCE SENSOR=$DISTANCE_SENSOR"
echo "OSD=$OSD"
echo "DAEMON_MODE=$DAEMON_MODE"
@@ -71,9 +77,13 @@ print_config_settings(){
echo -e "*************************\n"
}
while getopts "bcdhfmorwz" flag
while getopts "abcdhfmoprwz" flag
do
case "${flag}" in
a)
echo "[INFO] MRO AIRSPEED Sensor selected"
AIRSPEED_SENSOR=MS4525DO
;;
b)
echo "[INFO] Holybro GPS selected"
GPS=HOLYBRO
@@ -104,6 +114,10 @@ do
echo "[INFO] OSD module selected"
OSD=ENABLE
;;
p)
echo "[INFO] Airframe Selected as Fixed Wing"
AIRFRAME=FIXED_WING
;;
r)
echo "[INFO] TBS Crossfire RC receiver, MAVLINK selected"
RC=CRSF_MAV
@@ -137,5 +151,6 @@ fi
print_config_settings
GPS=$GPS RC=$RC ESC=$ESC POWER_MANAGER=$POWER_MANAGER DISTANCE_SENSOR=$DISTANCE_SENSOR \
OSD=$OSD EXTRA_STEPS=$EXTRA_STEPS px4 $DAEMON -s /usr/bin/voxl-px4-start
AIRFRAME=$AIRFRAME GPS=$GPS RC=$RC ESC=$ESC POWER_MANAGER=$POWER_MANAGER DISTANCE_SENSOR=$DISTANCE_SENSOR \
AIRSPEED_SENSOR=$AIRSPEED_SENSOR OSD=$OSD EXTRA_STEPS=$EXTRA_STEPS \
px4 $DAEMON -s /usr/bin/voxl-px4-start
@@ -17,13 +17,15 @@ if [ $RETURNCODE -ne 0 ]; then
fi
fi
# We can only run on M0052, M0054, or M0104 so exit with error if that is not the case
# We can only run on M0052, M0054, M0104, or M0197 so exit with error if that is not the case
if [ $PLATFORM = "M0052" ]; then
/bin/echo "Running on M0052"
elif [ $PLATFORM = "M0054" ]; then
/bin/echo "Running on M0054"
elif [ $PLATFORM = "M0104" ]; then
/bin/echo "Running on M0104"
elif [ $PLATFORM = "M0197" ]; then
/bin/echo "Running on M0197"
else
/bin/echo "Error, cannot determine platform!"
exit 0
@@ -76,7 +78,11 @@ microdds_client start -t udp -h 127.0.0.1 -p 8888
qshell pwm_out_sim start -m hil
# g = gps, m = mag, o = odometry (vio), h = distance sensor, f = optic flow
# qshell dsp_hitl start -g -m -o -h -f
qshell dsp_hitl start -g -m
if [ "$PLATFORM" == "M0197" ]; then
qshell dsp_hitl start -g -m -p 6
else
qshell dsp_hitl start -g -m
fi
# start the onboard fast link to connect to voxl-mavlink-server
mavlink start -x -u 14556 -o 14557 -r 100000 -n lo -m onboard
+92 -52
View File
@@ -4,10 +4,12 @@
. px4-alias.sh
echo -e "\n*************************"
echo "AIRFRAME: $AIRFRAME"
echo "GPS: $GPS"
echo "RC: $RC"
echo "ESC: $ESC"
echo "POWER MANAGER: $POWER_MANAGER"
echo "AIRSPEED SENSOR: $AIRSPEED_SENSOR"
echo "DISTANCE SENSOR: $DISTANCE_SENSOR"
echo "OSD: $OSD"
echo "EXTRA STEPS:"
@@ -23,6 +25,8 @@ echo -e "*************************\n"
# and modules manually from the px4 command shell
if [ ! -z $MINIMAL_PX4 ]; then
/bin/echo "Running minimal script"
param select /data/px4/param/parameters
param load
exit 0
fi
@@ -33,23 +37,30 @@ if [ $RETURNCODE -ne 0 ]; then
# If we couldn't get the platform from the voxl-platform utility then check
# /etc/version to see if there is an M0052 substring in the version string. If so,
# then we assume that we are on M0052.
VERSIONSTRING=$(</etc/version)
VERSIONSTRING=""
if [ -f /etc/version ]; then
VERSIONSTRING=$(</etc/version)
fi
M0052SUBSTRING="M0052"
if [[ "$VERSIONSTRING" == *"$M0052SUBSTRING"* ]]; then
PLATFORM="M0052"
fi
fi
# We can only run on M0052, M0054, or M0104 so exit with error if that is not the case
# We can only run on M0054, M0104, or M0197 so exit with error if that is not the case
if [ $PLATFORM = "M0052" ]; then
/bin/echo "Running on M0052"
/bin/echo "Error M0052 is no longer supported!!!"
exit 1
elif [ $PLATFORM = "M0054" ]; then
/bin/echo "Running on M0054"
elif [ $PLATFORM = "M0104" ]; then
/bin/echo "Running on M0104"
elif [ $PLATFORM = "M0197" ]; then
/bin/echo "Running on M0197"
else
/bin/echo "Error, cannot determine platform!"
exit 0
exit 1
fi
# Sleep a little here. A lot happens when the uorb and muorb start
@@ -76,14 +87,43 @@ param load
# IMU (accelerometer / gyroscope)
if [ "$PLATFORM" == "M0104" ]; then
/bin/echo "Starting IMU driver with rotation 12"
qshell icm42688p start -s -R 12
qshell icm42688p start -s -R 12 -C 32768
elif [ "$PLATFORM" == "M0197" ]; then
/bin/echo "Starting bmi270 IMU driver with rotation 26"
qshell bmi270 start -s -R 26
else
/bin/echo "Starting IMU driver with no rotation"
qshell icm42688p start -s
qshell icm42688p start -s -C 32768
fi
# Start Invensense ICP 101xx barometer built on to VOXL 2
qshell icp101xx start -I -b 5
# First look for any external barometers connected to the apps proc
EXTERNAL_BAROMETER=0
/bin/echo "Looking for external DPS368 barometer"
if dps310 start -X -b /dev/i2c-0; then
/bin/echo "Detected external DPS368 barometer"
EXTERNAL_BAROMETER=1
fi
if (( EXTERNAL_BAROMETER == 0 )); then
/bin/echo "Looking for external ICP10100 barometer"
if icp101xx start -X -b /dev/i2c-0; then
/bin/echo "Detected external ICP10100 barometer"
EXTERNAL_BAROMETER=1
fi
fi
# If no external barometers found, use the builtin barometer
if (( EXTERNAL_BAROMETER == 0 )); then
/bin/echo "Did not detect an external barometer, starting onboard barometer"
if [ "$PLATFORM" == "M0197" ]; then
/bin/echo "Starting dps368 barometer on M0197"
qshell dps310 start -I -b 5
else
# Start Invensense ICP 101xx barometer built on to VOXL 2
qshell icp101xx start -I -b 5
fi
fi
# Auto detect the magnetometer. If one or both of these devices
# are not connected it will fail but not cause any harm.
@@ -91,15 +131,19 @@ qshell icp101xx start -I -b 5
qshell qmc5883l start -R 10 -X -b 1
/bin/echo "Looking for ist8310 magnetometer"
qshell ist8310 start -R 10 -X -b 1
/bin/echo "Looking for ist8308 magnetometer"
# Rotation 12 = PITCH_180
qshell ist8308 start -R 12 -X -b 1
/bin/echo "Looking for iis2mdc magnetometer"
# Note: Rotation may not be correct
qshell iis2mdc start -R 10 -X -b 1
# GPS and magnetometer
if [ "$GPS" != "NONE" ]; then
# On M0052 the GPS driver runs on the apps processor
if [ $PLATFORM = "M0052" ]; then
gps start -d /dev/ttyHS2
# On M0054 and M0104 the GPS driver runs on SLPI DSP
if [ "$PLATFORM" == "M0197" ]; then
gps start -d /dev/ttyHS7
else
qshell gps start -d 6
qshell gps start
fi
fi
@@ -144,20 +188,12 @@ elif [ "$RC" == "CRSF_MAV" ]; then
qshell mavlink_rc_in start -m -p 7 -b 115200
elif [ "$RC" == "SPEKTRUM" ]; then
/bin/echo "Starting Spektrum RC"
# On M0052 the RC driver runs on the apps processor
if [ $PLATFORM = "M0052" ]; then
rc_input start -d /dev/ttyHS1
# On M0054 and M0104 the RC driver runs on SLPI DSP
else
qshell spektrum_rc start
fi
qshell spektrum_rc start
elif [ "$RC" == "GHST" ]; then
/bin/echo "Starting GHST RC driver"
qshell ghst_rc start -d 7
elif [ "$RC" == "M0065_SBUS" ]; then
if [ $PLATFORM = "M0052" ]; then
apps_sbus start
elif [ "$ESC" != "VOXL2_IO_PWM_ESC" ]; then
if [ "$ESC" != "VOXL2_IO_PWM_ESC" ]; then
/bin/echo "Attempting to start M0065 SBUS RC driver for original M0065 FW"
qshell dsp_sbus start
retVal=$?
@@ -181,6 +217,10 @@ if [ "$POWER_MANAGER" == "VOXLPM" ]; then
qshell voxlpm start -X -b 2
fi
if [ "$AIRSPEED_SENSOR" == "MS4525DO" ]; then
qshell ms4525do start -X -b 4
fi
# Optional distance sensor on spare i2c
# qshell vl53l0x start -X -b 4
# qshell vl53l1x start -X -b 4
@@ -188,22 +228,27 @@ fi
# Start all of the processing modules on DSP
qshell sensors start
qshell ekf2 start
qshell mc_pos_control start
qshell mc_att_control start
qshell mc_rate_control start
qshell mc_hover_thrust_estimator start
qshell mc_autotune_attitude_control start
qshell land_detector start multicopter
if [ "$AIRFRAME" == "FIXED_WING" ]; then
qshell fw_pos_control start
qshell fw_att_control start
qshell fw_rate_control start
qshell airspeed_selector start
qshell fw_autotune_attitude_control start
qshell land_detector start fixedwing
elif [ $AIRFRAME = "MULTICOPTER" ]; then
qshell mc_pos_control start
qshell mc_att_control start
qshell mc_rate_control start
qshell mc_hover_thrust_estimator start
qshell mc_autotune_attitude_control start
qshell land_detector start multicopter
fi
qshell manual_control start
qshell control_allocator start
qshell load_mon start
# Only start the rc_update module if an actual RC driver
# is publishing input_rc topics. Otherwise for external RC
# over Mavlink this isn't needed.
if [ "$RC" != "EXTERNAL" ]; then
qshell rc_update start
fi
qshell rc_update start
qshell commander start
@@ -213,21 +258,15 @@ qshell flight_mode_manager start
# Start all of the processing modules on the applications processor
dataman start
navigator start
# This bridge allows raw data packets to be sent over UART to the ESC
# voxl2_io_bridge start
vehicle_air_data_bridge start
sensor_baro_bridge start
vehicle_local_position_bridge start
# Start uxrce_dds_client for ros2 offboard messages from agent over localhost
uxrce_dds_client start -t udp -h 127.0.0.1 -p 8888
voxl_save_cal_params start
# On M0052 there is only one IMU. So, PX4 needs to
# publish IMU samples externally for VIO to use.
if [ $PLATFORM = "M0052" ]; then
imu_server start
fi
# start the onboard fast link to connect to voxl-mavlink-server
mavlink start -x -u 14556 -o 14557 -r 100000 -n lo -m onboard
@@ -238,17 +277,12 @@ mavlink stream -u 14556 -s ATTITUDE_QUATERNION -r 10
mavlink stream -u 14556 -s GLOBAL_POSITION_INT -r 30
mavlink stream -u 14556 -s SCALED_PRESSURE -r 10
# Increase heartbeat rate so VFC can get faster mode updates
mavlink stream -u 14556 -s HEARTBEAT -r 10
# start the slow normal mode for voxl-mavlink-server to forward to GCS
mavlink start -x -u 14558 -o 14559 -r 100000 -n lo
# Start logging and use timestamps for log files when possible.
# Add the "-e" option to start logging immediately. Default is
# to log only when armed. Caution must be used with the "-e" option
# because if power is removed without stopping the logger gracefully then
# the log file may be corrupted. Rather than using "-e" option it's better
# to use the SDLOG_MODE to do that.
logger start -t -b 256
mavlink boot_complete
# Optional MSP OSD driver for DJI goggles
@@ -263,3 +297,9 @@ for i in "${EXTRA_STEPS[@]}"
do
$i
done
# Start logging module. This is done as the last step because any topics
# marked as optional will only be logged if they have been advertised when
# this is started. By starting it last it makes sure to see those
# advertisements as the other modules are starting before it.
logger start
@@ -269,7 +269,6 @@
*(.text.udp_pollsetup)
*(.text._ZL14timer_callbackPv)
*(.text._ZN3Ekf4fuseERKN6matrix6VectorIfLj24EEEf)
*(.text._ZN13land_detector23MulticopterLandDetector22_set_hysteresis_factorEi)
*(.text.nxsem_wait_irq)
*(.text._ZN20MavlinkCommandSender4lockEv)
*(.text.MEM_LongCopyEnd)
@@ -432,7 +431,7 @@
*(.text._ZN23MavlinkStreamStatustext8get_sizeEv)
*(.text._ZN11calibration13Accelerometer13set_device_idEm)
*(.text._ZN3px46logger6Logger18start_stop_loggingEv)
*(.text._ZN14FlightTaskAuto17_evaluateTripletsEv)
*(.text._ZN14FlightTaskAuto32_evaluatePositionSetpointTripletEv)
*(.text._ZN11calibration9Gyroscope23SensorCorrectionsUpdateEb)
*(.text._ZN25MavlinkStreamMagCalReport4sendEv)
*(.text.imxrt_config_gpio)
@@ -573,7 +572,6 @@
*(.text._ZN4uORB12SubscriptionaSEOS0_)
*(.text._ZN15TakeoffHandling18updateTakeoffStateEbbbfbRKy)
*(.text._ZN10ModeChecks14checkAndReportERK7ContextR6Report)
*(.text._ZN14FlightTaskAuto24_updateInternalWaypointsEv)
*(.text._ZN8Failsafe17updateArmingStateERKybRK16failsafe_flags_s)
*(.text.imxrt_lpi2c_modifyreg)
*(.text.up_flush_dcache)
@@ -269,7 +269,6 @@
*(.text.udp_pollsetup)
*(.text._ZL14timer_callbackPv)
*(.text._ZN3Ekf4fuseERKN6matrix6VectorIfLj24EEEf)
*(.text._ZN13land_detector23MulticopterLandDetector22_set_hysteresis_factorEi)
*(.text.nxsem_wait_irq)
*(.text._ZN20MavlinkCommandSender4lockEv)
*(.text.MEM_LongCopyEnd)
@@ -432,7 +431,7 @@
*(.text._ZN23MavlinkStreamStatustext8get_sizeEv)
*(.text._ZN11calibration13Accelerometer13set_device_idEm)
*(.text._ZN3px46logger6Logger18start_stop_loggingEv)
*(.text._ZN14FlightTaskAuto17_evaluateTripletsEv)
*(.text._ZN14FlightTaskAuto32_evaluatePositionSetpointTripletEv)
*(.text._ZN11calibration9Gyroscope23SensorCorrectionsUpdateEb)
*(.text._ZN25MavlinkStreamMagCalReport4sendEv)
*(.text.imxrt_config_gpio)
@@ -573,7 +572,6 @@
*(.text._ZN4uORB12SubscriptionaSEOS0_)
*(.text._ZN15TakeoffHandling18updateTakeoffStateEbbbfbRKy)
*(.text._ZN10ModeChecks14checkAndReportERK7ContextR6Report)
*(.text._ZN14FlightTaskAuto24_updateInternalWaypointsEv)
*(.text._ZN8Failsafe17updateArmingStateERKybRK16failsafe_flags_s)
*(.text.imxrt_lpi2c_modifyreg)
*(.text.up_flush_dcache)
+1
View File
@@ -19,6 +19,7 @@ CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_AUAV=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_SF45_SERIAL=y
CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_GRF_SERIAL=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
@@ -273,7 +273,6 @@
*(.text.udp_pollsetup)
*(.text._ZL14timer_callbackPv)
*(.text._ZN3Ekf4fuseERKN6matrix6VectorIfLj24EEEf)
*(.text._ZN13land_detector23MulticopterLandDetector22_set_hysteresis_factorEi)
*(.text.nxsem_wait_irq)
*(.text._ZN20MavlinkCommandSender4lockEv)
*(.text.MEM_LongCopyEnd)
@@ -440,7 +439,7 @@
*(.text._ZN23MavlinkStreamStatustext8get_sizeEv)
*(.text._ZN11calibration13Accelerometer13set_device_idEm)
*(.text._ZN3px46logger6Logger18start_stop_loggingEv)
*(.text._ZN14FlightTaskAuto17_evaluateTripletsEv)
*(.text._ZN14FlightTaskAuto32_evaluatePositionSetpointTripletEv)
*(.text._ZN11calibration9Gyroscope23SensorCorrectionsUpdateEb)
*(.text._ZN25MavlinkStreamMagCalReport4sendEv)
*(.text.imxrt_config_gpio)
@@ -586,7 +585,6 @@
*(.text._ZN4uORB12SubscriptionaSEOS0_)
*(.text._ZN15TakeoffHandling18updateTakeoffStateEbbbfbRKy)
*(.text._ZN10ModeChecks14checkAndReportERK7ContextR6Report)
*(.text._ZN14FlightTaskAuto24_updateInternalWaypointsEv)
*(.text._ZN8Failsafe17updateArmingStateERKybRK16failsafe_flags_s)
*(.text.imxrt_lpi2c_modifyreg)
*(.text.up_flush_dcache)
+9
View File
@@ -162,6 +162,15 @@
}
/**
* Custom style to hide search on the ome page
* -------------------------------------------------------------------------- */
.home #local-search {
display: none;
}
/**
* Custom styles for wide pages
* -------------------------------------------------------------------------- */
@@ -1,8 +1,8 @@
# Onboard parameters for Vehicle 1
#
# Stack: PX4 Pro
# Vehicle: Multi-Rotor
# Version: 1.15.4
# Vehicle: Amovlab F410
# Version: 1.15.4
# Git Revision: 99c40407ff000000
#
# Vehicle-Id Component-Id Name Value Type
@@ -546,7 +546,6 @@
1 1 IMU_INTEG_RATE 200 6
1 1 LNDMC_ALT_GND 2.000000000000000000 9
1 1 LNDMC_ROT_MAX 20.000000000000000000 9
1 1 LNDMC_TRIG_TIME 1.000000000000000000 9
1 1 LNDMC_XY_VEL_MAX 1.500000000000000000 9
1 1 LNDMC_Z_VEL_MAX 0.250000000000000000 9
1 1 LND_FLIGHT_T_HI 5 6
@@ -1056,9 +1055,6 @@
1 1 UAVCAN_EC_REV 0 6
1 1 UAVCAN_ENABLE 2 6
1 1 UAVCAN_LGT_ANTCL 2 6
1 1 UAVCAN_LGT_LAND 0 6
1 1 UAVCAN_LGT_NAV 3 6
1 1 UAVCAN_LGT_STROB 1 6
1 1 UAVCAN_NODE_ID 1 6
1 1 UAVCAN_PUB_ARM 0 6
1 1 UAVCAN_PUB_MBD 0 6
Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

+7 -4
View File
@@ -255,6 +255,7 @@
- [Lidar-Lite](sensor/lidar_lite.md)
- [Lightware Lidars (SF/LW/GRF)](sensor/sfxx_lidar.md)
- [Lightware SF45 Rotary Lidar](sensor/sf45_rotating_lidar.md)
- [Lightware GRF250/GRF500 Gimbal Lidar](sensor/grf_lidar.md)
- [TeraRanger](sensor/teraranger.md)
- [✘ Lanbao PSK-CM8JL65-CC5](sensor/cm8jl65_ir_distance_sensor.md)
- [Avionics Anonymous Laser Altimeter UAVCAN Interface (CAN)](dronecan/avanon_laser_interface.md)
@@ -327,10 +328,11 @@
- [Vertiq Motor/ESC Modules](peripherals/vertiq.md)
- [VESC Project ESCs](peripherals/vesc.md)
- [Zubax Telega ESCs](dronecan/zubax_telega.md)
- [Radio Control (RC)](getting_started/rc_transmitter_receiver.md)
- [Radio Setup](config/radio.md)
- [Flight Modes](config/flight_mode.md)
- [Joysticks](config/joystick.md)
- [Manual Control](config/manual_control.md)
- [Radio Control (RC)](getting_started/rc_transmitter_receiver.md)
- [Radio Setup](config/radio.md)
- [Flight Modes](config/flight_mode.md)
- [Joysticks](config/joystick.md)
- [Data Links](data_links/index.md)
- [MAVLink Telemetry (OSD/GCS)](peripherals/mavlink_peripherals.md)
- [Telemetry Radios](telemetry/index.md)
@@ -417,6 +419,7 @@
- [Standard Configuration](config/index.md)
- [Advanced Configuration](advanced_config/index.md)
- [Using PX4's Navigation Filter (EKF2)](advanced_config/tuning_the_ecl_ekf.md)
- [GNSS-Denied & Degraded Flight](advanced_config/gnss_degraded_or_denied_flight.md)
- [Finding/Updating Parameters](advanced_config/parameters.md)
- [Full Parameter Reference](advanced_config/parameter_reference.md)
@@ -0,0 +1,77 @@
# GNSS-Degraded & Denied Flight ("Dead-Reckoning" Mode)
<Badge type="tip" text="PX4 v1.17" /> <Badge type="warning" text="Experimental" />
::: warning Experimental
This is a new feature with limited real-world testing.
It is intended for GNSS dropout scenarios (not pure GNSS-denied from takeoff), and requires that alternative velocity/position sensors are available.
Please [share your related test logs](../getting_started/flight_reporting.md#sharing-the-log-files-for-review-by-px4-developers) to help us verify and harden it.
:::
PX4 is default-configured for outdoor flight with a reliable GNSS signal, but it can also be set up in "dead-reckoning mode" to more gracefully handle environments where GNSS is intermittently degraded or denied during flight.
This section describes the differences between automatic and dead-reckoning modes, the circumstances in which each should be used, and how dead-reckoning is configured.
## Overview
PX4's EKF2 navigation has two modes for handling when GNSS data is determined to be unreliable:
- **Automatic mode** (the default): Used for flying outdoors in environments where a GNSS signal is expected to be largely reliable.
- **Dead-reckoning mode**: Recommended when you want to fly missions or other position controlled modes when there is intermittent GNSS loss, such as when flying under a bridge, from outdoors into an indoor setting, or when there is GNSS jamming (it is not suitable for pure-indoor use, as a GNSS signal is required before arming).
::: info
Dead-reckoning mode helps for both Fixed-Wing and Multicopter vehicles.
MC vehicles benefit more because they can hover when transitioning between sensor regimes.
FW needs continuous accurate velocity/position during the entire mission arc, making sensor transitions trickier.
:::
## Mode Comparison
The following sections provide more detail about each of the modes and when they should be used.
### Automatic Mode
In Automatic mode the EKF2 resets if GNSS is lost and no other sources of position are available.
This can result in a [position loss failsafe](../config/safety.md#position-loss-failsafe) and may trigger a shift into a mode that does not require global position, including stopping missions.
This is desirable if the GNSS signal is likely to be recovered quickly and there are no mechanisms to estimate position when GNSS is unavailable.
Use Automatic (default) when:
- Flying in open sky with reliable GNSS throughout the mission.
- You want the EKF to reset to GNSS when it becomes available again.
- Operating in environments where GNSS is either good or completely unavailable (binary state).
### Dead-Reckoning Mode
In dead-reckoning mode, EKF2 stops fusing GNSS data when it becomes unreliable and prevents EKF2 resets — provided there are other sources of position or velocity data that can be fused.
This ensures that the vehicle can continue flying missions and other position controlled modes when GNSS is lost.
When GNSS is recovered it will be fused with other measurements when tests indicate it can be trusted.
This may cause jerky movements in position controlled modes if the estimate has drifted.
This mode relies on having additional position or velocity sensors and must also have a reliable GNSS signal at boot.
Use Dead-Reckoning when:
- **Transitioning between GNSS and non-GNSS environments** (flying into buildings, under bridges, through tree cover).
- You have **redundant sensors** (optical flow, VIO, rangefinder, quality baro) that can maintain position estimation.
- Flying **missions that cross GPS-denied areas** where you want continuous operation rather than failsafe.
- **Urban environments** or other areas with intermittent GNSS quality.
- You want to **avoid EKF resets and jumps** when GNSS recovers (smoother transitions).
## Configuration
To use dead-reckoning mode, the vehicle must have an alternative source of position or velocity information, such as an [Optical Flow](../sensor/optical_flow.md) sensor or [VIO](../computer_vision/visual_inertial_odometry.md) setup.
To enable the mode:
1. Set [EKF2_GPS_MODE](../advanced_config/parameter_reference.md#EKF2_GPS_MODE) to `1`.
2. Ensure that GNSS arming checks are enabled (a reliable GNSS signal is required before arming):
- [COM_ARM_WO_GPS](../advanced_config/parameter_reference.md#COM_ARM_WO_GPS) - set to `0`
- [EKF2_GPS_CHECK](../advanced_config/parameter_reference.md#EKF2_GPS_CHECK) - set to default.
## See Also
- [GNSS Fault Detection](../advanced_config/tuning_the_ecl_ekf.md#gnss-fault-detection) in _Using PX4's Navigation Filter (EKF2)_
- [Fuse, Reset, or Reject? Handling Various Data-sources in EKF2](https://www.youtube.com/watch?v=CMGQJNPiTJg) - _PX4 Developer Summit 2025_, Marco Hauswirth, Auterion AG
+1
View File
@@ -10,6 +10,7 @@ This topic lists configuration topics that are not particularly vehicle specific
## Feature configuration
- [Using PX4's Navigation Filter (EKF2)](../advanced_config/tuning_the_ecl_ekf.md)
- [GNSS-Denied and Degraded Flight](../advanced_config/gnss_degraded_or_denied_flight.md)
- [Flight Termination Configuration](../advanced_config/flight_termination.md)
- [Land Detector Configuration](../advanced_config/land_detector.md)
- [Prearm/Arm/Disarm Configuration](../advanced_config/prearm_arm_disarm.md)
+1 -1
View File
@@ -38,7 +38,7 @@ In order to detect landing, the multicopter first has to go through three differ
If a condition cannot be reached because of missing sensors, then the condition is true by default.
For instance, in [Acro mode](../flight_modes_mc/acro.md) and no sensor is active except for the gyro sensor, then the detection solely relies on thrust output and time.
In order to proceed to the next state, each condition has to be true for a third of the configured total land detector trigger time [LNDMC_TRIG_TIME](../advanced_config/parameter_reference.md#LNDMC_TRIG_TIME).
In order to proceed to the next state, each condition has to be true for 300ms.
If the vehicle is equipped with a distance sensor, but the distance to ground is currently not measurable (usually because it is too large), the trigger time is increased by a factor of 3.
If one condition fails, the land detector drops out of the current state immediately.
File diff suppressed because it is too large Load Diff
@@ -361,6 +361,10 @@ The mode is set using the [EKF2_GPS_MODE](../advanced_config/parameter_reference
EKF2 may reset if no other sources of position or velocity are available.
If GNSS altitude OR horizontal position data drifts, the system disables fusion of both measurements simultaneously (even if one would still pass validation) and avoids performing resets.
::: tip
See also [Fault Detection](https://youtu.be/CMGQJNPiTJg?si=sFtdf4AQbcOH8-u8) in "Fuse, Reset, or Reject? Handling Various Data-sources in EKF2" _PX4 Developer Summit 2025_, Marco Hauswirth, Auterion AG
:::
##### Detection Logic
Horizontal Position:
@@ -892,3 +896,4 @@ If no terrain estimate is available this parameter will have no effect and the s
## Further Information
- [PX4 State Estimation Overview](https://youtu.be/HkYRJJoyBwQ), _PX4 Developer Summit 2019_, Dr. Paul Riseborough): Overview of the estimator, and major changes from 2018/19, and the expected improvements through 2019/20.
- [Fuse, Reset, or Reject? Handling Various Data-sources in EKF2](https://www.youtube.com/watch?v=CMGQJNPiTJg) - _PX4 Developer Summit 2025_, Marco Hauswirth, Auterion AG
+1 -1
View File
@@ -18,7 +18,7 @@ Further/updated information may be available in the [Cube User Manual](https://d
## Accessories
Cube comes with most (or all) of the accessories you will need when [purchased](../flight_controller/pixhawk-2.md#stores).
Cube comes with most (or all) of the accessories you will need when [purchased](../flight_controller/pixhawk-2.md#store).
![Cube Accessories](../../assets/flight_controller/cube/cube_accessories.jpg)
+14 -10
View File
@@ -2,12 +2,12 @@
<Badge type="info" text="Discontinued" />
:::warning
::: warning
_Crazyflie 2.0_ has been [discontinued/superseded](../flight_controller/autopilot_experimental.md).
Try [Bitcraze Crazyflie 2.1](../complete_vehicles_mc/crazyflie21.md) instead!
:::
:::warning
::: warning
- PX4 does not manufacture this (or any) autopilot.
Contact the [manufacturer](https://www.bitcraze.io/) for hardware support or compliance issues.
@@ -202,7 +202,7 @@ Next, launch the cfbridge by giving the same channel and address as the first an
- After using _cfbridge_, you can deactivate the virtualenv if you activated it by pressing `CTRL+z`.
Most of the time, launching _cfbridge_ again from the same terminal doesn't connect to crazyflie, this can be solved by closing the terminal and relaunching _cfbridge_ in a new terminal.
:::tip
::: tip
If you change any driver in [crazyflie-lib-python](https://github.com/bitcraze/crazyflie-lib-python) or if launching _cfbridge_ in a new terminal does not find crazyflie, you can try navigating to the crazyflie-lib-python folder and run the script below to rebuild cflib.
```sh
@@ -212,13 +212,17 @@ make venv
:::
::: info
To use Joystick, set `COM_RC_IN_MODE` in QGroundControl to "Joystick/No RC Checks".
Calibrate the Joystick and set the Joystick message frequency in QGroundControl to any value between 5 to 14 Hz (10 Hz is recommended).
To be able to set the frequency, the advanced option should be enabled.
This is the rate at which Joystick commands are sent from QGroundControl to Crazyflie 2.0 (to do this, you will need to follow the instructions [here](https://github.com/mavlink/qgroundcontrol) to obtain the latest QGroundControl source code (master) and build it).
:::
To use a [Joystick](../config/joystick.md):
![](../../assets/hardware/joystick-message-frequency.png)
- Make sure you're using a [`COM_RC_IN_MODE` that allows Joystick](../config/manual_control.md#px4-configuration).
- Calibrate the Joystick and set the Joystick message frequency in QGroundControl if needed (25 Hz is the default).
To be able to set the frequency, the advanced option should be enabled.
![QGC UI for setting message frequency](../../assets/hardware/joystick-message-frequency.png)
This is the rate at which Joystick commands are sent from QGroundControl to Crazyflie 2.0 (to do this, you will need to follow the instructions [here](https://github.com/mavlink/qgroundcontrol) to obtain the latest QGroundControl source code (master) and build it).
:::
## Hardware Setup
@@ -247,7 +251,7 @@ Then, you need to stick the battery on top of the SD card deck using a double si
Crazyflie is able to fly in _Altitude_ mode if you use a [Z-ranger deck](https://store.bitcraze.io/collections/decks/products/z-ranger-deck).
According to the datasheet, the maximum height (above ground) the range finder can sense is 2 m. However, when tested on dark surfaces this value decreases to 0.5 m. On a light floor, it goes up to max 1.3 m. This means you cannot hold altitudes above this value in _Altitude_ or _Position_ flight modes.
:::tip
::: tip
If the Crazyflie 2.0 height drifts at mid-throttle command in _Altitude mode_ or _Position mode_, first try rebooting the vehicle. If this does not fix the problem, recalibrate the accel and mag (compass).
:::
+3 -3
View File
@@ -21,7 +21,7 @@ For that to work, a few things are required:
- PX4 modules need to look like individual executables to the system.
This is done via symbolic links.
For each module a symbolic link `px4-<module> -> px4` is created in the `bin` directory of the build folder.
When executed, the binary path is checked (`argv[0]`), and if it is a module (starts with `px4-`), it sends the command to the main px4 instance (see below).
When executed, the binary path is checked (`argv[0]`), and if it is a module (starts with `px4-`), it sends the command to the main PX4 instance (see below).
:::tip
The `px4-` prefix is used to avoid conflicts with system commands (e.g. `shutdown`), and it also allows for simple tab completion by typing `px4-<TAB>`.
@@ -30,13 +30,13 @@ For that to work, a few things are required:
- The shell needs to know where to find the symbolic links.
For that the `bin` directory with the symbolic links is added to the `PATH` variable right before executing the startup scripts.
- The shell starts each module as a new (client) process.
Each client process needs to communicate with the main instance of px4 (the server), where the actual modules are running as threads.
Each client process needs to communicate with the main instance of PX4 (the server), where the actual modules are running as threads.
This is done through a [UNIX socket](https://man7.org/linux/man-pages/man7/unix.7.html).
The server listens on a socket, to which clients can connect and send a command.
The server then sends the output and return code back to the client.
- The startup scripts call the module directly, e.g. `commander start`, rather than using the `px4-` prefix.
This works via aliases: for each module an alias in the form of `alias <module>=px4-<module>` is created in the file `bin/px4-alias.sh`.
- The `rcS` script is executed from the main px4 instance.
- The `rcS` script is executed from the main PX4 instance.
It does not start any modules, but first updates the `PATH` variable and then simply runs a shell with the `rcS` file as argument.
- In addition to that, multiple server instances can be started for multi-vehicle simulations.
A client selects the instance via `--instance`.
+2 -3
View File
@@ -23,8 +23,7 @@ Information about how to set up a joystick is covered in: [QGroundControl > Joys
In summary:
- Open _QGroundControl_
- Set the parameter [COM_RC_IN_MODE=1](../advanced_config/parameter_reference.md#COM_RC_IN_MODE) - `Joystick`
- See [Parameters](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/parameters.html) for information about setting parameters
- Setting the parameter to `2` or `3` also enables Joystick under some circumstances.
- [Enable a `COM_RC_IN_MODE` mode that allows Joystick](../config/manual_control.md#px4-configuration).
The default `RC or MAVLink keep first` should work if you plan to only have a Joystick connected.
- Connect the joystick
- Configure the connected joystick in: **Vehicle Setup > Joystick**.
+58
View File
@@ -0,0 +1,58 @@
# Manual Control
Pilots can control a vehicle manually using either a [Radio Control (RC) System](../getting_started/rc_transmitter_receiver.md) or a [Joystick/Gamepad](../config/joystick.md) controller connected via QGroundControl.
PX4 also supports using RC and/or multiple Joysticks, with fallback from one type to the other.
![Taranis X9D Transmitter](../../assets/hardware/transmitters/frsky_taranis_x9d_transmitter.jpg) <img src="../../assets/peripherals/joystick/micronav.jpg" alt="Photo of MicroNav, a ground controller with integrated joysticks" width="400px">
## Overview
_Joystick_ setups use QGroundControl to encode the control information from a "standard" computer gaming joystick into [MAVLink messages](https://mavlink.io/en/services/manual_control.html) that are sent to the vehicle over the (shared) telemetry radio channel.
They are often used in integrated GCS/manual control systems because it is cheaper and easier to integrate a joystick than a separate radio system.
Joysticks are suitable for most applications provided your telemetry channel has a high enough bandwidth/low latency.
They are perfect for flying the PX4 simulator, because you can plug them directly into your ground control computer and start flying.
_RC systems_ use a dedicated ground-based radio transmitter and vehicle-based receiver for sending control information.
They offer lower latency than Joysticks, and are very highly recommended when first tuning/testing a new frame design, when flying racers/acrobatically, and in other cases where low latency is important.
They can also be useful as a robust backup link for safety.
Note RC systems usually require significantly more configuration and calibration, much of which may be brand or model-specific.
::: info
PX4 does not _require_ a manual control system for autonomous flight modes.
:::
## PX4 Configuration
::: tip
This section explains how to configure PX4 to use and prioritise various manual control sources (other configuration is covered in the guides for each type of manual control).
:::
If you only have one manual control system, either RC or Joystick, then by default no manual control selection is required.
In this case PX4 locks to the first valid manual control source it detects and uses that source until the vehicle is rebooted.
If you have multiple control sources, such as an RC system and/or one or more Joysticks, then you can use the [COM_RC_IN_MODE](../advanced_config/parameter_reference.md#COM_RC_IN_MODE) parameter to determine which source is active, specifying selection priorities and fallback behavior ([parameters can be set](../advanced_config/parameters.md#finding-a-parameter) using QGC):
- `0`: RC only.
- `1`: MAVLink only.
- `2`: RC or MAVLink with fallback (switches if current source becomes invalid).
- `3`: RC or MAVLink keep first (locks to the first valid source until reboot).
- `4`: Disable manual control (ignores all sources).
- `5`: RC priority, then MAVLink (lower instance before higher) — `RC > MAVLink 1 > MAVLink 2`
- `6`: MAVLink priority (lower instance before higher), then RC — `MAVLink 1 > MAVLink 2 > RC`
- `7`: RC priority, then MAVLink (higher instance before lower) — `RC > MAVLink 2 > MAVLink 1`
- `8`: MAVLink priority (higher instance before lower), then RC — `MAVLink 2 > MAVLink 1 > RC`
The [MAVLink instance](../peripherals/mavlink_peripherals.md#mavlink-instances) refers to an instance assigned to a serial port, such as [MAV_0_CONFIG](../advanced_config/parameter_reference.md#MAV_0_CONFIG).
Notes:
- RC checks are run for any option that uses RC (so not for `MAVLink only` or `Disable manual control`).
- When using priority sources, sources are evaluated as soon as they become valid and may trigger an immediate switch (if higher priority than the currently active source).
- A [Manual Control Loss Failsafe](../config/safety.md#manual-control-loss-failsafe) is triggered when none of the manual control inputs allowed by the `COM_RC_IN_MODE` mode are available for a time that is greater than the RC Loss Timeout.
As long as there is a fallback input source available, the failsafe is not triggered.
## See Also
- [Radio Control (RC)](../getting_started/rc_transmitter_receiver.md)
- [Joysticks](../config/joystick.md)
+5 -3
View File
@@ -1,10 +1,12 @@
# Radio Control (RC) Setup
The _Radio Setup_ screen is used to configure the mapping of your RC controller's main attitude control sticks (roll, pitch, yaw, throttle) to channels, and to calibrate the minimum, maximum, trim and reverse settings for all other transmitter controls/RC channels.
The _Radio Setup_ screen is used to configure the mapping of your [RC controller's](../getting_started/rc_transmitter_receiver.md) main attitude control sticks (roll, pitch, yaw, throttle) to channels, and to calibrate the minimum, maximum, trim and reverse settings for all other transmitter controls/RC channels.
::: info
A [Joystick](../config/joystick.md) can be used instead of RC for manual control.
The [COM_RC_IN_MODE](../advanced_config/parameter_reference.md#COM_RC_IN_MODE) parameter [can be set](../advanced_config/parameters.md) to define what kind of manual controller(s) are enabled.
A [Joystick](../config/joystick.md) can also be used for [Manual Control](../config/manual_control.md).
By default PX4 will latch the first valid controller it discovers and use it until the vehicle reboots.
If you have multiple controllers and you want to define their priority see [Manual Control > PX4 Configuration](../config/manual_control.md#px4-configuration).
:::
## Binding the Receiver
+31 -18
View File
@@ -111,19 +111,17 @@ The settings and underlying parameters are shown below.
## Manual Control Loss Failsafe
The manual control loss failsafe may be triggered if the connection to the [RC transmitter](../getting_started/rc_transmitter_receiver.md) or [joystick](../config/joystick.md) is lost, and there is no fallback.
If using an [RC transmitter](../getting_started/rc_transmitter_receiver.md) this is triggered if the RC [transmitter link is lost](../getting_started/rc_transmitter_receiver.md#set-signal-loss-behaviour).
If using [joysticks](../config/joystick.md) connected over a MAVLink data link, this is triggered if the joysticks are disconnected or the data link is lost.
::: info
PX4 and the receiver may also need to be configured in order to _detect RC loss_: [Radio Setup > RC Loss Detection](../config/radio.md#rc-loss-detection).
:::
A [Manual Control Loss Failsafe](../config/safety.md#manual-control-loss-failsafe) is triggered after a [manual control loss timeout](#COM_RC_LOSS_T) in which none of the configured [Manual Controllers](../config/manual_control.md) are available.
![Safety - RC Loss (QGC)](../../assets/qgc/setup/safety/safety_rc_loss.png)
The QGCroundControl Safety UI allows you to set the [failsafe action](#failsafe-actions) and [manual control loss timeout](#COM_RC_LOSS_T).
Users that want to disable this failsafe in specific modes can do so using the parameter [COM_RCL_EXCEPT](#COM_RCL_EXCEPT).
::: info
PX4 and the receiver may also need to be configured in order to _detect RC loss_: [Radio Setup > RC Loss Detection](../config/radio.md#rc-loss-detection).
:::
Additional (and underlying) parameter settings are shown below.
| Parameter | Setting | Description |
@@ -181,17 +179,22 @@ The following settings also apply, but are not displayed in the QGC UI.
| <a id="GF_PREDICT"></a>Preemptive geofence triggering | [GF_PREDICT](../advanced_config/parameter_reference.md#GF_PREDICT) | (Experimental) Trigger geofence if current motion of the vehicle is predicted to trigger the breach (rather than late triggering after the breach). |
| <a id="CBRK_FLIGHTTERM"></a>Circuit breaker for flight termination | [CBRK_FLIGHTTERM](../advanced_config/parameter_reference.md#CBRK_FLIGHTTERM) | Enables/Disables flight termination action (disabled by default). |
## Position (GNSS) Loss Failsafe
## Position Estimation Failsafes
This section describes failsafes related to the quality of the vehicle's position estimate.
### Position Loss Failsafe
The _Position Loss Failsafe_ is triggered if the quality of the PX4 position estimate falls below acceptable levels (this might be caused by GPS loss) while in a mode that requires an acceptable position estimate.
The sections below cover first the trigger and then the failsafe action taken by the controller.
### Position Loss Failsafe Trigger
There are basically two mechanisms in PX4 to trigger position failsafes:
The position loss failsafe triggers if the position estimate becomes _invalid_. There are two mechanisms in PX4 to invalidate the position estimate:
- A timeout since the last sensor data was fused that provides direct speed or horizontal position measurements. Sensors that fall into that category are: GNSS, optical flow, airspeed, VIO, auxiliary global position.
- The estimated horizontal position accuracy exceeds a certain threshold. This check is only done on hovering systems (rotary wing vehicles or VTOLs in hover phase).
- A timeout since the last sensor data was fused that provides direct speed or horizontal position measurements.
- Sensors that fall into that category are: GNSS, optical flow, airspeed, VIO, auxiliary global position.
- The estimated horizontal position inaccuracy exceeds the threshold [COM_POS_LOW_EPH](../advanced_config/parameter_reference.md#COM_POS_LOW_EPH)
- This check is only done on hovering systems (rotary-wing vehicles or VTOLs in hover phase). For fixed-wing vehicles, refer to the [Position Accuracy Low](#position-accuracy-low-failsafe) section.
The relevant parameters shown below.
@@ -207,14 +210,24 @@ Multicopters will switch to [Altitude mode](../flight_modes_mc/altitude.md) if a
Fixed-wing planes, and VTOLs not configured to land in hover ([NAV_FORCE_VT](../advanced_config/parameter_reference.md#NAV_FORCE_VT)), have a parameter ([FW_GPSF_LT](../advanced_config/parameter_reference.md#FW_GPSF_LT)) that defines how long they will loiter (circle with a constant roll angle ([FW_GPSF_R](../advanced_config/parameter_reference.md#FW_GPSF_R)) at the current altitude) after losing position before attempting to land.
If VTOLs have are configured to switch to hover for landing ([NAV_FORCE_VT](../advanced_config/parameter_reference.md#NAV_FORCE_VT)) then they will first transition and then descend.
The relevant parameters for all vehicles shown below.
The relevant parameters are:
Parameters that only affect Fixed-wing vehicles:
| Parameter | Description |
| ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="FW_GPSF_LT"></a>[FW_GPSF_LT](../advanced_config/parameter_reference.md#FW_GPSF_LT) | Fixed-wing only: Loiter time (waiting at current altitude for position estimation recovery before starting to descend). Set to 0 to disable. |
| <a id="FW_GPSF_R"></a>[FW_GPSF_R](../advanced_config/parameter_reference.md#FW_GPSF_R) | Fixed roll/bank angle while circling. |
| <a id="NAV_FORCE_VT"></a>[NAV_FORCE_VT](../advanced_config/parameter_reference.md#NAV_FORCE_VT) | If true, force VTOL takeoff and landing, even in `Descend` failsafe. |
| Parameter | Description |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| <a id="FW_GPSF_LT"></a>[FW_GPSF_LT](../advanced_config/parameter_reference.md#FW_GPSF_LT) | Loiter time (waiting for GPS recovery before it goes into land or flight termination). Set to 0 to disable. |
| <a id="FW_GPSF_R"></a>[FW_GPSF_R](../advanced_config/parameter_reference.md#FW_GPSF_R) | Fixed roll/bank angle while circling. |
### Position Accuracy Low Failsafe
In Fixed-wing, the position estimate is never strictly invalidated as long as we have a horizontal aiding source, such as an airspeed sensor. In that case, a separate failsafe can be configured that triggers if the position estimate inacuraccy exceeds the threshold [COM_POS_LOW_EPH](../advanced_config/parameter_reference.md#COM_POS_LOW_EPH). The failsafe action is taken if the vehicle is in mission or hold mode, otherwise it is only a warning. The relevant parameters are:
| Parameter | Description |
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| <a id="COM_POS_LOW_EPH"></a>[COM_POS_LOW_EPH](../advanced_config/parameter_reference.md#COM_POS_LOW_EPH) | Position inaccuracy threshold above which COM_POS_LOW_ACT is taken. |
| <a id="COM_POS_LOW_ACT"></a>[COM_POS_LOW_ACT](../advanced_config/parameter_reference.md#COM_POS_LOW_ACT) | Failsafe action taken when position inaccuracy is above configured threshold. |
Note that if there is no horizontal aiding source anymore, the position estimate is invalidated after `EKF2_NOAID_TOUT`, and the standard position loss failsafe applies.
## Offboard Loss Failsafe
@@ -95,7 +95,7 @@ It should be set to a value which ensures that the vehicle reaches a high enough
[VT_TRANS_TIMEOUT](../advanced_config/parameter_reference.md#VT_TRANS_TIMEOUT)
This specifies the upper limit for the duration of the front transition. If the vehicle has not reached the transition airspeed after this time, then the transition will be aborted and a [Quadchute](../config/safety.md#quad-chute-failsafe) event will be triggered.
:::note
::: info
Additionally, if an airspeed sensor is present, the transition will also be aborted if the airspeed has not reached [VT_ARSP_BLEND](../advanced_config/parameter_reference.md#VT_ARSP_BLEND) after the openloop transition time [VT_F_TR_OL_TM](../advanced_config/parameter_reference.md#VT_F_TR_OL_TM) has elapsed. This checks is used to avoid a scenario where the vehicle gains excessive speed when the airspeed sensor is faulty.
:::
+1 -1
View File
@@ -106,7 +106,7 @@ You can also start your simulation, and _then_ attach `gdb`:
```
As the script runs, note the **SITL COMMAND:** output text located right above the large "PX4" text.
It will list the location of your px4 bin file for later use.
It will list the location of your PX4 bin file for later use.
```sh
SITL COMMAND: "<px4 bin file>" "<build dir>"/etc
+18 -41
View File
@@ -39,15 +39,6 @@ Navigate into the **PX4-Autopilot** directory and start [Gazebo SITL](../sim_gaz
make px4_sitl gz_x500
```
::: details If you installed Gazebo Classic
Start [Gazebo Classic SITL](../sim_gazebo_classic/index.md) using the following command:
```sh
make px4_sitl gazebo-classic
```
:::
This will bring up the PX4 console:
![PX4 Console](../../assets/toolchain/console_gazebo.png)
@@ -88,6 +79,16 @@ cd PX4-Autopilot
make px4_fmu-v5_default
```
:::tip
You can also build using the [px4-dev Docker container](../test_and_ci/docker.md) without installing the toolchain locally.
From the PX4-Autopilot directory:
```sh
./Tools/docker_run.sh 'make px4_fmu-v5_default'
```
:::
A successful run will end with similar output to:
```sh
@@ -126,7 +127,8 @@ The following list shows the build commands for the [Pixhawk standard](../flight
- [Pixhawk 1 (FMUv2)](../flight_controller/pixhawk.md): `make px4_fmu-v2_default`
:::warning
You **must** use a supported version of GCC to build this board (e.g. the same as used by [CI/docker](../test_and_ci/docker.md)) or remove modules from the build. Building with an unsupported GCC may fail, as PX4 is close to the board's 1MB flash limit.
You **must** use a supported version of GCC to build this board (e.g. the `gcc-arm-none-eabi` package from the current Ubuntu LTS, which is the same toolchain used by CI) or remove modules from the build.
Building with an unsupported GCC may fail, as PX4 is close to the board's 1MB flash limit.
:::
- Pixhawk 1 with 2 MB flash: `make px4_fmu-v3_default`
@@ -191,7 +193,7 @@ The `region 'flash' overflowed by XXXX bytes` error indicates that the firmware
This is common for `make px4_fmu-v2_default` builds, where the flash size is limited to 1MB.
If you're building the _vanilla_ master branch, the most likely cause is using an unsupported version of GCC.
In this case, install the version specified in the [Developer Toolchain](../dev_setup/dev_env.md) instructions.
In this case, install the `gcc-arm-none-eabi` package from the current Ubuntu LTS as described in the [Developer Toolchain](../dev_setup/dev_env.md) instructions.
If building your own branch, it is possible that you have increased the firmware size over the 1MB limit.
In this case you will need to remove any drivers/modules that you don't need from the build.
@@ -204,7 +206,7 @@ The PX4 build system opens a large number of files, so you may exceed this numbe
The build toolchain will then report `Too many open files` for many files, as shown below:
```sh
/usr/local/Cellar/gcc-arm-none-eabi/20171218/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: cannot find NuttX/nuttx/fs/libfs.a: Too many open files
arm-none-eabi-ld: cannot find NuttX/nuttx/fs/libfs.a: Too many open files
```
The solution is to increase the maximum allowed number of open files (e.g. to 300).
@@ -227,34 +229,9 @@ xcode-select --install
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/
```
### Ubuntu 18.04: Compile errors involving arm_none_eabi_gcc
Build issues related to `arm_none_eabi_gcc`may be due to a broken g++ toolchain installation.
You can verify that this is the case by checking for missing dependencies using:
```sh
arm-none-eabi-gcc --version
arm-none-eabi-g++ --version
arm-none-eabi-gdb --version
arm-none-eabi-size --version
```
Example of bash output with missing dependencies:
```sh
arm-none-eabi-gdb --version
arm-none-eabi-gdb: command not found
```
This can be resolved by removing and [reinstalling the compiler](https://askubuntu.com/questions/1243252/how-to-install-arm-none-eabi-gdb-on-ubuntu-20-04-lts-focal-fossa).
### Ubuntu 18.04: Visual Studio Code is unable to watch for file changes in this large workspace
See [Visual Studio Code IDE (VSCode) > Troubleshooting](../dev_setup/vscode.md#troubleshooting).
### Failed to import Python packages
"Failed to import" errors when running the `make px4_sitl jmavsim` command indicates that some Python packages are not installed (where expected).
"Failed to import" errors when running the `make px4_sitl gz_x500` command indicates that some Python packages are not installed (where expected).
```sh
Failed to import jinja2: No module named 'jinja2'
@@ -262,12 +239,12 @@ You may need to install it using:
pip3 install --user jinja2
```
If you have already installed these dependencies this may be because there is more than one Python version on the computer (e.g. Python 2.7.16 Python 3.8.3), and the module is not present in the version used by the build toolchain.
If you have already installed these dependencies this may be because there is more than one Python version on the computer (e.g. Python 2.7.16 and Python 3.8.3), and the module is not present in the version used by the build toolchain.
You should be able to fix this by explicitly installing the dependencies as shown:
You should be able to fix this by installing the dependencies from the repository's requirements file:
```sh
pip3 install --user pyserial empty toml numpy pandas jinja2 pyyaml pyros-genmsg packaging
pip3 install --user -r Tools/setup/requirements.txt
```
## PX4 Make Build Targets
+4 -4
View File
@@ -20,7 +20,7 @@ The equipment below is highly recommended:
:::
- Lenovo Thinkpad with i5-core running Windows 11
- MacBook Pro (early 2015 and later) with macOS 10.15 or later
- Lenovo Thinkpad i5 with Ubuntu Linux 20.04 or later
- Lenovo Thinkpad i5 with Ubuntu Linux 22.04 or later
- **Ground control station** (computer or tablet):
- iPad (may require Wifi telemetry adapter)
@@ -39,9 +39,9 @@ Install the [QGroundControl Daily Build](../dev_setup/qgc_daily_build.md) for a
To configure the vehicle:
1. [Install PX4 firmware](../config/firmware.md#installing-px4-main-beta-or-custom-firmware) (including "custom" firmware with your own changes).
1. [Start with the airframe](../config/airframe.md) that best-matches your vehicle from the [airframe reference](../airframes/airframe_reference.md).
1. [Basic Configuration](../config/index.md) explains how to perform basic configuration.
1. [Parameter Configuration](../advanced_config/parameters.md) explains how you can find and modify individual parameters.
2. [Start with the airframe](../config/airframe.md) that best-matches your vehicle from the [airframe reference](../airframes/airframe_reference.md).
3. [Basic Configuration](../config/index.md) explains how to perform basic configuration.
4. [Parameter Configuration](../advanced_config/parameters.md) explains how you can find and modify individual parameters.
::: info
+3 -3
View File
@@ -2,7 +2,7 @@
The _supported platforms_ for PX4 development are:
- [Ubuntu Linux (24.04/22.04)](../dev_setup/dev_env_linux_ubuntu.md) — Recommended
- [Ubuntu Linux (24.04/22.04)](../dev_setup/dev_env_linux_ubuntu.md)
- [Windows (10/11)](../dev_setup/dev_env_windows_wsl.md) — via WSL2
- [macOS](../dev_setup/dev_env_mac.md)
@@ -15,9 +15,9 @@ The table below shows what PX4 targets you can build on each OS.
| **NuttX based hardware:** [Pixhawk Series](../flight_controller/pixhawk_series.md), [Crazyflie](../complete_vehicles_mc/crazyflie2.md) | ✓ | ✓ | ✓ |
| **Linux-based hardware:** [Raspberry Pi 2/3](../flight_controller/raspberry_pi_navio2.md) | ✓ | | |
| **Simulation:** [Gazebo SITL](../sim_gazebo_gz/index.md) | ✓ | ✓ | ✓ |
| **Simulation:** [Gazebo Classic SITL](../sim_gazebo_classic/index.md) | ✓ | ✓ | ✓ |
| **Simulation:** [ROS with Gazebo Classic](../simulation/ros_interface.md) | ✓ | | ✓ |
| **Simulation:** ROS 2 with Gazebo | ✓ | | ✓ |
| **Simulation:** [Gazebo Classic SITL](../sim_gazebo_classic/index.md) | | ✓ | ✓ |
| **Simulation:** [ROS with Gazebo Classic](../simulation/ros_interface.md) | | | ✓ |
Experienced Docker users can also build with the containers used by our continuous integration system: [Docker Containers](../test_and_ci/docker.md)
+3 -2
View File
@@ -39,8 +39,9 @@ You may want to also install `python-pip` and `screen`.
Execute the script below to install GCC 7-2017-q4:
:::warning
This version of GCC is out of date.
At time of writing the current version on Ubuntu is `9-2020-q2-update` (see [focal nuttx docker file](https://github.com/PX4/PX4-containers/blob/master/docker/Dockerfile_nuttx-focal#L28))
This version of GCC is very outdated.
PX4 now uses the `gcc-arm-none-eabi` package from the current Ubuntu LTS (GCC 13.2.1 on Ubuntu 24.04).
This CentOS guide is community-maintained and may not produce working builds.
:::
```sh
+9 -16
View File
@@ -4,20 +4,14 @@ The following instructions use a bash script to set up the PX4 development envir
The environment includes:
- [Gazebo Simulator](../sim_gazebo_gz/index.md) ("Harmonic")
- [Build toolchain for Pixhawk (and other NuttX-based hardware)](../dev_setup/building_px4.md#nuttx-pixhawk-based-boards).
On Ubuntu 22.04:
- [Gazebo Classic Simulator](../sim_gazebo_classic/index.md) can be used instead of Gazebo.
Gazebo is nearing feature-parity with Gazebo-Classic on PX4, and will soon replace it for all use cases.
- [Gazebo Simulator](../sim_gazebo_gz/index.md) (Gazebo Harmonic)
- [Build toolchain for Pixhawk (and other NuttX-based hardware)](../dev_setup/building_px4.md#nuttx-pixhawk-based-boards) using the `gcc-arm-none-eabi` compiler from the Ubuntu package manager.
The build toolchain for other flight controllers, simulators, and working with ROS are discussed in the [Other Targets](#other-targets) section below.
::: details Can I use an older version of Ubuntu?
PX4 supports the current and last Ubuntu LTS release where possible.
Older releases are not supported (so you can't raise defects against them), but may still work.
For example, Gazebo Classic setup is included in our standard build instructions for macOS, Ubuntu 18.04 and 20.04, and Windows on WSL2 for the same hosts.
::: info
PX4 targets the **current Ubuntu LTS** (24.04) for CI and release builds, with the **previous LTS** (22.04) also supported.
Older Ubuntu versions are not supported and may not work.
:::
## Simulation and NuttX (Pixhawk) Targets
@@ -50,19 +44,18 @@ To install the toolchain:
- Acknowledge any prompts as the script progress.
- You can use the `--no-nuttx` and `--no-sim-tools` options to omit the NuttX and/or simulation tools.
3. If you need Gazebo Classic (Ubuntu 22.04 only) then you can manually remove Gazebo and install it by following the instructions in [Gazebo Classic > Installation](../sim_gazebo_classic/index.md#installation).
4. Restart the computer on completion.
3. Restart the computer on completion.
:::details Additional notes
These notes are provided "for information only":
- This setup is supported by the PX4 Dev Team.
The instructions may also work on other Debian Linux based systems.
- You can verify the NuttX installation by confirming the `gcc` version as shown:
- You can verify the NuttX installation by confirming `gcc` is available.
The version depends on your Ubuntu release (e.g. GCC 13.2.1 on Ubuntu 24.04):
```sh
$arm-none-eabi-gcc --version
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009
Copyright (C) 2023 Free Software Foundation, Inc.
+84 -76
View File
@@ -1,111 +1,119 @@
# macOS Development Environment
The following instructions set up a PX4 development environment for macOS.
The following instructions set up a PX4 development environment on macOS.
This environment can be used to build PX4 for:
- Pixhawk and other NuttX-based hardware
- [Gazebo Classic Simulation](../sim_gazebo_classic/index.md)
- [Gazebo Simulation](../sim_gazebo_gz/index.md) (Gazebo Harmonic)
It works on both Intel and Apple Silicon Macs.
:::tip
This setup is supported by the PX4 dev team.
To build other targets you will need to use a [different OS](../dev_setup/dev_env.md#supported-targets) (or an [unsupported development environment](../advanced/community_supported_dev_env.md)).
To build for [other targets](../dev_setup/dev_env.md#supported-targets) you will need to use a [different OS](../dev_setup/dev_env.md#supported-targets) or an [unsupported development environment](../advanced/community_supported_dev_env.md).
:::
## Video Guide
## Development Environment Setup
<lite-youtube videoid="tMbMGiMs1cQ" title="Setting up your PX4 development environment on macOS"/>
### Prerequisites
## Base Setup
The "base" macOS setup installs the tools needed for building firmware, and includes the common tools that will be needed for installing/using the simulators.
### Environment Setup
:::details Apple Silicon MacBook users!
If you have an Apple M1, M2 etc. MacBook, make sure to run the terminal as x86 by setting up an x86 terminal:
1. Locate the Terminal application within the Utilities folder (**Finder > Go menu > Utilities**)
2. Select _Terminal.app_ and right-click on it, then choose **Duplicate**.
3. Rename the duplicated Terminal app, e.g. to _x86 Terminal_
4. Now select the renamed _x86 Terminal_ app and right-click and choose \*_Get Info_
5. Check the box for **Open using Rosetta**, then close the window
6. Run the _x86 Terminal_ as usual, which will fully support the current PX4 toolchain
:::
First set up the environment
1. Enable more open files by appending the following line to the `~/.zshenv` file (creating it if necessary):
1. **Install Xcode Command Line Tools** — provides `git`, `make`, and the Apple `clang` compiler:
```sh
echo ulimit -S -n 2048 >> ~/.zshenv
xcode-select --install
```
2. **Install Homebrew** by following the [installation instructions](https://brew.sh).
3. **Increase the open-file limit.** The PX4 build opens many files simultaneously and the macOS default limit (256) is too low — you may see `"LD: too many open files"` errors without this.
Add the following line to your shell startup file so it applies to every new terminal session.
macOS defaults to **zsh** since Catalina, so add it to `~/.zshrc` (use `~/.bashrc` if you use bash):
```sh
echo "ulimit -S -n 2048" >> ~/.zshrc
```
Then **open a new terminal** (or run `source ~/.zshrc`) for the change to take effect.
4. **Ensure Python 3 is available.** Some PX4 build scripts require `python3` and `pip3` to be in your `PATH`. The Xcode Command Line Tools include Python 3 by default.
:::tip
If you need to install or manage a different Python version, we recommend [pyenv](https://github.com/pyenv/pyenv), which lets you set global and per-directory Python versions.
:::
### Install Development Tools
1. **Download PX4 Source Code:**
```sh
git clone https://github.com/PX4/PX4-Autopilot.git
cd PX4-Autopilot
git submodule update --init --recursive --force
```
2. **Install development environment libraries** from the [macos.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/setup/macos.sh) helper script:
```sh
./Tools/setup/macos.sh --sim-tools
```
This installs:
- **`px4-dev`** — ARM cross-compiler (`arm-gcc-bin@13`), `cmake`, `ninja`, `ccache`, and other build tools
- **Python packages** from `requirements.txt`
- **`px4-sim`** (via `--sim-tools`) — Gazebo Harmonic simulation (`gz-harmonic`) and related tools
::: info
If you don't do this, the build toolchain may report the error: `"LD: too many open files"`
Omit `--sim-tools` if you only need to build for NuttX hardware and don't need simulation.
Use `--reinstall` to force reinstallation of all Homebrew formulas (useful if something is broken).
:::
1. Enforce Python 3 by appending the following lines to `~/.zshenv`
### Gazebo Simulation
```sh
# Point pip3 to macOS system python 3 pip
alias pip3=/usr/bin/pip3
```
The `--sim-tools` flag installs the `px4-sim` Homebrew formula, which pulls in Gazebo Harmonic.
### Common Tools
If you skipped `--sim-tools` during initial setup and want to add simulation later:
To setup the environment to be able to build for Pixhawk/NuttX hardware (and install the common tools for using simulators):
```sh
brew tap PX4/px4
brew install px4-sim
```
1. Install Homebrew by following these [installation instructions](https://brew.sh).
1. Run these commands in your shell to install the common tools:
::: info
Gazebo requires **XQuartz** for display on macOS.
If you don't already have it installed:
```sh
brew tap PX4/px4
brew install px4-dev
```
```sh
brew install --cask xquartz
```
1. Install the required Python packages:
You may need to log out and back in after installing XQuartz.
:::
```sh
# install required packages using pip3
python3 -m pip install --user pyserial empty toml numpy pandas jinja2 pyyaml pyros-genmsg packaging kconfiglib future jsonschema
# if this fails with a permissions error, your Python install is in a system path - use this command instead:
sudo -H python3 -m pip install --user pyserial empty toml numpy pandas jinja2 pyyaml pyros-genmsg packaging kconfiglib future jsonschema
```
### Verify Installation
## Gazebo Classic Simulation
After installation, verify the key tools are available:
To setup the environment for [Gazebo Classic](../sim_gazebo_classic/index.md) simulation:
```sh
# NuttX cross-compiler (from arm-gcc-bin@13)
arm-none-eabi-gcc --version
1. Run the following commands in your shell:
# Build tools
cmake --version
ninja --version
```sh
brew unlink tbb
sed -i.bak '/disable! date:/s/^/ /; /disable! date:/s/./#/3' $(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula/tbb@2020.rb
brew install tbb@2020
brew link tbb@2020
```
# Gazebo (if --sim-tools was used)
gz sim --versions
```
::: info
September 2021: The commands above are a workaround to this bug: [PX4-Autopilot#17644](https://github.com/PX4/PX4-Autopilot/issues/17644).
They can be removed once it is fixed (along with this note).
:::
Quick smoke test — build and run a simulation target:
1. To install SITL simulation with Gazebo Classic:
```sh
make px4_sitl gz_x500
```
```sh
brew install --cask temurin
brew install --cask xquartz
brew install px4-sim-gazebo
```
1. Run the macOS setup script: `PX4-Autopilot/Tools/setup/macos.sh`
The easiest way to do this is to clone the PX4 source, and then run the script from the directory, as shown:
```sh
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
cd PX4-Autopilot/Tools/setup
sh macos.sh
```
If everything is set up correctly, this will build PX4 SITL and launch a Gazebo simulation with the x500 quadcopter.
## Next Steps
@@ -114,7 +122,7 @@ Once you have finished setting up the command-line toolchain:
- Install [VSCode](../dev_setup/vscode.md) (if you prefer using an IDE to the command line).
- Install the [QGroundControl Daily Build](../dev_setup/qgc_daily_build.md)
:::tip
::: tip
The _daily build_ includes development tools that are hidden in release builds.
It may also provide access to new PX4 features that are not yet supported in release builds.
:::
+8 -8
View File
@@ -58,20 +58,20 @@ To install WSL2 with Ubuntu on a new installation of Windows 10 or 11:
wsl --install
```
- Ubuntu 20.04 ([Gazebo-Classic Simulation](../sim_gazebo_classic/index.md))
```sh
wsl --install -d Ubuntu-20.04
```
- Ubuntu 22.04 ([Gazebo Simulation](../sim_gazebo_gz/index.md))
```sh
wsl --install -d Ubuntu-22.04
```
- Ubuntu 24.04 ([Gazebo Simulation](../sim_gazebo_gz/index.md))
```sh
wsl --install -d Ubuntu-24.04
```
::: info
You can also install[Ubuntu 20.04](https://www.microsoft.com/store/productId/9MTTCL66CPXJ) and [Ubuntu 22.04](https://www.microsoft.com/store/productId/9PN20MSR04DW) from the store, which allows you to delete the application using the normal Windows Add/Remove settings:
You can also [Ubuntu 24.04](https://www.microsoft.com/store/productId/9nz3klhxdjp5) or [Ubuntu 22.04](https://www.microsoft.com/store/productId/9PN20MSR04DW) from Microsoft Store, which allows you to delete the application using the normal Windows Add/Remove settings.
:::
1. WSL will prompt you for a user name and password for the Ubuntu installation.
@@ -106,7 +106,7 @@ To open a WSL shell using a command prompt:
```
```sh
wsl -d Ubuntu-20.04
wsl -d Ubuntu-24.04
```
If you only have one version of Ubuntu, you can just use `wsl`.
+2 -2
View File
@@ -124,10 +124,10 @@ Once that is done you don't need to do anything else; the toolchain will automat
This section includes guidance on setup and build errors.
### Ubuntu 18.04: "Visual Studio Code is unable to watch for file changes in this large workspace"
### "Visual Studio Code is unable to watch for file changes in this large workspace"
This error surfaces on startup.
On some systems, there is an upper-limit of 8192 file handles imposed on applications, which means that VSCode might not be able to detect file modifications in `/PX4-Autopilot`.
On some systems, there is an upper-limit on file handles imposed on applications, which means that VSCode might not be able to detect file modifications in `/PX4-Autopilot`.
You can increase this limit to avoid the error, at the expense of memory consumption.
Follow the [instructions here](https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc).
+16
View File
@@ -281,6 +281,22 @@ PX4 DroneCAN parameters:
Select the specific CAN interface(s) used for ESC data output using the [UAVCAN_ESC_IFACE](../advanced_config/parameter_reference.md#UAVCAN_ESC_IFACE) parameter (all that all interfaces are selected by default).
Note that DroneCAN ESCs should be on their own dedicated CAN interface(s) because ESC messages can saturate the bus and starve other nodes of bandwidth.
### Lights
PX4 can control LEDs via DroneCAN [LightsCommand](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#lightscommand) messages.
Configuration:
1. Set [UAVCAN_LGT_NUM](../advanced_config/parameter_reference.md#UAVCAN_LGT_NUM) to the number of lights (0 disables, maximum 2). You need to reboot and reopen the ground station to have parameters for new instances available.
2. [UAVCAN_LGT_MODE](../advanced_config/parameter_reference.md#UAVCAN_LGT_MODE) controls when lights should be in active state (always off, when armed, when prearmed, always on).
3. For each light slot (0 to NUM-1), set:
- `UAVCAN_LGT_IDx`: The `light_id` matching your peripheral.
- `UAVCAN_LGT_FNx`: The light function. Available options:
- System status light
- Static colors which light up when `UAVCAN_LGT_MODE` is active.
- Hybrid modes where the Status is shown when `UAVCAN_LGT_MODE` is inactive, and a static color when active.
4. Reboot for changes to take effect.
## QGC CANNODE Parameter Configuration
QGroundControl can inspect and modify parameters belonging to CAN devices attached to the flight controller, provided the device are connected to the flight controller before QGC is started.
@@ -1,18 +1,18 @@
# Accton Godwit G-A1
:::warning
::: warning
PX4 does not manufacture this (or any) autopilot.
Contact the [manufacturer](https://cubepilot.org/#/home) for hardware support or compliance issues.
:::
The G-A1 is a state-of-the-art flight controller developed derived from the [Pixhawk Autopilot v6X Standard](https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-012%20Pixhawk%20Autopilot%20v6X%20Standard.pdf).
The G-A1 is a state-of-the-art flight controller derived from the [Pixhawk Autopilot v6X Standard](https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-012%20Pixhawk%20Autopilot%20v6X%20Standard.pdf).
It includes an STM32H753 double-precision floating-point FMU processor and an STM32F103 IO coprocessor, multiple IMUs with 6-axis inertial sensors, two pressure/temperature sensors, and a geomagnetic sensor.
It also has independent buses and power supplies, and is designed for safety and rich expansion capabilities.
With an integrated 10/100M Ethernet Physical Layer (PHY), the G-A1 can also communicate with a mission computer (airborne computer), high-end surveying and mapping cameras, and other UxV-mounted equipment for high-speed communications, meeting the needs of advanced UxV systems.
:::tip
::: tip
Visit [Accton-IoT Godwit](https://www.accton-iot.com/godwit/) for more information.
:::
@@ -65,7 +65,7 @@ This flight controller is [manufacturer supported](../flight_controller/autopilo
- 92.2 (L) x 51.2 (W) x 28.3 (H) mm
- 77.6g (carrier board with IMU)
## Where to Buy
## Where to Buy {#store}
- [Accton-IoT Godwit](https://www.accton-iot.com/godwit/)
- [sales@accton-iot.com](sales@accton-iot.com)
@@ -115,7 +115,7 @@ PPM receivers should be connected to the PPM interface. And other RC systems can
## GPS/Compass
The Godwit G-A1 has a built-in compass
The Godwit G-A1 has a built-in compass.
Due to potential interference, the autopilot is usually used with an external I2C compass as part of a GPS/Compass combination.
![G-A1 GPS](../../assets/flight_controller/accton-godwit/ga1/gps.png "G-A1 GPS")
+6 -6
View File
@@ -1,6 +1,6 @@
# Sky-Drones AIRLink
:::warning
::: warning
PX4 does not manufacture this (or any) autopilot.
Contact the [manufacturer](https://sky-drones.com/) for hardware support or compliance issues.
:::
@@ -26,7 +26,7 @@ AIRLink has two computers and integrated LTE Module:
## Specifications
- **Sensors**
- 3x Accelerometers, 3x Gyroscopes, 3x Magnetometers, 3x Pressure sensorss
- 3x Accelerometers, 3x Gyroscopes, 3x Magnetometers, 3x Pressure sensors
- GNSS, Rangefinders, Lidars, Optical Flow, Cameras
- 3x-redundant IMU
- Vibration dampening
@@ -71,7 +71,7 @@ AIRLink has two computers and integrated LTE Module:
- Antenna, 4x4 MIMO
- Bands: Worldwide
## Where to Buy
## Where to Buy {#store}
Purchase from the original Sky-Drones Store (worldwide shipping with 1-2 days order processing time):
@@ -92,7 +92,7 @@ The standard set contains:
- 1x FPV camera with CSI cable
- 1x WiFi antenna with MMCX connector
- 2x/4x LTE/5G antenna with MMCX connector
- 1x HDMI to mini HDMI cable1x set of cables (7 cables for all connectors)
- 1x HDMI to mini HDMI cable, 1x set of cables (7 cables for all connectors)
[AIRLink Telemetry](https://sky-drones.com/sets/airlink-telemetry-set.html) based on the Microhard LAN/IP-based RF micromodule is available as an add-on and is fully compatible with AIRLink.
@@ -344,14 +344,14 @@ AIRLink has 16 PWM ouputs. Main outputs 1-8 and connected to IO MCU. AUX outputs
## Building Firmware
:::tip
::: tip
Most users will not need to build this firmware!
It is pre-built and automatically installed by _QGroundControl_ when appropriate hardware is connected.
:::
To [build PX4](../dev_setup/building_px4.md) for this target:
```
```sh
make sky-drones_smartap-airlink
```

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