From ab0d0fd0beadb66f8770db35205a1ab6b613791d Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Wed, 17 Feb 2021 11:25:56 -0500 Subject: [PATCH] uORB move to PX4 platform layer --- CMakeLists.txt | 1 - ROMFS/cannode/init.d/rcS | 7 -- ROMFS/px4fmu_common/init.d-posix/rc.replay | 1 - ROMFS/px4fmu_common/init.d-posix/rcS | 2 - ROMFS/px4fmu_common/init.d/rcS | 7 -- ROMFS/px4fmu_test/init.d/rc.standalone | 5 - ROMFS/px4fmu_test/init.d/rcS | 7 -- boards/aerotenna/ocpoc/default.cmake | 1 + boards/airmind/mindpx-v2/default.cmake | 1 + boards/atlflight/eagle/default.cmake | 1 + boards/atlflight/excelsior/default.cmake | 1 + boards/av/x-v1/default.cmake | 1 + boards/beaglebone/blue/default.cmake | 1 + boards/bitcraze/crazyflie/default.cmake | 1 + boards/bitcraze/crazyflie21/default.cmake | 1 + boards/cuav/can-gps-v1/default.cmake | 1 + boards/cuav/nora/default.cmake | 1 + boards/cuav/x7pro/default.cmake | 1 + boards/cubepilot/cubeorange/console.cmake | 1 + boards/cubepilot/cubeorange/default.cmake | 1 + boards/cubepilot/cubeyellow/console.cmake | 1 + boards/cubepilot/cubeyellow/default.cmake | 1 + boards/emlid/navio2/default.cmake | 1 + boards/holybro/durandal-v1/default.cmake | 1 + boards/holybro/kakutef7/default.cmake | 1 + boards/holybro/pix32v5/default.cmake | 1 + boards/intel/aerofc-v1/default.cmake | 1 + boards/intel/aerofc-v1/rtps.cmake | 1 + boards/modalai/fc-v1/default.cmake | 1 + boards/mro/ctrl-zero-f7-oem/default.cmake | 1 + boards/mro/ctrl-zero-f7/default.cmake | 1 + boards/mro/pixracerpro/default.cmake | 1 + boards/mro/x21-777/default.cmake | 1 + boards/mro/x21/default.cmake | 1 + boards/nxp/fmuk66-e/default.cmake | 1 + boards/nxp/fmuk66-e/socketcan.cmake | 1 + boards/nxp/fmuk66-v3/default.cmake | 1 + boards/nxp/fmuk66-v3/rtps.cmake | 1 + boards/nxp/fmuk66-v3/socketcan.cmake | 1 + boards/nxp/fmurt1062-v1/default.cmake | 1 + boards/omnibus/f4sd/default.cmake | 1 + boards/px4/fmu-v2/default.cmake | 1 + boards/px4/fmu-v2/fixedwing.cmake | 1 + boards/px4/fmu-v2/lpe.cmake | 1 + boards/px4/fmu-v2/multicopter.cmake | 1 + boards/px4/fmu-v2/rover.cmake | 1 + boards/px4/fmu-v2/test.cmake | 1 + boards/px4/fmu-v3/ctrlalloc.cmake | 1 + boards/px4/fmu-v3/default.cmake | 1 + boards/px4/fmu-v3/rtps.cmake | 1 + boards/px4/fmu-v3/stackcheck.cmake | 1 + boards/px4/fmu-v4/ctrlalloc.cmake | 1 + boards/px4/fmu-v4/default.cmake | 1 + boards/px4/fmu-v4/optimized.cmake | 1 + boards/px4/fmu-v4/rtps.cmake | 1 + boards/px4/fmu-v4/stackcheck.cmake | 1 + boards/px4/fmu-v4/uavcanv1.cmake | 1 + boards/px4/fmu-v4pro/default.cmake | 1 + boards/px4/fmu-v4pro/rtps.cmake | 1 + boards/px4/fmu-v5/critmonitor.cmake | 1 + boards/px4/fmu-v5/ctrlalloc.cmake | 1 + boards/px4/fmu-v5/debug.cmake | 1 + boards/px4/fmu-v5/default.cmake | 1 + boards/px4/fmu-v5/fixedwing.cmake | 1 + boards/px4/fmu-v5/irqmonitor.cmake | 1 + boards/px4/fmu-v5/multicopter.cmake | 1 + boards/px4/fmu-v5/optimized.cmake | 1 + boards/px4/fmu-v5/rover.cmake | 1 + boards/px4/fmu-v5/rtps.cmake | 1 + boards/px4/fmu-v5/stackcheck.cmake | 1 + boards/px4/fmu-v5/uavcanv1.cmake | 1 + boards/px4/fmu-v5x/base_phy_DP83848C.cmake | 1 + boards/px4/fmu-v5x/default.cmake | 1 + boards/px4/fmu-v6u/default.cmake | 1 + boards/px4/fmu-v6u/stackcheck.cmake | 1 + boards/px4/fmu-v6x/default.cmake | 1 + boards/px4/fmu-v6x/stackcheck.cmake | 1 + boards/px4/raspberrypi/default.cmake | 1 + boards/px4/sitl/ctrlalloc.cmake | 1 + boards/px4/sitl/default.cmake | 1 + boards/px4/sitl/nolockstep.cmake | 1 + boards/px4/sitl/rtps.cmake | 1 + boards/px4/sitl/test.cmake | 1 + boards/scumaker/pilotpi/arm64.cmake | 1 + boards/scumaker/pilotpi/default.cmake | 1 + boards/spracing/h7extreme/default.cmake | 1 + boards/uvify/core/default.cmake | 1 + cmake/gtest/px4_add_gtest.cmake | 2 +- cmake/px4_add_common_flags.cmake | 2 + platforms/common/CMakeLists.txt | 9 +- .../common}/uORB/CMakeLists.txt | 65 +++++------ .../common}/uORB/ORBSet.hpp | 1 - .../common}/uORB/Publication.hpp | 0 .../common}/uORB/PublicationMulti.hpp | 0 .../common}/uORB/Subscription.cpp | 0 .../common}/uORB/Subscription.hpp | 0 .../common}/uORB/SubscriptionBlocking.hpp | 0 .../common}/uORB/SubscriptionCallback.hpp | 0 .../common}/uORB/SubscriptionInterval.hpp | 0 .../common}/uORB/SubscriptionMultiArray.hpp | 0 .../common}/uORB/uORB.cpp | 51 ++++++++ {src/modules => platforms/common}/uORB/uORB.h | 4 + .../common}/uORB/uORBCommon.hpp | 0 .../common}/uORB/uORBCommunicator.hpp | 0 .../common}/uORB/uORBDeviceMaster.cpp | 0 .../common}/uORB/uORBDeviceMaster.hpp | 0 .../common}/uORB/uORBDeviceNode.cpp | 0 .../common}/uORB/uORBDeviceNode.hpp | 0 .../common}/uORB/uORBManager.cpp | 0 .../common}/uORB/uORBManager.hpp | 0 .../common}/uORB/uORBTopics.h | 0 .../common}/uORB/uORBUtils.cpp | 0 .../common}/uORB/uORBUtils.hpp | 0 .../common}/uORB/uORB_tests/CMakeLists.txt | 0 .../uORB/uORB_tests/uORBTest_UnitTest.cpp | 0 .../uORB/uORB_tests/uORBTest_UnitTest.hpp | 0 .../uORB/uORB_tests/uORB_tests_main.cpp | 0 platforms/nuttx/CMakeLists.txt | 8 +- platforms/nuttx/src/px4/common/CMakeLists.txt | 3 +- platforms/nuttx/src/px4/common/px4_init.cpp | 5 + platforms/posix/CMakeLists.txt | 2 +- platforms/posix/src/px4/common/px4_init.cpp | 5 + platforms/qurt/src/px4/common/commands_hil.c | 1 - platforms/qurt/src/px4/common/main.cpp | 2 +- platforms/qurt/src/px4/common/px4_init.cpp | 4 + posix-configs/SITL/init/test/cmd_template.in | 2 - posix-configs/SITL/init/test/test_mavlink | 2 - posix-configs/SITL/init/test/test_shutdown | 2 - posix-configs/SITL/init/test/test_template.in | 2 - posix-configs/SITL/init/test/tests_all | 2 - posix-configs/bbblue/px4.config | 1 - posix-configs/bbblue/px4_fw.config | 1 - posix-configs/eagle/200qx/mainapp.config | 1 - posix-configs/eagle/200qx/px4.config | 1 - posix-configs/eagle/210qc/mainapp.config | 1 - posix-configs/eagle/210qc/px4.config | 1 - posix-configs/eagle/flight/mainapp.config | 1 - posix-configs/eagle/flight/px4.config | 1 - posix-configs/eagle/hil/mainapphil.config | 1 - posix-configs/eagle/hil/px4.config | 1 - posix-configs/eagle/init/rcS | 1 - posix-configs/excelsior/mainapp.config | 1 - posix-configs/excelsior/px4.config | 1 - posix-configs/ocpoc/px4.config | 2 - posix-configs/rpi/pilotpi_fw.config | 2 - posix-configs/rpi/pilotpi_mc.config | 2 - posix-configs/rpi/px4.config | 2 - posix-configs/rpi/px4_fw.config | 2 - posix-configs/rpi/px4_hil.config | 2 - posix-configs/rpi/px4_test.config | 2 - src/lib/parameters/CMakeLists.txt | 6 +- src/modules/events/CMakeLists.txt | 2 - src/modules/muorb/adsp/CMakeLists.txt | 2 +- src/systemcmds/uorb/CMakeLists.txt | 40 +++++++ .../uORBMain.cpp => systemcmds/uorb/uorb.cpp} | 110 +++++------------- src/templates/template_module/CMakeLists.txt | 2 - 156 files changed, 261 insertions(+), 212 deletions(-) rename {src/modules => platforms/common}/uORB/CMakeLists.txt (67%) rename {src/modules => platforms/common}/uORB/ORBSet.hpp (99%) rename {src/modules => platforms/common}/uORB/Publication.hpp (100%) rename {src/modules => platforms/common}/uORB/PublicationMulti.hpp (100%) rename {src/modules => platforms/common}/uORB/Subscription.cpp (100%) rename {src/modules => platforms/common}/uORB/Subscription.hpp (100%) rename {src/modules => platforms/common}/uORB/SubscriptionBlocking.hpp (100%) rename {src/modules => platforms/common}/uORB/SubscriptionCallback.hpp (100%) rename {src/modules => platforms/common}/uORB/SubscriptionInterval.hpp (100%) rename {src/modules => platforms/common}/uORB/SubscriptionMultiArray.hpp (100%) rename {src/modules => platforms/common}/uORB/uORB.cpp (84%) rename {src/modules => platforms/common}/uORB/uORB.h (98%) rename {src/modules => platforms/common}/uORB/uORBCommon.hpp (100%) rename {src/modules => platforms/common}/uORB/uORBCommunicator.hpp (100%) rename {src/modules => platforms/common}/uORB/uORBDeviceMaster.cpp (100%) rename {src/modules => platforms/common}/uORB/uORBDeviceMaster.hpp (100%) rename {src/modules => platforms/common}/uORB/uORBDeviceNode.cpp (100%) rename {src/modules => platforms/common}/uORB/uORBDeviceNode.hpp (100%) rename {src/modules => platforms/common}/uORB/uORBManager.cpp (100%) rename {src/modules => platforms/common}/uORB/uORBManager.hpp (100%) rename {src/modules => platforms/common}/uORB/uORBTopics.h (100%) rename {src/modules => platforms/common}/uORB/uORBUtils.cpp (100%) rename {src/modules => platforms/common}/uORB/uORBUtils.hpp (100%) rename {src/modules => platforms/common}/uORB/uORB_tests/CMakeLists.txt (100%) rename {src/modules => platforms/common}/uORB/uORB_tests/uORBTest_UnitTest.cpp (100%) rename {src/modules => platforms/common}/uORB/uORB_tests/uORBTest_UnitTest.hpp (100%) rename {src/modules => platforms/common}/uORB/uORB_tests/uORB_tests_main.cpp (100%) create mode 100644 src/systemcmds/uorb/CMakeLists.txt rename src/{modules/uORB/uORBMain.cpp => systemcmds/uorb/uorb.cpp} (64%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3891c085c2..d0a54d987a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -406,7 +406,6 @@ add_subdirectory(src/lib EXCLUDE_FROM_ALL) add_subdirectory(platforms/${PX4_PLATFORM}/src/px4) add_subdirectory(platforms EXCLUDE_FROM_ALL) -add_subdirectory(src/modules/uORB EXCLUDE_FROM_ALL) # TODO: platform layer if(EXISTS "${PX4_BOARD_DIR}/CMakeLists.txt") add_subdirectory(${PX4_BOARD_DIR}) diff --git a/ROMFS/cannode/init.d/rcS b/ROMFS/cannode/init.d/rcS index deb4f11aa9..f6c5a44d47 100644 --- a/ROMFS/cannode/init.d/rcS +++ b/ROMFS/cannode/init.d/rcS @@ -30,13 +30,6 @@ sercon # ver all -# -# Start the ORB (first app to start) -# tone_alarm and tune_control -# is dependent. -# -uorb start - # # Set the parameter file if mtd starts successfully. # diff --git a/ROMFS/px4fmu_common/init.d-posix/rc.replay b/ROMFS/px4fmu_common/init.d-posix/rc.replay index 25a9612197..89c999a38c 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rc.replay +++ b/ROMFS/px4fmu_common/init.d-posix/rc.replay @@ -20,7 +20,6 @@ module: replay ignore_others: false EOF -uorb start param set SDLOG_DIRS_MAX 7 # apply all params before ekf starts, as some params cannot be changed after startup diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index edf49e203a..73b7c5c0ec 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -53,8 +53,6 @@ else fi fi -uorb start - # Load parameters set PARAM_FILE eeprom/parameters_"$REQUESTED_AUTOSTART" param select $PARAM_FILE diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 6c2d616505..583e1e038d 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -73,13 +73,6 @@ sercon # ver all -# -# Start the ORB (first app to start) -# tone_alarm and tune_control -# is dependent. -# -uorb start - # # Try to mount the microSD card. # diff --git a/ROMFS/px4fmu_test/init.d/rc.standalone b/ROMFS/px4fmu_test/init.d/rc.standalone index 84f305e881..a0072d5d1d 100644 --- a/ROMFS/px4fmu_test/init.d/rc.standalone +++ b/ROMFS/px4fmu_test/init.d/rc.standalone @@ -5,9 +5,4 @@ echo "[i] doing standalone PX4FMU startup..." -# -# Start the ORB -# -uorb start - echo "[i] startup done" diff --git a/ROMFS/px4fmu_test/init.d/rcS b/ROMFS/px4fmu_test/init.d/rcS index 2097d6acc7..4d8da071e4 100644 --- a/ROMFS/px4fmu_test/init.d/rcS +++ b/ROMFS/px4fmu_test/init.d/rcS @@ -8,8 +8,6 @@ set unit_test_failure 0 set BOARD_RC ${R}etc/init.d/rc.board -uorb start - if rgbled start -X then led_control on -c blue @@ -41,11 +39,6 @@ fi # Start a minimal system # -# -# Start the ORB (first app to start) -# -uorb start - # # Load parameters # diff --git a/boards/aerotenna/ocpoc/default.cmake b/boards/aerotenna/ocpoc/default.cmake index 76c9993f09..834c519475 100644 --- a/boards/aerotenna/ocpoc/default.cmake +++ b/boards/aerotenna/ocpoc/default.cmake @@ -83,6 +83,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/airmind/mindpx-v2/default.cmake b/boards/airmind/mindpx-v2/default.cmake index 507f621ee8..77b8d1fd8f 100644 --- a/boards/airmind/mindpx-v2/default.cmake +++ b/boards/airmind/mindpx-v2/default.cmake @@ -105,6 +105,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/atlflight/eagle/default.cmake b/boards/atlflight/eagle/default.cmake index 1a03e8b536..95f3c84f1b 100644 --- a/boards/atlflight/eagle/default.cmake +++ b/boards/atlflight/eagle/default.cmake @@ -110,6 +110,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/atlflight/excelsior/default.cmake b/boards/atlflight/excelsior/default.cmake index b67f9dbd34..1a2bcf2a81 100644 --- a/boards/atlflight/excelsior/default.cmake +++ b/boards/atlflight/excelsior/default.cmake @@ -108,6 +108,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/av/x-v1/default.cmake b/boards/av/x-v1/default.cmake index 9d9e681e5d..9ffe268013 100644 --- a/boards/av/x-v1/default.cmake +++ b/boards/av/x-v1/default.cmake @@ -102,6 +102,7 @@ px4_add_board( top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/beaglebone/blue/default.cmake b/boards/beaglebone/blue/default.cmake index dcd771167d..546fe5ca38 100644 --- a/boards/beaglebone/blue/default.cmake +++ b/boards/beaglebone/blue/default.cmake @@ -79,6 +79,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/bitcraze/crazyflie/default.cmake b/boards/bitcraze/crazyflie/default.cmake index 0cfe49246b..23caa2cd31 100644 --- a/boards/bitcraze/crazyflie/default.cmake +++ b/boards/bitcraze/crazyflie/default.cmake @@ -64,6 +64,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/bitcraze/crazyflie21/default.cmake b/boards/bitcraze/crazyflie21/default.cmake index 7761ac7203..3ce93a5b89 100644 --- a/boards/bitcraze/crazyflie21/default.cmake +++ b/boards/bitcraze/crazyflie21/default.cmake @@ -61,6 +61,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/cuav/can-gps-v1/default.cmake b/boards/cuav/can-gps-v1/default.cmake index 8a03049938..0515102c9a 100644 --- a/boards/cuav/can-gps-v1/default.cmake +++ b/boards/cuav/can-gps-v1/default.cmake @@ -49,6 +49,7 @@ px4_add_board( top topic_listener tune_control + uorb ver work_queue ) diff --git a/boards/cuav/nora/default.cmake b/boards/cuav/nora/default.cmake index c5688aeb9a..e32f58844a 100644 --- a/boards/cuav/nora/default.cmake +++ b/boards/cuav/nora/default.cmake @@ -109,6 +109,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/cuav/x7pro/default.cmake b/boards/cuav/x7pro/default.cmake index 1e011dcc1e..82abc1c1cf 100644 --- a/boards/cuav/x7pro/default.cmake +++ b/boards/cuav/x7pro/default.cmake @@ -112,6 +112,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/cubepilot/cubeorange/console.cmake b/boards/cubepilot/cubeorange/console.cmake index 043e4ce6cd..fc66e0ec84 100644 --- a/boards/cubepilot/cubeorange/console.cmake +++ b/boards/cubepilot/cubeorange/console.cmake @@ -113,6 +113,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/cubepilot/cubeorange/default.cmake b/boards/cubepilot/cubeorange/default.cmake index 0ba9f31077..49c4437920 100644 --- a/boards/cubepilot/cubeorange/default.cmake +++ b/boards/cubepilot/cubeorange/default.cmake @@ -113,6 +113,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/cubepilot/cubeyellow/console.cmake b/boards/cubepilot/cubeyellow/console.cmake index 2f2201d4d3..d0c4c2595c 100644 --- a/boards/cubepilot/cubeyellow/console.cmake +++ b/boards/cubepilot/cubeyellow/console.cmake @@ -112,6 +112,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/cubepilot/cubeyellow/default.cmake b/boards/cubepilot/cubeyellow/default.cmake index 4b3a5d67b3..04f688ce3c 100644 --- a/boards/cubepilot/cubeyellow/default.cmake +++ b/boards/cubepilot/cubeyellow/default.cmake @@ -112,6 +112,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/emlid/navio2/default.cmake b/boards/emlid/navio2/default.cmake index fea8499992..0c826cd41f 100644 --- a/boards/emlid/navio2/default.cmake +++ b/boards/emlid/navio2/default.cmake @@ -79,6 +79,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/holybro/durandal-v1/default.cmake b/boards/holybro/durandal-v1/default.cmake index 82c153a347..561e262dc7 100644 --- a/boards/holybro/durandal-v1/default.cmake +++ b/boards/holybro/durandal-v1/default.cmake @@ -110,6 +110,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/holybro/kakutef7/default.cmake b/boards/holybro/kakutef7/default.cmake index 6cb637baf0..0e76f42608 100644 --- a/boards/holybro/kakutef7/default.cmake +++ b/boards/holybro/kakutef7/default.cmake @@ -72,6 +72,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/holybro/pix32v5/default.cmake b/boards/holybro/pix32v5/default.cmake index 20f8115817..a82a6236e4 100644 --- a/boards/holybro/pix32v5/default.cmake +++ b/boards/holybro/pix32v5/default.cmake @@ -117,6 +117,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/intel/aerofc-v1/default.cmake b/boards/intel/aerofc-v1/default.cmake index 77a8168204..9d2b306169 100644 --- a/boards/intel/aerofc-v1/default.cmake +++ b/boards/intel/aerofc-v1/default.cmake @@ -88,6 +88,7 @@ px4_add_board( top #topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/intel/aerofc-v1/rtps.cmake b/boards/intel/aerofc-v1/rtps.cmake index dd47790a00..c81745792a 100644 --- a/boards/intel/aerofc-v1/rtps.cmake +++ b/boards/intel/aerofc-v1/rtps.cmake @@ -87,6 +87,7 @@ px4_add_board( top #topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/modalai/fc-v1/default.cmake b/boards/modalai/fc-v1/default.cmake index 54bfb8901f..486fc14e5f 100644 --- a/boards/modalai/fc-v1/default.cmake +++ b/boards/modalai/fc-v1/default.cmake @@ -104,6 +104,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/mro/ctrl-zero-f7-oem/default.cmake b/boards/mro/ctrl-zero-f7-oem/default.cmake index 887020703c..d28c3aa004 100644 --- a/boards/mro/ctrl-zero-f7-oem/default.cmake +++ b/boards/mro/ctrl-zero-f7-oem/default.cmake @@ -109,6 +109,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/mro/ctrl-zero-f7/default.cmake b/boards/mro/ctrl-zero-f7/default.cmake index 169d907c6a..03111bcc84 100644 --- a/boards/mro/ctrl-zero-f7/default.cmake +++ b/boards/mro/ctrl-zero-f7/default.cmake @@ -109,6 +109,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/mro/pixracerpro/default.cmake b/boards/mro/pixracerpro/default.cmake index 0bd854ff26..cf9322f170 100644 --- a/boards/mro/pixracerpro/default.cmake +++ b/boards/mro/pixracerpro/default.cmake @@ -110,6 +110,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/mro/x21-777/default.cmake b/boards/mro/x21-777/default.cmake index 3f091aa63e..92f0dea1b7 100644 --- a/boards/mro/x21-777/default.cmake +++ b/boards/mro/x21-777/default.cmake @@ -111,6 +111,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/mro/x21/default.cmake b/boards/mro/x21/default.cmake index baf3ff0123..f01a17d0fb 100644 --- a/boards/mro/x21/default.cmake +++ b/boards/mro/x21/default.cmake @@ -107,6 +107,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/nxp/fmuk66-e/default.cmake b/boards/nxp/fmuk66-e/default.cmake index 51cbe7180b..ba4d6ad325 100644 --- a/boards/nxp/fmuk66-e/default.cmake +++ b/boards/nxp/fmuk66-e/default.cmake @@ -106,6 +106,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/nxp/fmuk66-e/socketcan.cmake b/boards/nxp/fmuk66-e/socketcan.cmake index db21a3a0b7..a982d2afcb 100644 --- a/boards/nxp/fmuk66-e/socketcan.cmake +++ b/boards/nxp/fmuk66-e/socketcan.cmake @@ -105,6 +105,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/nxp/fmuk66-v3/default.cmake b/boards/nxp/fmuk66-v3/default.cmake index dccf51ad58..f276f19de6 100644 --- a/boards/nxp/fmuk66-v3/default.cmake +++ b/boards/nxp/fmuk66-v3/default.cmake @@ -106,6 +106,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/nxp/fmuk66-v3/rtps.cmake b/boards/nxp/fmuk66-v3/rtps.cmake index ebf7f7beeb..996298b584 100644 --- a/boards/nxp/fmuk66-v3/rtps.cmake +++ b/boards/nxp/fmuk66-v3/rtps.cmake @@ -106,6 +106,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/nxp/fmuk66-v3/socketcan.cmake b/boards/nxp/fmuk66-v3/socketcan.cmake index 0aee173d69..502210b9ce 100644 --- a/boards/nxp/fmuk66-v3/socketcan.cmake +++ b/boards/nxp/fmuk66-v3/socketcan.cmake @@ -105,6 +105,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/nxp/fmurt1062-v1/default.cmake b/boards/nxp/fmurt1062-v1/default.cmake index 23dc2d9989..6196bbe969 100644 --- a/boards/nxp/fmurt1062-v1/default.cmake +++ b/boards/nxp/fmurt1062-v1/default.cmake @@ -98,6 +98,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/omnibus/f4sd/default.cmake b/boards/omnibus/f4sd/default.cmake index 676c7c6cf8..31ab03cc8c 100644 --- a/boards/omnibus/f4sd/default.cmake +++ b/boards/omnibus/f4sd/default.cmake @@ -93,6 +93,7 @@ px4_add_board( top #topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v2/default.cmake b/boards/px4/fmu-v2/default.cmake index f65075961f..6d07e60f91 100644 --- a/boards/px4/fmu-v2/default.cmake +++ b/boards/px4/fmu-v2/default.cmake @@ -123,6 +123,7 @@ px4_add_board( top #topic_listener tune_control + #uorb #usb_connected #ver #work_queue diff --git a/boards/px4/fmu-v2/fixedwing.cmake b/boards/px4/fmu-v2/fixedwing.cmake index 5222e88a1d..d0656e3880 100644 --- a/boards/px4/fmu-v2/fixedwing.cmake +++ b/boards/px4/fmu-v2/fixedwing.cmake @@ -82,6 +82,7 @@ px4_add_board( top #topic_listener tune_control + #uorb #usb_connected ver #work_queue diff --git a/boards/px4/fmu-v2/lpe.cmake b/boards/px4/fmu-v2/lpe.cmake index a21c45816d..5bed6c1557 100644 --- a/boards/px4/fmu-v2/lpe.cmake +++ b/boards/px4/fmu-v2/lpe.cmake @@ -108,6 +108,7 @@ px4_add_board( top #topic_listener tune_control + uorb ver work_queue diff --git a/boards/px4/fmu-v2/multicopter.cmake b/boards/px4/fmu-v2/multicopter.cmake index c3982cd205..f6864321b4 100644 --- a/boards/px4/fmu-v2/multicopter.cmake +++ b/boards/px4/fmu-v2/multicopter.cmake @@ -81,6 +81,7 @@ px4_add_board( top #topic_listener tune_control + #uorb #usb_connected ver #work_queue diff --git a/boards/px4/fmu-v2/rover.cmake b/boards/px4/fmu-v2/rover.cmake index 537db8dadc..0f4c6318e5 100644 --- a/boards/px4/fmu-v2/rover.cmake +++ b/boards/px4/fmu-v2/rover.cmake @@ -75,6 +75,7 @@ px4_add_board( top #topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v2/test.cmake b/boards/px4/fmu-v2/test.cmake index 732f116d41..5d24b4e629 100644 --- a/boards/px4/fmu-v2/test.cmake +++ b/boards/px4/fmu-v2/test.cmake @@ -116,6 +116,7 @@ px4_add_board( top #topic_listener tune_control + #uorb #usb_connected ver #work_queue diff --git a/boards/px4/fmu-v3/ctrlalloc.cmake b/boards/px4/fmu-v3/ctrlalloc.cmake index 726900aaf6..7c28b349b6 100644 --- a/boards/px4/fmu-v3/ctrlalloc.cmake +++ b/boards/px4/fmu-v3/ctrlalloc.cmake @@ -122,6 +122,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v3/default.cmake b/boards/px4/fmu-v3/default.cmake index 6891046e53..6880620067 100644 --- a/boards/px4/fmu-v3/default.cmake +++ b/boards/px4/fmu-v3/default.cmake @@ -120,6 +120,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v3/rtps.cmake b/boards/px4/fmu-v3/rtps.cmake index cc2ad9ee8e..be9068ff2f 100644 --- a/boards/px4/fmu-v3/rtps.cmake +++ b/boards/px4/fmu-v3/rtps.cmake @@ -116,6 +116,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v3/stackcheck.cmake b/boards/px4/fmu-v3/stackcheck.cmake index cba93b5f94..e9eaf3ab0e 100644 --- a/boards/px4/fmu-v3/stackcheck.cmake +++ b/boards/px4/fmu-v3/stackcheck.cmake @@ -111,6 +111,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v4/ctrlalloc.cmake b/boards/px4/fmu-v4/ctrlalloc.cmake index d94052facf..697956fbb8 100644 --- a/boards/px4/fmu-v4/ctrlalloc.cmake +++ b/boards/px4/fmu-v4/ctrlalloc.cmake @@ -119,6 +119,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v4/default.cmake b/boards/px4/fmu-v4/default.cmake index 6c88eb2c8e..93e46a62ef 100644 --- a/boards/px4/fmu-v4/default.cmake +++ b/boards/px4/fmu-v4/default.cmake @@ -118,6 +118,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v4/optimized.cmake b/boards/px4/fmu-v4/optimized.cmake index 05bb456997..b65a252300 100644 --- a/boards/px4/fmu-v4/optimized.cmake +++ b/boards/px4/fmu-v4/optimized.cmake @@ -112,6 +112,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v4/rtps.cmake b/boards/px4/fmu-v4/rtps.cmake index d87230acab..6075ce88bd 100644 --- a/boards/px4/fmu-v4/rtps.cmake +++ b/boards/px4/fmu-v4/rtps.cmake @@ -112,6 +112,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v4/stackcheck.cmake b/boards/px4/fmu-v4/stackcheck.cmake index 45e7577208..970e77528b 100644 --- a/boards/px4/fmu-v4/stackcheck.cmake +++ b/boards/px4/fmu-v4/stackcheck.cmake @@ -111,6 +111,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v4/uavcanv1.cmake b/boards/px4/fmu-v4/uavcanv1.cmake index b4a9b29283..acb0d8bbf2 100644 --- a/boards/px4/fmu-v4/uavcanv1.cmake +++ b/boards/px4/fmu-v4/uavcanv1.cmake @@ -117,6 +117,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v4pro/default.cmake b/boards/px4/fmu-v4pro/default.cmake index 3592562acd..4016bd5670 100644 --- a/boards/px4/fmu-v4pro/default.cmake +++ b/boards/px4/fmu-v4pro/default.cmake @@ -114,6 +114,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v4pro/rtps.cmake b/boards/px4/fmu-v4pro/rtps.cmake index 8167947868..5539cd4546 100644 --- a/boards/px4/fmu-v4pro/rtps.cmake +++ b/boards/px4/fmu-v4pro/rtps.cmake @@ -111,6 +111,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/critmonitor.cmake b/boards/px4/fmu-v5/critmonitor.cmake index 48d0368bbd..7932969f70 100644 --- a/boards/px4/fmu-v5/critmonitor.cmake +++ b/boards/px4/fmu-v5/critmonitor.cmake @@ -113,6 +113,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/ctrlalloc.cmake b/boards/px4/fmu-v5/ctrlalloc.cmake index 0adf5cff0d..c2dbb22f98 100644 --- a/boards/px4/fmu-v5/ctrlalloc.cmake +++ b/boards/px4/fmu-v5/ctrlalloc.cmake @@ -122,6 +122,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/debug.cmake b/boards/px4/fmu-v5/debug.cmake index e157e46b59..0ad41402b0 100644 --- a/boards/px4/fmu-v5/debug.cmake +++ b/boards/px4/fmu-v5/debug.cmake @@ -118,6 +118,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/default.cmake b/boards/px4/fmu-v5/default.cmake index 8eedc7b875..8472ad76d4 100644 --- a/boards/px4/fmu-v5/default.cmake +++ b/boards/px4/fmu-v5/default.cmake @@ -120,6 +120,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/fixedwing.cmake b/boards/px4/fmu-v5/fixedwing.cmake index 9ff4e3286d..8c333bcb4b 100644 --- a/boards/px4/fmu-v5/fixedwing.cmake +++ b/boards/px4/fmu-v5/fixedwing.cmake @@ -87,6 +87,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/irqmonitor.cmake b/boards/px4/fmu-v5/irqmonitor.cmake index 84f51e730a..4749467037 100644 --- a/boards/px4/fmu-v5/irqmonitor.cmake +++ b/boards/px4/fmu-v5/irqmonitor.cmake @@ -114,6 +114,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/multicopter.cmake b/boards/px4/fmu-v5/multicopter.cmake index f966510aa2..ba85501855 100644 --- a/boards/px4/fmu-v5/multicopter.cmake +++ b/boards/px4/fmu-v5/multicopter.cmake @@ -99,6 +99,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/optimized.cmake b/boards/px4/fmu-v5/optimized.cmake index 46a2d2599c..c63b47973c 100644 --- a/boards/px4/fmu-v5/optimized.cmake +++ b/boards/px4/fmu-v5/optimized.cmake @@ -111,6 +111,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/rover.cmake b/boards/px4/fmu-v5/rover.cmake index 94d03e80e9..331e5fc07c 100644 --- a/boards/px4/fmu-v5/rover.cmake +++ b/boards/px4/fmu-v5/rover.cmake @@ -86,6 +86,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/rtps.cmake b/boards/px4/fmu-v5/rtps.cmake index 615857d1b2..0604383d73 100644 --- a/boards/px4/fmu-v5/rtps.cmake +++ b/boards/px4/fmu-v5/rtps.cmake @@ -114,6 +114,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/stackcheck.cmake b/boards/px4/fmu-v5/stackcheck.cmake index d497763de4..087dc8b588 100644 --- a/boards/px4/fmu-v5/stackcheck.cmake +++ b/boards/px4/fmu-v5/stackcheck.cmake @@ -118,6 +118,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5/uavcanv1.cmake b/boards/px4/fmu-v5/uavcanv1.cmake index b75b5353ff..e7612a0fd1 100644 --- a/boards/px4/fmu-v5/uavcanv1.cmake +++ b/boards/px4/fmu-v5/uavcanv1.cmake @@ -120,6 +120,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5x/base_phy_DP83848C.cmake b/boards/px4/fmu-v5x/base_phy_DP83848C.cmake index e9bdbce90e..cedcdfd3ec 100644 --- a/boards/px4/fmu-v5x/base_phy_DP83848C.cmake +++ b/boards/px4/fmu-v5x/base_phy_DP83848C.cmake @@ -113,6 +113,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v5x/default.cmake b/boards/px4/fmu-v5x/default.cmake index d760d664df..b2544095df 100644 --- a/boards/px4/fmu-v5x/default.cmake +++ b/boards/px4/fmu-v5x/default.cmake @@ -117,6 +117,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v6u/default.cmake b/boards/px4/fmu-v6u/default.cmake index 4c839c807c..000017b7cd 100644 --- a/boards/px4/fmu-v6u/default.cmake +++ b/boards/px4/fmu-v6u/default.cmake @@ -116,6 +116,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v6u/stackcheck.cmake b/boards/px4/fmu-v6u/stackcheck.cmake index 4c839c807c..000017b7cd 100644 --- a/boards/px4/fmu-v6u/stackcheck.cmake +++ b/boards/px4/fmu-v6u/stackcheck.cmake @@ -116,6 +116,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v6x/default.cmake b/boards/px4/fmu-v6x/default.cmake index 0444cfb5d6..67d68acf7a 100644 --- a/boards/px4/fmu-v6x/default.cmake +++ b/boards/px4/fmu-v6x/default.cmake @@ -114,6 +114,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/fmu-v6x/stackcheck.cmake b/boards/px4/fmu-v6x/stackcheck.cmake index 0444cfb5d6..67d68acf7a 100644 --- a/boards/px4/fmu-v6x/stackcheck.cmake +++ b/boards/px4/fmu-v6x/stackcheck.cmake @@ -114,6 +114,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/px4/raspberrypi/default.cmake b/boards/px4/raspberrypi/default.cmake index 7e64927351..a728372bf5 100644 --- a/boards/px4/raspberrypi/default.cmake +++ b/boards/px4/raspberrypi/default.cmake @@ -79,6 +79,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/px4/sitl/ctrlalloc.cmake b/boards/px4/sitl/ctrlalloc.cmake index 61c126f8fc..267b18097a 100644 --- a/boards/px4/sitl/ctrlalloc.cmake +++ b/boards/px4/sitl/ctrlalloc.cmake @@ -82,6 +82,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/px4/sitl/default.cmake b/boards/px4/sitl/default.cmake index cccb9d9409..4b38a847bc 100644 --- a/boards/px4/sitl/default.cmake +++ b/boards/px4/sitl/default.cmake @@ -80,6 +80,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/px4/sitl/nolockstep.cmake b/boards/px4/sitl/nolockstep.cmake index f797304951..0cf36842b1 100644 --- a/boards/px4/sitl/nolockstep.cmake +++ b/boards/px4/sitl/nolockstep.cmake @@ -80,6 +80,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/px4/sitl/rtps.cmake b/boards/px4/sitl/rtps.cmake index cba4e8adfc..9004c67dbe 100644 --- a/boards/px4/sitl/rtps.cmake +++ b/boards/px4/sitl/rtps.cmake @@ -79,6 +79,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/px4/sitl/test.cmake b/boards/px4/sitl/test.cmake index 4c101974a4..861b5af0d2 100644 --- a/boards/px4/sitl/test.cmake +++ b/boards/px4/sitl/test.cmake @@ -78,6 +78,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/scumaker/pilotpi/arm64.cmake b/boards/scumaker/pilotpi/arm64.cmake index 9674354dd0..f02d39b087 100644 --- a/boards/scumaker/pilotpi/arm64.cmake +++ b/boards/scumaker/pilotpi/arm64.cmake @@ -79,6 +79,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/scumaker/pilotpi/default.cmake b/boards/scumaker/pilotpi/default.cmake index 853dbbf041..c5fed5e441 100644 --- a/boards/scumaker/pilotpi/default.cmake +++ b/boards/scumaker/pilotpi/default.cmake @@ -79,6 +79,7 @@ px4_add_board( #top topic_listener tune_control + uorb ver work_queue EXAMPLES diff --git a/boards/spracing/h7extreme/default.cmake b/boards/spracing/h7extreme/default.cmake index 9c7f0ada3a..e82de24a40 100644 --- a/boards/spracing/h7extreme/default.cmake +++ b/boards/spracing/h7extreme/default.cmake @@ -107,6 +107,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/boards/uvify/core/default.cmake b/boards/uvify/core/default.cmake index 4c7663d9b1..12d8879e1d 100644 --- a/boards/uvify/core/default.cmake +++ b/boards/uvify/core/default.cmake @@ -88,6 +88,7 @@ px4_add_board( top topic_listener tune_control + uorb usb_connected ver work_queue diff --git a/cmake/gtest/px4_add_gtest.cmake b/cmake/gtest/px4_add_gtest.cmake index 77b2b5c24f..5560fca062 100644 --- a/cmake/gtest/px4_add_gtest.cmake +++ b/cmake/gtest/px4_add_gtest.cmake @@ -92,7 +92,7 @@ function(px4_add_functional_gtest) target_link_libraries(${TESTNAME} ${LINKLIBS} gtest_functional_main px4_layer px4_platform - modules__uORB + uORB systemlib cdev px4_work_queue diff --git a/cmake/px4_add_common_flags.cmake b/cmake/px4_add_common_flags.cmake index 699d976641..546cbfce30 100644 --- a/cmake/px4_add_common_flags.cmake +++ b/cmake/px4_add_common_flags.cmake @@ -180,7 +180,9 @@ function(px4_add_common_flags) ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/${PX4_CHIP_MANUFACTURER}/${PX4_CHIP}/include ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/common/include + ${PX4_SOURCE_DIR}/platforms/common ${PX4_SOURCE_DIR}/platforms/common/include + ${PX4_SOURCE_DIR}/src ${PX4_SOURCE_DIR}/src/include ${PX4_SOURCE_DIR}/src/lib diff --git a/platforms/common/CMakeLists.txt b/platforms/common/CMakeLists.txt index be145bdbae..2e5dc931a6 100644 --- a/platforms/common/CMakeLists.txt +++ b/platforms/common/CMakeLists.txt @@ -36,7 +36,7 @@ set(SRCS) if (NOT "${PX4_PLATFORM}" MATCHES "qurt" AND NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader") list(APPEND SRCS px4_log.cpp - ) + ) endif() add_library(px4_platform @@ -50,11 +50,12 @@ add_library(px4_platform shutdown.cpp spi.cpp ${SRCS} - ) +) add_dependencies(px4_platform prebuild_targets) -if (NOT "${PX4_PLATFORM}" MATCHES "qurt" AND NOT "${PX4_BOARD}" MATCHES "io-v2") - target_link_libraries(px4_platform PRIVATE modules__uORB) # px4_log awkward dependency with uORB, TODO: orb should part of the platform layer +if (NOT "${PX4_BOARD}" MATCHES "io-v2") + add_subdirectory(uORB) + target_link_libraries(px4_platform PRIVATE uORB) endif() add_subdirectory(px4_work_queue) diff --git a/src/modules/uORB/CMakeLists.txt b/platforms/common/uORB/CMakeLists.txt similarity index 67% rename from src/modules/uORB/CMakeLists.txt rename to platforms/common/uORB/CMakeLists.txt index 8c97b527ba..5838d8c40e 100644 --- a/src/modules/uORB/CMakeLists.txt +++ b/platforms/common/uORB/CMakeLists.txt @@ -31,44 +31,35 @@ # ############################################################################ -if(NOT PX4_BOARD MATCHES "px4_io") # TODO: fix this hack (move uORB to platform layer) +# this includes the generated topics directory +include_directories(${CMAKE_CURRENT_BINARY_DIR}) - # this includes the generated topics directory - include_directories(${CMAKE_CURRENT_BINARY_DIR}) +px4_add_library(uORB + ORBSet.hpp + Publication.hpp + PublicationMulti.hpp + Subscription.cpp + Subscription.hpp + SubscriptionCallback.hpp + SubscriptionInterval.hpp + SubscriptionMultiArray.hpp + uORB.cpp + uORB.h + uORBCommon.hpp + uORBCommunicator.hpp + uORBDeviceMaster.cpp + uORBDeviceMaster.hpp + uORBDeviceNode.cpp + uORBDeviceNode.hpp + uORBManager.cpp + uORBManager.hpp + uORBUtils.cpp + uORBUtils.hpp +) - px4_add_module( - MODULE modules__uORB - MAIN uorb - COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} - SRCS - ORBSet.hpp - Publication.hpp - PublicationMulti.hpp - Subscription.cpp - Subscription.hpp - SubscriptionCallback.hpp - SubscriptionInterval.hpp - SubscriptionMultiArray.hpp - uORB.cpp - uORB.h - uORBCommon.hpp - uORBCommunicator.hpp - uORBDeviceMaster.cpp - uORBDeviceMaster.hpp - uORBDeviceNode.cpp - uORBDeviceNode.hpp - uORBMain.cpp - uORBManager.cpp - uORBManager.hpp - uORBUtils.cpp - uORBUtils.hpp - DEPENDS - cdev - uorb_msgs - ) +target_compile_options(uORB PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_link_libraries(uORB PRIVATE cdev uorb_msgs) - if(PX4_TESTING) - add_subdirectory(uORB_tests) - endif() +if(PX4_TESTING) + add_subdirectory(uORB_tests) endif() diff --git a/src/modules/uORB/ORBSet.hpp b/platforms/common/uORB/ORBSet.hpp similarity index 99% rename from src/modules/uORB/ORBSet.hpp rename to platforms/common/uORB/ORBSet.hpp index 94ba85138e..aed38dbc8f 100644 --- a/src/modules/uORB/ORBSet.hpp +++ b/platforms/common/uORB/ORBSet.hpp @@ -143,4 +143,3 @@ private: Node *_top; Node *_end; }; - diff --git a/src/modules/uORB/Publication.hpp b/platforms/common/uORB/Publication.hpp similarity index 100% rename from src/modules/uORB/Publication.hpp rename to platforms/common/uORB/Publication.hpp diff --git a/src/modules/uORB/PublicationMulti.hpp b/platforms/common/uORB/PublicationMulti.hpp similarity index 100% rename from src/modules/uORB/PublicationMulti.hpp rename to platforms/common/uORB/PublicationMulti.hpp diff --git a/src/modules/uORB/Subscription.cpp b/platforms/common/uORB/Subscription.cpp similarity index 100% rename from src/modules/uORB/Subscription.cpp rename to platforms/common/uORB/Subscription.cpp diff --git a/src/modules/uORB/Subscription.hpp b/platforms/common/uORB/Subscription.hpp similarity index 100% rename from src/modules/uORB/Subscription.hpp rename to platforms/common/uORB/Subscription.hpp diff --git a/src/modules/uORB/SubscriptionBlocking.hpp b/platforms/common/uORB/SubscriptionBlocking.hpp similarity index 100% rename from src/modules/uORB/SubscriptionBlocking.hpp rename to platforms/common/uORB/SubscriptionBlocking.hpp diff --git a/src/modules/uORB/SubscriptionCallback.hpp b/platforms/common/uORB/SubscriptionCallback.hpp similarity index 100% rename from src/modules/uORB/SubscriptionCallback.hpp rename to platforms/common/uORB/SubscriptionCallback.hpp diff --git a/src/modules/uORB/SubscriptionInterval.hpp b/platforms/common/uORB/SubscriptionInterval.hpp similarity index 100% rename from src/modules/uORB/SubscriptionInterval.hpp rename to platforms/common/uORB/SubscriptionInterval.hpp diff --git a/src/modules/uORB/SubscriptionMultiArray.hpp b/platforms/common/uORB/SubscriptionMultiArray.hpp similarity index 100% rename from src/modules/uORB/SubscriptionMultiArray.hpp rename to platforms/common/uORB/SubscriptionMultiArray.hpp diff --git a/src/modules/uORB/uORB.cpp b/platforms/common/uORB/uORB.cpp similarity index 84% rename from src/modules/uORB/uORB.cpp rename to platforms/common/uORB/uORB.cpp index 23830d4638..7e3b96904d 100644 --- a/src/modules/uORB/uORB.cpp +++ b/platforms/common/uORB/uORB.cpp @@ -37,9 +37,60 @@ */ #include "uORB.h" + #include "uORBManager.hpp" #include "uORBCommon.hpp" +static uORB::DeviceMaster *g_dev = nullptr; + +int uorb_start(void) +{ + if (g_dev != nullptr) { + PX4_WARN("already loaded"); + /* user wanted to start uorb, its already running, no error */ + return 0; + } + + if (!uORB::Manager::initialize()) { + PX4_ERR("uorb manager alloc failed"); + return -ENOMEM; + } + + /* create the driver */ + g_dev = uORB::Manager::get_instance()->get_device_master(); + + if (g_dev == nullptr) { + return -errno; + } + + return OK; +} + +int uorb_status(void) +{ + if (g_dev != nullptr) { + g_dev->printStatistics(); + + } else { + PX4_INFO("uorb is not running"); + } + + return OK; +} + +int uorb_top(char **topic_filter, int num_filters) +{ + if (g_dev != nullptr) { + g_dev->showTop(topic_filter, num_filters); + + } else { + PX4_INFO("uorb is not running"); + } + + return OK; +} + + orb_advert_t orb_advertise(const struct orb_metadata *meta, const void *data) { return uORB::Manager::get_instance()->orb_advertise(meta, data); diff --git a/src/modules/uORB/uORB.h b/platforms/common/uORB/uORB.h similarity index 98% rename from src/modules/uORB/uORB.h rename to platforms/common/uORB/uORB.h index b9d0f2705f..95061c37f4 100644 --- a/src/modules/uORB/uORB.h +++ b/platforms/common/uORB/uORB.h @@ -114,6 +114,10 @@ typedef const struct orb_metadata *orb_id_t; __BEGIN_DECLS +int uorb_start(void); +int uorb_status(void); +int uorb_top(char **topic_filter, int num_filters); + /** * ORB topic advertiser handle. * diff --git a/src/modules/uORB/uORBCommon.hpp b/platforms/common/uORB/uORBCommon.hpp similarity index 100% rename from src/modules/uORB/uORBCommon.hpp rename to platforms/common/uORB/uORBCommon.hpp diff --git a/src/modules/uORB/uORBCommunicator.hpp b/platforms/common/uORB/uORBCommunicator.hpp similarity index 100% rename from src/modules/uORB/uORBCommunicator.hpp rename to platforms/common/uORB/uORBCommunicator.hpp diff --git a/src/modules/uORB/uORBDeviceMaster.cpp b/platforms/common/uORB/uORBDeviceMaster.cpp similarity index 100% rename from src/modules/uORB/uORBDeviceMaster.cpp rename to platforms/common/uORB/uORBDeviceMaster.cpp diff --git a/src/modules/uORB/uORBDeviceMaster.hpp b/platforms/common/uORB/uORBDeviceMaster.hpp similarity index 100% rename from src/modules/uORB/uORBDeviceMaster.hpp rename to platforms/common/uORB/uORBDeviceMaster.hpp diff --git a/src/modules/uORB/uORBDeviceNode.cpp b/platforms/common/uORB/uORBDeviceNode.cpp similarity index 100% rename from src/modules/uORB/uORBDeviceNode.cpp rename to platforms/common/uORB/uORBDeviceNode.cpp diff --git a/src/modules/uORB/uORBDeviceNode.hpp b/platforms/common/uORB/uORBDeviceNode.hpp similarity index 100% rename from src/modules/uORB/uORBDeviceNode.hpp rename to platforms/common/uORB/uORBDeviceNode.hpp diff --git a/src/modules/uORB/uORBManager.cpp b/platforms/common/uORB/uORBManager.cpp similarity index 100% rename from src/modules/uORB/uORBManager.cpp rename to platforms/common/uORB/uORBManager.cpp diff --git a/src/modules/uORB/uORBManager.hpp b/platforms/common/uORB/uORBManager.hpp similarity index 100% rename from src/modules/uORB/uORBManager.hpp rename to platforms/common/uORB/uORBManager.hpp diff --git a/src/modules/uORB/uORBTopics.h b/platforms/common/uORB/uORBTopics.h similarity index 100% rename from src/modules/uORB/uORBTopics.h rename to platforms/common/uORB/uORBTopics.h diff --git a/src/modules/uORB/uORBUtils.cpp b/platforms/common/uORB/uORBUtils.cpp similarity index 100% rename from src/modules/uORB/uORBUtils.cpp rename to platforms/common/uORB/uORBUtils.cpp diff --git a/src/modules/uORB/uORBUtils.hpp b/platforms/common/uORB/uORBUtils.hpp similarity index 100% rename from src/modules/uORB/uORBUtils.hpp rename to platforms/common/uORB/uORBUtils.hpp diff --git a/src/modules/uORB/uORB_tests/CMakeLists.txt b/platforms/common/uORB/uORB_tests/CMakeLists.txt similarity index 100% rename from src/modules/uORB/uORB_tests/CMakeLists.txt rename to platforms/common/uORB/uORB_tests/CMakeLists.txt diff --git a/src/modules/uORB/uORB_tests/uORBTest_UnitTest.cpp b/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp similarity index 100% rename from src/modules/uORB/uORB_tests/uORBTest_UnitTest.cpp rename to platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp diff --git a/src/modules/uORB/uORB_tests/uORBTest_UnitTest.hpp b/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.hpp similarity index 100% rename from src/modules/uORB/uORB_tests/uORBTest_UnitTest.hpp rename to platforms/common/uORB/uORB_tests/uORBTest_UnitTest.hpp diff --git a/src/modules/uORB/uORB_tests/uORB_tests_main.cpp b/platforms/common/uORB/uORB_tests/uORB_tests_main.cpp similarity index 100% rename from src/modules/uORB/uORB_tests/uORB_tests_main.cpp rename to platforms/common/uORB/uORB_tests/uORB_tests_main.cpp diff --git a/platforms/nuttx/CMakeLists.txt b/platforms/nuttx/CMakeLists.txt index 0c78f21541..93c34ffc80 100644 --- a/platforms/nuttx/CMakeLists.txt +++ b/platforms/nuttx/CMakeLists.txt @@ -93,7 +93,7 @@ list(APPEND nuttx_libs nuttx_fs nuttx_mm nuttx_sched - ) +) if (CONFIG_NET) list(APPEND nuttx_libs nuttx_net) @@ -163,7 +163,7 @@ endif() add_custom_command(OUTPUT ${PX4_BINARY_OUTPUT} COMMAND ${CMAKE_OBJCOPY} -O binary ${PX4_BINARY_DIR_REL}/${FW_NAME} ${PX4_BINARY_OUTPUT} DEPENDS px4 - ) +) # create .px4 with parameter and airframe metadata if (TARGET parameters_xml AND TARGET airframes_xml) @@ -203,7 +203,7 @@ add_custom_target(weak_symbols DEPENDS px4 VERBATIM USES_TERMINAL - ) +) # debugger helpers @@ -292,7 +292,7 @@ add_custom_target(debug DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit WORKING_DIRECTORY ${PX4_BINARY_DIR} USES_TERMINAL - ) +) include(blackmagic) include(jlink) diff --git a/platforms/nuttx/src/px4/common/CMakeLists.txt b/platforms/nuttx/src/px4/common/CMakeLists.txt index 5bb17b5877..6a87f19a10 100644 --- a/platforms/nuttx/src/px4/common/CMakeLists.txt +++ b/platforms/nuttx/src/px4/common/CMakeLists.txt @@ -32,7 +32,7 @@ ############################################################################ # skip for px4_layer support on an IO board -if(NOT PX4_BOARD MATCHES "px4_io") +if(NOT PX4_BOARD MATCHES "io-v2") add_library(px4_layer board_crashdump.c @@ -57,6 +57,7 @@ if(NOT PX4_BOARD MATCHES "px4_io") nuttx_apps nuttx_sched px4_work_queue + uORB ) else() add_library(px4_layer ${PX4_SOURCE_DIR}/platforms/common/empty.c) diff --git a/platforms/nuttx/src/px4/common/px4_init.cpp b/platforms/nuttx/src/px4/common/px4_init.cpp index c731ad16b6..563974a171 100644 --- a/platforms/nuttx/src/px4/common/px4_init.cpp +++ b/platforms/nuttx/src/px4/common/px4_init.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include @@ -118,6 +119,10 @@ int px4_platform_init(void) px4::WorkQueueManagerStart(); + uorb_start(); + + px4_log_initialize(); + return PX4_OK; } diff --git a/platforms/posix/CMakeLists.txt b/platforms/posix/CMakeLists.txt index 03eb02daa1..927c3e35b2 100644 --- a/platforms/posix/CMakeLists.txt +++ b/platforms/posix/CMakeLists.txt @@ -70,7 +70,7 @@ else() target_link_libraries(px4 PRIVATE rt) endif() - target_link_libraries(px4 PRIVATE modules__uORB) + target_link_libraries(px4 PRIVATE uORB) #============================================================================= # install diff --git a/platforms/posix/src/px4/common/px4_init.cpp b/platforms/posix/src/px4/common/px4_init.cpp index a28e01c014..b93a53ba5f 100644 --- a/platforms/posix/src/px4/common/px4_init.cpp +++ b/platforms/posix/src/px4/common/px4_init.cpp @@ -37,6 +37,7 @@ #include #include #include +#include int px4_platform_init(void) { @@ -46,5 +47,9 @@ int px4_platform_init(void) px4::WorkQueueManagerStart(); + uorb_start(); + + px4_log_initialize(); + return PX4_OK; } diff --git a/platforms/qurt/src/px4/common/commands_hil.c b/platforms/qurt/src/px4/common/commands_hil.c index 8baaa32416..6519fcce32 100644 --- a/platforms/qurt/src/px4/common/commands_hil.c +++ b/platforms/qurt/src/px4/common/commands_hil.c @@ -42,7 +42,6 @@ const char *get_commands() { static const char *commands = - "uorb start\n" "param set CAL_GYRO0_ID 2293760\n" "param set CAL_ACC0_ID 1310720\n" "param set CAL_ACC1_ID 1376256\n" diff --git a/platforms/qurt/src/px4/common/main.cpp b/platforms/qurt/src/px4/common/main.cpp index 5d69ae9491..a238dc33f5 100644 --- a/platforms/qurt/src/px4/common/main.cpp +++ b/platforms/qurt/src/px4/common/main.cpp @@ -184,7 +184,7 @@ const char *get_commands() // All that needs to be started automatically on the DSP side // are uorb and qshell. After that, everything else can get // started from the main startup script on the Linux side. - static const char *commands = "uorb start\nqshell start\n"; + static const char *commands = "qshell start\n"; return commands; } diff --git a/platforms/qurt/src/px4/common/px4_init.cpp b/platforms/qurt/src/px4/common/px4_init.cpp index 1921d88fe3..73bada3ae1 100644 --- a/platforms/qurt/src/px4/common/px4_init.cpp +++ b/platforms/qurt/src/px4/common/px4_init.cpp @@ -46,5 +46,9 @@ int px4_platform_init() px4::WorkQueueManagerStart(); + uorb_start(); + + //px4_log_initialize(); + return PX4_OK; } diff --git a/posix-configs/SITL/init/test/cmd_template.in b/posix-configs/SITL/init/test/cmd_template.in index 78a3c7726d..c758f6a8ec 100644 --- a/posix-configs/SITL/init/test/cmd_template.in +++ b/posix-configs/SITL/init/test/cmd_template.in @@ -3,8 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start - param load param set CBRK_SUPPLY_CHK 894281 param set SYS_RESTART_TYPE 0 diff --git a/posix-configs/SITL/init/test/test_mavlink b/posix-configs/SITL/init/test/test_mavlink index 540eb03096..e5db40970f 100644 --- a/posix-configs/SITL/init/test/test_mavlink +++ b/posix-configs/SITL/init/test/test_mavlink @@ -3,8 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start - param load param set CBRK_SUPPLY_CHK 894281 param set SYS_RESTART_TYPE 0 diff --git a/posix-configs/SITL/init/test/test_shutdown b/posix-configs/SITL/init/test/test_shutdown index 8fe5fe1f7d..6f5649f9f2 100644 --- a/posix-configs/SITL/init/test/test_shutdown +++ b/posix-configs/SITL/init/test/test_shutdown @@ -3,8 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start - param load param set BAT_N_CELLS 3 diff --git a/posix-configs/SITL/init/test/test_template.in b/posix-configs/SITL/init/test/test_template.in index c55a98ece2..d495bde084 100644 --- a/posix-configs/SITL/init/test/test_template.in +++ b/posix-configs/SITL/init/test/test_template.in @@ -3,8 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start - param load param set CBRK_SUPPLY_CHK 894281 param set SYS_RESTART_TYPE 0 diff --git a/posix-configs/SITL/init/test/tests_all b/posix-configs/SITL/init/test/tests_all index 252cc343a1..063dee50da 100644 --- a/posix-configs/SITL/init/test/tests_all +++ b/posix-configs/SITL/init/test/tests_all @@ -3,8 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start - param load param set CBRK_SUPPLY_CHK 894281 param set SYS_RESTART_TYPE 0 diff --git a/posix-configs/bbblue/px4.config b/posix-configs/bbblue/px4.config index ed127ef660..25517b324d 100644 --- a/posix-configs/bbblue/px4.config +++ b/posix-configs/bbblue/px4.config @@ -6,7 +6,6 @@ # config for a quad # modified from ../rpi/px4.config -uorb start param load param set CBRK_SUPPLY_CHK 894281 diff --git a/posix-configs/bbblue/px4_fw.config b/posix-configs/bbblue/px4_fw.config index 11ec56d554..8ed0816836 100644 --- a/posix-configs/bbblue/px4_fw.config +++ b/posix-configs/bbblue/px4_fw.config @@ -6,7 +6,6 @@ # config for fixed wing (FW) # modified from ./px4.config, switch att/pos_control & mixer -uorb start param load param set CBRK_SUPPLY_CHK 894281 diff --git a/posix-configs/eagle/200qx/mainapp.config b/posix-configs/eagle/200qx/mainapp.config index fedc520c27..43495fd679 100644 --- a/posix-configs/eagle/200qx/mainapp.config +++ b/posix-configs/eagle/200qx/mainapp.config @@ -4,7 +4,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start muorb start logger start -t -b 200 # Wait 1s before setting parameters for muorb to initialize diff --git a/posix-configs/eagle/200qx/px4.config b/posix-configs/eagle/200qx/px4.config index 2ffb972c0b..90d35c64e8 100644 --- a/posix-configs/eagle/200qx/px4.config +++ b/posix-configs/eagle/200qx/px4.config @@ -1,4 +1,3 @@ -uorb start qshell start param set CBRK_SUPPLY_CHK 894281 param set SYS_AUTOSTART 4001 diff --git a/posix-configs/eagle/210qc/mainapp.config b/posix-configs/eagle/210qc/mainapp.config index fedc520c27..43495fd679 100644 --- a/posix-configs/eagle/210qc/mainapp.config +++ b/posix-configs/eagle/210qc/mainapp.config @@ -4,7 +4,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start muorb start logger start -t -b 200 # Wait 1s before setting parameters for muorb to initialize diff --git a/posix-configs/eagle/210qc/px4.config b/posix-configs/eagle/210qc/px4.config index 0780e33a9b..941a704607 100644 --- a/posix-configs/eagle/210qc/px4.config +++ b/posix-configs/eagle/210qc/px4.config @@ -1,4 +1,3 @@ -uorb start qshell start param set CBRK_SUPPLY_CHK 894281 param set SYS_AUTOSTART 4001 diff --git a/posix-configs/eagle/flight/mainapp.config b/posix-configs/eagle/flight/mainapp.config index fedc520c27..43495fd679 100644 --- a/posix-configs/eagle/flight/mainapp.config +++ b/posix-configs/eagle/flight/mainapp.config @@ -4,7 +4,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start muorb start logger start -t -b 200 # Wait 1s before setting parameters for muorb to initialize diff --git a/posix-configs/eagle/flight/px4.config b/posix-configs/eagle/flight/px4.config index 6b13a92bf0..0ae7e48503 100644 --- a/posix-configs/eagle/flight/px4.config +++ b/posix-configs/eagle/flight/px4.config @@ -1,4 +1,3 @@ -uorb start qshell start param set CBRK_SUPPLY_CHK 894281 param set SYS_AUTOSTART 4001 diff --git a/posix-configs/eagle/hil/mainapphil.config b/posix-configs/eagle/hil/mainapphil.config index 30ed3728fc..edfc7d21b7 100644 --- a/posix-configs/eagle/hil/mainapphil.config +++ b/posix-configs/eagle/hil/mainapphil.config @@ -1,4 +1,3 @@ -uorb start muorb start # Wait 1s before setting parameters for muorb to initialize sleep 1 diff --git a/posix-configs/eagle/hil/px4.config b/posix-configs/eagle/hil/px4.config index f8b8d9bb5c..f1afab09db 100644 --- a/posix-configs/eagle/hil/px4.config +++ b/posix-configs/eagle/hil/px4.config @@ -1,4 +1,3 @@ -uorb start qshell start param set CBRK_SUPPLY_CHK 894281 diff --git a/posix-configs/eagle/init/rcS b/posix-configs/eagle/init/rcS index 6ae93a882f..387dba1ebb 100644 --- a/posix-configs/eagle/init/rcS +++ b/posix-configs/eagle/init/rcS @@ -4,7 +4,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start muorb start # We need to wait until the DSP side is ready before diff --git a/posix-configs/excelsior/mainapp.config b/posix-configs/excelsior/mainapp.config index 1d26ad5f7b..c2a8740fc0 100644 --- a/posix-configs/excelsior/mainapp.config +++ b/posix-configs/excelsior/mainapp.config @@ -3,7 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start muorb start logger start -e -t param set CBRK_SUPPLY_CHK 894281 diff --git a/posix-configs/excelsior/px4.config b/posix-configs/excelsior/px4.config index d0206e5f3d..f634095b35 100644 --- a/posix-configs/excelsior/px4.config +++ b/posix-configs/excelsior/px4.config @@ -1,4 +1,3 @@ -uorb start qshell start param set CBRK_SUPPLY_CHK 894281 param set SYS_AUTOSTART 4001 diff --git a/posix-configs/ocpoc/px4.config b/posix-configs/ocpoc/px4.config index 82de41b52f..e533c2b5a6 100644 --- a/posix-configs/ocpoc/px4.config +++ b/posix-configs/ocpoc/px4.config @@ -3,8 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start - param select /root/rootfs/eeprom/parameters if [ -f /root/rootfs/eeprom/parameters ] then diff --git a/posix-configs/rpi/pilotpi_fw.config b/posix-configs/rpi/pilotpi_fw.config index 56ec62f6e1..977b27649e 100644 --- a/posix-configs/rpi/pilotpi_fw.config +++ b/posix-configs/rpi/pilotpi_fw.config @@ -3,8 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start - if [ -f eeprom/parameters ] then param load diff --git a/posix-configs/rpi/pilotpi_mc.config b/posix-configs/rpi/pilotpi_mc.config index 12b6816f24..d09bd21c0e 100644 --- a/posix-configs/rpi/pilotpi_mc.config +++ b/posix-configs/rpi/pilotpi_mc.config @@ -3,8 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -uorb start - if [ -f eeprom/parameters ] then param load diff --git a/posix-configs/rpi/px4.config b/posix-configs/rpi/px4.config index 55bdb73284..d9a63b25ae 100644 --- a/posix-configs/rpi/px4.config +++ b/posix-configs/rpi/px4.config @@ -5,8 +5,6 @@ # navio config for a quad -uorb start - if [ -f eeprom/parameters ] then param load diff --git a/posix-configs/rpi/px4_fw.config b/posix-configs/rpi/px4_fw.config index 7f2f5c228e..b814e624d0 100644 --- a/posix-configs/rpi/px4_fw.config +++ b/posix-configs/rpi/px4_fw.config @@ -5,8 +5,6 @@ # navio config for FW -uorb start - if [ -f eeprom/parameters ] then param load diff --git a/posix-configs/rpi/px4_hil.config b/posix-configs/rpi/px4_hil.config index b9d945d2bd..8d1abad588 100644 --- a/posix-configs/rpi/px4_hil.config +++ b/posix-configs/rpi/px4_hil.config @@ -7,8 +7,6 @@ # connect to it with jMAVSim: # ./Tools/jmavsim_run.sh -q -i -p 14577 -r 250 -uorb start - if [ -f eeprom/parameters ] then param load diff --git a/posix-configs/rpi/px4_test.config b/posix-configs/rpi/px4_test.config index d31dc08ffe..07562034f9 100644 --- a/posix-configs/rpi/px4_test.config +++ b/posix-configs/rpi/px4_test.config @@ -5,8 +5,6 @@ # navio config for simple testing -uorb start - if [ -f eeprom/parameters ] then param load diff --git a/src/lib/parameters/CMakeLists.txt b/src/lib/parameters/CMakeLists.txt index 3964ade448..4978af39d1 100644 --- a/src/lib/parameters/CMakeLists.txt +++ b/src/lib/parameters/CMakeLists.txt @@ -150,11 +150,7 @@ if (NOT "${PX4_BOARD}" MATCHES "px4_io") px4_parameters.hpp ) - if ("${CONFIG_SHMEM}" STREQUAL "1") - target_link_libraries(parameters PRIVATE px4_layer) - endif() - - target_link_libraries(parameters PRIVATE perf tinybson) + target_link_libraries(parameters PRIVATE perf tinybson px4_layer) target_compile_definitions(parameters PRIVATE -DMODULE_NAME="parameters") target_compile_options(parameters PRIVATE diff --git a/src/modules/events/CMakeLists.txt b/src/modules/events/CMakeLists.txt index a886cd5f4f..8c54833d4e 100644 --- a/src/modules/events/CMakeLists.txt +++ b/src/modules/events/CMakeLists.txt @@ -40,6 +40,4 @@ px4_add_module( send_event.cpp set_leds.cpp status_display.cpp - DEPENDS - modules__uORB ) diff --git a/src/modules/muorb/adsp/CMakeLists.txt b/src/modules/muorb/adsp/CMakeLists.txt index 7da84aa170..de899113b0 100644 --- a/src/modules/muorb/adsp/CMakeLists.txt +++ b/src/modules/muorb/adsp/CMakeLists.txt @@ -35,4 +35,4 @@ px4_add_library(modules__muorb__adsp px4muorb.cpp uORBFastRpcChannel.cpp ) -target_include_directories(modules__muorb__adsp PRIVATE ${PX4_SOURCE_DIR}/src/modules/uORB) +target_include_directories(modules__muorb__adsp PRIVATE ${PX4_SOURCE_DIR}/platforms/common/uORB) diff --git a/src/systemcmds/uorb/CMakeLists.txt b/src/systemcmds/uorb/CMakeLists.txt new file mode 100644 index 0000000000..2c1362394b --- /dev/null +++ b/src/systemcmds/uorb/CMakeLists.txt @@ -0,0 +1,40 @@ +############################################################################ +# +# Copyright (c) 2021 PX4 Development Team. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name PX4 nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ +px4_add_module( + MODULE systemcmds__uorb + MAIN uorb + COMPILE_FLAGS + SRCS + uorb.cpp + DEPENDS + ) diff --git a/src/modules/uORB/uORBMain.cpp b/src/systemcmds/uorb/uorb.cpp similarity index 64% rename from src/modules/uORB/uORBMain.cpp rename to src/systemcmds/uorb/uorb.cpp index 84e05f34ff..b9fb565c14 100644 --- a/src/modules/uORB/uORBMain.cpp +++ b/src/systemcmds/uorb/uorb.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2012-2015 PX4 Development Team. All rights reserved. + * Copyright (c) 2020 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,36 +33,49 @@ #include -#include "uORBManager.hpp" -#include "uORB.h" -#include "uORBCommon.hpp" +#include #include #include extern "C" { __EXPORT int uorb_main(int argc, char *argv[]); } -static uORB::DeviceMaster *g_dev = nullptr; -static void usage() +static void usage(); + +int uorb_main(int argc, char *argv[]) +{ + if (argc < 2) { + usage(); + return -1; + } + + if (!strcmp(argv[1], "start")) { + return uorb_start(); + + } else if (!strcmp(argv[1], "status")) { + return uorb_status(); + + } else if (!strcmp(argv[1], "top")) { + return uorb_top(argv + 2, argc - 2); + } + + usage(); + return 0; +} + +void usage() { PRINT_MODULE_DESCRIPTION( R"DESCR_STR( ### Description uORB is the internal pub-sub messaging system, used for communication between modules. -It is typically started as one of the very first modules and most other modules depend on it. - ### Implementation -No thread or work queue is needed, the module start only makes sure to initialize the shared global state. -Communication is done via shared memory. The implementation is asynchronous and lock-free, ie. a publisher does not wait for a subscriber and vice versa. This is achieved by having a separate buffer between a publisher and a subscriber. The code is optimized to minimize the memory footprint and the latency to exchange messages. -The interface is based on file descriptors: internally it uses `read`, `write` and `ioctl`. Except for the -publications, which use `orb_advert_t` handles, so that they can be used from interrupts as well (on NuttX). - Messages are defined in the `/msg` directory. They are converted into C/C++ code at build-time. If compiled with ORB_USE_PUBLISHER_RULES, a file with uORB publication rules can be used to configure which @@ -74,80 +87,9 @@ $ uorb top )DESCR_STR"); PRINT_MODULE_USAGE_NAME("uorb", "communication"); - PRINT_MODULE_USAGE_COMMAND("start"); PRINT_MODULE_USAGE_COMMAND_DESCR("status", "Print topic statistics"); PRINT_MODULE_USAGE_COMMAND_DESCR("top", "Monitor topic publication rates"); PRINT_MODULE_USAGE_PARAM_FLAG('a', "print all instead of only currently publishing topics with subscribers", true); PRINT_MODULE_USAGE_PARAM_FLAG('1', "run only once, then exit", true); PRINT_MODULE_USAGE_ARG(" []", "topic(s) to match (implies -a)", true); } - -int -uorb_main(int argc, char *argv[]) -{ - if (argc < 2) { - usage(); - return -EINVAL; - } - - /* - * Start/load the driver. - */ - if (!strcmp(argv[1], "start")) { - - if (g_dev != nullptr) { - PX4_WARN("already loaded"); - /* user wanted to start uorb, its already running, no error */ - return 0; - } - - if (!uORB::Manager::initialize()) { - PX4_ERR("uorb manager alloc failed"); - return -ENOMEM; - } - - /* create the driver */ - g_dev = uORB::Manager::get_instance()->get_device_master(); - - if (g_dev == nullptr) { - return -errno; - } - -#if !defined(__PX4_QURT) - /* FIXME: this fails on Snapdragon (see https://github.com/PX4/Firmware/issues/5406), - * so we disable logging messages to the ulog for now. This needs further investigations. - */ - px4_log_initialize(); -#endif - - return OK; - } - - /* - * Print driver information. - */ - if (!strcmp(argv[1], "status")) { - if (g_dev != nullptr) { - g_dev->printStatistics(); - - } else { - PX4_INFO("uorb is not running"); - } - - return OK; - } - - if (!strcmp(argv[1], "top")) { - if (g_dev != nullptr) { - g_dev->showTop(argv + 2, argc - 2); - - } else { - PX4_INFO("uorb is not running"); - } - - return OK; - } - - usage(); - return -EINVAL; -} diff --git a/src/templates/template_module/CMakeLists.txt b/src/templates/template_module/CMakeLists.txt index 19e9e5d313..ddda8ba394 100644 --- a/src/templates/template_module/CMakeLists.txt +++ b/src/templates/template_module/CMakeLists.txt @@ -36,7 +36,5 @@ px4_add_module( MAIN template_module SRCS template_module.cpp - DEPENDS - modules__uORB )