Using NaN instead of range_max+1 to remove scans in angular_bounds_filter_in_place #202
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem statement
The current implementation of
angular_bounds_filter_in_place
usesrange_max + 1.0
to filter laser scans, which can lead to unintended behaviours when these scans are passed to packages likeAMCL
andslam_toolbox
.Proposed Change
This PR modifies the code to use
NaN
instead ofrange_max + 1
for filtering out-of-range scans. UsingNaN
is a more robust approach because it eliminates the need for other packages to verify whether each scan falls within the range specified in the message header.This change aligns with the existing methodology used in
box_filter
, enhancing consistency across the codebase. We've ported this approach toangular_bounds_filter_in_place
to ensure more reliable and predictable performance.