Commit Graph

262 Commits

Author SHA1 Message Date
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
Beat Küng 3b7c1b4ff1 src/drivers/boards: move to platforms/nuttx/src/px4/common 2019-10-30 11:48:47 +01:00
Daniel Agar 5126e6ea61 cmake: use gold linker if available 2019-10-01 20:44:07 -04:00
Daniel Agar fb7521eb5e cmake px4_base -> px4_parse_function_args 2019-09-15 14:36:38 -04:00
Daniel Agar d256fb8770 cmake px4_find_python_module move to standalone file 2019-09-15 14:36:38 -04:00
Daniel Agar f2189dd045 CMakeLists.txt extract top level helpers (ccache, doxygen, metadata, etc) 2019-09-15 14:36:38 -04:00
Beat Küng f8e0441e7b src/platforms/common: move to platforms/common
Script to update include paths:
for i in $(grep -rl 'include <px4_work_queue' src platforms); do sed -i 's/#include <px4_work_queue/#include <px4_platform_common\/px4_work_queue/' $i; done
2019-08-30 07:59:44 +02:00
Beat Küng ab43a83bed platform: restructure (NuttX) architecture-specific code
updated: tone_alarm, px4io_serial, px4_micro_hal
2019-08-30 07:59:44 +02:00
Daniel Agar 030508a71d cmake make bloaty available everywhere and improve output 2019-08-05 00:19:18 -04:00
Daniel Agar dc10a68539 NuttX and apps update 7.29 2019-07-10 12:58:35 -04:00
Matthias Grob 146a3866c0 Testing: hotfix to recover test coverage CI
CMAKE_TESTING should automatically be enabled
but I hoped to do that in the test.cmake
target specific options and not in the main
CMakeLists. I have to see if I can make that
order work. Here the hotfix to make CI work
again.
2019-06-14 06:54:10 -07:00
Matthias Grob 868b4e1746 Testing: correct license headers 2019-05-09 09:42:46 +02:00