646 Commits

Author SHA1 Message Date
Jacob Dahl
882bee610d
feat(logger): add sensor_baro to high rate sensors logging profile (#26834) 2026-03-20 00:46:43 -08:00
Jacob Dahl
f00e46f618
feat(dshot): Extended Telemetry and EEPROM support
Overhauls the DShot driver with per-timer BDShot selection, multi-timer                                                                                                                                  
sequential capture, Extended DShot Telemetry (EDT), and AM32 ESC EEPROM                                                                                                                                  
read/write via MAVLink. Expands ESC support from 8 to 12 channels.                                                                                                                                       
                                                                                                                                                                                                   
BDShot:                                                                                                                                                                                                  
- Per-timer BDShot protocol selection via actuator config UI                                                                                                                                             
- Multi-timer sequential burst/capture on any DMA-capable timer                                                                                                                                          
- Adaptive per-channel GCR bitstream decoding                                                                                                                                                            
- Per-channel online/offline detection with hysteresis                                                                                                                                                   
                                                                                                                                                                                                   
Extended DShot Telemetry (EDT):                                                                                                                                                                          
- Temperature, voltage, current from BDShot frames (no serial wire)                                                                                                                                      
- New DSHOT_BIDIR_EDT parameter                                                                                                                                     
- EDT data merged with serial telemetry when both available                                                                                                                                              
                                                                                                                                                                                                   
AM32 EEPROM:                                                                                                                                                                                             
- Read/write AM32 ESC settings via MAVLink ESC_EEPROM message                                                                                                                                            
- ESCSettingsInterface abstraction for future ESC firmware types                                                                                                                                         
- New DSHOT_ESC_TYPE parameter                                                                                                                                                                           
                                                                                                                                                                                                   
Other changes:                                                                                                                                                                                           
- Per-motor pole count params DSHOT_MOT_POL1–12 (replaces MOT_POLE_COUNT)                                                                                                                              
- EscStatus/EscReport expanded to 12 ESCs with uint16 bitmasks                                                                                                                                           
- Numerous bounds-check, overflow, and concurrency fixes                                                                                                                                                 
- Updated DShot documentation
2026-03-17 16:38:33 -08:00
ttechnick
c4330f5a47 feat(fw_att_control): tilt-tracking controller 2026-03-17 17:59:20 +01:00
ttechnick
e370b3f4b8 feat(fw_att_control): Add Initial Quat Controller + Debug topic
This commit introduces a new control mode for fixed-wing aircraft that
utilizes Euler angles for attitude control.
Additionally, a new logged topic has been added to facilitate debugging and
monitoring of the Euler rates setpoints during flight.
2026-03-17 17:59:20 +01:00
Jacob Dahl
88a57c5b65 logger: add sensor_gnss_relative to High Rate Sensors 2026-03-04 10:10:16 -09:00
CaFeZn
963a776fa6
feat(heater): Add multi-instance support for heaters (#26325)
* heater: add multi-instance support, refactor parameter handling, remove legacy params file

This change introduces multi-instance heater support to allow independent temperature control for multiple IMUs.

Main changes:
- Add support for multiple heater instances
- Refactor parameter handling to use per-instance parameters
- Remove the legacy parameter file and migrate to the updated parameter structure

This improves scalability and makes heater configuration consistent across setups with multiple sensors.

* Refactor heater configuration across multiple boards

- Updated heater GPIO definitions to introduce a new naming convention for better clarity and consistency.
- Replaced `GPIO_HEATER_OUTPUT` with `GPIO_HEATER1_OUTPUT` and adjusted the corresponding output enable macros.
- Changed parameter names from `SENS_TEMP_ID` to `HEATER1_IMU_ID` in various board default configurations to reflect the new heater setup.
- Ensured all affected board configurations are updated to maintain functionality with the new heater definitions.

* heater: fix missing HEATER1_OUTPUT_EN control

* heater: fix more missing HEATER1_OUTPUT_EN control

* heater: tidy config, docs, and instance handling

- Remove unused controller period member and use CONTROLLER_PERIOD_DEFAULT
- Improve HEATER${i}_IMU_ID description and instance-related logging/behavior
- Add a guard when HEATER_NUM exceeds HEATER_MAX_INSTANCES

Note: drop intermediate/reverted change around the 'celsius' spelling.

* heater: refactor constructor to remove unused parameter and add instance name function

- Remove unused ModuleParams argument from Heater constructor
- Add heater_instance_name() helper to provide per-instance work queue task names
- Use instance-specific parameter lookup (HEATER{n}_*) during initialization

Use heater_instance_name() to label each instance (heater_1/2/3) in work queue.
Also drop unused ModuleParams argument from constructor and keep per-instance
parameter handle lookup in initialization.

* format

* board: update GPIO configuration for multiple heater instances, add HEATER_NUM for boards using PX4IO

* heater: update heater control to use HEATER1_OUTPUT_EN when using PX4IO for consistency

* heater: add a TODO for px4io multi-instance

* heater: update missing GPIO_HEATER1_OUTPUT in  sky-drones

* heater: fix multiple newlines at EOF (resolve CI check failure)

* heater: switch to PublicationMulti for heater_status and log multi-instance

- Changed _heater_status_pub from Publication to PublicationMulti to support independent per-instance publications without overwriting.
- Updated logged_topics.cpp to use add_optional_topic_multi("heater_status")

This fixes the issue where multiple heater instances were writing to the same heater_status topic, causing data overwriting and incorrect update rates in logs.

---------

Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2026-03-02 12:13:08 -09: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
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
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
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
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
Julian Oes
d411e1c40d logger: increase stack size for littlefs 2026-02-10 15:23:51 +13:00
Niklas Hauser
c0c265cd1f [vtx] Add VTX driver with Tramp and SmartAudio support 2026-01-26 11:05:22 +01:00
Niklas Hauser
9cf07c2452 [logger] Ensure msg buffer is large enough for all uORB message headers 2026-01-22 17:58:04 +01:00
Phil-Engljaehringer
46d9b14ba0
Feat: Add driver for TMP102 temperature sensor for Skynode-N (#26241)
* feat: added driver for tmp102 temperature sensor

* style: removed new line

* style: adjusted date in header

* style: removed duplicated logging

* fix: moved start-up command from rc.board_sensors to rc.sensors

* style: used consexpr for expected config reg value

* feat: added retry logic to probe function

* style: added _ as prefix to global variable

* style: used make format

* fix: corrected temperature calculation

* fix: mask AL-bit in probe function

* style: removed header files from CMakeLists

* style: used correct english in comments

* refactor: return error right after failure

* style: moved init call to correct place

* fix: corrected temperature calculation (again)

* refactor: removed _curr_pr variable => always have to set PR to desired register on read

* fix: add multi logged topic
2026-01-12 18:42:51 +01:00
Alex Klimaj
d8220d4948
logger: add logger_status topic to default topics (#26197) 2026-01-05 10:50:03 -09:00
Jacob Dahl
699ec30c9c
logger: gps_dump non-optional (#26096) 2025-12-17 09:59:38 -09:00
Claudio Chies
24d06047bd
UAVCAN: Add device tracking and information publishing (#25617)
* uavcan: collect node info and publish every second

* UORB: Add DeviceInformation Message

Format DeviceInformation.msg with standard comment spaces

* SENS: add getter for device_id

* UAVCAN: add publishing of DeviceInformation based on publised message type, and Node Information

* LOG: add deviceInformation

* MSG:BAT: fix comment to be inline with the max_instaces

* UAVCAN: DeviceInformation, incorporated feedback

* UAVCAN: DeviceInformation, incorporated feedback

* UAVCAN: DeviceInformation, Fixed bug with Powermonitor

---------

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
2025-12-16 14:53:44 -09:00
Balduin
8604604a5b
logged_topics: clean up old commented-out topics (#26120) 2025-12-15 09:53:24 -09:00
bresch
3646032296 fw rate: add gain compression algorithm 2025-11-27 17:33:06 +01:00
TedObrien
5483d901f9 MPC9808: Run ScheduleOnInterval() at desired publishing rate and remove elapsed time check and timestamp_sample field from message as no longer needed.
MCP9808: Replaced PX4_INFO with PX4_DEBUG

MCP9808: Update date in headers

MCP9808: Define functions before variables

MCP9808: Increase logging interval for sensor_temp

MCP9808: Removed extra space

MCP9808: Remove this->
2025-11-06 10:00:26 -09:00
TedObrien
a94ee4382b MCP9808: Create driver for MCP9808 temperature sensor 2025-11-06 10:00:26 -09:00
mahima-yoga
be29f647cb logging: log sensor_baro with add_topic_multi
Ensures external barometers (e.g., over UAVCAN) are also logged.
2025-10-06 10:19:01 +02:00
Daniel Agar
469fe62166 logger: cleanup crypto defines 2025-09-25 15:10:21 -04:00
Daniel Agar
6f4e873bce logger: only include crypto params if enabled 2025-09-25 15:10:21 -04:00
Claudio Chies
f90d6c03fc LOG: increase number of loggable batteries to 3 2025-09-22 15:02:24 +02:00
Rowan Dempster
d205d11c3d
Recovering UTC timestamps from ULog without sensor_gps (#25534)
* Added overloaded get_log_time util for fractional seconds

* Added write_info implementation for double info types

* Save boot time to .ulg via info message key boot_time_utc

* Changed time type from double to uint64_t, formatted

* Fixing get_log_time function doc
2025-09-15 16:18:26 -08:00
Alexander Lerach
8f2c36689d
logging: allow logging backend config
* logging: allow logging backend config

* correct board comments

* documentation: updated logging section
2025-08-27 15:44:36 +02:00
chfriedrich98
a1bc09a6ad
rover: seperate speed control 2025-08-20 10:54:16 +02:00
Ian Scholl
5736b948ac increase battery max logging instances to 3 2025-07-30 16:43:21 +02:00
Sindre Meyer Hegre
3be0cb077c
Neural Control Mode (#24366)
* Add tflm to px4 with module

 - Add TensorFlow Lite Micro(TFLM) as a library in px4
 - Make a module that uses neural network inference for control, which uses TFLM for inference
 - Make board config files for PX4 with neural module

* Added neural flight mode

* Add posibility to read of inference times

* Fix comments from review:

- Switch ssh link to https link in submodule
- Remove mc_nn_control from startup

* Add tflm to px4 with module

 - Add TensorFlow Lite Micro(TFLM) as a library in px4
 - Make a module that uses neural network inference for control, which uses TFLM for inference
 - Make board config files for PX4 with neural module

* Added neural flight mode

* Add posibility to read of inference times

* Remove auto start

* Add logging from neural control module

* Fix automatic startup to only be when module is included

* Switch to flight mode registration

* Add docs

* Change min/max/coeff to actual parameters

* add figures to neural network docs

* Switch to e2e network

* Remove toolchain changes and replace with instructions in docs

* Get ready for merge after toolchain upgrade

* switch back to submodule

* Try to figure out cmake

* Get CI working with new toolchain

* Remove fork dependency

* Finalize PR

* fix toolchain inclusion

* Fix ctype_base.h include

* Cleanup includes for TFLM

* Remove redundant std

* Update FW module names in board files

* Fix docs

* Remove cstdlib copy

* Copy header from nuttx

* Prettier, markup, layout

* NeuralControl.msg - update uorb comments to current standard

* Add description to neural topic

* Fix typo

* Typo

* TFLM and Module utitlities

* Neural networks top level

* Update docs

* Add manual control

* Update docs

* Revert the manual control attempt

* Update docs/en/advanced/nn_module_utilities.md

* Add posibility to set trajectory setpoint with manual control

---------

Co-authored-by: Pedro Roque <padr@kth.se>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
2025-07-25 09:42:12 -08:00
Jacob Dahl
af878cee7b
uavcan: add node status logging to uORB (#23890)
Co-authored-by: Jordan Leiber <jordan.leiber@vertiq.co>
2025-07-22 23:17:58 -08:00
Matthias Grob
d7ab21b8d6 Add battery_info message with serial number compatible with UAVCAN, MAVLink and drivers
I'm starting the separate battery info message because no char[32] should be published and logged
at high rate and we need a separate battery info message for static information as discussed.
2025-06-17 09:05:22 +02:00
Jacob Dahl
3bbe3e5268 logger: add new mask for high rate sensors 2025-05-27 08:09:28 +02:00
Silvan Fuhrer
2600946172 FW Attitude Controller: Wheel controller rework
add RunwayControl messge to pass wheel steering controls to wheel controller

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

Runway takeoff: specify that RWTO_TKOFF is directly applied during takeoff

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

msg/RateCtrlStatus: remove unused wheel_rate_integ field

The wheel rate controller is not run in the moduels that are now
running the MC/FW rate controllers, so thsi field canot be filled.

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

wheel rate controller: use speed scaler quadratically on integrator

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

wheel yaw controller: use a time constant of 0.1

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

FW Attitude Controller: lock heading setpoint for wheels to initial heading

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-05-26 14:47:38 +02:00
RomanBapst
779a55c6dc FW Position Controller rework
- split up old module into two, one handling setpoint generation, one control
- add lateral and longitudinal control setpoints topics that can also be
injected from companion computer
- add configuration topics that (optionally) configure the controller
with limits and momentary settings

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2025-05-26 14:47:38 +02:00
chfriedrich98
1857920a5f rover: clean up velocity setpoint 2025-05-13 10:23:35 +02:00
chfriedrich98
04512ee91f mecanum: separate velocity control 2025-05-05 11:38:17 +02:00
chfriedrich98
0ab9071606 differential: seperate velocity control 2025-04-29 14:49:44 +02:00
chfriedrich98
9fe98b0724 ackermann: seperate velocity control 2025-04-08 12:27:11 +02:00
Jacob Dahl
543851db50
[Sponsored by ARK] Bidirectional DShot (#23863)
* Bidirectional DShot

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

* f4/f1 support, not supported

* fix f1 build target

* sanity check timer_channel value, fix CCxNP ifdef, debug stuff

* removed debug code, added define for H7 HAVE_GTIM_CCXNP

* round robin sampling for less than 4 DMA

* unlimited esc_status logging

* dshot: fix formatting

* dshot: add define for number of DMA channels to use

This allows individual boards to override the number of DShot channels
and hence avoid round robin capture of the RPM feedback.

* ARK: enable 4 DMA channels for DShot on 6X

* dshot: publish when all channels are updated

This slows down the ESC_STATUS publication in the case of round robin
capture. E.g. for 800 Hz output with one DMA channel, the ESC_STATUS is
now published at 200 Hz.

* dshot: avoid duplicate publications for bidir and telem

Instead of publishing both bidirectional dshot updates as well as
telemetry updates, we now combine the data from both streams, and
publish whenever we get RPM updates, as the latter arrives with higher
rate, e.g. 200 Hz with round robin, or faster otherwise.

When combining the data, we take RPM from bidirectional dshot, and the
rest from telemetry.

When we have only one of the two, either telemetry or bidirectional
dshot, we just publish that one.

* boards: add ark fpv and pi6x BOARD_DMA_NUM_DSHOT_CHANNELS

* dshot: turn off debug build

---------

Co-authored-by: Julian Oes <julian@oes.ch>
Co-authored-by: alexklimaj <alex@arkelectron.com>
2025-03-12 12:55:15 -06:00
chfriedrich98
d1b0be18b2 pure_pursuit: update library 2025-03-10 11:14:00 +01:00
chfriedrich98
7c63468e8b mecanum: refactor code architecture 2025-02-25 17:06:17 +01:00
chfriedrich98
04a3c4af20
Differential Rover: Refactor and clean up, align with Ackermann rover(#24318)
* differential: refactor code architecture

* Offboard fix

* fix accel/decel slew rate
2025-02-18 18:26:38 +01:00
Silvan Fuhrer
3c129aefa1
Add IC engine control module (#24055)
Internal combustion engine control module.
New actuator functions and RPM based start/restart logic.
Not enabled by default. 

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Pernilla <pernilla@auterion.com>
2025-02-18 17:15:32 +01:00
Silvan
b916a96e00 Remove uorb topics exclusively used for avoidance
- TrajectoryBezier.msg
- TrajectoryWaypoint.msg
- VehicleTrajectoryBezier.msg
- VehicleTrajectoryWaypoint.msg

Additionally remove TRAJECTORY_REPRESENTATION_WAYPOINTS mavlink stream.

Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
Silvan
1f2dba68d2 remove avoidance library and logic
Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
chfriedrich98
55f51d7e7e ackermann: refactor code architecture 2025-02-10 15:54:24 +01:00
bresch
c76e74338b ekf-replay: fix airspeed replay
If available, the EKF uses airspeed_validated, not airspeed
2025-01-26 23:05:39 -05:00