Commit Graph

273 Commits

Author SHA1 Message Date
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
Ramon Roche
a54bbe0b24 coverage: move coverage flags within its own cmake
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2025-07-07 10:25:40 +02:00
Ramon Roche
5faa46fa0a cmake: use atomic profile updates for coverage
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2025-07-07 10:25:40 +02:00
Ramon Roche
6deac08b42 docs: remove old doxygen builds (#24743)
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2025-07-02 14:51:18 -07:00
Jacob Dahl
f23ae924de cmake: bump min version (#24386)
* cmake: bump min version to 3.16.3, which is what Ubuntu 20.04 ships with

* reduce to cmake 3.10

---------

Co-authored-by: Alex Klimaj <alex@arkelectron.com>
2025-02-26 11:22:39 -07:00
Matthias Grob
1aadbf85af gtest cmake: fix unit test filter 2024-11-19 23:00:59 -05:00
Ramon Roche
1e23f25560 ci: test ubuntu 22.04 in ci
* missing and updated dependencies
* setup: install zeromq for ubuntu 24.04
* cleans up ubuntu script
2024-11-12 22:09:37 -05:00
Daniel Agar
d7b165991f cmake: relax git tag requirements
- default to v0.0.0 if tag isn't available
 - src/lib/px_update_git_header.py use same PX4_GIT_TAG as cmake
 - update lingering master branch references to main
2024-08-23 12:05:34 -04:00
Julian Oes
7c4507b6d6 bootloader: add bootloader version
This adds a new protocol extension which allows to get the bootloader
version.

The bootloader version is different from the bootloader protocol
revision which has stabilized at 5 and is not easy to update unless a
bootloader is actually breaking the protocol. The reason being that both
the Python script as well as the uploader used in QGC will not attempt
to load firmware if they don't know the bootloader version, so it could
basically be considered a "breaking" protocol revision.

Signed-off-by: Julian Oes <julian@oes.ch>
2024-05-22 18:18:55 +12:00
Daniel Agar
bfb04ddd19 CMakeLists: install_python_requirements allow --break-system-packages 2024-04-22 12:11:53 -04:00
Matthias Grob
6ffc5a9eae events: pass relative paths plus base path to source parser script (#22551)
* events: pass relative paths plus base path to source parser script

to work around maximum Makefile command lenght limits.

* events: correct cmake comment typo

Co-authored-by: Beat Küng <beat-kueng@gmx.net>

---------

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
2023-12-18 09:33:53 +01:00
Ville Juven
6cb2c176d5 events: Move implementation of events::send() to lib/events
Events have a global, system-wide sequence number, which must be handled
atomically, (fetching and incrementing the sequence AND sending the event
to uORB must be atomic). Currently in FLAT mode, only one instance of this
sequence number exists, so it is OK to have it in px4_platform.

However, in PROTECTED mode px4_platform is instantiated both in kernel-
and user spaces, which makes two instances of this sequence number, which
causes problems in the mavlink event handling logic.

When mavlink receives and handles events, it expects that:
- The sequence numbers arrive in order (seq n is followed by n+1 etc)
- It increments by 1
- There is only one instance of the sequence number

In PROTECTED mode this is violated, as the kernel and user sequence
numbers run freely on their own. This patch fixes the issue by moving
the event backend to the kernel and by providing user access to it via
ioctl.
2023-09-25 09:54:11 +02:00
Daniel Agar
2b5722786b cmake: fix and update packaging 2023-01-18 22:51:12 -05:00
Daniel Agar
618288cca9 SITL Gazebo classic make airframes simulator specific 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
a7bbcd5b04 delete lib/mixer and mixer_module static mixing 2022-09-09 09:14:09 -04:00
Beat Küng
84b0a889a4 cmake: add clion support 2022-07-20 01:14:04 -04:00
Peter van der Perk
108c98a691 Added experimental LTO kconfig option 2022-05-02 10:07:54 -04:00
Jukka Laitinen
0d31aadcc3 src/lib/paramters: Add a new interface library for protected build user side
Implement an interface for protected build to access parameters.

The implementation only does IOCTL calls to the kernel, where the parameters
live.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-03-15 07:52:26 +01:00
Jukka Laitinen
51ceb9a85e Add support for compiling modules into kernel side
Define __KERNEL__ macro during compilation and place the module in separate library

Remove default library linking to m or libc on NuttX. Add these in platform layer instead, since
they are different on kernel and user side

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Beat Küng
b94c5db55d component_information: add actuators json generation & CI deployment 2021-11-23 12:40:22 -05:00
Daniel Agar
f5d9b01f5c NuttX build in place
- cmake NuttX build wrapper compile in place instead of copying source tree to build directory
    - slightly faster skipping necessary copying (depending on system)
    - allows debugging in place
    - easier to work directly in NuttX following official documentation
    - simplifies overall build which should make it easier to resolve any remaining NuttX dependency issues in the build system
 - the downside is switching back and forth between different builds always require rebuilding NuttX, but I think this is worth the improved developer experience
 - also no longer builds px4io and bootloader in every single build, for most users these rarely change and we're wasting a lot of build time
2021-11-15 18:47:38 -05:00
Peter van der Perk
7c6b995cb4 [Kconfig] Replace find_executable by python module, moved python check before calling kconfig 2021-10-07 10:09:01 -04:00
Peter van der Perk
56472eeed7 Completely removed px4_add_board 2021-10-07 10:09:01 -04:00
Peter van der Perk
4044fbd4a0 Initial Kconfig implementation in CMake
Used fmuk66-v3 as test case
2021-10-07 10:09:01 -04:00
Beat Küng
2320477839 uorb graph: some minor fixes, add full graph w/o mavlink 2021-08-03 07:54:41 +02:00
Beat Küng
38f3b8d356 mavlink & system: add events interface
- sending protocol
- uorb event message & template methods for argument packing
- libevents submodule to send common events and handle json files
- cmake maintains a list of all (PX4) source files for the current build
  (PX4 modules + libs), which is used to extract event metadata and
  generate a json file
2021-07-07 21:38:09 -04:00
Daniel Agar
f5b6656a6c cmake: set MAX_CUSTOM_OPT_LEVEL to -O3 if Release 2021-05-04 21:20:32 -04:00
Beat Küng
bac2a02a65 git: ignore git tags starting with 'ext/' when getting the version tag
Allows for external/extra tags
2021-03-24 10:08:41 -04:00
Daniel Agar
aef3c474e2 cmake: add install_python_requirements helper
- this is useful because it installs the python requirements using the
python interpreter found and used by cmake
2021-03-19 23:58:16 -04:00
Daniel Agar
ab0d0fd0be uORB move to PX4 platform layer 2021-02-17 11:25:56 -05:00
Daniel Agar
9426c68a13 cmake: only allow gold linker for posix builds
- the gold linker doesn't currently work for NuttX builds
 - NuttX skip --print-memory-usage if using the GOLD linker
 - fixes #15400
2020-07-23 09:41:35 -04:00
Daniel Agar
31fe7af454 selectively increase optimization -Os -> -O2
- targetted at modules/libraries that benefit without drastically
increasing flash usage
 - ignored on boards with CONSTRAINED_FLASH set
2020-06-04 20:59:52 -04:00
Julian Oes
b895a356aa cmake: fix warning
When not building for testing, test_mixer_multirotor is not available
and causes a waraning with cmake 3.17:

  This project specifies custom command DEPENDS on files in the build tree
  that are not specified as the OUTPUT or BYPRODUCTS of any
  add_custom_command or add_custom_target:

   test_mixer_multirotor
2020-03-26 14:32:03 +01:00
Julian Oes
abd2bb4eb7 cmake: fix Python 3 libs name
This was just wrong. `devel` might be correct on Fedora but no on Ubuntu
:).
2020-02-13 09:20:26 -05:00
Daniel Agar
b47eaa6061 update C++ standard (c++11 -> c++14)
- temporarily disable snapdragon builds until toolchain is updated
2020-01-21 21:49:10 -05:00
Julian Oes
75c8fb12e4 cmake: add custom error messsage about Python 3
This should be helpful as developers need to migrate to Python 3.
2020-01-16 16:25:26 +01:00
Julian Oes
c77816aef2 cmake: move jinja2 check to Python modules
This removes the cmake check for jinja2 and moves it to the respective
Python scripts.
2020-01-16 16:25:26 +01:00
TSC21
c9fc6f8dd1 if building with catkin, don't specifically look for Python 3 2020-01-13 21:48:35 +00:00
Julian Oes
4329de9e3b Use Python 3 everywhere
Since Python 2 is retired in 4 months, we should move everything to 3.
2020-01-13 21:48:35 +00:00
Daniel Agar
de4f594937 DriverFramework purge
The bulk of this change was tightly coupled and needed to be deleted in one pass. Some of the smaller changes were things that broke as a result of the initial purge and subsequently fixed by further eradicating unnecessary platform differences. Finally, I deleted any dead code I came across in the related files I touched while going through everything.

 - DriverFramework (src/lib/DriverFramework submodule) completely removed
 - added dspal submodule in qurt platform (was brought in via DriverFramework)
 - all df wrapper drivers removed
 - all boards using df wrapper drivers updated to use in tree equivalents
 - unused empty arch/board.h on posix and qurt removed
 - unused IOCTLs removed (pub block, priv, etc)
 - Integrator delete methods only used from df wrapper drivers
 - commander: sensor calibration use "NuttX version" everywhere for now
 - sensors: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
 - battery_status: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
 - cdev cleanup conflicting typedefs and names with actual OS (pollevent_t, etc)
 - load_mon and top remove from linux boards (unused)
 - delete unused PX4_MAIN_FUNCTION
 - delete unused getreg32 macro
 - delete unused SIOCDEVPRIVATE define
 - named each platform tasks consistently
 - posix list_devices and list_topics removed (list_files now shows all virtual files)
2020-01-13 14:07:03 -05:00
Daniel Agar
7241eebd80 cmake merge linux cross compile targets (cross + native) and cleanup
- consolidate cross and native variants (only a single default is needed)
   - beaglebone_blue_cross + beaglebone_blue_native => beaglebone_blue_default
   - emlid_navio2_cross + emlid_navio2_native => emlid_navio2_default
   - px4_raspberrypi_cross + px4_raspberrypi_native => px4_raspberrypi_default
 - move upload helpers to cmake/upload.cmake
2020-01-05 14:03:57 -05:00
Daniel Agar
1edfee4fdd mavsdk_tests: build should be independant of px4 2020-01-01 22:05:29 -05:00
Daniel Agar
cc7a0cd69d beaglebone blue: build librobotcontrol with cmake 2019-12-29 17:32:06 -05:00
Daniel Agar
30a73416dc mavsdk SITL testing code coverage and upload to codecov.io 2019-12-26 14:31:33 -05:00
Lorenz Meier
663436fd47 Integration tests: Add Makefile target
This enables unfamiliar users to run the tests quickly without having to memorize all commandsline options.
2019-12-26 10:16:58 +01:00
Julian Oes
956bd1b7b1 Move mavsdk_tests into test 2019-12-26 10:16:58 +01:00
Julian Oes
97d7925431 mavsdk_tests: add to PX4 Makefile/CMakeLists.txt 2019-12-26 10:16:58 +01:00
Daniel Agar
8ce2f30aa6 NuttX cmake improve dependencies between configure and runtime
- attempting to make the build slightly more robust to incomplete configures or other bad states.
2019-11-16 18:30:52 -05:00
Daniel Agar
df73a6667d NuttX cmake improvements
- fix temporary Make.defs copy
 - implement custom macros for COMPILE, COMPILEXX, ASSEMBLE, ARCHIVE to enable ccache properly (if available and enabled)
 - fix NuttX mkdeps
 - fix libapps race condition with context
2019-11-16 15:42:19 -05:00