371 Commits

Author SHA1 Message Date
Eric Katzfey
845a7efd58 voxl2: add system reboot support 2026-02-23 11:25:13 -07: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
Eric Katzfey
aacb7e35dd For VOXL flight controllers, Use DSP clock directly on Posix for CLOCK_MONOTONIC 2026-02-09 15:22:36 -07:00
Eric Katzfey
1dbee4100a uORB: Added a new uorb_shutdown function that is called during normal shutdown procedures. It will only
call into a new UORB COMMUNICATOR ICHANNEL shutdown interface if it has been configured, otherwise it
does nothing. This allows ICHANNEL implementations to pass on a shutdown indication to a remote processor.
Implemented the shutdown interface in the muorb module for VOXL flight controllers.
2026-02-09 15:21:41 -07:00
Jacob Dahl
b92d21bd31
serial: add txSpaceAvailable function (#26069)
* serial: add txSpaceAvailable function

* serial: txSpaceAvailable and bytesAvailable fixups
2025-12-12 09:31:33 -09:00
Niklas Hauser
17f3db9231 [serial] Fix byte size, flow control, parity, stop bits configuration 2025-11-20 10:29:57 -09:00
Alexander Sherikov
6e8f61c551
various cmake fixes (#25748)
- enable building in a cmake subdirectory:
    - use consistent path to "etc" in build directory
    - add a quick fix for mavlink inclusion with
      `mavlink/<version>/mavlink.h`, presumably the problem does not
      appear normally since somewhere the build root directory is added
      to include paths.
- install gazebo config and plugins, the goal is to enable packaging of
  PX4 sitl binaries.
- fix dependency on dds_topics.h generation in uxrce_dds_client:
  *** No rule to make target 'PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.h', needed by 'PX4-Autopilot/events/px4.json'.  Stop.
  https://github.com/PX4/PX4-Autopilot/issues/21788

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-10-17 11:11:00 -08:00
Daniel Agar
d3f912ad25
platforms: Serial new dedicated writeBlocking method (#25537)
* platforms: Serial new dedicated writeBlocking method

* finish writeBlocking()

* add back fsync

* updated posix, added string constant for port not open error

* format

* fix build

* remove fsync

* actually remove fsync

* remove fsync from write

* review feedback

---------

Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-09-15 15:22:49 -08:00
Jacob Dahl
1aad8b6ec9
serial: nuttx: revert tcdrain back to fsync (#25538)
* serial: nuttx: revert tcdrain back to fsync

* serial: do not print error on EAGAIN

---------

Co-authored-by: Alexander Lerach <alexander@auterion.com>
2025-09-11 12:32:34 -08:00
Jacob Dahl
b5bf28c204 platform: serial: add bytesAvailable() function 2025-07-29 09:07:03 -08:00
Beat Küng
7594a270f7 tests: remove previous fuzz testing
We now use https://github.com/google/fuzztest (see previous commits).
And the test was also failing to build
(https://github.com/PX4/PX4-Autopilot/actions/workflows/cflite_batch.yml)

This reverts these commits:
- 9eda5b373c1f16ffec585a0e27d55682d5726c0e
- 2cbc99397681ad9b67f69703c5dd65eaea26c154
- be0a5b4b3272fac13716436c06ff435d157965b4
2025-07-11 10:39:28 +02:00
Beat Küng
d31f227f15 tests: add mavlink fuzz test
Based on the previous fuzz tests in main_fuzztesting.cpp
2025-07-11 10:39:28 +02:00
Beat Küng
fd2ded08e4 pxh: do not use variable sized array on the stack
This is a compiler-specific extension
2025-07-11 10:39:28 +02:00
Beat Küng
3d1cace7b7 test: add google fuzztest to unit test build
From https://github.com/google/fuzztest.
This will now also add gtest (via cmake FetchContent)

And requires newer cmake (container updates):
CMake 3.19 or higher is required.  You are running version 3.16.3
2025-07-11 10:39:28 +02:00
Daniel Agar
45bdf20481 lockstep_scheduler: bump cmake minimum to 3.5 2025-04-30 18:12:33 -04:00
Silvan
b7b6d45e18 lib: remove bezier
Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
Thomas Frans
3157a4e171
gnss: update supported baud rates (#23415)
* gnss: update supported baud rates

The Septentrio GNSS driver requires certain baud rates to test all the
supported baud rates of the receiver. Without these changes, certain
"non-standard" ones would print an error to the MAVLink console when the
driver was started through the console.

* platforms: add missing baudrate defines

---------

Co-authored-by: Thomas Frans <franske2000@gmail.com>
Co-authored-by: Julian Oes <julian@oes.ch>
2024-08-07 10:46:18 +12:00
Matthias Grob
f2bca92221 Fix duplicate newlines at the end of files 2024-07-19 14:33:36 +02:00
Jacob Dahl
fe5a07a96d gz: added x500_lidar model for publishing obstacle_distance 2024-07-16 11:07:03 +02:00
Eric Katzfey
c334e488e4 Changed Serial readAtLeast timeout from microseconds to milliseconds 2024-06-18 18:48:56 -04:00
Jacob Dahl
fcb479cd3d
platforms: nuttx: SerialImpl: fix poll timeout and integer underflow (#23248)
* platforms: nuttx: SerialImpl: fix poll timeout

* platforms: posix: SerialImpl: fix poll timeout
2024-06-14 17:43:15 -08:00
Rowan Dempster
bc51eb37eb Only close server when errno is not EINTR 2024-06-06 07:40:12 +02:00
Eric Katzfey
2dccd6cacb
Voxl ESC driver update (#23022)
* Made Serial API open the UART in NON BLOCKING mode
* Updated voxl_esc driver to latest from ModalAI fork
* Ported voxl_esc driver over to new Serial UART API
* Removed voxl_esc serial abstraction since new Serial API is already a serial abstraction
2024-04-17 15:09:35 -04:00
Eric Katzfey
0a867b5d1d
Serial: removed the validateBaudrate function from nuttx and posix platforms and just send out a warning it baudrate is non-standard (#22969)
- Fix some Qurt platform build issues uncovered when changing the posix version of SerialImpl
2024-04-04 12:07:46 -04:00
Eric Katzfey
8e61026511
Port CRSF RC driver to new Serial UART API (#22917)
* Added implementations of Rx Tx swap and single wire for new UART API needed by CRSF driver
* Added inverted mode to Serial interface API
2024-04-01 22:09:13 -04:00
Eric Katzfey
ccdf060393
Additions to the Serial UART API (#22953)
- Added an empty constructor, setPort, and validatePort functions for Serial API
- Changed GPS to not allocate Serial object dynamically
- Moved access check on serial port name into the Serial API
- Improved the Qurt platform validatePort Serial function to implement a more rigorous check. Added safety check
to the setPort Serial function to make sure it isn't called after the port has been already opened.
2024-04-01 12:27:59 -04:00
Eric Katzfey
4a553938fb
VOXL2: HRT updates for synchronization with Qurt time (#22881)
- Added offset to Posix hrt time to account for synchronization with Qurt hrt time
- Added new Kconfig to configure synchronization of HRT timestamps on VOXL2
- Moved voxl2 libfc sensor library submodule from muorb module to boards directory
- Added check to make sure hrt_elapsed_time can never be negative
2024-03-22 15:24:51 -04:00
Eric Katzfey
69028f37a9
New platform independent Serial interface (#21723) 2024-03-21 21:00:23 -04:00
Eric Katzfey
f07eeaa776 Added special muorb startup ordering in px4_init for posix platform 2024-02-21 11:52:24 -05:00
Eric Katzfey
2b69a3d290
VOXL2 specific drivers, modules, and miscellaneous support files (#22588) 2024-01-18 12:14:17 -05:00
Daniel Agar
b0566cd8aa posix: cmake INSTALL make new GZ models/worlds optional for now
- the entire posix install package needs to be reviewed and tested
2023-12-18 11:49:53 -05:00
Daniel Honies
476b5d5594
fix macos compile issues (#22173)
* fix macos compile issues

* remove unused variable
2023-10-12 09:13:19 +13:00
Patrick José Pereira
724f5a97a9 platform: posix: px4: Add missing ctsdint include for uint8_t
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2023-07-06 08:24:33 +02:00
Beat Küng
1bfca24fa9 refactor param: move autosave to px4::wq_configurations::lp_default work queue
Changes initialization order as param_init now depends on wq manager
2023-05-31 07:45:20 +02:00
Beniamino Pozzan
636dfdec6a VScode: fix tasks.json and launch_sitl.json after ign -> gazebo renaming
PX4_SIM model need the simulator (gz_) prefix
Fix post debug task
Add x500_depth, rc_cessna, standard_vtol

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
2023-03-07 21:28:39 -05:00
Eric Katzfey
21c7f8ad74
posix server: changed the method of checking and setting the server file lock (#21243)
* Changed the method of checking and setting the server file lock on Posix to avoid conditions where the server can indicate that it is running but still hasn't finished it's initialization
2023-03-06 09:55:57 -05:00
Beat Küng
0687fd2689 lockstep_scheduler: avoid pthread_cond_destroy on at_exit
The static object is destroyed on at_exit while threads might still be
inside a CS. This can lead to a hanging process.
Cleaner would be to gracefully stop the threads.

According to https://linux.die.net/man/3/pthread_cond_destroy:
Attempting to destroy a condition variable upon which other threads are
currently blocked results in undefined behavior.
2023-01-30 11:45:02 +01:00
Daniel Agar
2b5722786b cmake: fix and update packaging 2023-01-18 22:51:12 -05:00
Daniel Agar
6991ac014c
rename 'gazebo' simulation to 'gazebo-classic' (#20936)
- use `gazebo-classic` everywhere consistently referring to the original Gazebo (eg version 9,10,11)
   - additional `gazebo_*` helper targets added for compatibility, but warn about deprecation and tell you the new target naming
 - use `gz` everywhere when referring to Gazebo (aka Ignition Gazebo or new Gazebo)
2023-01-15 11:36:12 -05:00
Daniel Agar
618288cca9 SITL Gazebo classic make airframes simulator specific 2023-01-07 17:00:35 -05:00
Daniel Agar
75125da34c SITL sihsim make airframes simulator specific 2023-01-07 17:00:35 -05:00
Daniel Agar
95a6eba36c SITL jmavsim make airframes simulator specific
-cleanup and simplify jmavsim SITL launch and debug
2023-01-07 17:00:35 -05:00
Daniel Agar
8114aad983
initial minimal PX4_ROS2 platform and px4_ros2_default build (#20689)
- new ROS2 platform in PX4 intended for creating configs that build and run entirely in ROS2
 - PX4_CONFIG defaults to px4_ros2_default if no config specified and in a colcon workspace with ROS_VERSION=2
 - currently doesn't do much other than allow you to build px4 msgs interface package
2022-12-08 23:03:44 -05:00
Daniel Agar
72cb4bee01
SITL gz fixes and init cleanup (#20725)
- remove broken gz version handling and remove x500-legacy
 - fix all shellcheck warnings
 - prepare for Gazebo Garden compatibility (needs more work)
2022-12-07 15:41:13 -05:00
Eric Katzfey
796fa8bd72
boards/modalai: separate voxl2 builds into two board builds instead of single board build with different variants
* Made voxl2 apps processor and slpi dsp processor builds into separate board builds so that they can
more easily be configured independently.

* Removed board specific link library command from px4_config.cmake and moved it to a more generic
board specific solution that can be used by any board that needs custom link libraries.

* Removed redundant cmake command for Qurt

* Removed unused definition from Qurt cmake file

* Removed unnecessary QURT_LIB cmake function

* Reorganized the voxl2 build structure to avoid 4 level board directories.

* Reverted cmake files to remove 4 level board naming code

* Updated documentation
2022-11-15 13:09:04 -05:00
Zachary Lowell
bcae7e550b
Qurt platform/common dependency fixes 2022-10-25 21:06:00 -04:00
Eric Katzfey
4afd19f037 Moved the bad-function-cast compiler warning option out of the common flags and into
the nuttx and posix specific options files since this option cannot be used with
the qurt platform. There are header files in the hexagon sdk that fail this check.
2022-10-20 18:18:40 -04:00
Beat Küng
31dfdea12e commander: remove state_machine_helper tests 2022-10-11 22:31:20 -04:00
Benjamin Perseghetti
f9522e831c
Gazebo Simulation Enablement (#20319) 2022-09-29 13:49:31 -04:00
Ville Juven
59e86c490d Remove include <log.h> from defines.h
The reason for this is that log.h includes drv_hrt.h which sucks in
half the project's include files with it, which causes strange build
issues
2022-09-29 07:56:24 +02:00