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

Support localization #315

Closed
wohe opened this Issue Jun 6, 2017 · 12 comments

Comments

Projects
None yet
8 participants
@wohe
Contributor

wohe commented Jun 6, 2017

The idea is to have a trajectory builder doing pure localization. Other trajectories contain the map data. To avoid a growing SLAM problem, only a few submaps of the localization trajectory are kept.

This depends on #283. Also see googlecartographer/cartographer_ros#95.

@wohe wohe added the enhancement label Jun 6, 2017

@wohe wohe self-assigned this Jun 6, 2017

wohe pushed a commit to wohe/cartographer that referenced this issue Jun 6, 2017

wohe pushed a commit that referenced this issue Jun 7, 2017

@SirVer

This comment has been minimized.

Contributor

SirVer commented Jun 22, 2017

I am calling this done. It requires some way of actually enabling it for a trajectory in cartographer_ros, but the functionality is now in Cartographer.

@SirVer SirVer closed this Jun 22, 2017

wohe pushed a commit to wohe/cartographer that referenced this issue Jul 4, 2017

Wolfgang Hess
First rough implementation of loading a map.
This implements loading of serialized maps in 2D:
We insert all submaps at the serialized optimized pose into
the pose graph and remove their poses from the optimization.

Related to googlecartographer#197 and googlecartographer#315.

wohe pushed a commit that referenced this issue Jul 4, 2017

Wolfgang Hess
First rough implementation of loading a map. (#382)
This implements loading of serialized maps in 2D:
We insert all submaps at the serialized optimized pose into
the pose graph and remove their poses from the optimization.

Related to #197 and #315.
@sradmard

This comment has been minimized.

sradmard commented Jul 24, 2017

Hi,
I am interested in using cartographer to localize my robot on a preexisting 2D map through ROS. I have already done that with AMCL package in ros, however I would like to get it done with the localizer implemented by cartographer as well. I tried to follow this issue, however I cannot figure out exactly what configurations I need to modify in my .lua file to just activate the localizer.
I am loading my full map using "map_server" ros package, and have set the following parameters in my .lua file:
TRAJECTORY_BUILDER.pure_localization = true
SPARSE_POSE_GRAPH.optimize_every_n_scans = 20

however, after running the launch file, the submap created by the cartographer and my full map do not match.
I would really appreciate any advice on this matter.

@SirVer

This comment has been minimized.

Contributor

SirVer commented Jul 25, 2017

Just continue driving for a bit and it should converge eventually. You should maybe also reduce the optimize_every_n_scans further (to 1 or 2).

@wohe

This comment has been minimized.

Contributor

wohe commented Jul 25, 2017

@sradmard How did you create the map? If you use Cartographer, you can write out a .pbstream file and serve this map passing an argument to the Cartographer ROS node like it is done in the localization demo launch file.

You cannot use map_server for serving the map and localize in it with Cartographer. You could write a tool that converts the .pgm and .yaml to a .pbstream file containing a single submap, but it does not exist yet.

@sradmard

This comment has been minimized.

sradmard commented Jul 25, 2017

Thank you for your quick responses.
@wohe I created the map using Cartographer, but I saved it using "map_server" package by running:
$ rosrun map_server map_saver -f mapname
It is more clear to me now on what to do. I can run my robot again and create another map, however, I cannot find a way to save the map into a .pbstream file. When I call the following service, it does not provide any file:
$ rosservice call /finish_trajectory 0
Also, calling the following service does not do anything:
$ rosservice call /submap_query 0 1

Am I providing wrong arguments to my service calls, or is there another way to save the map into a .pbstream file.

@lanyaye

This comment has been minimized.

Contributor

lanyaye commented Jul 26, 2017

@sradmard Please call service "write_state" (cartographer_ros_msgs/WriteState) provided by cargotrapher_ROS' node_main to save the map into a .pbstream file. this API already shows in cartographer_ros's main page.

@BrannonKing

This comment has been minimized.

BrannonKing commented Aug 1, 2017

When in pure localization mode, does the Cartographer use the incoming IMU and relative position data? Or does it only use the laser scan data when localizing?

@sradmard

This comment has been minimized.

sradmard commented Aug 2, 2017

I have been able to run it with and without IMU in pure localization. However, I realized that when IMU is disabled, you really need to move the robot around very slowly, and with IMU enabled the localization can still catch up with higher speeds. I would still appreciate any feedback from the amazing Google team on the best approach to tune the parameters to speed up the localization.

@damonkohler

This comment has been minimized.

Contributor

damonkohler commented Aug 7, 2017

Localization is just multi-trajectory SLAM. Assuming you map and then localize with the same platform, the configuration shouldn't change much and all the same sensor data will be used.

@sradmard if you're having performance issues with localization, please open a new issue.

@jpro91

This comment has been minimized.

jpro91 commented Aug 25, 2017

Hi,
This issue is closed, but it looks like that the pure 3D localization is not implemented yet?
By the way, thanks for open sourcing your amazing work.

@yinnxinn

This comment has been minimized.

yinnxinn commented Sep 23, 2017

@sradmard , may i ask did you get the correct localization just use a 2D radiar ???? if so , could you please give more details about it . i would appreciate if if you could give more info

@sradmard

This comment has been minimized.

sradmard commented Oct 26, 2017

@yinnxinn sorry for the late response. Yes, I got it working with both a depth camera, and just recently with a 2D 360 lidar. I would totally recommend using the lidar option though, as it works greatly.
If you manage to get the 2D SLAM running, then the Localization should run as well. You just need to:

  • load the saved map in your launch file,
  • in your config.lua file set the TRAJECTORY_BUILDER.pure_localization = true,
  • in your config.lua file reduce your SPARSE_POSE_GRAPH.optimize_every_n_scans.

Take a look at demo_backpack_2d_localization.launch under cartographer_ros, and compare it to demo_backpack_2d.launch. That would basically guide you on how to implement your Localization.
Once again, a big thank to google cartographer team for their amazing work and support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment