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

Nav2 should work with Cartographer, other SLAM packages #595

Closed
mkhansenbot opened this issue Mar 7, 2019 · 11 comments
Closed

Nav2 should work with Cartographer, other SLAM packages #595

mkhansenbot opened this issue Mar 7, 2019 · 11 comments
Assignees
Labels
1 - High High Priority
Milestone

Comments

@mkhansenbot
Copy link
Collaborator

Feature request

Instead of using AMCL and map_server, a user should be able to run a SLAM package such as Cartographer or gmapping to provide the map and localization info.

Feature description

This is a common usage model from ROS1 when mapping. Explore algorithms and RVIZ can then be used to drive the robot during mapping.

Implementation considerations

Currently the robot's pose is retrieved from the amcl_pose topic which isn't published by SLAM packages such as Cartographer.

@mhpanah
Copy link
Contributor

mhpanah commented Mar 7, 2019

We can look at the following three scenarios with Cartographer or other SLAM packages:

  1. Map of environment is unknown and user is tele-operating the robot with Cartographer to map the environment. Once the environment is mapped, the user will use our Nav2 stack the way it is to navigate.
  2. Map of environment is unknown and the user wants to autonomously map the environment with Cartographer. Once the environment is mapped, the user will use our Nav2 stack the way it is to navigate.
  3. Map of environment is known or partially known; user is using Cartographer to keep updating the map while navigating.

For the second and third use cases, we can utilize behavior tree to enable/disable proper components and add proper planner within our Nav2 stack that is suitable for these tasks.

@mkhansenbot
Copy link
Collaborator Author

I agree with the 3 use cases. I think we should support all 3 with both simple_navigator and bt_navigator. Otherwise we have to document exactly which ones work with each use case.

@mkhansenbot mkhansenbot added this to Incoming Issues in Navigation 2 Kanban via automation Mar 11, 2019
@mkhansenbot mkhansenbot added the 1 - High High Priority label Mar 11, 2019
@mkhansenbot mkhansenbot added this to the EndMarch milestone Mar 11, 2019
@crdelsey
Copy link
Contributor

Regarding @mhpanah 's points 1 to 3 above:

  1. Is already working
  2. We just need to change the QOS settings on the map topics to the default so we are compatible with the maps published by Cartographer
  3. Involves bringing up an exploration node to drive the mission. It's probably outside of nav2

@mkhansenbot
Copy link
Collaborator Author

Use case 3 requires the change I mentioned above. amcl_pose is not published in that case, so another method is needed to check for the robot's position.

@crdelsey crdelsey moved this from Incoming Issues to High Priority Issues in Navigation 2 Kanban Mar 18, 2019
@crdelsey crdelsey moved this from High Priority Issues to For Upcoming Release in Navigation 2 Kanban Mar 18, 2019
@rotu
Copy link
Contributor

rotu commented Jun 20, 2019

Trying to use Nav2 with Cartographer, one issue is that the static layer costmap plugin hangs indefinitely waiting for a service (nav_msgs/srv/GetMap). Even though the static plugin can subscribe to the OccupancyGrid as a topic (nav_msgs/msg/OccupancyGrid), it needs an option to turn off the map service client.

[world_model-1] [INFO] [global_costmap.world_model]: Creating
[navfn_planner-2] [INFO] [navfn_planner]: Creating
[world_model-1] [INFO] [world_model]: Configuring
[world_model-1] [INFO] [global_costmap.world_model]: Configuring
[world_model-1] [INFO] [global_costmap.world_model]: Using plugin "static_layer"
[world_model-1] [INFO] [global_costmap.world_model]: StaticLayer: Requesting map from the map service
[world_model-1] [INFO] [world_model_client]: map service client: waiting for service to appear...
[world_model-1] [INFO] [world_model_client]: map service client: waiting for service to appear...
[world_model-1] [INFO] [world_model_client]: map service client: waiting for service to appear...

PR #885

@rotu
Copy link
Contributor

rotu commented Jun 21, 2019

Another issue is that Cartographer ROS only publishes transforms, not poses (nav stack expects PoseWithCovariance):

ros2/cartographer_ros#30

@crdelsey
Copy link
Contributor

Another issue is that Cartographer ROS only publishes transforms

PR #793 should address that problem. However, when I tested with that code enabled a month or two ago, both DWB and Cartographer crashed frequently, so I expect there is still more to debug.

@mkhansenbot
Copy link
Collaborator Author

This is working now, fixed by #1057

@mhaboali
Copy link

mhaboali commented Jun 6, 2020

Regarding @mhpanah 's points 1 to 3 above:

  1. Is already working
  2. We just need to change the QOS settings on the map topics to the default so we are compatible with the maps published by Cartographer
  3. Involves bringing up an exploration node to drive the mission. It's probably outside of nav2

Hi
Thanks for this great discussion, I'm wondering now about how can I run the scenario #2 as described here? I mean to run nav2 with cartographer without using mapserver.

Thanks!

@mhaboali
Copy link

mhaboali commented Jun 7, 2020

Hi @mkhansenbot

Could you help me with running the Nav2 with Cartographer without a previously recorded map? And how can I disable the map server in this case?

You help will be appreciated!

@SteveMacenski
Copy link
Member

Please file a question on ROS Answers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - High High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants