diff --git a/.github/workflows/jazzy.yml b/.github/workflows/jazzy.yml
new file mode 100644
index 0000000..e341e2a
--- /dev/null
+++ b/.github/workflows/jazzy.yml
@@ -0,0 +1,61 @@
+name: ROS 2 Jazzy CI
+
+on:
+ push:
+ branches: [ main, master ]
+ pull_request:
+ branches: [ main, master ]
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-24.04
+ strategy:
+ fail-fast: false
+ matrix:
+ ros_distro: [jazzy]
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ path: src/qt_rviz2_tutorial
+
+ - name: Setup ROS 2 environment
+ uses: ros-tooling/setup-ros@v0.7
+ with:
+ required-ros-distributions: ${{ matrix.ros_distro }}
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y \
+ python3-colcon-common-extensions \
+ python3-rosdep \
+ qtbase5-dev \
+ qtdeclarative5-dev \
+ libqt5svg5-dev
+
+ - name: Initialize rosdep
+ run: |
+ sudo rosdep init || true
+ rosdep update
+
+ - name: Install package dependencies
+ run: |
+ source /opt/ros/${{ matrix.ros_distro }}/setup.bash
+ rosdep install --from-paths src --ignore-src -r -y
+
+ - name: Build workspace
+ run: |
+ source /opt/ros/${{ matrix.ros_distro }}/setup.bash
+ colcon build --symlink-install \
+ --cmake-args -DCMAKE_BUILD_TYPE=Release \
+ --event-handlers console_direct+
+
+ - name: Run tests
+ run: |
+ source /opt/ros/${{ matrix.ros_distro }}/setup.bash
+ source install/setup.bash
+ colcon test --event-handlers console_direct+
+ colcon test-result --verbose
diff --git a/.github/workflows/ros2_ci.yml b/.github/workflows/ros2_ci.yml
new file mode 100644
index 0000000..9a8cf86
--- /dev/null
+++ b/.github/workflows/ros2_ci.yml
@@ -0,0 +1,65 @@
+name: ROS 2 CI (Multi-Distribution)
+
+on:
+ push:
+ branches: [ main, master ]
+ pull_request:
+ branches: [ main, master ]
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - ros_distro: humble
+ ubuntu_version: ubuntu-22.04
+ - ros_distro: jazzy
+ ubuntu_version: ubuntu-24.04
+ - ros_distro: rolling
+ ubuntu_version: ubuntu-24.04
+
+ container:
+ image: ros:${{ matrix.ros_distro }}-ros-base
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ path: src/qt_rviz2_tutorial
+
+ - name: Install dependencies
+ run: |
+ apt-get update
+ apt-get install -y \
+ python3-colcon-common-extensions \
+ python3-rosdep \
+ qtbase5-dev \
+ qtdeclarative5-dev \
+ libqt5svg5-dev
+
+ - name: Initialize rosdep
+ run: |
+ rosdep init || true
+ rosdep update
+
+ - name: Install package dependencies
+ run: |
+ . /opt/ros/${{ matrix.ros_distro }}/setup.sh
+ rosdep install --from-paths src --ignore-src -r -y
+
+ - name: Build workspace
+ run: |
+ . /opt/ros/${{ matrix.ros_distro }}/setup.sh
+ colcon build --symlink-install \
+ --cmake-args -DCMAKE_BUILD_TYPE=Release \
+ --event-handlers console_direct+
+
+ - name: Run tests
+ run: |
+ . /opt/ros/${{ matrix.ros_distro }}/setup.sh
+ . install/setup.sh
+ colcon test --event-handlers console_direct+
+ colcon test-result --verbose
diff --git a/10_rviz2panel_hello/CMakeLists.txt b/10_rviz2panel_hello/CMakeLists.txt
index 71ed908..93af949 100644
--- a/10_rviz2panel_hello/CMakeLists.txt
+++ b/10_rviz2panel_hello/CMakeLists.txt
@@ -18,7 +18,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src/
)
ament_auto_add_library(rviz2panel_hello SHARED
- src/widget/rviz2panel_hello.ui
+ src/widget/rviz2panel_hello.ui
src/widget/widget.cpp)
target_link_libraries(rviz2panel_hello ${QT5_LIBS})
@@ -28,6 +28,8 @@ if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
+ set(ament_cmake_uncrustify_FOUND TRUE)
+ set(ament_cmake_lint_cmake_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
diff --git a/10_rviz2panel_hello/package.xml b/10_rviz2panel_hello/package.xml
index 3e9c07e..d9a63ba 100644
--- a/10_rviz2panel_hello/package.xml
+++ b/10_rviz2panel_hello/package.xml
@@ -9,6 +9,7 @@
ament_cmake_auto
+ pluginlib
rviz_common
qtbase5-dev
diff --git a/11_rviz2panel_hello_template/CMakeLists.txt b/11_rviz2panel_hello_template/CMakeLists.txt
index 7514293..947d72b 100644
--- a/11_rviz2panel_hello_template/CMakeLists.txt
+++ b/11_rviz2panel_hello_template/CMakeLists.txt
@@ -15,7 +15,7 @@ set(QT5_LIBS Qt5::Core Qt5::Gui Qt5::Widgets)
# ===== Widget =====
ament_auto_add_library(rviz2panel_hello_template_rviz SHARED
- src/widget/base/rviz2panel_hello_template.ui
+ src/widget/base/rviz2panel_hello_template.ui
src/widget/base/base_widget.cpp
src/widget/rviz_widget.cpp
)
@@ -29,9 +29,9 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_WIDGET}_autogen/include
)
ament_auto_add_library(${TARGET_WIDGET} SHARED
- src/widget/base/rviz2panel_hello_template.ui
+ src/widget/base/rviz2panel_hello_template.ui
src/widget/base/base_widget.cpp
- src/widget/qt_widget.hpp
+ src/widget/qt_widget.cpp
)
target_link_libraries(${TARGET_WIDGET} ${QT5_LIBS})
set(QT5_LIBS ${QT5_LIBS} ${TARGET_WIDGET})
@@ -52,6 +52,8 @@ if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
+ set(ament_cmake_uncrustify_FOUND TRUE)
+ set(ament_cmake_lint_cmake_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
diff --git a/11_rviz2panel_hello_template/package.xml b/11_rviz2panel_hello_template/package.xml
index 638ed07..e36200d 100644
--- a/11_rviz2panel_hello_template/package.xml
+++ b/11_rviz2panel_hello_template/package.xml
@@ -9,6 +9,7 @@
ament_cmake_auto
+ pluginlib
rviz_common
qtbase5-dev
diff --git a/12_rviz2panel_pubsub/CMakeLists.txt b/12_rviz2panel_pubsub/CMakeLists.txt
index d0a0327..c2fa011 100644
--- a/12_rviz2panel_pubsub/CMakeLists.txt
+++ b/12_rviz2panel_pubsub/CMakeLists.txt
@@ -18,7 +18,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src/
)
ament_auto_add_library(rviz2panel_pubsub SHARED
- src/widget/rviz2panel_pubsub.ui
+ src/widget/rviz2panel_pubsub.ui
src/widget/widget.cpp)
target_link_libraries(rviz2panel_pubsub ${QT5_LIBS})
@@ -28,6 +28,8 @@ if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
+ set(ament_cmake_uncrustify_FOUND TRUE)
+ set(ament_cmake_lint_cmake_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
diff --git a/12_rviz2panel_pubsub/package.xml b/12_rviz2panel_pubsub/package.xml
index 76412d6..24cb918 100644
--- a/12_rviz2panel_pubsub/package.xml
+++ b/12_rviz2panel_pubsub/package.xml
@@ -9,6 +9,7 @@
ament_cmake_auto
+ pluginlib
rviz_common
qtbase5-dev
diff --git a/13_rviz2panel_service_client/CMakeLists.txt b/13_rviz2panel_service_client/CMakeLists.txt
index 761f3ee..e3f1756 100644
--- a/13_rviz2panel_service_client/CMakeLists.txt
+++ b/13_rviz2panel_service_client/CMakeLists.txt
@@ -18,7 +18,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src/
)
ament_auto_add_library(rviz2panel_service_client SHARED
- src/widget/rviz2panel_service_client.ui
+ src/widget/rviz2panel_service_client.ui
src/widget/widget.cpp)
target_link_libraries(rviz2panel_service_client ${QT5_LIBS})
@@ -28,6 +28,8 @@ if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
+ set(ament_cmake_uncrustify_FOUND TRUE)
+ set(ament_cmake_lint_cmake_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
diff --git a/13_rviz2panel_service_client/package.xml b/13_rviz2panel_service_client/package.xml
index c19778d..0566e96 100644
--- a/13_rviz2panel_service_client/package.xml
+++ b/13_rviz2panel_service_client/package.xml
@@ -10,6 +10,7 @@
ament_cmake_auto
example_interfaces
+ pluginlib
rviz_common
qtbase5-dev
diff --git a/14_rviz2panel_action_client/CMakeLists.txt b/14_rviz2panel_action_client/CMakeLists.txt
index 6fdfb1a..3bb03e1 100644
--- a/14_rviz2panel_action_client/CMakeLists.txt
+++ b/14_rviz2panel_action_client/CMakeLists.txt
@@ -18,7 +18,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src/
)
ament_auto_add_library(rviz2panel_action_client SHARED
- src/widget/rviz2panel_action_client.ui
+ src/widget/rviz2panel_action_client.ui
src/widget/widget.cpp)
target_link_libraries(rviz2panel_action_client ${QT5_LIBS})
@@ -28,6 +28,8 @@ if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
+ set(ament_cmake_uncrustify_FOUND TRUE)
+ set(ament_cmake_lint_cmake_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
diff --git a/14_rviz2panel_action_client/package.xml b/14_rviz2panel_action_client/package.xml
index e4651ad..e70888b 100644
--- a/14_rviz2panel_action_client/package.xml
+++ b/14_rviz2panel_action_client/package.xml
@@ -10,6 +10,7 @@
ament_cmake_auto
example_interfaces
+ pluginlib
rviz_common
qtbase5-dev
diff --git a/20_qt5_hello_ros2_cmake/CMakeLists.txt b/20_qt5_hello_ros2_cmake/CMakeLists.txt
index 945a9bc..89b9ae7 100644
--- a/20_qt5_hello_ros2_cmake/CMakeLists.txt
+++ b/20_qt5_hello_ros2_cmake/CMakeLists.txt
@@ -22,7 +22,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_WIDGET}_autogen/include
)
add_library(${TARGET_WIDGET}
- src/widget/qt5_hello_ros2_cmake.ui
+ src/widget/qt5_hello_ros2_cmake.ui
src/widget/widget.cpp)
target_link_libraries(${TARGET_WIDGET} ${QT5_LIBS})
set(QT5_LIBS ${QT5_LIBS} ${TARGET_WIDGET})
@@ -41,5 +41,14 @@ ament_auto_add_executable(qt5_hello_ros2_cmake_exec
src/main.cpp)
target_link_libraries(qt5_hello_ros2_cmake_exec ${QT5_LIBS})
+if(BUILD_TESTING)
+ find_package(ament_lint_auto REQUIRED)
+ set(ament_cmake_copyright_FOUND TRUE)
+ set(ament_cmake_cpplint_FOUND TRUE)
+ set(ament_cmake_uncrustify_FOUND TRUE)
+ set(ament_cmake_lint_cmake_FOUND TRUE)
+ ament_lint_auto_find_test_dependencies()
+endif()
+
# amentのパッケージ情報を生成
ament_auto_package()
\ No newline at end of file
diff --git a/README.md b/README.md
index 8a4c369..952e503 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,28 @@
# qt_rviz2_tutorial
+[](https://github.com/NITKK-ROS-Team/qt_rviz2_tutorial/actions/workflows/ros2_ci.yml)
+[](https://github.com/NITKK-ROS-Team/qt_rviz2_tutorial/actions/workflows/jazzy.yml)
+
QtはC++を使用したGUI開発によく使われるツールキットであり、Rviz2のpanelに使用できます。
このチュートリアルでは、Qtの基本からRviz2プラグインの作成までを目標としています。
+## サポートされているROS 2ディストリビューション
+
+このプロジェクトは以下のROS 2ディストリビューションでテストされています:
+
+- ROS 2 Humble Hawksbill (Ubuntu 22.04)
+- ROS 2 Jazzy Jalisco (Ubuntu 24.04)
+- ROS 2 Rolling Ridley (Ubuntu 24.04)
+
+CI(継続的インテグレーション)により、各ディストリビューションでのビルドとテストが自動的に実行されます。
+
+**注記**: ROS 2 Iron Irwiniは、`ament_cmake_auto`とrviz_commonの互換性の問題により、サポートから除外されています。
+
+
+
## 対象
C++とCMakeListsが読める人。