Commit Graph

6974 Commits

Author SHA1 Message Date
Alexander Lerach 273766a4ea drivers: auav, read sensor eeprom to get cal range (#26294)
* drivers: auav, read sensor eeprom to get cal range

* added review feedback
2026-01-19 15:21:18 +01:00
Matthias Grob 473ef5fd06 uavcan: esc: fix actuator test on uavcan ESCs that consume ArmingStatus (#26255)
* uavcan esc: remove unused includes

* uavcan arming_status: disarm when terminated

To stay consistent with kill.

* uavcan: publish armed during actuator tests to make it possible spinning motors
2026-01-13 10:57:54 -09: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 27181619fc Update GPS submodule (#26238) 2026-01-08 10:24:28 -09:00
Claudio Chies 86e1356e0a Extend SENS_GPS_PRIME usage for UAVCAN GNSS devices (#26126)
* UAVCAN: extent SENS_GPS_PRIME usage to UAVCAN GNSS devices

* use convenience function

Co-authored-by: Matthias Grob <maetugr@gmail.com>

* Update src/drivers/uavcan/sensors/gnss.cpp

Co-authored-by: Øyvind Taksdal Stubhaug <o_github@oystub.com>

* Apply suggestion from @MaEtUgR

Co-authored-by: Matthias Grob <maetugr@gmail.com>

* Fix type casting in GPS prime range check

* reverted parameter default

* UAVCAN: fix and improve device_id logic (#26135)

* UAVCAN: extent SENS_GPS_PRIME usage to UAVCAN GNSS devices

* use convenience function

Co-authored-by: Matthias Grob <maetugr@gmail.com>

* Update src/drivers/uavcan/sensors/gnss.cpp

Co-authored-by: Øyvind Taksdal Stubhaug <o_github@oystub.com>

* Apply suggestion from @MaEtUgR

Co-authored-by: Matthias Grob <maetugr@gmail.com>

* Fix type casting in GPS prime range check

* UAVCAN: fix and improve device_id logic

* Added bus information to more UAVCAN drivers

* Fix device_id registration in UavcanBarometerBridge

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
Co-authored-by: Øyvind Taksdal Stubhaug <o_github@oystub.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
Co-authored-by: Øyvind Taksdal Stubhaug <o_github@oystub.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2026-01-07 10:19:07 -09:00
isentek-webbyeh b537601b7a driver: ist8310: add IST8310J device ID support (#26134)
* driver: ist8310: add IST8310J device ID support and cross-axis compensation

IST8310J shares the same register map and initialization sequence as IST8310.

This change extends the existing IST8310 driver to:
- Accept the IST8310J device ID during probe and reset
- Load factory cross-axis calibration data from OTP
- Apply cross-axis compensation to raw magnetometer samples

The cross-axis compensation corrects factory axis misalignment only and
does not replace PX4 runtime magnetometer calibration.

Tested on Raspberry Pi using I2C with both IST8310 and IST8310J devices.

Signed-off-by: webbyeh <webbyeh@isentek.com>

* driver: ist8310: add IST8310J device ID support

IST8310J shares the same register map and initialization sequence as IST8310.

Factory cross-axis compensation support was evaluated but has been removed
in this revision due to flash size constraints on embedded targets. The
driver now focuses on device identification and stability, while relying on
the existing PX4 magnetometer calibration framework.

This commit also addresses review feedback by caching the WAI register value
to avoid redundant I2C reads during the reset wait state.

Tested on Raspberry Pi using I2C with both IST8310 and IST8310J devices.

Signed-off-by: webbyeh <webbyeh@isentek.com>

* Fix formatting issues in IST8310.cpp

---------

Signed-off-by: webbyeh <webbyeh@isentek.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-12-17 17:14:17 -09:00
Jacob Dahl 1d5a8531e4 update gps submodule 2025-12-17 10:33:21 -09:00
Jacob Dahl e71348967d gps: fix RTCM injection and enable MSM7 for PPK (#26095)
* serial: add txSpaceAvailable function

* serial: txSpaceAvailable and bytesAvailable fixups

* msg: GpsDump: increase queue from 8 to 16 and replace instance with device_id

* lib: gnss: add RTCM parsing library. Generated by Claude Code.

* gps: fix RTCM injection to use inject-before-read pattern as before. Add RTCM parser to frame-align injection. Drain GpsInjectData uORB queue into RTCM parser buffer and then inject. Add GPS_UBX_PPK parameter to enable MSM7 output from the GPS module (rather than the default of MSM4) which is required for PPK workflows.

* gps: replace PX4_WARN with perf counters
2025-12-17 10:20:00 -09:00
Jacob Dahl fbe49db571 uavcannode: publisher: MovingBaseLine enhancements (#26092)
* uavcannode: publishers: MovingBaselineData: publish all GpsInjectData updates during BroadcastAnyUpdates. Check and report data loss via uorb generationcounter. Only registerCallback outside of the loop.

* remove unnecessary include
2025-12-17 10:18:17 -09:00
Jacob Dahl 4b36cfccfc uavcan: gnss: MovingBaselineData subscriber (#26094)
* msg: GpsDump: increase queue from 8 to 16 and replace instance with device_id

* uavcan: gnss: MovingBaselineData subscriber for RTCM logging for PPK. Add uORB generation tracking to detect data loss on RTCM injection.

* add instance TODO
2025-12-17 10:17:56 -09:00
Phil-Engljaehringer 3438d593a1 drivers: MCP23009 & MCP23017 shared code base (#25924)
* Implemented driver for MCP23017

* fixed compatability with mcp23009. (naming of instantiated GPIO-Devices)

* removed some comments

* removed even more comments

* commented out instatntiation of driver since it will not be used with v6x

* removed last useless comments

* re-activated gpio_mcp23009 driver, removed useless comments and empty lines

* removed empty lines at the end of mcp23017.cpp

* removed empty line

* Implemented driver for MCP23017

* fixed compatability with mcp23009. (naming of instantiated GPIO-Devices)

* removed some comments

* removed even more comments

* commented out instatntiation of driver since it will not be used with v6x

* removed last useless comments

* re-activated gpio_mcp23009 driver, removed useless comments and empty lines

* removed empty lines at the end of mcp23017.cpp

* removed empty line

* basic working implementation

* first improved driver version with shared code base for MCP23009 & MCP23017 (built as state machine with sanity checks)

* removed unused imports

* changed module name from MCP to MCP230XX

* removed debug print statements

* adjusted auto start command of driver

* removed comments

* -added seperate main functions for both derivative modules (mcp23009 and mcp23017)

* compile common functions as shared library in src/lib/drivers

* fixed cleanup of modules

* ->unclean working version with shared common library

* used make format

* working & cleaned version

* -> Added CallbackHandler to be able to use multiple reading GPIO-expanders simultaneously
-> Removed old mcap23009 calls and pin registrations
-> Adjusted GpioIn.msg to contain MAX_INSTANCES

* ->removed unused imports
->used make format

* Fix: Re-enabled platform_mcp_gpio for accton-godwit, cuav, fmu-v5x

* Fix: enabled platform_mcp_gpio in px4/fmu-v5x

* added depency to fmu-v5x

* Fix: removed new lines

* Fix: fixed linker errors

* removed unused linkage against mcp-library

* Made mcp start calls consistent for fmu-v5x and fmu-v6x

* moved logging of comm errors to read/write function directly

* added perf_count for sanity_check

* removed error message

* ensured member variables follow naming convention

* added retries to probe function

* simplyfied state-logic

* add break to terminate loop early

* ensured clean state when register_gpios() fails

* add registered-flag to pins

* used path from top dir instead of relative path in CMakeLists

* used constexpr to set parameters instead of calculating them at runtime

* style: used make format

* fix: corrected i2c_bus assignment

* style: init input of callbackhandler to 0

* fix: mark pin as registered if successful

* style: made arguments const type

---------

Co-authored-by: Alexander Lerach <alexander@auterion.com>
2025-12-17 17:48:30 +01:00
dirksavage88 b64860f9f8 consolidated into update method; use default value in declaration
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2025-12-17 17:12:12 +01:00
dirksavage88 e51d09612f vl53l1x quaternion example
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2025-12-17 17:12:12 +01: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
Jacob Dahl 778ad160f2 msg: GpsDump: queue 8->16 and add device_id (#26091)
* msg: GpsDump: increase queue from 8 to 16 and replace instance with device_id

* gps: add back instance
2025-12-16 08:36:02 -09:00
Alex Klimaj 12745baf6c Adds configurable I2C address for PCA9685 PWM driver (#26051)
* Adds configurable I2C address for PCA9685 PWM driver

Introduces a parameter to set the I2C address for the PCA9685 PWM output driver, enhancing flexibility for hardware variations. Updates documentation and board initialization scripts to support the new configuration and streamline device startup.

* Update src/drivers/pca9685_pwm_out/module.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/drivers/pca9685_pwm_out/module.yaml

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-12-12 09:31:19 -09:00
Jacob Dahl 67d62cb371 Revert "gps: fix RTCM injection to use inject-before-read pattern as before. Add RTCM parser to frame-align injection. Drain GpsInjectData uORB queue into RTCM parser buffer and then inject. Add GPS_UBX_PPK parameter to enable MSM7 output from the GPS module (rather than the default of MSM4) which is required for PPK workflows."
This reverts commit 0704580a30.
2025-12-11 21:32:26 -09:00
Jacob Dahl 0704580a30 gps: fix RTCM injection to use inject-before-read pattern as before. Add RTCM parser to frame-align injection. Drain GpsInjectData uORB queue into RTCM parser buffer and then inject. Add GPS_UBX_PPK parameter to enable MSM7 output from the GPS module (rather than the default of MSM4) which is required for PPK workflows. 2025-12-11 20:10:22 -09:00
Tarmo Tänav ad38dba167 crsf_rc: fixed cmake directory conflict 2025-11-26 15:52:33 -09:00
Nick 575fa0850b PWM: Add servo center setting & asymetric deflection (#25897)
Add PWM_*_CENTERx for each servo.
Use a bilinear transform to map actuator_servos to PWM signals.

This solution only works for PWM based servos. Other types of servos are not affected.

* PWM: Add servo trim option

* PWM: Improve documentation of PWM trim feature

* PWM: cleaner clamping and docs typo

* update documentation & safety

* add migration formula

* rename param from trim to center

* docs with center instead of trim

* move clamping and reorder values

* improve documentation

* adress failing range check

* improve documentation

* CA: add event for setting CENTER with TRIM

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

---------

Signed-off-by: Silvan <silvan@auterion.com>
Co-authored-by: Silvan <silvan@auterion.com>
2025-11-26 18:12:25 +01:00
Niklas Hauser 0ce60fd528 Revert "[crsf_rc] Allow setting the baudrate via parameter"
This reverts commit 7a9b04c67c.
2025-11-26 15:09:00 +01:00
Alexander Lerach 8dd88e036d gps: add init timeout to handle larger diff after configuration 2025-11-25 11:41:50 -05:00
Alexander Lerach c4a459838e gps: wipe FLASH config only once 2025-11-25 11:41:50 -05:00
Niklas Hauser 932abfd558 [auav] Robustify I2C transfers and enforce minimum sample time 2025-11-25 17:09:52 +01:00
Alexander Lerach bd3b3d647f drivers: PCA9685 robustness & logging improvements
Co-authored-by: Phil-Engljaehringer <philipp.engljahringer@auterion.com>
2025-11-25 10:42:48 -05:00
Niklas Hauser bb72088ff6 [crsf_rc] Add ability to inject buffers for development 2025-11-25 13:15:44 +01:00
Niklas Hauser 1904838043 [crsf_rc] Extend the RC packet reception timeouts to 0.5s 2025-11-25 13:15:44 +01:00
Niklas Hauser 7a9b04c67c [crsf_rc] Allow setting the baudrate via parameter 2025-11-25 13:15:44 +01:00
Niklas Hauser a514560169 [crsf_rc] Add support for link statistic messages 2025-11-25 13:15:44 +01:00
bresch 45e8712d60 VectorNav: set global position validity 2025-11-24 12:00:55 +01:00
Phil-Engljaehringer 0cefd74fee drivers: add perf counters and documentation to ads7953 2025-11-24 11:06:56 +01:00
Jacob Dahl 5c469a36b8 drivers: bootloaders: specify UAVCAN only in KConfig (#25947) 2025-11-19 13:58:58 -05:00
Alexander Lerach 229b53d25d uavcannode: fix compile error in BatteryInfo.hpp (#25944) 2025-11-19 16:23:25 +01:00
Phil-Engljaehringer 8a2239f3e8 drivers: Add TLA2528 ADC driver (#25898)
* tla2528 basic implementation (restarting driver still fails)

* fixed probe function, restarting driver now works

* -added reset call to init
-added return value checks on all important transfers and retry if failed when possible
-removed comments
-removed unnecessary parameters of module

* Introduced initialization-states that can be executed multiple times on failure

* Added one more state s.t. init() only does probing

* added communication error count _comms_errors

* use get() instead of param_find

* changed scheduling interval

* start in reset state. check second byte in probe. add 2 retries to probe function

* add space in front of comments

* jump to reset state when another state fails

* changed SAMPLE_INTERVAL to 10_ms

* added static assert on number of channels in adc_report
2025-11-18 17:30:34 +01:00
alexklimaj f1a68b7450 gps: update submodule and fix M9N output rate 2025-11-14 16:16:45 -09:00
Matthias Grob 7b05a00db1 MS5837: correct unit conversion to Pascal 2025-11-13 15:52:00 -08:00
Valentin Bugrov 98d3a2141a drivers/ins: InertialLabs INS driver bugfix 2025-11-11 00:59:59 -05: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 ddb98abf1d MCP9808: refactor driver based on feedback
- Remove enum class Register : uint8_t
- Explicitly initialize buffer
- Explicitly initialize temp_raw
- Rename uorb publisher
- Remove overide from print_status()
- Take timestamp after read, correct measurement_time to uint64 and use hrt_elapsed_time()
- Remove exit_and_cleanup
- Move functions out of main + cleanup whitespace

MCP9808: remove exit_and_cleanup

MCP9808: Take timestamp after read, correct measurement_time to uint64 and use hrt_elapsed_time()

MCP9808: remove overide from print_status()

MCP9808: rename uorb publisher

MCP9808: explicitly initialize temp_raw

MCP9808: explicitly initialize buffer

MCP9808: Remove enum class Register : uint8_t

MCP9808: move functions out of main + cleanup whitespace
2025-11-06 10:00:26 -09:00
TedObrien 90f82dabcf MCP9808: Add perf_count for comms errors and prevent publishing nan temp values. 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
Phil-Engljaehringer fb13b880ce sensors: add ads7953 adc
* sensors: add ads7953 adc

* Update src/drivers/adc/ads7953/ADS7953.h

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

* Implemented changes suggested by review

* Implemented suggested changes

* removed unused variables and moved scope of ch_id

* Activated distance sensor again

* Update msg/AdcReport.msg

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

* Update ADC report message field comments

* Update ADC msg - fix layout

* update comments

* changed group to Sensors in module.yaml

* created new module subcategory "adc"

* reverted group change in module.yaml

* added module descrption to modules_driver.md

* removed module description in modules_driver.md (autogenerated)

* removed unused variable, changed board_adc publication method to "multi"

* added static assert

---------

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-11-04 17:22:10 +01:00
Matthias Grob ae03630570 uavcan: more efficient calculation of esc.RawCommand.cmd array size 2025-11-03 08:18:55 -09:00
Claudio Chies cfe4cc82ea UAVCAN: fix message definition issues (#25809) 2025-11-03 09:34:54 +01:00
alexklimaj be9fa620fd drivers: rm3100 add i2c/spi ifdefs 2025-10-31 13:16:49 -08:00
Niklas Hauser 6ec106a0ed INA2xx: Debounce battery connection state (#25786)
To prevent critical low battery messages on a single I2C issue.
2025-10-31 13:19:10 +01:00
cuav-liu1 37398248aa BMM350: Fix BMM350 temperature calculation 2025-10-28 20:29:16 -04:00
Jacob Dahl 444b31be21 uavcan: fix logic for static node id 2025-10-17 18:35:20 -08:00
Jacob Dahl b3acde4899 use uavcan::NodeID::Max 2025-10-17 18:35:20 -08:00
Jacob Dahl 0b63b8317a uavcannode: add CANNODE_NODE_ID to allow setting static node ID 2025-10-17 18:35:20 -08:00