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
10 changes: 7 additions & 3 deletions src/scan_to_scan_filter_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ ScanToScanFilterChain::ScanToScanFilterChain(
#endif
this->declare_parameter("tf_message_filter_target_frame", "", read_only_desc);
this->declare_parameter("tf_message_filter_tolerance", 0.03, read_only_desc);
this->declare_parameter("scan_filtered_history_depth", 1000);

// Get parameters
#ifdef RCLCPP_SUPPORTS_MATCHED_CALLBACKS
this->get_parameter("lazy_subscription", lazy_subscription_);
#endif
this->get_parameter("tf_message_filter_target_frame", tf_message_filter_target_frame_);
this->get_parameter("tf_message_filter_tolerance", tf_filter_tolerance_);
this->get_parameter("scan_filtered_history_depth", scan_filtered_history_depth_);

if (!tf_message_filter_target_frame_.empty()) {
tf_.reset(new tf2_ros::TransformListener(buffer_));
Expand Down Expand Up @@ -103,13 +105,15 @@ ScanToScanFilterChain::ScanToScanFilterChain(
}
};
output_pub_ = this->create_publisher<sensor_msgs::msg::LaserScan>(
"scan_filtered", 1000, pub_options);
"scan_filtered", scan_filtered_history_depth_, pub_options);
} else {
output_pub_ = this->create_publisher<sensor_msgs::msg::LaserScan>("scan_filtered", 1000);
output_pub_ = this->create_publisher<sensor_msgs::msg::LaserScan>(
"scan_filtered", scan_filtered_history_depth_);
scan_sub_.subscribe(this, "scan", rclcpp::SensorDataQoS());
}
#else
output_pub_ = this->create_publisher<sensor_msgs::msg::LaserScan>("scan_filtered", 1000);
output_pub_ = this->create_publisher<sensor_msgs::msg::LaserScan>(
"scan_filtered", scan_filtered_history_depth_);
scan_sub_.subscribe(this, "scan", rclcpp::SensorDataQoS());
#endif
}
Expand Down
1 change: 1 addition & 0 deletions src/scan_to_scan_filter_chain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class ScanToScanFilterChain : public rclcpp::Node
#endif
std::string tf_message_filter_target_frame_;
double tf_filter_tolerance_;
int scan_filtered_history_depth_;

// Diagnostic updater
diagnostic_updater::Heartbeat heartbeat_diagnostics_;
Expand Down