From 9ace6a70b399b3a9c16833e3e2b298c83dcf3fcf Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Tue, 25 Apr 2023 13:52:47 +0000 Subject: [PATCH] add heartbeat package --- px4_connection/CMakeLists.txt | 45 ++++++++++++++++++++++++++++++++ px4_connection/package.xml | 20 ++++++++++++++ px4_connection/src/heartbeat.cpp | 10 +++++++ src/px4_msgs | 2 +- src/px4_ros_com | 2 +- 5 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 px4_connection/CMakeLists.txt create mode 100644 px4_connection/package.xml create mode 100644 px4_connection/src/heartbeat.cpp diff --git a/px4_connection/CMakeLists.txt b/px4_connection/CMakeLists.txt new file mode 100644 index 00000000..874483cc --- /dev/null +++ b/px4_connection/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.5) +project(px4_connection) + +# Default to C99 +if(NOT CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) +endif() + +# Default to C++14 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) +find_package(rclcpp REQUIRED) + +add_executable(heartbeat src/heartbeat.cpp) +target_include_directories(heartbeat PUBLIC + $ + $) +ament_target_dependencies( + heartbeat + "rclcpp" +) + +install(TARGETS heartbeat + DESTINATION lib/${PROJECT_NAME}) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + # the following line skips the linter which checks for copyrights + # uncomment the line when a copyright and license is not present in all source files + #set(ament_cmake_copyright_FOUND TRUE) + # the following line skips cpplint (only works in a git repo) + # uncomment the line when this package is not in a git repo + #set(ament_cmake_cpplint_FOUND TRUE) + ament_lint_auto_find_test_dependencies() +endif() + +ament_package() diff --git a/px4_connection/package.xml b/px4_connection/package.xml new file mode 100644 index 00000000..4a804039 --- /dev/null +++ b/px4_connection/package.xml @@ -0,0 +1,20 @@ + + + + px4_connection + 0.0.0 + TODO: Package description + ubuntu + TODO: License declaration + + ament_cmake + + rclcpp + + ament_lint_auto + ament_lint_common + + + ament_cmake + + diff --git a/px4_connection/src/heartbeat.cpp b/px4_connection/src/heartbeat.cpp new file mode 100644 index 00000000..5d36d006 --- /dev/null +++ b/px4_connection/src/heartbeat.cpp @@ -0,0 +1,10 @@ +#include + +int main(int argc, char ** argv) +{ + (void) argc; + (void) argv; + + printf("hello world px4_connection package\n"); + return 0; +} diff --git a/src/px4_msgs b/src/px4_msgs index b64ef047..4db0a3f1 160000 --- a/src/px4_msgs +++ b/src/px4_msgs @@ -1 +1 @@ -Subproject commit b64ef0475c1d44605688f4770899fe453d532be4 +Subproject commit 4db0a3f14ea81b9de7511d738f8ad9bd8ae5b3ad diff --git a/src/px4_ros_com b/src/px4_ros_com index 1562ff30..0bcf68bc 160000 --- a/src/px4_ros_com +++ b/src/px4_ros_com @@ -1 +1 @@ -Subproject commit 1562ff30d56b7ba26e4d2436724490f900cc2375 +Subproject commit 0bcf68bcb635199adcd134e8932932054e863c0d