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.
This pull request is in regards to #341
After filing the bug report I went an did some digging to figure out why the bug was occurring.
As it turns out, in
laser_scan_display:75
, the function call:projector_->transformLaserScanToPointCloud( fixed_frame_.toStdString(), *scan, *cloud, *buffer, laser_geometry::channel_option::Intensity);
calls a function in laser_geometry with a prototype as such:
The relevant parameter here is the
range_cutoff
, which controls at what range reading the transform should discard the readings. By default this value is implicitly set to -1 as seen, which means therange_cutoff
would be inherited from themax_range
of the incomingLaserscan
, this is usually desired behavior.However,
range_cutoff
is not the only default argument,channel_options
is one as well, and the bug was caused by ambigious interpretation of the arguments due to the original call above omitting the range_cutoff. Since both arguments can be implicitly converted to one another's type, both are default, andrange_cutoff
comes first, this results in the interpretation thatcutoff is one meter because
laser_geometry::channel_option::Intensity = 0x01
The proposed fix is the simplest possible solution, which is to explicitly set
range_cutoff
and correct the positioning.