@@ -56,14 +56,20 @@ class ImageSyncNode : public rclcpp::Node {
5656 rclcpp::QoS qos (rclcpp::KeepLast (10 ));
5757 qos.reliable ();
5858
59- camera_01_color_sub_.subscribe (this , " /camera_01/color/image_raw" , qos.get_rmw_qos_profile ());
60- camera_01_depth_sub_.subscribe (this , " /camera_01/depth/image_raw" , qos.get_rmw_qos_profile ());
61- camera_02_color_sub_.subscribe (this , " /camera_02/color/image_raw" , qos.get_rmw_qos_profile ());
62- camera_02_depth_sub_.subscribe (this , " /camera_02/depth/image_raw" , qos.get_rmw_qos_profile ());
63- camera_03_color_sub_.subscribe (this , " /camera_03/color/image_raw" , qos.get_rmw_qos_profile ());
64- camera_03_depth_sub_.subscribe (this , " /camera_03/depth/image_raw" , qos.get_rmw_qos_profile ());
65- camera_04_color_sub_.subscribe (this , " /camera_04/color/image_raw" , qos.get_rmw_qos_profile ());
66- camera_04_depth_sub_.subscribe (this , " /camera_04/depth/image_raw" , qos.get_rmw_qos_profile ());
59+ #ifdef message_filters_QoS
60+ const rclcpp::QoS qos_prof = qos;
61+ #else
62+ const rmw_qos_profile_t qos_prof = qos.get_rmw_qos_profile ();
63+ #endif
64+
65+ camera_01_color_sub_.subscribe (this , " /camera_01/color/image_raw" , qos_prof);
66+ camera_01_depth_sub_.subscribe (this , " /camera_01/depth/image_raw" , qos_prof);
67+ camera_02_color_sub_.subscribe (this , " /camera_02/color/image_raw" , qos_prof);
68+ camera_02_depth_sub_.subscribe (this , " /camera_02/depth/image_raw" , qos_prof);
69+ camera_03_color_sub_.subscribe (this , " /camera_03/color/image_raw" , qos_prof);
70+ camera_03_depth_sub_.subscribe (this , " /camera_03/depth/image_raw" , qos_prof);
71+ camera_04_color_sub_.subscribe (this , " /camera_04/color/image_raw" , qos_prof);
72+ camera_04_depth_sub_.subscribe (this , " /camera_04/depth/image_raw" , qos_prof);
6773
6874 sync_ =
6975 std::make_shared<Sync>(SyncPolicy (10 ), camera_01_color_sub_, camera_01_depth_sub_,
0 commit comments