-
Notifications
You must be signed in to change notification settings - Fork 334
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
Change occupancy value in dummy_map_server
to 1.
#680
Conversation
Signed-off-by: Marco A. Gutierrez <[email protected]>
@@ -65,7 +65,7 @@ int main(int argc, char * argv[]) | |||
msg.data[(center) % (msg.info.width * msg.info.height)] = -1; | |||
msg.data[(rhs) % (msg.info.width * msg.info.height)] = -1; | |||
msg.data[(++lhs) % (msg.info.width * msg.info.height)] = 0; | |||
msg.data[(++center) % (msg.info.width * msg.info.height)] = 100; | |||
msg.data[(++center) % (msg.info.width * msg.info.height)] = 1; |
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 that 100
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.
This is a good justification to me to keep things as they are then. I'm going to close this PR. We can reopen it if we decide to revisit this. Thanks for the suggestion @marcoag! |
As pointed out in osrf/ros2_test_cases#1200, dummy map server occupancy value should be
1
as specified in https://github.com/ros2/common_interfaces/blob/rolling/nav_msgs/msg/OccupancyGrid.msg.We should backport this once merged.