From 54b14067daa01c4ac6a8f15e1c5342472b37a04a Mon Sep 17 00:00:00 2001 From: v4hn Date: Thu, 10 Oct 2024 16:38:09 +0200 Subject: [PATCH 1/3] drop ROS_DISTRO STRGREATER tests As the Debian packages use "Debian" https://salsa.debian.org/science-team/ros-ros-environment/-/blame/master/debian/rules?ref_type=heads#L6 which is incompatible, does not trigger them c++14 is the default from melodic onward, so the additional statements there are not necessary --- .../jsk_interactive_marker/CMakeLists.txt | 5 ++--- jsk_rqt_plugins/CMakeLists.txt | 2 +- jsk_rviz_plugins/CMakeLists.txt | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/jsk_interactive_markers/jsk_interactive_marker/CMakeLists.txt b/jsk_interactive_markers/jsk_interactive_marker/CMakeLists.txt index 26b6e5209..f9cbe2489 100644 --- a/jsk_interactive_markers/jsk_interactive_marker/CMakeLists.txt +++ b/jsk_interactive_markers/jsk_interactive_marker/CMakeLists.txt @@ -1,9 +1,8 @@ cmake_minimum_required(VERSION 2.8.3) project(jsk_interactive_marker) -if("$ENV{ROS_DISTRO}" STRGREATER "melodic") - add_compile_options(-std=c++14) -else() +if("$ENV{ROS_DISTRO}" STREQUAL "kinetic") + # catch special case ROS kinetic where c++11 is not the default yet add_compile_options(-std=c++11) endif() diff --git a/jsk_rqt_plugins/CMakeLists.txt b/jsk_rqt_plugins/CMakeLists.txt index 42af8a8b9..9f02b9cae 100644 --- a/jsk_rqt_plugins/CMakeLists.txt +++ b/jsk_rqt_plugins/CMakeLists.txt @@ -32,7 +32,7 @@ install(DIRECTORY launch resource sample sample_scripts test if (CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) - if("$ENV{ROS_DISTRO}" STRGREATER "indigo") + if(NOT "$ENV{ROS_DISTRO}" STREQUAL "indigo") catkin_add_nosetests(test) add_rostest(test/test_rqt_plugins.test) endif() diff --git a/jsk_rviz_plugins/CMakeLists.txt b/jsk_rviz_plugins/CMakeLists.txt index 310db0bde..c14b02143 100644 --- a/jsk_rviz_plugins/CMakeLists.txt +++ b/jsk_rviz_plugins/CMakeLists.txt @@ -4,9 +4,8 @@ # http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html cmake_minimum_required(VERSION 2.8.3) project(jsk_rviz_plugins) -if("$ENV{ROS_DISTRO}" STRGREATER "melodic") - add_compile_options(-std=c++14) -else() +if("$ENV{ROS_DISTRO}" STREQUAL "kinetic") + # catch special case ROS kinetic where c++11 is not the default yet add_compile_options(-std=c++11) endif() # Load catkin and all dependencies required for this package From 73fb2b311aaeefffa1b9767a573d299f47a79060 Mon Sep 17 00:00:00 2001 From: v4hn Date: Mon, 18 Nov 2024 15:37:54 +0100 Subject: [PATCH 2/3] support Ogre 1.12 OgreTechnique and Overlay are only forward declared in some headers now. `SimpleRenderable::setMaterial` requires a MaterialPtr from 1.12. The std::string overload was deprecated in 1.10. --- jsk_rviz_plugins/src/camera_info_display.h | 1 + jsk_rviz_plugins/src/overlay_camera_display.cpp | 8 ++++++++ jsk_rviz_plugins/src/overlay_utils.h | 1 + jsk_rviz_plugins/src/polygon_array_display.h | 1 + 4 files changed, 11 insertions(+) diff --git a/jsk_rviz_plugins/src/camera_info_display.h b/jsk_rviz_plugins/src/camera_info_display.h index eaea45ee2..315a1f8c5 100644 --- a/jsk_rviz_plugins/src/camera_info_display.h +++ b/jsk_rviz_plugins/src/camera_info_display.h @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include diff --git a/jsk_rviz_plugins/src/overlay_camera_display.cpp b/jsk_rviz_plugins/src/overlay_camera_display.cpp index 110b48d67..800373cd8 100644 --- a/jsk_rviz_plugins/src/overlay_camera_display.cpp +++ b/jsk_rviz_plugins/src/overlay_camera_display.cpp @@ -206,7 +206,11 @@ void OverlayCameraDisplay::onInitialize() bg_screen_rect_->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND); bg_screen_rect_->setBoundingBox(aabInf); +#if ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH) < ((1 << 16) | (10 << 8) | 0) bg_screen_rect_->setMaterial(bg_material_->getName()); +#else + bg_screen_rect_->setMaterial(bg_material_); +#endif bg_scene_node_->attachObject(bg_screen_rect_); bg_scene_node_->setVisible(false); @@ -217,7 +221,11 @@ void OverlayCameraDisplay::onInitialize() fg_material_ = bg_material_->clone( ss.str()+"fg" ); fg_screen_rect_->setBoundingBox(aabInf); +#if ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH) < ((1 << 16) | (10 << 8) | 0) fg_screen_rect_->setMaterial(fg_material_->getName()); +#else + fg_screen_rect_->setMaterial(fg_material_); +#endif fg_material_->setSceneBlending( Ogre::SBT_TRANSPARENT_ALPHA ); fg_screen_rect_->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY - 1); diff --git a/jsk_rviz_plugins/src/overlay_utils.h b/jsk_rviz_plugins/src/overlay_utils.h index 760ba5ab5..828d588f6 100644 --- a/jsk_rviz_plugins/src/overlay_utils.h +++ b/jsk_rviz_plugins/src/overlay_utils.h @@ -50,6 +50,7 @@ #include #include #else + #include #include #include #include diff --git a/jsk_rviz_plugins/src/polygon_array_display.h b/jsk_rviz_plugins/src/polygon_array_display.h index a2da3fff6..4cfec75cb 100644 --- a/jsk_rviz_plugins/src/polygon_array_display.h +++ b/jsk_rviz_plugins/src/polygon_array_display.h @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include From 064068d0836309d0e19968cb35a4648e1d677486 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Tue, 10 Dec 2024 11:44:34 +0900 Subject: [PATCH 3/3] CMakeLists.txt: check both kinetic and indigo --- jsk_interactive_markers/jsk_interactive_marker/CMakeLists.txt | 2 +- jsk_rviz_plugins/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jsk_interactive_markers/jsk_interactive_marker/CMakeLists.txt b/jsk_interactive_markers/jsk_interactive_marker/CMakeLists.txt index f9cbe2489..7f25f4c83 100644 --- a/jsk_interactive_markers/jsk_interactive_marker/CMakeLists.txt +++ b/jsk_interactive_markers/jsk_interactive_marker/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8.3) project(jsk_interactive_marker) -if("$ENV{ROS_DISTRO}" STREQUAL "kinetic") +if(("$ENV{ROS_DISTRO}" STREQUAL "kinetic") OR ("$ENV{ROS_DISTRO}" STREQUAL "indigo")) # catch special case ROS kinetic where c++11 is not the default yet add_compile_options(-std=c++11) endif() diff --git a/jsk_rviz_plugins/CMakeLists.txt b/jsk_rviz_plugins/CMakeLists.txt index c14b02143..b9f14dc36 100644 --- a/jsk_rviz_plugins/CMakeLists.txt +++ b/jsk_rviz_plugins/CMakeLists.txt @@ -4,7 +4,7 @@ # http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html cmake_minimum_required(VERSION 2.8.3) project(jsk_rviz_plugins) -if("$ENV{ROS_DISTRO}" STREQUAL "kinetic") +if(("$ENV{ROS_DISTRO}" STREQUAL "kinetic") OR ("$ENV{ROS_DISTRO}" STREQUAL "indigo")) # catch special case ROS kinetic where c++11 is not the default yet add_compile_options(-std=c++11) endif()