Issue #22: only touch cells within the triangular projection of the sensor cone #30
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.
On updateCostmap, only touch cells within the triangular projection of the sensor cone.
I also add a parameter (inflate_cone) to regulate this feature as a percentage. 100% rolls back to current behavior of covering a rectangular area, while 0% corresponds to just the triangle. I added this because, if your sensor fov is very narrow, the covered area can become zero due to cell discretization.
The parameter meaning is a bit tricky, I think, so I created a video to show it working: I set all cells as obstacles to see the covered area. Also a good wiki explanation will be required if this PR is accepted.
Btw, in terms of performance, the feature has nearly no impact; if ever, it makes the update a bit faster when the sensor covers a big area.