cartographer 优化参数

TRAJECTORY_BUILDER_2D.voxel_filter_size:平均误差在0.1 和0.2时发生起伏,虽然0.1的误差比0.2的更大,但由于0.2时绘图偏差严重,建议选择小于0.1的值。
submaps.resolution:平均误差在0.1时达到顶峰,建议小于0.1较为良好。
submaps.num_range_data:可以接受的调整参数范围在90 - 60之间,在80左右效果较为优秀。
TRAJECTORY_BUILDER_2D.max_range:可以接受的调整参数范围在30 - 15之间,推荐20-25误差较小。
adaptive_voxel_filter.max_range:可以接受的调整参数范围在50 - 20之间,在30左右效果较为优秀。
adaptive_voxel_filter.max_length:可以接受的调整参数范围在0.5 - 4之间,在2 - 4左右效果较为优秀。
adaptive_voxel_filter.min_num_points:可以接受的调整参数范围在100 - 200之间,100以上的效果较为优秀。

optimize_every_n_nodes:推荐参数修改范围为30-70,官方文档中建议减少该值来提高速度,推荐30左右配置较为良好

MAP_BUILDER.num_background_threads:建议优化至每个机器的CPU线程数量

global_sampling_ratio:在0.001,0.002时平均误差处于较小位置,优化时可以考虑的值为0.001和0.002

constraint_builder.sampling_ratio:该参数在0.2-0.25左右平均误差处于相对低位。最小方差的位置在在0.25左右,推荐参数修改范围为0.2-0.3

constraint_builder.min_score:该参数在0.75-0.95误差的方差和最大误差处于相对低位,推荐0.75-0.95为修改参数范围

search_windows_sizes.linear_xy_search_window:该参数在10-20左右误差的方差和最大误差上升较快,在10左右时处于较低点,推荐5-10为修改参数范围

search_windows_sizes.linear_z_search_window:该参数在4以后误差的方差和最大误差上升较快,在4左右时仍处于较低点,推荐1-4为修改参数范围

search_windows_sizes.angular_search_window:该参数随着角度的增加,误差的方差和最大误差减小,推荐60左右为修改参数范围

global_constraint_search_after_n_seconds:该参数随着间隔时间的增加误差的方差和最大误差逐渐下降,但最大误差逐渐上升,在30-40时处于两者的平衡点。推荐30-40为修改参数范围

ceres_scan_matcher.max_num_iterations:该参数误差波动较大,平均误差大时最大误差小,平均误差小时最大误差大,在7左右处于相对平衡点,推荐7-10为修改参数范围

各个工程与实际使用的雷达,传感器各有差异。


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

options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,
  map_frame = "map",
  tracking_frame = "gyro_link",
  published_frame = "base_footprint",
  odom_frame = "odom",
  provide_odom_frame = true,
  publish_frame_projected_to_2d = false,
  use_pose_extrapolator = true,
  use_odometry = true,
  use_nav_sat = false,
  use_landmarks = false,
  num_laser_scans = 1,
  num_multi_echo_laser_scans = 0,
  num_subdivisions_per_laser_scan = 1,
  num_point_clouds = 0,
  lookup_transform_timeout_sec = 0.5,
  submap_publish_period_sec = 0.2,
  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 = 1.,
  landmarks_sampling_ratio = 1.,
}

MAP_BUILDER.use_trajectory_builder_2d = true
MAP_BUILDER.num_background_threads =2

TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 1 --积累几帧激光数据作为一个标准单位scan
TRAJECTORY_BUILDER_2D.min_range = 0.1  --激光的最近有效距离
TRAJECTORY_BUILDER_2D.max_range = 12.   --激光最远的有效距离
TRAJECTORY_BUILDER_2D.missing_data_ray_length = 5. --无效激光数据设置距离为该数值
TRAJECTORY_BUILDER_2D.use_imu_data = false  --是否使用imu数据

TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.linear_search_window = 0.1 
--线距离搜索框,在这个框的大小内,搜索最佳scan匹配  减小该参数可以增强实时的建图效果,降低闭环优化的效果,形成闭环时,产生的重影较多
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher. angular_search_window = math.rad(10.) --角度搜索框的大小
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.translation_delta_cost_weight = 20.
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.rotation_delta_cost_weight = 2e-1  
--影响的是过程中的效果,间接会影响最后的优化时间长

TRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight = 30.
TRAJECTORY_BUILDER_2D.ceres_scan_matcher.rotation_weight = 30.
TRAJECTORY_BUILDER_2D.ceres_scan_matcher.ceres_solver_options.max_num_iterations = 20


TRAJECTORY_BUILDER_2D.submaps.num_range_data = 40
--num_range_data设置的值与CPU有这样一种关系,值小(10),CPU使用率比较稳定,整体偏高,值大时,CPU短暂爆发使用(插入子图的时候),平时使用率低,呈现极大的波动状态。
TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.probability_grid_range_data_inserter.hit_probability = 0.55
TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.probability_grid_range_data_inserter.miss_probability = 0.49

TRAJECTORY_BUILDER_2D.motion_filter.max_distance_meters = 0.05   //尽量小点  // 如果移动距离过小, 或者时间过短, 不进行地图的更新
TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(0.3)
TRAJECTORY_BUILDER_2D.motion_filter.max_time_seconds = 0.5

POSE_GRAPH.optimization_problem.huber_scale = 1e2  --鲁棒核函数,去噪

POSE_GRAPH.optimize_every_n_nodes = 35   --后端优化节点
POSE_GRAPH.global_constraint_search_after_n_seconds = 10 

POSE_GRAPH.optimization_problem.ceres_solver_options.max_num_iterations = 15  --优化迭代步数
POSE_GRAPH.optimization_problem.ceres_solver_options.num_threads = 1

POSE_GRAPH.constraint_builder.max_constraint_distance = 15.
POSE_GRAPH.constraint_builder.sampling_ratio = 0.3
POSE_GRAPH.constraint_builder.min_score = 0.50
POSE_GRAPH.constraint_builder.global_localization_min_score = 0.6
POSE_GRAPH.constraint_builder.fast_correlative_scan_matcher.linear_search_window = 3.
POSE_GRAPH.constraint_builder.fast_correlative_scan_matcher.branch_and_bound_depth = 5. --搜索方法,界定分支法,求解问题构成一个搜索树,depth是构造树的深度
POSE_GRAPH.global_sampling_ratio = 0.001

return options

  • 6
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

chilian12321

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值