cartographer_ros icon indicating copy to clipboard operation
cartographer_ros copied to clipboard

Optimization problem

Open kay01-kwon opened this issue 3 years ago • 0 comments

Hi, I'm working with the cartographer with tsdf. The environment is quite simple, but whenever the robot goes to its initial position, the value of initial position varies. I think that only local slam is enough for the environment. The environment is like below one. map_scan_matching

My question is "are there any way to fix the initial position and to do so how can I tune the lua file?" Sometimes, I saw the position error is below 1 mm, but when it moves further, the initial position is changed and the accuracy becomes bad.

My Lua file is like that, and use 2 velodynes and odometry. Also, I can share you bag file with topics /tf /vlp1/scan_filtered /vlp2/scan_filtered /odom and motion caputre data with mat file.

Just let me know how to tune to fix the initial pose...

-- Copyright 2016 The Cartographer Authors

-- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at

-- http://www.apache.org/licenses/LICENSE-2.0

-- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License.

include "map_builder.lua" include "trajectory_builder.lua"

options = { map_builder = MAP_BUILDER, trajectory_builder = TRAJECTORY_BUILDER, map_frame = "map", tracking_frame = "base_footprint", published_frame = "odom", odom_frame = "odom", provide_odom_frame = false, publish_frame_projected_to_2d = false, -- use_pose_extrapolator=true, use_odometry = true, use_nav_sat = false, use_landmarks = false, num_laser_scans = 2, num_multi_echo_laser_scans = 0, num_subdivisions_per_laser_scan = 1, num_point_clouds = 0, lookup_transform_timeout_sec = 0.2, submap_publish_period_sec = 0.3, pose_publish_period_sec = 5e-3, trajectory_publish_period_sec = 30e-3, rangefinder_sampling_ratio = 1., odometry_sampling_ratio = 1., fixed_frame_pose_sampling_ratio = 1., imu_sampling_ratio = 0.1, landmarks_sampling_ratio = 1., }

MAP_BUILDER.use_trajectory_builder_2d = true

TRAJECTORY_BUILDER_2D.use_imu_data = false TRAJECTORY_BUILDER_2D.submaps.grid_options_2d.grid_type="TSDF" TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.range_data_inserter_type="TSDF_INSERTER_2D"

TRAJECTORY_BUILDER_2D.min_range=0.5 TRAJECTORY_BUILDER_2D.max_range=5.0

TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.tsdf_range_data_inserter.project_sdf_distance_to_scan_normal=true TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.tsdf_range_data_inserter.update_free_space=false TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.tsdf_range_data_inserter.update_weight_angle_scan_normal_to_ray_kernel_bandwidth=0.7 TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.tsdf_range_data_inserter.update_weight_distance_cell_to_hit_kernel_bandwidth=0.7 TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.tsdf_range_data_inserter.update_weight_range_exponent=0

TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.tsdf_range_data_inserter.truncation_distance=0.15 TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.tsdf_range_data_inserter.maximum_weight=5.

TRAJECTORY_BUILDER_2D.ceres_scan_matcher.occupied_space_weight = 1 TRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight = 1.3 TRAJECTORY_BUILDER_2D.ceres_scan_matcher.rotation_weight = 1 TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 2

POSE_GRAPH = { --optimize_every_n_nodes = 90, constraint_builder = { sampling_ratio=0.3, max_constraint_distance=5, min_score = 0.55, global_localization_min_score = 0.60, --loop_closure_translation_weight = 1e4, --loop_closure_rotation_weight = 100, --log_matches = true, fast_correlative_scan_matcher = { linear_search_window = 120, angular_search_window = math.rad(0.01), branch_and_bound_depth = 7 }, --ceres_scan_matcher = { -- occupied_space_weight = 50, -- translation_weight = 10., -- rotation_weight = 1., -- ceres_solver_options = { -- use_nonmontonic_steps = true, -- max_num_iterations = 50, -- num_threads = 1, -- } --} } }

--POSE_GRAPH.constraint_builder.ceres_scan_matcher.translation_weight=1e5 --POSE_GRAPH.constraint_builder.ceres_scan_matcher.rotation_weight = 100 --POSE_GRAPH.constraint_builder.ceres_scan_matcher.occupied_space_weight = 50

return options

kay01-kwon avatar May 31 '21 15:05 kay01-kwon