Skip to content

Commit

Permalink
Declare speckle filter params writeable
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbinney committed Sep 10, 2024
1 parent ed29567 commit 027b936
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/laser_filters/speckle_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ class LaserScanSpeckleFilter : public filters::FilterBase<sensor_msgs::msg::Lase

///////////////////////////////////////////////////////////////
bool configure(){

#ifdef RCLCPP_SUPPORTS_POST_SET_PARAMS_CALLBACK
// Declare parameters as writeable. Otherwise, the first time we call FilterBase::getParam() for each one,
// it will get declared as write only.
rcl_interfaces::msg::ParameterDescriptor desc;
desc.read_only = true;
params_interface_->declare_parameter("filter_type", rclcpp::ParameterType::PARAMETER_INTEGER, desc);
params_interface_->declare_parameter("max_range", rclcpp::ParameterType::PARAMETER_DOUBLE, desc);
params_interface_->declare_parameter("max_range_difference", rclcpp::ParameterType::PARAMETER_DOUBLE, desc);
params_interface_->declare_parameter("filter_window", rclcpp::ParameterType::PARAMETER_INTEGER, desc);
#endif

// get params
if (!filters::FilterBase<sensor_msgs::msg::LaserScan>::getParam(std::string("filter_type"), filter_type))
{
Expand Down

0 comments on commit 027b936

Please sign in to comment.