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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dummy_robot/dummy_map_server/src/dummy_map_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

msg.data[(++rhs) % (msg.info.width * msg.info.height)] = 0;

msg.header.stamp = clock->now();
Expand Down