Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/generic_laser_filter_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class GenericLaserScanFilterNode
tf_filter_.setTolerance(0.03s);

// Advertise output
output_pub_ = nh_->create_publisher<sensor_msgs::msg::LaserScan>("output", 1000);
rclcpp::PublisherOptions pub_options;
pub_options.qos_overriding_options = rclcpp::QosOverridingOptions::with_default_policies();
output_pub_ = nh_->create_publisher<sensor_msgs::msg::LaserScan>("output", 1000, pub_options);

std::function<void(const sensor_msgs::msg::LaserScan::SharedPtr)> standard_callback =
std::bind(&GenericLaserScanFilterNode::foo, this, std::placeholders::_1);
Expand Down
7 changes: 4 additions & 3 deletions src/scan_to_cloud_filter_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -103,11 +104,11 @@ ScanToCloudFilterChain::ScanToCloudFilterChain(
cloud_pub_ = this->create_publisher<sensor_msgs::msg::PointCloud2>(
"cloud_filtered", 10, pub_options);
} else {
cloud_pub_ = this->create_publisher<sensor_msgs::msg::PointCloud2>("cloud_filtered", 10);
cloud_pub_ = this->create_publisher<sensor_msgs::msg::PointCloud2>("cloud_filtered", 10, pub_options);
scan_sub_.subscribe(this, "scan", rclcpp::SensorDataQoS());
}
#else
cloud_pub_ = this->create_publisher<sensor_msgs::msg::PointCloud2>("cloud_filtered", 10);
cloud_pub_ = this->create_publisher<sensor_msgs::msg::PointCloud2>("cloud_filtered", 10, pub_options);
scan_sub_.subscribe(this, "scan", rclcpp::SensorDataQoS());
#endif

Expand Down
7 changes: 4 additions & 3 deletions src/scan_to_scan_filter_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -108,12 +109,12 @@ ScanToScanFilterChain::ScanToScanFilterChain(
"scan_filtered", scan_filtered_history_depth_, pub_options);
} else {
output_pub_ = this->create_publisher<sensor_msgs::msg::LaserScan>(
"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<sensor_msgs::msg::LaserScan>(
"scan_filtered", scan_filtered_history_depth_);
"scan_filtered", scan_filtered_history_depth_, pub_options);
scan_sub_.subscribe(this, "scan", rclcpp::SensorDataQoS());
#endif
}
Expand Down
Loading