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

Add flag to round the occupancy grid values to the trinary interpretation #1489

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

Conversation

BarceloChristian
Copy link

  • ROS navigation stack does not work correctly with the map currently published by Cartographer ROS.
  • Autonomous exploration packages are not able to detect frontiers.
  • MoveBase complains about TF needing to extrapolate into the future when running autonomous exploration nodes.

  • For the first two bullets, I added a FLAG trinary_interpretation into occupancy_grid_node_main and pbstream_map_publisher_main to round the values into 0 or 100 based on default phit and pmiss.
  • For the third bullet, I added a FLAG to node_main and offline_node that allows setting a tolerance to the TF message. This is something similar to what AMCL and GMapping do.

Signed-off-by: Christian Barcelo [email protected]

…tion.

Add transform tolerance option to avoid TF extrapolating into the future.

Signed-off-by: Christian Barcelo <[email protected]>
if (observed != 0) {
const auto cell =
::cartographer::common::RoundToInt((1. - color / 255.) * 100.);
if (trinary_interpretation) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deviating from documentation of this message: http://docs.ros.org/api/nav_msgs/html/msg/OccupancyGrid.html

Did you consider improving the nav stack to handle this properly?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it is correct that deviates from the documentation of OccupancyGrid, map_server as a standard in ROS uses that same message for publishing in this way.
It's true also that nav stack could be improved to properly work with the current approach that Cartographer has, but I want to bring an option that would allow ANY package developed to work with map_server (again, as a standard), to properly work with Cartographer too. As I mentioned this is the case of autonomous exploration packages as explore-lite and frontier-exploration. There are a lot of issues opened on the GitHub of those packages asking to work with Cartographer, and the same might be happening with others packages that I don't know.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds unconvincing. It seems you agree that the current implementation is correct. Also map_server which you mention seems to use the message as documented. http://wiki.ros.org/map_server even mentions scale and raw modes which would also break the other packages you are interested in it would seem at first glance. Is this not the case? I can only encourage you to investigate improvements in these packages. Not foremost to support the approach that Cartographer has, but to the support the OccupancyGrid message as it is documented.

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.

2 participants