cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.09k stars 2.25k forks source link

Obtaining better map resolution #1782

Closed JakeInit closed 3 years ago

JakeInit commented 3 years ago

I am performing mapping in 2d with cartographer stand alone. I have the following parameters for my configuration:

MAP_BUILDER.use_trajectory_builder_2d = true MAP_BUILDER.use_trajectory_builder_3d = false MAP_BUILDER.num_background_threads = 4 POSE_GRAPH.global_sampling_ratio = 0.003 POSE_GRAPH.constraint_builder.ceres_scan_matcher.occupied_space_weight = 20 POSE_GRAPH.constraint_builder.ceres_scan_matcher.translation_weight = 10 POSE_GRAPH.constraint_builder.ceres_scan_matcher.rotation_weight = 2 POSE_GRAPH.constraint_builder.global_localization_min_score = 0.75 POSE_GRAPH.constraint_builder.loop_closure_rotation_weight = 1e5 POSE_GRAPH.constraint_builder.loop_closure_translation_weight = 1.1e4 POSE_GRAPH.constraint_builder.max_constraint_distance = 15 POSE_GRAPH.constraint_builder.min_score = 0.8 POSE_GRAPH.constraint_builder.sampling_ratio = 0.6 POSE_GRAPH.global_constraint_search_after_n_seconds = 4 POSE_GRAPH.matcher_rotation_weight = 1e1 POSE_GRAPH.matcher_translation_weight = 1e2 POSE_GRAPH.optimization_problem.ceres_solver_options.use_nonmonotonic_steps = true POSE_GRAPH.optimization_problem.ceres_solver_options.max_num_iterations = 50 POSE_GRAPH.optimization_problem.ceres_solver_options.num_threads = 4 POSE_GRAPH.optimization_problem.local_slam_pose_rotation_weight = 1e2 POSE_GRAPH.optimization_problem.local_slam_pose_translation_weight = 1e3 POSE_GRAPH.optimization_problem.odometry_rotation_weight = 1e2 POSE_GRAPH.optimization_problem.odometry_translation_weight = 1e3 POSE_GRAPH.optimization_problem.huber_scale = 1e2 POSE_GRAPH.optimize_every_n_nodes = 0 POSE_GRAPH.max_num_final_iterations = 1 return MAP_BUILDER TRAJECTORY_BUILDER.trajectory_builder_2d.use_imu_data = true TRAJECTORY_BUILDER.trajectory_builder_2d.min_range = 0.05 TRAJECTORY_BUILDER.trajectory_builder_2d.max_range = 20 TRAJECTORY_BUILDER.trajectory_builder_2d.submaps.num_range_data = 90 TRAJECTORY_BUILDER.trajectory_builder_3d.submaps.num_range_data = 90 TRAJECTORY_BUILDER.trajectory_builder_2d.num_accumulated_range_data = 1 TRAJECTORY_BUILDER.trajectory_builder_2d.ceres_scan_matcher.occupied_space_weight = 1. TRAJECTORY_BUILDER.trajectory_builder_2d.ceres_scan_matcher.translation_weight = 1 TRAJECTORY_BUILDER.trajectory_builder_2d.ceres_scan_matcher.rotation_weight = 40 TRAJECTORY_BUILDER.trajectory_builder_2d.submaps.grid_options_2d.resolution = 0.050 TRAJECTORY_BUILDER.trajectory_builder_2d.voxel_filter_size = 0.050 TRAJECTORY_BUILDER.trajectory_builder_2d.adaptive_voxel_filter.max_range = 25 TRAJECTORY_BUILDER.trajectory_builder_2d.adaptive_voxel_filter.max_length = 0.90 TRAJECTORY_BUILDER.trajectory_builder_2d.adaptive_voxel_filter.min_num_points = 200 TRAJECTORY_BUILDER.trajectory_builder_2d.submaps.range_data_inserter.probability_grid_range_data_inserter.hit_probability = 0.55 TRAJECTORY_BUILDER.trajectory_builder_2d.submaps.range_data_inserter.probability_grid_range_data_inserter.miss_probability = 0.49 TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(1.) TRAJECTORY_BUILDER_2D.motion_filter.max_distance_meters = 0.2 TRAJECTORY_BUILDER.trajectory_builder_2d.use_online_correlative_scan_matching = true TRAJECTORY_BUILDER.trajectory_builder_2d.real_time_correlative_scan_matcher.angular_search_window = math.rad(20.) TRAJECTORY_BUILDER.trajectory_builder_2d.real_time_correlative_scan_matcher.linear_search_window = 0.15 TRAJECTORY_BUILDER.trajectory_builder_2d.real_time_correlative_scan_matcher.translation_delta_cost_weight = 1e-1 TRAJECTORY_BUILDER.trajectory_builder_2d.real_time_correlative_scan_matcher.rotation_delta_cost_weight = 1e-1

This works great for mapping and I get a clear map of the environment I'm working in. I'm wanting to change the resolution down to 0.010m. This is not that simple though. I believe the calculation in the map becomes so great that measurements can't keep up with the movement of the robot while trying to map. Are there any suggested parameters to change that will help increase the speed of the calculations? My map with the new resolution is blurry and most of the time has rotated features. All help is appreciated.