From 829fcc00e785178a835551c0439f59ab971bd809 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 30 Apr 2024 17:49:16 +0200 Subject: [PATCH 1/6] Enable nav2-related packages on Windows --- vinca_win.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vinca_win.yaml b/vinca_win.yaml index 1b681a717..9f32a7687 100644 --- a/vinca_win.yaml +++ b/vinca_win.yaml @@ -64,16 +64,16 @@ packages_select_by_deps: - ros2-controllers-test-nodes - joint-state-publisher-gui + # Nav2 + - slam-toolbox + - nav2-bringup + # PREVIOUSLY SUPPORTED PACKAGES, CURRENTLY BROKEN # Currently has upstream issues with git LFS # - moveit # Broken for now until we migrate to newer gazebo # - desktop_full - # REQUESTED PACKAGES - # Fails due to not finding csparse, could borrow patch from mrpt2 - # - slam-toolbox - # Needs slam-toolbox - # - nav2-bringup + patch_dir: patch From 4bcf69bf5aebf833b5af39ccdfadea356ebf4c43 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 30 Apr 2024 18:27:43 +0200 Subject: [PATCH 2/6] Update ros-humble-nav2-waypoint-follower.patch --- patch/ros-humble-nav2-waypoint-follower.patch | 93 ------------------- 1 file changed, 93 deletions(-) diff --git a/patch/ros-humble-nav2-waypoint-follower.patch b/patch/ros-humble-nav2-waypoint-follower.patch index b01e8d3d2..bf36ad77d 100644 --- a/patch/ros-humble-nav2-waypoint-follower.patch +++ b/patch/ros-humble-nav2-waypoint-follower.patch @@ -11,96 +11,3 @@ index a3b46942b..e228086fa 100644 # Try for OpenCV 4.X, but settle for whatever is installed find_package(OpenCV 4 QUIET) if(NOT OpenCV_FOUND) -@@ -25,7 +27,11 @@ find_package(pluginlib REQUIRED) - - nav2_package() - --link_libraries(stdc++fs) -+if(UNIX AND NOT APPLE) -+ link_libraries(stdc++fs) -+else() -+ -+endif() - - include_directories( - include -diff --git a/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp b/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp -index fc4aee5c5..a4fc67b82 100644 ---- a/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp -+++ b/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp -@@ -20,20 +20,22 @@ - * to ignore deprecated declarations - */ - #define _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM -+#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING - - --#include -+#include - #include - #include - #include - -+#include -+#include -+ - #include "rclcpp/rclcpp.hpp" - #include "rclcpp_components/register_node_macro.hpp" - - #include "sensor_msgs/msg/image.hpp" - #include "nav2_core/waypoint_task_executor.hpp" --#include "opencv4/opencv2/core.hpp" --#include "opencv4/opencv2/opencv.hpp" - #include "cv_bridge/cv_bridge.h" - #include "image_transport/image_transport.hpp" - -@@ -97,7 +99,7 @@ protected: - // to ensure safety when accessing global var curr_frame_ - std::mutex global_mutex_; - // the taken photos will be saved under this directory -- std::experimental::filesystem::path save_dir_; -+ std::filesystem::path save_dir_; - // .png ? .jpg ? or some other well known format - std::string image_format_; - // the topic to subscribe in order capture a frame -diff --git a/plugins/photo_at_waypoint.cpp b/plugins/photo_at_waypoint.cpp -index 8a6cb74b9..4e2858f65 100644 ---- a/plugins/photo_at_waypoint.cpp -+++ b/plugins/photo_at_waypoint.cpp -@@ -61,14 +61,14 @@ void PhotoAtWaypoint::initialize( - // get inputted save directory and make sure it exists, if not log and create it - save_dir_ = save_dir_as_string; - try { -- if (!std::experimental::filesystem::exists(save_dir_)) { -+ if (!std::filesystem::exists(save_dir_)) { - RCLCPP_WARN( - logger_, - "Provided save directory for photo at waypoint plugin does not exist," - "provided directory is: %s, the directory will be created automatically.", - save_dir_.c_str() - ); -- if (!std::experimental::filesystem::create_directory(save_dir_)) { -+ if (!std::filesystem::create_directory(save_dir_)) { - RCLCPP_ERROR( - logger_, - "Failed to create directory!: %s required by photo at waypoint plugin, " -@@ -110,16 +110,16 @@ bool PhotoAtWaypoint::processAtWaypoint( - } - try { - // construct the full path to image filename -- std::experimental::filesystem::path file_name = std::to_string( -+ std::filesystem::path file_name = std::to_string( - curr_waypoint_index) + "_" + - std::to_string(curr_pose.header.stamp.sec) + "." + image_format_; -- std::experimental::filesystem::path full_path_image_path = save_dir_ / file_name; -+ std::filesystem::path full_path_image_path = save_dir_ / file_name; - - // save the taken photo at this waypoint to given directory - std::lock_guard guard(global_mutex_); - cv::Mat curr_frame_mat; - deepCopyMsg2Mat(curr_frame_msg_, curr_frame_mat); -- cv::imwrite(full_path_image_path.c_str(), curr_frame_mat); -+ cv::imwrite(full_path_image_path.string().c_str(), curr_frame_mat); - RCLCPP_INFO( - logger_, - "Photo has been taken sucessfully at waypoint %i", curr_waypoint_index); From 59786f85a93f2224f5917689dc1f29566aea4fa2 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 1 May 2024 00:00:35 +0200 Subject: [PATCH 3/6] Update ros-humble-nav2-waypoint-follower.patch --- patch/ros-humble-nav2-waypoint-follower.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/patch/ros-humble-nav2-waypoint-follower.patch b/patch/ros-humble-nav2-waypoint-follower.patch index bf36ad77d..79eda6549 100644 --- a/patch/ros-humble-nav2-waypoint-follower.patch +++ b/patch/ros-humble-nav2-waypoint-follower.patch @@ -11,3 +11,19 @@ index a3b46942b..e228086fa 100644 # Try for OpenCV 4.X, but settle for whatever is installed find_package(OpenCV 4 QUIET) if(NOT OpenCV_FOUND) + +diff --git a/nav2_waypoint_follower/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp b/nav2_waypoint_follower/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp +index 9c46fdf1f8..1e6048aefc 100644 +--- a/nav2_waypoint_follower/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp ++++ b/nav2_waypoint_follower/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp +@@ -32,8 +32,8 @@ + + #include "sensor_msgs/msg/image.hpp" + #include "nav2_core/waypoint_task_executor.hpp" +-#include "opencv4/opencv2/core.hpp" +-#include "opencv4/opencv2/opencv.hpp" ++#include "opencv2/core.hpp" ++#include "opencv2/opencv.hpp" + #include "cv_bridge/cv_bridge.hpp" + #include "image_transport/image_transport.hpp" + From a92b39daf37a63dc3482e2934e01ae9a7bc3211f Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Wed, 1 May 2024 13:53:25 +1000 Subject: [PATCH 4/6] Update ros-humble-nav2-waypoint-follower.patch --- patch/ros-humble-nav2-waypoint-follower.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patch/ros-humble-nav2-waypoint-follower.patch b/patch/ros-humble-nav2-waypoint-follower.patch index 79eda6549..68f22e5b8 100644 --- a/patch/ros-humble-nav2-waypoint-follower.patch +++ b/patch/ros-humble-nav2-waypoint-follower.patch @@ -12,10 +12,10 @@ index a3b46942b..e228086fa 100644 find_package(OpenCV 4 QUIET) if(NOT OpenCV_FOUND) -diff --git a/nav2_waypoint_follower/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp b/nav2_waypoint_follower/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp +diff --git a/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp b/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp index 9c46fdf1f8..1e6048aefc 100644 ---- a/nav2_waypoint_follower/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp -+++ b/nav2_waypoint_follower/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp +--- a/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp ++++ b/include/nav2_waypoint_follower/plugins/photo_at_waypoint.hpp @@ -32,8 +32,8 @@ #include "sensor_msgs/msg/image.hpp" From 9e4cc87fa86e3d0ac2de1af0404c1bfa6b6482cc Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Fri, 3 May 2024 05:59:56 +1000 Subject: [PATCH 5/6] Update ros-humble-nav2-waypoint-follower.patch --- patch/ros-humble-nav2-waypoint-follower.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch/ros-humble-nav2-waypoint-follower.patch b/patch/ros-humble-nav2-waypoint-follower.patch index 68f22e5b8..7be8dd948 100644 --- a/patch/ros-humble-nav2-waypoint-follower.patch +++ b/patch/ros-humble-nav2-waypoint-follower.patch @@ -24,6 +24,6 @@ index 9c46fdf1f8..1e6048aefc 100644 -#include "opencv4/opencv2/opencv.hpp" +#include "opencv2/core.hpp" +#include "opencv2/opencv.hpp" - #include "cv_bridge/cv_bridge.hpp" + #include "cv_bridge/cv_bridge.h" #include "image_transport/image_transport.hpp" From 2827f066d44e84e53d16552e0a49e7547842994d Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Fri, 3 May 2024 11:03:16 +1000 Subject: [PATCH 6/6] Update ros-humble-nav2-waypoint-follower.patch --- patch/ros-humble-nav2-waypoint-follower.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patch/ros-humble-nav2-waypoint-follower.patch b/patch/ros-humble-nav2-waypoint-follower.patch index 7be8dd948..469cda25a 100644 --- a/patch/ros-humble-nav2-waypoint-follower.patch +++ b/patch/ros-humble-nav2-waypoint-follower.patch @@ -1,3 +1,16 @@ +diff --git a/plugins/photo_at_waypoint.cpp b/plugins/photo_at_waypoint.cpp +index 296f8f41de..4e2858f655 100644 +--- a/plugins/photo_at_waypoint.cpp ++++ b/plugins/photo_at_waypoint.cpp +@@ -119,7 +119,7 @@ bool PhotoAtWaypoint::processAtWaypoint( + std::lock_guard guard(global_mutex_); + cv::Mat curr_frame_mat; + deepCopyMsg2Mat(curr_frame_msg_, curr_frame_mat); +- cv::imwrite(full_path_image_path.c_str(), curr_frame_mat); ++ cv::imwrite(full_path_image_path.string().c_str(), curr_frame_mat); + RCLCPP_INFO( + logger_, + "Photo has been taken sucessfully at waypoint %i", curr_waypoint_index); diff --git a/CMakeLists.txt b/CMakeLists.txt index a3b46942b..e228086fa 100644 --- a/CMakeLists.txt