diff --git a/src/generic_laser_filter_node.cpp b/src/generic_laser_filter_node.cpp index 2e8a7921..b5bf3124 100644 --- a/src/generic_laser_filter_node.cpp +++ b/src/generic_laser_filter_node.cpp @@ -89,7 +89,9 @@ class GenericLaserScanFilterNode tf_filter_.setTolerance(0.03s); // Advertise output - output_pub_ = nh_->create_publisher("output", 1000); + rclcpp::PublisherOptions pub_options; + pub_options.qos_overriding_options = rclcpp::QosOverridingOptions::with_default_policies(); + output_pub_ = nh_->create_publisher("output", 1000, pub_options); std::function standard_callback = std::bind(&GenericLaserScanFilterNode::foo, this, std::placeholders::_1); diff --git a/src/scan_to_cloud_filter_chain.cpp b/src/scan_to_cloud_filter_chain.cpp index 859f7758..a608f2dd 100644 --- a/src/scan_to_cloud_filter_chain.cpp +++ b/src/scan_to_cloud_filter_chain.cpp @@ -88,9 +88,10 @@ ScanToCloudFilterChain::ScanToCloudFilterChain( this->get_node_timers_interface()); buffer_.setCreateTimerInterface(timer_interface); + rclcpp::PublisherOptions pub_options; + pub_options.qos_overriding_options = rclcpp::QosOverridingOptions::with_default_policies(); #ifdef RCLCPP_SUPPORTS_MATCHED_CALLBACKS if (lazy_subscription_) { - rclcpp::PublisherOptions pub_options; pub_options.event_callbacks.matched_callback = [this](rclcpp::MatchedInfo & s) { @@ -103,11 +104,11 @@ ScanToCloudFilterChain::ScanToCloudFilterChain( cloud_pub_ = this->create_publisher( "cloud_filtered", 10, pub_options); } else { - cloud_pub_ = this->create_publisher("cloud_filtered", 10); + cloud_pub_ = this->create_publisher("cloud_filtered", 10, pub_options); scan_sub_.subscribe(this, "scan", rclcpp::SensorDataQoS()); } #else - cloud_pub_ = this->create_publisher("cloud_filtered", 10); + cloud_pub_ = this->create_publisher("cloud_filtered", 10, pub_options); scan_sub_.subscribe(this, "scan", rclcpp::SensorDataQoS()); #endif diff --git a/src/scan_to_scan_filter_chain.cpp b/src/scan_to_scan_filter_chain.cpp index 98743316..4157a264 100644 --- a/src/scan_to_scan_filter_chain.cpp +++ b/src/scan_to_scan_filter_chain.cpp @@ -92,9 +92,10 @@ ScanToScanFilterChain::ScanToScanFilterChain( std::placeholders::_1)); } + rclcpp::PublisherOptions pub_options; + pub_options.qos_overriding_options = rclcpp::QosOverridingOptions::with_default_policies(); #ifdef RCLCPP_SUPPORTS_MATCHED_CALLBACKS if (lazy_subscription_) { - rclcpp::PublisherOptions pub_options; pub_options.event_callbacks.matched_callback = [this](rclcpp::MatchedInfo & s) { @@ -108,12 +109,12 @@ ScanToScanFilterChain::ScanToScanFilterChain( "scan_filtered", scan_filtered_history_depth_, pub_options); } else { output_pub_ = this->create_publisher( - "scan_filtered", scan_filtered_history_depth_); + "scan_filtered", scan_filtered_history_depth_, pub_options); scan_sub_.subscribe(this, "scan", rclcpp::SensorDataQoS()); } #else output_pub_ = this->create_publisher( - "scan_filtered", scan_filtered_history_depth_); + "scan_filtered", scan_filtered_history_depth_, pub_options); scan_sub_.subscribe(this, "scan", rclcpp::SensorDataQoS()); #endif }