From 5415b8274ffab14f91deb347b69ddcceb6506d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Wed, 26 Jun 2024 10:49:28 +0200 Subject: [PATCH 1/6] Removed deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- depth_image_proc/src/disparity.cpp | 3 ++- depth_image_proc/src/point_cloud_xyzi.cpp | 3 ++- depth_image_proc/src/point_cloud_xyzi_radial.cpp | 3 ++- depth_image_proc/src/point_cloud_xyzrgb.cpp | 6 ++++-- depth_image_proc/src/point_cloud_xyzrgb_radial.cpp | 3 ++- depth_image_proc/src/register.cpp | 6 ++++-- image_view/include/image_view/disparity_view_node.hpp | 6 ++---- image_view/include/image_view/image_view_node.hpp | 8 ++++---- image_view/include/image_view/stereo_view_node.hpp | 8 ++++---- image_view/include/image_view/video_recorder_node.hpp | 8 ++++---- image_view/src/stereo_view_node.cpp | 3 ++- .../src/stereo_image_proc/disparity_node.cpp | 6 ++++-- .../src/stereo_image_proc/point_cloud_node.cpp | 9 ++++++--- 13 files changed, 42 insertions(+), 30 deletions(-) diff --git a/depth_image_proc/src/disparity.cpp b/depth_image_proc/src/disparity.cpp index 4cad8eb5d..0a48fa85a 100644 --- a/depth_image_proc/src/disparity.cpp +++ b/depth_image_proc/src/disparity.cpp @@ -116,7 +116,8 @@ DisparityNode::DisparityNode(const rclcpp::NodeOptions & options) std::string topic = node_base->resolve_topic_or_service_name("left/image_rect", false); image_transport::TransportHints hints(this); sub_depth_image_.subscribe(this, topic, hints.getTransport()); - sub_info_.subscribe(this, "right/camera_info"); + sub_info_.subscribe(this, "right/camera_info", + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); } }; pub_disparity_ = create_publisher( diff --git a/depth_image_proc/src/point_cloud_xyzi.cpp b/depth_image_proc/src/point_cloud_xyzi.cpp index 0abc0ff8c..784b894c8 100644 --- a/depth_image_proc/src/point_cloud_xyzi.cpp +++ b/depth_image_proc/src/point_cloud_xyzi.cpp @@ -108,7 +108,8 @@ PointCloudXyziNode::PointCloudXyziNode(const rclcpp::NodeOptions & options) // intensity uses normal ros transport hints. image_transport::TransportHints hints(this, "raw"); sub_intensity_.subscribe(this, intensity_topic, hints.getTransport()); - sub_info_.subscribe(this, intensity_info_topic); + sub_info_.subscribe(this, intensity_info_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); } }; pub_point_cloud_ = create_publisher("points", rclcpp::SensorDataQoS(), pub_options); diff --git a/depth_image_proc/src/point_cloud_xyzi_radial.cpp b/depth_image_proc/src/point_cloud_xyzi_radial.cpp index c592851e0..ff9519d93 100644 --- a/depth_image_proc/src/point_cloud_xyzi_radial.cpp +++ b/depth_image_proc/src/point_cloud_xyzi_radial.cpp @@ -103,7 +103,8 @@ PointCloudXyziRadialNode::PointCloudXyziRadialNode(const rclcpp::NodeOptions & o // intensity uses normal ros transport hints. image_transport::TransportHints hints(this); sub_intensity_.subscribe(this, intensity_topic, hints.getTransport()); - sub_info_.subscribe(this, intensity_info_topic); + sub_info_.subscribe(this, intensity_info_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); } }; pub_point_cloud_ = create_publisher( diff --git a/depth_image_proc/src/point_cloud_xyzrgb.cpp b/depth_image_proc/src/point_cloud_xyzrgb.cpp index 5ef736d96..be3e236b1 100644 --- a/depth_image_proc/src/point_cloud_xyzrgb.cpp +++ b/depth_image_proc/src/point_cloud_xyzrgb.cpp @@ -133,8 +133,10 @@ PointCloudXyzrgbNode::PointCloudXyzrgbNode(const rclcpp::NodeOptions & options) image_transport::TransportHints hints(this); sub_rgb_.subscribe( this, rgb_topic, - hints.getTransport(), rmw_qos_profile_default, sub_opts); - sub_info_.subscribe(this, rgb_info_topic); + hints.getTransport(), + rmw_qos_profile_default, sub_opts); + sub_info_.subscribe(this, rgb_info_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); } }; pub_point_cloud_ = create_publisher("points", rclcpp::SensorDataQoS(), pub_options); diff --git a/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp b/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp index 7d2c92477..ba7801cfd 100644 --- a/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp +++ b/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp @@ -118,7 +118,8 @@ PointCloudXyzrgbRadialNode::PointCloudXyzrgbRadialNode(const rclcpp::NodeOptions // rgb uses normal ros transport hints. image_transport::TransportHints hints(this, "raw"); sub_rgb_.subscribe(this, rgb_topic, hints.getTransport()); - sub_info_.subscribe(this, rgb_info_topic); + sub_info_.subscribe(this, rgb_info_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); } }; pub_point_cloud_ = create_publisher("points", rclcpp::SensorDataQoS(), pub_options); diff --git a/depth_image_proc/src/register.cpp b/depth_image_proc/src/register.cpp index 6269f4cf4..54aa828e3 100644 --- a/depth_image_proc/src/register.cpp +++ b/depth_image_proc/src/register.cpp @@ -139,8 +139,10 @@ RegisterNode::RegisterNode(const rclcpp::NodeOptions & options) std::string topic = node_base->resolve_topic_or_service_name("depth/image_rect", false); image_transport::TransportHints hints(this, "raw", "depth_image_transport"); sub_depth_image_.subscribe(this, topic, hints.getTransport()); - sub_depth_info_.subscribe(this, "depth/camera_info"); - sub_rgb_info_.subscribe(this, "rgb/camera_info"); + sub_depth_info_.subscribe(this, "depth/camera_info", + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); + sub_rgb_info_.subscribe(this, "rgb/camera_info", + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); } }; // For compressed topics to remap appropriately, we need to pass a diff --git a/image_view/include/image_view/disparity_view_node.hpp b/image_view/include/image_view/disparity_view_node.hpp index d8ab8bc34..3c0bc8d0f 100644 --- a/image_view/include/image_view/disparity_view_node.hpp +++ b/image_view/include/image_view/disparity_view_node.hpp @@ -30,10 +30,8 @@ class DisparityViewNode { public: explicit DisparityViewNode(const rclcpp::NodeOptions & options); - explicit DisparityViewNode(const DisparityViewNode &) = default; - explicit DisparityViewNode(DisparityViewNode &&) = default; - DisparityViewNode & operator=(const DisparityViewNode &) = default; - DisparityViewNode & operator=(DisparityViewNode &&) = default; + explicit DisparityViewNode(const DisparityViewNode &) = delete; + explicit DisparityViewNode(DisparityViewNode &&) = delete; ~DisparityViewNode(); private: diff --git a/image_view/include/image_view/image_view_node.hpp b/image_view/include/image_view/image_view_node.hpp index a98290840..4a31e643f 100644 --- a/image_view/include/image_view/image_view_node.hpp +++ b/image_view/include/image_view/image_view_node.hpp @@ -48,10 +48,10 @@ class ImageViewNode { public: explicit ImageViewNode(const rclcpp::NodeOptions & options); - explicit ImageViewNode(const ImageViewNode &) = default; - explicit ImageViewNode(ImageViewNode &&) = default; - ImageViewNode & operator=(const ImageViewNode &) = default; - ImageViewNode & operator=(ImageViewNode &&) = default; + explicit ImageViewNode(const ImageViewNode &) = delete; + explicit ImageViewNode(ImageViewNode &&) = delete; + ImageViewNode & operator=(const ImageViewNode &) = delete; + ImageViewNode & operator=(ImageViewNode &&) = delete; ~ImageViewNode(); private: diff --git a/image_view/include/image_view/stereo_view_node.hpp b/image_view/include/image_view/stereo_view_node.hpp index f2c40c625..0df43e508 100644 --- a/image_view/include/image_view/stereo_view_node.hpp +++ b/image_view/include/image_view/stereo_view_node.hpp @@ -77,10 +77,10 @@ class StereoViewNode { public: explicit StereoViewNode(const rclcpp::NodeOptions & options); - explicit StereoViewNode(const StereoViewNode &) = default; - explicit StereoViewNode(StereoViewNode &&) = default; - StereoViewNode & operator=(const StereoViewNode &) = default; - StereoViewNode & operator=(StereoViewNode &&) = default; + explicit StereoViewNode(const StereoViewNode &) = delete; + explicit StereoViewNode(StereoViewNode &&) = delete; + StereoViewNode & operator=(const StereoViewNode &) = delete; + StereoViewNode & operator=(StereoViewNode &&) = delete; ~StereoViewNode(); private: diff --git a/image_view/include/image_view/video_recorder_node.hpp b/image_view/include/image_view/video_recorder_node.hpp index 52d6b5bd7..51dda6b90 100644 --- a/image_view/include/image_view/video_recorder_node.hpp +++ b/image_view/include/image_view/video_recorder_node.hpp @@ -30,10 +30,10 @@ class VideoRecorderNode { public: explicit VideoRecorderNode(const rclcpp::NodeOptions & options); - explicit VideoRecorderNode(const VideoRecorderNode &) = default; - explicit VideoRecorderNode(VideoRecorderNode &&) = default; - VideoRecorderNode & operator=(const VideoRecorderNode &) = default; - VideoRecorderNode & operator=(VideoRecorderNode &&) = default; + explicit VideoRecorderNode(const VideoRecorderNode &) = delete; + explicit VideoRecorderNode(VideoRecorderNode &&) = delete; + VideoRecorderNode & operator=(const VideoRecorderNode &) = delete; + VideoRecorderNode & operator=(VideoRecorderNode &&) = delete; ~VideoRecorderNode(); private: diff --git a/image_view/src/stereo_view_node.cpp b/image_view/src/stereo_view_node.cpp index 5113da7f2..e478a09f1 100644 --- a/image_view/src/stereo_view_node.cpp +++ b/image_view/src/stereo_view_node.cpp @@ -130,7 +130,8 @@ StereoViewNode::StereoViewNode(const rclcpp::NodeOptions & options) // Subscribe to three input topics. left_sub_.subscribe(this, left_topic, hints.getTransport()); right_sub_.subscribe(this, right_topic, hints.getTransport()); - disparity_sub_.subscribe(this, disparity_topic); + disparity_sub_.subscribe(this, disparity_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); RCLCPP_INFO( this->get_logger(), diff --git a/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp b/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp index a5f9c2d63..dbebb5e3f 100644 --- a/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp +++ b/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp @@ -326,10 +326,12 @@ DisparityNode::DisparityNode(const rclcpp::NodeOptions & options) sub_l_image_.subscribe( this, left_topic, hints.getTransport(), sensor_data_qos, sub_opts); - sub_l_info_.subscribe(this, left_info_topic, sensor_data_qos, sub_opts); + sub_l_info_.subscribe(this, left_info_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); sub_r_image_.subscribe( this, right_topic, hints.getTransport(), sensor_data_qos, sub_opts); - sub_r_info_.subscribe(this, right_info_topic, sensor_data_qos, sub_opts); + sub_r_info_.subscribe(this, right_info_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); } }; diff --git a/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp b/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp index c654f231c..90a1e3e62 100644 --- a/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp +++ b/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp @@ -191,9 +191,12 @@ PointCloudNode::PointCloudNode(const rclcpp::NodeOptions & options) sub_l_image_.subscribe( this, left_topic, hints.getTransport(), sensor_data_qos, sub_opts); - sub_l_info_.subscribe(this, left_info_topic, sensor_data_qos, sub_opts); - sub_r_info_.subscribe(this, right_topic, sensor_data_qos, sub_opts); - sub_disparity_.subscribe(this, disparity_topic, sensor_data_qos, sub_opts); + sub_l_info_.subscribe(this, left_info_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); + sub_r_info_.subscribe(this, right_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); + sub_disparity_.subscribe(this, disparity_topic, + rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); } }; pub_points2_ = create_publisher("points2", 1, pub_opts); From 9dd0936d9c561e606328fae7b9cd5af01da872e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 12 Jul 2024 13:07:24 +0200 Subject: [PATCH 2/6] Clean PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- image_view/include/image_view/disparity_view_node.hpp | 6 ++++-- image_view/include/image_view/image_view_node.hpp | 8 ++++---- image_view/include/image_view/stereo_view_node.hpp | 8 ++++---- image_view/include/image_view/video_recorder_node.hpp | 8 ++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/image_view/include/image_view/disparity_view_node.hpp b/image_view/include/image_view/disparity_view_node.hpp index 3c0bc8d0f..d8ab8bc34 100644 --- a/image_view/include/image_view/disparity_view_node.hpp +++ b/image_view/include/image_view/disparity_view_node.hpp @@ -30,8 +30,10 @@ class DisparityViewNode { public: explicit DisparityViewNode(const rclcpp::NodeOptions & options); - explicit DisparityViewNode(const DisparityViewNode &) = delete; - explicit DisparityViewNode(DisparityViewNode &&) = delete; + explicit DisparityViewNode(const DisparityViewNode &) = default; + explicit DisparityViewNode(DisparityViewNode &&) = default; + DisparityViewNode & operator=(const DisparityViewNode &) = default; + DisparityViewNode & operator=(DisparityViewNode &&) = default; ~DisparityViewNode(); private: diff --git a/image_view/include/image_view/image_view_node.hpp b/image_view/include/image_view/image_view_node.hpp index 4a31e643f..a98290840 100644 --- a/image_view/include/image_view/image_view_node.hpp +++ b/image_view/include/image_view/image_view_node.hpp @@ -48,10 +48,10 @@ class ImageViewNode { public: explicit ImageViewNode(const rclcpp::NodeOptions & options); - explicit ImageViewNode(const ImageViewNode &) = delete; - explicit ImageViewNode(ImageViewNode &&) = delete; - ImageViewNode & operator=(const ImageViewNode &) = delete; - ImageViewNode & operator=(ImageViewNode &&) = delete; + explicit ImageViewNode(const ImageViewNode &) = default; + explicit ImageViewNode(ImageViewNode &&) = default; + ImageViewNode & operator=(const ImageViewNode &) = default; + ImageViewNode & operator=(ImageViewNode &&) = default; ~ImageViewNode(); private: diff --git a/image_view/include/image_view/stereo_view_node.hpp b/image_view/include/image_view/stereo_view_node.hpp index 0df43e508..f2c40c625 100644 --- a/image_view/include/image_view/stereo_view_node.hpp +++ b/image_view/include/image_view/stereo_view_node.hpp @@ -77,10 +77,10 @@ class StereoViewNode { public: explicit StereoViewNode(const rclcpp::NodeOptions & options); - explicit StereoViewNode(const StereoViewNode &) = delete; - explicit StereoViewNode(StereoViewNode &&) = delete; - StereoViewNode & operator=(const StereoViewNode &) = delete; - StereoViewNode & operator=(StereoViewNode &&) = delete; + explicit StereoViewNode(const StereoViewNode &) = default; + explicit StereoViewNode(StereoViewNode &&) = default; + StereoViewNode & operator=(const StereoViewNode &) = default; + StereoViewNode & operator=(StereoViewNode &&) = default; ~StereoViewNode(); private: diff --git a/image_view/include/image_view/video_recorder_node.hpp b/image_view/include/image_view/video_recorder_node.hpp index 51dda6b90..52d6b5bd7 100644 --- a/image_view/include/image_view/video_recorder_node.hpp +++ b/image_view/include/image_view/video_recorder_node.hpp @@ -30,10 +30,10 @@ class VideoRecorderNode { public: explicit VideoRecorderNode(const rclcpp::NodeOptions & options); - explicit VideoRecorderNode(const VideoRecorderNode &) = delete; - explicit VideoRecorderNode(VideoRecorderNode &&) = delete; - VideoRecorderNode & operator=(const VideoRecorderNode &) = delete; - VideoRecorderNode & operator=(VideoRecorderNode &&) = delete; + explicit VideoRecorderNode(const VideoRecorderNode &) = default; + explicit VideoRecorderNode(VideoRecorderNode &&) = default; + VideoRecorderNode & operator=(const VideoRecorderNode &) = default; + VideoRecorderNode & operator=(VideoRecorderNode &&) = default; ~VideoRecorderNode(); private: From c4f867cbe584ac5826aeb5e94d1d17ccf31fcc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 12 Jul 2024 13:09:36 +0200 Subject: [PATCH 3/6] Added feeback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- depth_image_proc/src/disparity.cpp | 3 +-- depth_image_proc/src/point_cloud_xyzi.cpp | 3 +-- depth_image_proc/src/point_cloud_xyzi_radial.cpp | 3 +-- depth_image_proc/src/point_cloud_xyzrgb.cpp | 3 +-- depth_image_proc/src/point_cloud_xyzrgb_radial.cpp | 3 +-- depth_image_proc/src/register.cpp | 6 ++---- image_view/src/stereo_view_node.cpp | 3 +-- 7 files changed, 8 insertions(+), 16 deletions(-) diff --git a/depth_image_proc/src/disparity.cpp b/depth_image_proc/src/disparity.cpp index 0a48fa85a..9e8d30f7d 100644 --- a/depth_image_proc/src/disparity.cpp +++ b/depth_image_proc/src/disparity.cpp @@ -116,8 +116,7 @@ DisparityNode::DisparityNode(const rclcpp::NodeOptions & options) std::string topic = node_base->resolve_topic_or_service_name("left/image_rect", false); image_transport::TransportHints hints(this); sub_depth_image_.subscribe(this, topic, hints.getTransport()); - sub_info_.subscribe(this, "right/camera_info", - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); + sub_info_.subscribe(this, "right/camera_info", rclcpp::QoS(10)); } }; pub_disparity_ = create_publisher( diff --git a/depth_image_proc/src/point_cloud_xyzi.cpp b/depth_image_proc/src/point_cloud_xyzi.cpp index 784b894c8..8a340f524 100644 --- a/depth_image_proc/src/point_cloud_xyzi.cpp +++ b/depth_image_proc/src/point_cloud_xyzi.cpp @@ -108,8 +108,7 @@ PointCloudXyziNode::PointCloudXyziNode(const rclcpp::NodeOptions & options) // intensity uses normal ros transport hints. image_transport::TransportHints hints(this, "raw"); sub_intensity_.subscribe(this, intensity_topic, hints.getTransport()); - sub_info_.subscribe(this, intensity_info_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); + sub_info_.subscribe(this, intensity_info_topic, rclcpp::QoS(10)); } }; pub_point_cloud_ = create_publisher("points", rclcpp::SensorDataQoS(), pub_options); diff --git a/depth_image_proc/src/point_cloud_xyzi_radial.cpp b/depth_image_proc/src/point_cloud_xyzi_radial.cpp index ff9519d93..d14afbe89 100644 --- a/depth_image_proc/src/point_cloud_xyzi_radial.cpp +++ b/depth_image_proc/src/point_cloud_xyzi_radial.cpp @@ -103,8 +103,7 @@ PointCloudXyziRadialNode::PointCloudXyziRadialNode(const rclcpp::NodeOptions & o // intensity uses normal ros transport hints. image_transport::TransportHints hints(this); sub_intensity_.subscribe(this, intensity_topic, hints.getTransport()); - sub_info_.subscribe(this, intensity_info_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); + sub_info_.subscribe(this, intensity_info_topic, rclcpp::QoS(10)); } }; pub_point_cloud_ = create_publisher( diff --git a/depth_image_proc/src/point_cloud_xyzrgb.cpp b/depth_image_proc/src/point_cloud_xyzrgb.cpp index be3e236b1..d48f6190a 100644 --- a/depth_image_proc/src/point_cloud_xyzrgb.cpp +++ b/depth_image_proc/src/point_cloud_xyzrgb.cpp @@ -135,8 +135,7 @@ PointCloudXyzrgbNode::PointCloudXyzrgbNode(const rclcpp::NodeOptions & options) this, rgb_topic, hints.getTransport(), rmw_qos_profile_default, sub_opts); - sub_info_.subscribe(this, rgb_info_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); + sub_info_.subscribe(this, rgb_info_topic, rclcpp::QoS(10)); } }; pub_point_cloud_ = create_publisher("points", rclcpp::SensorDataQoS(), pub_options); diff --git a/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp b/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp index ba7801cfd..d5d7f5f0b 100644 --- a/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp +++ b/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp @@ -118,8 +118,7 @@ PointCloudXyzrgbRadialNode::PointCloudXyzrgbRadialNode(const rclcpp::NodeOptions // rgb uses normal ros transport hints. image_transport::TransportHints hints(this, "raw"); sub_rgb_.subscribe(this, rgb_topic, hints.getTransport()); - sub_info_.subscribe(this, rgb_info_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); + sub_info_.subscribe(this, rgb_info_topic, rclcpp::QoS(10)); } }; pub_point_cloud_ = create_publisher("points", rclcpp::SensorDataQoS(), pub_options); diff --git a/depth_image_proc/src/register.cpp b/depth_image_proc/src/register.cpp index 54aa828e3..3fab51ba3 100644 --- a/depth_image_proc/src/register.cpp +++ b/depth_image_proc/src/register.cpp @@ -139,10 +139,8 @@ RegisterNode::RegisterNode(const rclcpp::NodeOptions & options) std::string topic = node_base->resolve_topic_or_service_name("depth/image_rect", false); image_transport::TransportHints hints(this, "raw", "depth_image_transport"); sub_depth_image_.subscribe(this, topic, hints.getTransport()); - sub_depth_info_.subscribe(this, "depth/camera_info", - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); - sub_rgb_info_.subscribe(this, "rgb/camera_info", - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); + sub_depth_info_.subscribe(this, "depth/camera_info", rclcpp::QoS(10)); + sub_rgb_info_.subscribe(this, "rgb/camera_info", rclcpp::QoS(10)); } }; // For compressed topics to remap appropriately, we need to pass a diff --git a/image_view/src/stereo_view_node.cpp b/image_view/src/stereo_view_node.cpp index e478a09f1..63d6608f2 100644 --- a/image_view/src/stereo_view_node.cpp +++ b/image_view/src/stereo_view_node.cpp @@ -130,8 +130,7 @@ StereoViewNode::StereoViewNode(const rclcpp::NodeOptions & options) // Subscribe to three input topics. left_sub_.subscribe(this, left_topic, hints.getTransport()); right_sub_.subscribe(this, right_topic, hints.getTransport()); - disparity_sub_.subscribe(this, disparity_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default))); + disparity_sub_.subscribe(this, disparity_topic, rclcpp::QoS(10)); RCLCPP_INFO( this->get_logger(), From 3bb201e4b9b939262584790bdacec974723f1d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 12 Jul 2024 17:16:20 +0200 Subject: [PATCH 4/6] Add feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- stereo_image_proc/src/stereo_image_proc/disparity_node.cpp | 4 ++-- .../src/stereo_image_proc/point_cloud_node.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp b/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp index dbebb5e3f..9316e14d5 100644 --- a/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp +++ b/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp @@ -327,11 +327,11 @@ DisparityNode::DisparityNode(const rclcpp::NodeOptions & options) sub_l_image_.subscribe( this, left_topic, hints.getTransport(), sensor_data_qos, sub_opts); sub_l_info_.subscribe(this, left_info_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); + sensor_data_qos.get_rmw_qos_profile(), sub_opts); sub_r_image_.subscribe( this, right_topic, hints.getTransport(), sensor_data_qos, sub_opts); sub_r_info_.subscribe(this, right_info_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); + sensor_data_qos.get_rmw_qos_profile(), sub_opts); } }; diff --git a/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp b/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp index 90a1e3e62..fa324d100 100644 --- a/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp +++ b/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp @@ -192,11 +192,11 @@ PointCloudNode::PointCloudNode(const rclcpp::NodeOptions & options) sub_l_image_.subscribe( this, left_topic, hints.getTransport(), sensor_data_qos, sub_opts); sub_l_info_.subscribe(this, left_info_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); + sensor_data_qos.get_rmw_qos_profile(), sub_opts); sub_r_info_.subscribe(this, right_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); + sensor_data_qos.get_rmw_qos_profile(), sub_opts); sub_disparity_.subscribe(this, disparity_topic, - rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(sensor_data_qos)), sub_opts); + sensor_data_qos.get_rmw_qos_profile(), sub_opts); } }; pub_points2_ = create_publisher("points2", 1, pub_opts); From 15e45f08d1e102ca757d97a667dabd00d18c1d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 12 Jul 2024 17:26:47 +0200 Subject: [PATCH 5/6] fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- .../src/stereo_image_proc/disparity_node.cpp | 6 +++--- .../src/stereo_image_proc/point_cloud_node.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp b/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp index 9316e14d5..5d09d10ff 100644 --- a/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp +++ b/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp @@ -315,7 +315,7 @@ DisparityNode::DisparityNode(const rclcpp::NodeOptions & options) image_transport::getCameraInfoTopic(right_topic), false); // REP-2003 specifies that subscriber should be SensorDataQoS - const auto sensor_data_qos = rclcpp::SensorDataQoS().get_rmw_qos_profile(); + const auto sensor_data_qos = rclcpp::SensorDataQoS(); // Support image transport for compression image_transport::TransportHints hints(this); @@ -327,11 +327,11 @@ DisparityNode::DisparityNode(const rclcpp::NodeOptions & options) sub_l_image_.subscribe( this, left_topic, hints.getTransport(), sensor_data_qos, sub_opts); sub_l_info_.subscribe(this, left_info_topic, - sensor_data_qos.get_rmw_qos_profile(), sub_opts); + sensor_data_qos, sub_opts); sub_r_image_.subscribe( this, right_topic, hints.getTransport(), sensor_data_qos, sub_opts); sub_r_info_.subscribe(this, right_info_topic, - sensor_data_qos.get_rmw_qos_profile(), sub_opts); + sensor_data_qos, sub_opts); } }; diff --git a/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp b/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp index fa324d100..6dc0cd8a8 100644 --- a/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp +++ b/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp @@ -180,7 +180,7 @@ PointCloudNode::PointCloudNode(const rclcpp::NodeOptions & options) image_transport::getCameraInfoTopic(left_topic), false); // REP-2003 specifies that subscriber should be SensorDataQoS - const auto sensor_data_qos = rclcpp::SensorDataQoS().get_rmw_qos_profile(); + const auto sensor_data_qos = rclcpp::SensorDataQoS(); // Support image transport for compression image_transport::TransportHints hints(this); @@ -190,13 +190,13 @@ PointCloudNode::PointCloudNode(const rclcpp::NodeOptions & options) sub_opts.qos_overriding_options = rclcpp::QosOverridingOptions::with_default_policies(); sub_l_image_.subscribe( - this, left_topic, hints.getTransport(), sensor_data_qos, sub_opts); + this, left_topic, hints.getTransport(), sensor_data_qos.get_rmw_qos_profile(), sub_opts); sub_l_info_.subscribe(this, left_info_topic, - sensor_data_qos.get_rmw_qos_profile(), sub_opts); + sensor_data_qos, sub_opts); sub_r_info_.subscribe(this, right_topic, - sensor_data_qos.get_rmw_qos_profile(), sub_opts); + sensor_data_qos, sub_opts); sub_disparity_.subscribe(this, disparity_topic, - sensor_data_qos.get_rmw_qos_profile(), sub_opts); + sensor_data_qos, sub_opts); } }; pub_points2_ = create_publisher("points2", 1, pub_opts); From 7597777635740b7b57159c3fa0c16d64bd408ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 12 Jul 2024 17:28:15 +0200 Subject: [PATCH 6/6] fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- stereo_image_proc/src/stereo_image_proc/disparity_node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp b/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp index 5d09d10ff..123cfe534 100644 --- a/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp +++ b/stereo_image_proc/src/stereo_image_proc/disparity_node.cpp @@ -325,11 +325,11 @@ DisparityNode::DisparityNode(const rclcpp::NodeOptions & options) sub_opts.qos_overriding_options = rclcpp::QosOverridingOptions::with_default_policies(); sub_l_image_.subscribe( - this, left_topic, hints.getTransport(), sensor_data_qos, sub_opts); + this, left_topic, hints.getTransport(), sensor_data_qos.get_rmw_qos_profile(), sub_opts); sub_l_info_.subscribe(this, left_info_topic, sensor_data_qos, sub_opts); sub_r_image_.subscribe( - this, right_topic, hints.getTransport(), sensor_data_qos, sub_opts); + this, right_topic, hints.getTransport(), sensor_data_qos.get_rmw_qos_profile(), sub_opts); sub_r_info_.subscribe(this, right_info_topic, sensor_data_qos, sub_opts); }