From 6349e6d22d161ce2d962d25a15881329c7eb58e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6ldi=20Tam=C3=A1s?= Date: Thu, 30 Nov 2023 12:16:41 +0100 Subject: [PATCH 01/12] build: fix build script for humble --- CMakeLists.txt | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 953a6c2..ca11cb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,12 +19,8 @@ endif() add_subdirectory(witmotion-uart-qt) -#set(CMAKE_AUTOMOC ON) -#qt5_wrap_cpp(MOC_SOURCES include/witmotion_ros.h) include_directories(include) -include_directories(/opt/ros/humble/include/tf2_geometry_msgs) include_directories(witmotion-uart-qt/include) -#add_library(witmotion_ros src/witmotion_ros.cpp include/witmotion_ros.h) find_package(ament_cmake REQUIRED) @@ -54,27 +50,30 @@ add_library(witmotion_ros message(WARNING "tf2_geometry_msgs include dir: ${tf2_geometry_msgs_INCLUDE_DIRS} ") -#find_package(Qt5 REQUIRED COMPONENTS Core SerialPort) -set(INCLUDE_DIRS ${ament_cmake_INCLUDE_DIRS} ${tf2_INCLUDE_DIRS} - ${tf2_geometry_msgs_INCLUDE_DIRS} ${rclcpp_INCLUDE_DIRS} - ${std_srvs_INCLUDE_DIRS} ${sensor_msgs_INCLUDE_DIRS} - ${geometry_msgs_INCLUDE_DIRS} ${nav_msgs_INCLUDE_DIRS} - ${rosgraph_msgs_INCLUDE_DIRS} ${std_msgs_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5SerialPort_INCLUDE_DIRS} ${rcl_interfaces_INCLUDE_DIRS} - ${rclcpp_lifecycle_INCLUDE_DIRS} ${lifecycle_msgs_INCLUDE_DIRS}) -include_directories(${INCLUDE_DIRS}) + +set(dependencies + tf2 + tf2_geometry_msgs + rclcpp + std_srvs + sensor_msgs + std_msgs + rcl_interfaces + rclcpp_lifecycle + lifecycle_msgs + ) +ament_target_dependencies(witmotion_ros ${dependencies}) + +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + + set(LIBRARY_DIRS ${ament_cmake_LIBRARIES} ${tf2_LIBRARIES} ${tf2_geometry_msgs_LIBRARIES} ${rclcpp_LIBRARIES} ${std_srvs_LIBRARIES} ${sensor_msgs_LIBRARIES} ${geometry_msgs_LIBRARIES} ${nav_msgs_LIBRARIES} ${rosgraph_msgs_LIBRARIES} ${std_msgs_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5SerialPort_LIBRARIES} ${rcl_interfaces_LIBRARIES} ${rclcpp_lifecycle_LIBRARIES} ${lifecycle_msgs_LIBRARIES}) -#target_link_libraries(another PUBLIC one) -set(LIBS ${ament_cmake_LIBRARIES} ${tf2_LIBRARIES} - ${tf2_geometry_msgs_LIBRARIES} ${rclcpp_LIBRARIES} ${std_srvs_LIBRARIES} - ${sensor_msgs_LIBRARIES} ${geometry_msgs_LIBRARIES} - ${nav_msgs_LIBRARIES} ${rosgraph_msgs_LIBRARIES} - ${std_msgs_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5SerialPort_LIBRARIES} ${rcl_interfaces_LIBRARIES} ${rclcpp_lifecycle_LIBRARIES} ${lifecycle_msgs_LIBRARIES}) - target_link_libraries(witmotion_ros ${LIBRARY_DIRS} witmotion-uart Qt5::Core Qt5::SerialPort) From 228a015a437399bf888b158b6f61f139a1c924f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6ldi=20Tam=C3=A1s?= Date: Thu, 30 Nov 2023 12:22:25 +0100 Subject: [PATCH 02/12] ci: add basic github CI/CD action --- .github/workflows/build_test.yml | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build_test.yml diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 0000000..57327a4 --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,42 @@ +name: ROS2 CI + +on: + pull_request: + branches: + - 'develop' + - 'ros2' + push: + branches: + - 'ros2' + +jobs: + test_environment: + runs-on: [ubuntu-latest] + strategy: + fail-fast: false + matrix: + ros_distribution: + - humble + - rolling + include: + # Humble Hawksbill (May 2022 - May 2027) + - docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest + ros_distribution: humble + ros_version: 2 + # Rolling Ridley (June 2020 - Present) + - docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest + ros_distribution: rolling + ros_version: 2 + container: + image: ${{ matrix.docker_image }} + steps: + - name: checkout + uses: actions/checkout@v2 + - name: install deps + run: sudo apt-get -y install qtbase5-dev libqt5serialbus5-dev python3-numpy + - name: build and test + uses: ros-tooling/action-ros-ci@master + with: + target-ros2-distro: ${{ matrix.ros_distribution }} + vcs-repo-file-url: "" + skip-tests: true From 5cabb64a5a91db91ac4308fd2632876f5d43efe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6ldi=20Tam=C3=A1s?= Date: Thu, 30 Nov 2023 12:41:50 +0100 Subject: [PATCH 03/12] ci: add Iron to the build matrix --- .github/workflows/build_test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 57327a4..f631310 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -17,12 +17,17 @@ jobs: matrix: ros_distribution: - humble + - iron - rolling include: # Humble Hawksbill (May 2022 - May 2027) - docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest ros_distribution: humble ros_version: 2 + # Iron Irwini (May 2023 - May 2028) + - docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest + ros_distribution: rolling + ros_version: 2 # Rolling Ridley (June 2020 - Present) - docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest ros_distribution: rolling @@ -33,7 +38,7 @@ jobs: - name: checkout uses: actions/checkout@v2 - name: install deps - run: sudo apt-get -y install qtbase5-dev libqt5serialbus5-dev python3-numpy + run: sudo apt-get -y install qtbase5-dev libqt5serialport5-dev - name: build and test uses: ros-tooling/action-ros-ci@master with: From c779c02e5ef6f51417cebe5a4f532e973023173c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6ldi=20Tam=C3=A1s?= Date: Thu, 30 Nov 2023 12:42:45 +0100 Subject: [PATCH 04/12] ci: fix `ros_distribution` for Iron --- .github/workflows/build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index f631310..ca5d65d 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -26,7 +26,7 @@ jobs: ros_version: 2 # Iron Irwini (May 2023 - May 2028) - docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest - ros_distribution: rolling + ros_distribution: iron ros_version: 2 # Rolling Ridley (June 2020 - Present) - docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest From eb13aee682ba833809ebf3cb75efee52d25d354c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6ldi=20Tam=C3=A1s?= Date: Thu, 30 Nov 2023 12:46:55 +0100 Subject: [PATCH 05/12] ci: add boost dependency --- .github/workflows/build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index ca5d65d..8428679 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -38,7 +38,7 @@ jobs: - name: checkout uses: actions/checkout@v2 - name: install deps - run: sudo apt-get -y install qtbase5-dev libqt5serialport5-dev + run: sudo apt-get -y install qtbase5-dev libqt5serialport5-dev libboost-all-dev - name: build and test uses: ros-tooling/action-ros-ci@master with: From c6a5ca005199b1dcebabe4bcb34002a0c683a71a Mon Sep 17 00:00:00 2001 From: Tamas Foldi Date: Thu, 30 Nov 2023 12:55:24 +0100 Subject: [PATCH 06/12] ci: add dependencies --- package.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.xml b/package.xml index 2d09bba..8fcc8b1 100644 --- a/package.xml +++ b/package.xml @@ -9,6 +9,12 @@ ament_cmake + qtbase5-dev + libqt5serialport5-dev + libboost-all-dev + std_msgs + tf2 + ament_lint_auto ament_lint_common From 07359ca5372ae51144c3eb2239a931f2a0b34f96 Mon Sep 17 00:00:00 2001 From: Tamas Foldi Date: Thu, 30 Nov 2023 13:06:03 +0100 Subject: [PATCH 07/12] ci: move all dependencies to package.xml from github action --- .github/workflows/build_test.yml | 2 -- package.xml | 11 +++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 8428679..5859331 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -37,8 +37,6 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - - name: install deps - run: sudo apt-get -y install qtbase5-dev libqt5serialport5-dev libboost-all-dev - name: build and test uses: ros-tooling/action-ros-ci@master with: diff --git a/package.xml b/package.xml index 8fcc8b1..96a79ba 100644 --- a/package.xml +++ b/package.xml @@ -3,12 +3,19 @@ witmotion_ros 0.0.0 - TODO: Package description + Witmotion IMU sensor driver for ROS pi - TODO: License declaration + MIT ament_cmake + tf2_geometry_msgs + rclcpp + std_srvs + tf2_geometry_msgs + rcl_interfaces + rclcpp_lifecycle + lifecycle_msgs qtbase5-dev libqt5serialport5-dev libboost-all-dev From a9ffcc2862a11d7308d91f4547ca6d8fffba4f52 Mon Sep 17 00:00:00 2001 From: Tamas Foldi Date: Thu, 30 Nov 2023 13:09:57 +0100 Subject: [PATCH 08/12] ci: remove tf2_geometry_msgs as it was added twice --- package.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/package.xml b/package.xml index 96a79ba..a7d1089 100644 --- a/package.xml +++ b/package.xml @@ -12,7 +12,6 @@ tf2_geometry_msgs rclcpp std_srvs - tf2_geometry_msgs rcl_interfaces rclcpp_lifecycle lifecycle_msgs From 432fb76805d580af6df24e391d775f92cc47098c Mon Sep 17 00:00:00 2001 From: Tamas Foldi Date: Thu, 30 Nov 2023 13:11:25 +0100 Subject: [PATCH 09/12] ci: add back Qt5base install --- .github/workflows/build_test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 5859331..ca5d65d 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -37,6 +37,8 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 + - name: install deps + run: sudo apt-get -y install qtbase5-dev libqt5serialport5-dev - name: build and test uses: ros-tooling/action-ros-ci@master with: From d3e46eb71afa940495044ba0de74d107049d5865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6ldi=20Tam=C3=A1s?= Date: Thu, 30 Nov 2023 13:17:37 +0100 Subject: [PATCH 10/12] build: add nav_msgs as dependency --- package.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.xml b/package.xml index a7d1089..110284e 100644 --- a/package.xml +++ b/package.xml @@ -17,7 +17,8 @@ lifecycle_msgs qtbase5-dev libqt5serialport5-dev - libboost-all-dev + boost + nav_msgs std_msgs tf2 From 966a273e56387c7a650eabb68ea74b983994155b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6ldi=20Tam=C3=A1s?= Date: Thu, 30 Nov 2023 13:23:26 +0100 Subject: [PATCH 11/12] build: add ament_cmake_auto as dependency --- package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/package.xml b/package.xml index 110284e..8b7c6ac 100644 --- a/package.xml +++ b/package.xml @@ -8,6 +8,7 @@ MIT ament_cmake + ament_cmake_auto tf2_geometry_msgs rclcpp From 23f53e9de6406cd63dc4739390757883e58d53f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6ldi=20Tam=C3=A1s?= Date: Thu, 30 Nov 2023 13:28:49 +0100 Subject: [PATCH 12/12] build: add libqt5-serialport as dependency --- package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.xml b/package.xml index 8b7c6ac..7ad4b71 100644 --- a/package.xml +++ b/package.xml @@ -17,7 +17,7 @@ rclcpp_lifecycle lifecycle_msgs qtbase5-dev - libqt5serialport5-dev + libqt5-serialport boost nav_msgs std_msgs