Using Cartographer as odometry with amcl for localization in a given map

asked 2017-04-18 01:49:27 -0600

zzzZuo gravatar image

I wanted to exploit the fact that Cartographer gives pretty accurate position estimate. I used Cartographer just using IMU and laser to make an indoor map, and it pretty good.

Then I want use Cartographer as odometry and amcl to do global localization in a pre-aquired map by Cartographer, but the robot drift away.

On my robot a TF frame that looks like this: image description

The configuration of Cartographer_ros is like:

include "map_builder.lua"

options = {
  map_builder = MAP_BUILDER,
  map_frame = "odom",
  tracking_frame = "gyro_link",
  published_frame = "base_footprint",
  odom_frame = "google_odom",
  provide_odom_frame = true,
  use_odometry = false,
  use_laser_scan = true,
  use_multi_echo_laser_scan = false,
  num_point_clouds = 0,
  lookup_transform_timeout_sec = 0.2,
  submap_publish_period_sec = 0.3,
  pose_publish_period_sec = 5e-3,

MAP_BUILDER.use_trajectory_builder_2d = true
TRAJECTORY_BUILDER_2D.laser_min_range = 0.2
TRAJECTORY_BUILDER_2D.laser_max_range = 8.
TRAJECTORY_BUILDER_2D.laser_missing_echo_ray_length = 5.
TRAJECTORY_BUILDER_2D.use_imu_data = true
TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true
TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(0.1)

SPARSE_POSE_GRAPH.constraint_builder.min_score = 0.65
SPARSE_POSE_GRAPH.constraint_builder.global_localization_min_score = 0.7

return options

I used the position estimate to find odometry and now Cartographer successful transform the required tf. But when I run amcl and publish an already created map using map_server, the pose of robot drift. It seems amcl doesn't work enven if the tf, map, laser_scan look like ok. And I also remap the Cartographer mapping map to something else . Please help how to resolve this issue.

edit retag flag offensive close merge delete