laser_filters
laser_filters copied to clipboard
Would it be possible to chose with what to replace 'error values' for LaserScanBoxFilter?
When using the LaserScanBoxFilter, we don't have a choice on the replacement of the values inside the filtered box. With this type of filter, the values are replaced by NaN. For my application, I would like to be able to have them replaced by something else. This can already be done for other filters such as the LaserScanRangeFilter with the upper/lower_replacement_value.
So is there a way we could be able to have the choice of the replacement value for the LaserScanBoxFilter filter too?
(I am using ROS2 Galactic)
Seems like a reasonable feature to add but I'm short on time - could you submit a PR that adds it? To do this you'd need to:
- read a parameter to get the replacement value after line 81 in this file: https://github.com/ros-perception/laser_filters/blob/ros2/include/laser_filters/box_filter.h
- modify line 193 in the same file to use that value instead of always using NaN
The default value for the parameter should be NaN so that the default behavior doesn't change for anyone currently using the filter.