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.
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.
I talked to @marcoag about this offline; I have some vague recollection that
100
means something in occupancy grids.That said, I think that either this number should match what we have in the documentation (which does indeed say to use
1
here), or the documentation should be updated to specifically say that100
has meaning.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.
So in ROS noetic it seems that it was 100 to represent percentage based probabilities. Then this was changed in the last comments update.
There were some efforts to change this to 0-255 for higher resolution here but it was not pursued in order to avoid disruption to users which makes me thing a change to 0-1 would have also been avoided. It seems that now nav2 uses the 0-255 range in costmaps and translates to 0-100 range.
Even though not a percentage anymore I found some uses of the 0-100 range, i.e.: https://github.com/open-navigation/navigation2/blob/main/nav2_costmap_2d/src/costmap_2d_publisher.cpp#L94.
Maybe @DLu can offer some extra info on why a binary value is suggested in the message doc instead of a percentage?
My current naive vote is that we should keep 0-100 and update docs where needed.
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.
So, now in 2024, almost exactly four years after I made ros2/common_interfaces#117, I now question what the heck I was doing. Specifically with the value of 1. Most frequently, its 100.
My full thoughts on the values published in Occupancy Grids can be seen in the robot_navigation documentation. To stay consistent with the RViz visualization, I would probably stick with 100.