Skip to content
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

Updates to raytrace clearing, edge case bugfix #25

Closed

Conversation

phil0stine
Copy link

@phil0stine phil0stine commented Jun 30, 2016

There are two basic changes here. One is a fix to an edge case bug where an observation point is very close to (0,0,0), leading to the unsigned int number_of_steps to be zero when input to bresenham3DIncludingCorners. number_of_steps is then decremented, leading to a crash. You could argue that (0,0,0) should never be included as an observation (I would agree), but it can happen in practice and is easy enough to handle here. Relevant discussion link

The second change is an update to the scaling factor applied to the line segment from the sensor origin to the observation point (dx, dy, and dz) before calling clearVoxelLineInMap. The existing code adjusted the scaling factor according to whether the observation point was outside the costmap boundary. The updated factor also prevents the line segment to be larger than the raytrace_range parameter. This prevents memory issues mentioned in the removed warning, since the clearing cache is guaranteed to have a width, height of at least 2*raytrace_range.

Finally, a design update to cache_clearer.h corrects logic to properly clear data coming from more than one sensor, as described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants