-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore measurements outside lidar range #544
base: ros2
Are you sure you want to change the base?
Conversation
|
||
m_UnfilteredPointReadings.push_back(point); | ||
if (!math::InRange(rangeReading, pLaserRangeFinder->GetMinimumRange(), | ||
pLaserRangeFinder->GetMaximumRange())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_pRangeThreshold->SetValue(math::Clip(rangeThreshold, GetMinimumRange(), GetMaximumRange())); |
The rangeThreshold
is always less than GetMaximumRange
so this is already true. You can revert these changes
@@ -5658,7 +5658,10 @@ class LocalizedRangeScan : public LaserRangeScan | |||
kt_int32u beamNum = 0; | |||
for (kt_int32u i = 0; i < pLaserRangeFinder->GetNumberOfRangeReadings(); i++, beamNum++) { | |||
kt_double rangeReading = GetRangeReadings()[i]; | |||
if (!math::InRange(rangeReading, pLaserRangeFinder->GetMinimumRange(), rangeThreshold)) { | |||
if (rangeReading < pLaserRangeFinder->GetMinimumRange()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using that InRange
line that was there before math::InRange(rangeReading, pLaserRangeFinder->GetMinimumRange(), rangeThreshold)
? This seems to remove the far-check
According to the comment in sensor_msgs/LaserScan, values < range_min or > range_max should be discarded. Without this, scan matching will fail for lidars publishing 0 for invalid measurements.
I moved the filtration outside karto_sdk in the latest iteration. The scan matching is fixed in both the old and this version, but loop closure still doesn't seem right with my half-blocked lidar. I placed a second lidar on top of the half-blocked one to do some comparison. Here's my robot setup: It would be great if someone can give me some suggestions on debugging. /scan is the half-blocked lidar and /scan2 is the one on top.
|
Fixed with the latest commit, but I'm not sure if it's the correct fix because I haven't actually understood how ScanMatcher works yet. edit: dropped this. I should simply lower the threshold in config file instead. |
According to the comment in sensor_msgs/LaserScan, values < range_min or > range_max should be discarded.
Without this, scan matching will fail for lidars publishing 0 for invalid measurements.
Basic Info
Description of contribution in a few bullet points