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

Change occupancy value in dummy_map_server to 1. #680

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from

Conversation

marcoag
Copy link
Contributor

@marcoag marcoag commented May 6, 2024

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.

Signed-off-by: Marco A. Gutierrez <marcogg@marcogg.com>
@@ -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;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link

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.

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.

None yet

3 participants