上一節介紹cartographer的主要配置引數,
本節會研究一下這些引數改動,對演算法的影響和效果,cartographer的調參一直是一個比較復雜的程序,
1,官方調參檔案
官方檔案
(1):調整本地 SLAM
關閉全域 SLAM 以免干擾本地調優:
POSE_GRAPH.optimize_every_n_nodes = 0
設定正確的子圖大小:
TRAJECTORY_BUILDER_2D.submaps.num_range_data
調整CeresScanMatcher,使偏離先驗的代價變得高昂:
TRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight = 2e2
TRAJECTORY_BUILDER_2D.ceres_scan_matcher.rotation_weight = 4e2
(2):低延遲
為了調整全域 SLAM 以降低延遲,我們減少其計算負載,直到始終跟上實時輸入, 低于此閾值,我們不會進一步降低它,而是嘗試達到最佳質量,
為了減少全域 SLAM 延遲,我們可以:
降低 optimize_every_n_nodes
增加 MAP_BUILDER.num_background_threads
降低 global_sampling_ratio
降低 constraint_builder.sampling_ratio
增加 constraint_builder.min_score
對于自適應體素濾波器, 降低 .min_num_points, .max_range, 增加 .max_length
增加 voxel_filter_size, submaps.resolution, 降低 submaps.num_range_data
降低 search windows sizes, .linear_xy_search_window, .linear_z_search_window, .angular_search_window
增加 global_constraint_search_after_n_seconds
降低 decrease max_num_iterations
要調整區域 SLAM 以降低延遲,我們可以:
增加 voxel_filter_size
增加 submaps.resolution
對于自適應體素濾波器, 降低 .min_num_points, .max_range, 增加 .max_length
降低 max_range (尤其是如果資料有噪聲的話)
降低 submaps.num_range_data
(3):純定位
要調整純定位模式,我們應該首先啟用 TRAJECTORY_BUILDER.pure_localization = true 并大幅度減少 POSE_GRAPH.optimize_every_n_nodes 以接收頻繁的結果, 有了這些設定,全域 SLAM 通常會太慢,跟不上,
作為下一步,我們大幅度降低global_sampling_ratio 和 constraint_builder.sampling_ratio 以抵消大量的約束,然后我們按照上面的解釋調整引數來保持較低的延遲,直到系統可靠地實時作業,
(4):全域優化中的里程計
如果使用單獨的里程計源作為本地 SLAM ( ) 的輸入,我們還可以調整全域 SLAM 以從這些附加資訊中受益,
use_odometry = true
總共有四個引數允許我們在優化中調整區域 SLAM 和里程計的各個權重:
POSE_GRAPH.optimization_problem.local_slam_pose_translation_weight
POSE_GRAPH.optimization_problem.local_slam_pose_rotation_weight
POSE_GRAPH.optimization_problem.odometry_translation_weight
POSE_GRAPH.optimization_problem.odometry_rotation_weight
我們可以根據我們對本地 SLAM 或里程計的信任程度來設定這些權重,默認情況下,里程計被加權到類似于區域 slam(掃描匹配)姿勢的全域優化中,然而,車輪編碼器的里程計通常在旋轉中具有很高的不確定性,在這種情況下,可以減少旋轉重量,甚至可以減少到零,
2:常用的引數
以revo_lds.lua為例:
MAP_BUILDER.use_trajectory_builder_2d = true
TRAJECTORY_BUILDER_2D.submaps.num_range_data = https://www.cnblogs.com/CloudFlame/p/35
TRAJECTORY_BUILDER_2D.min_range = 0.3
TRAJECTORY_BUILDER_2D.max_range = 8.
TRAJECTORY_BUILDER_2D.missing_data_ray_length = 1.
TRAJECTORY_BUILDER_2D.use_imu_data = false
TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.linear_search_window = 0.1
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.translation_delta_cost_weight = 10.
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.rotation_delta_cost_weight = 1e-1
POSE_GRAPH.optimization_problem.huber_scale = 1e2
POSE_GRAPH.optimize_every_n_nodes = 35
POSE_GRAPH.constraint_builder.min_score = 0.65
3:調參效果
這里推薦火種原始碼的Cartographer調參
分析了下面引數單獨調參后的效果變化和資源消耗
submap.num_range_data
real_time_correlative_scan_matcher.rotation_delta_cost_weiht
bool use_online_correlative_scan_matching
Ceres.POSE_GRAPH.constraint_builder.fast_correlative_scan_matcher.branch_and_bound_depth
real_time_correlative_scan_matcher.real_time_correlative_scan_matcher.linear_search_window
real_time_correlative_scan_matcher.real_time_correlative_scan_matcher.angular_search_window
real_time_correlative_scan_matcher( translation_delta_cost_weight)/(rotation_delta_cost_weight)
4:調參總結
--一個子圖插入多少個節點,根據laser和運動速度進行具體的調整
TRAJECTORY_BUILDER_2D.submaps.num_range_data = https://www.cnblogs.com/CloudFlame/p/35.
--雷達的最大最小距離,根據雷達硬體設定
TRAJECTORY_BUILDER_2D.min_range = 0.3
TRAJECTORY_BUILDER_2D.max_range = 100.
--使用多高以上的點云,單線的時候不要設定,多線防止打到地面上的點干擾建圖
TRAJECTORY_BUILDER_2D.min_z = 0.2
--體素濾波引數
TRAJECTORY_BUILDER_2D.voxel_filter_size = 0.02
--ceres地圖的掃描,平移,旋轉的權重,影響建圖效果,其他基本上是影響計算量等
--掃描匹配點云和地圖匹配程度,值越大,點云和地圖匹配置信度越高
TRAJECTORY_BUILDER_2D.ceres_scan_matcher.occupied_space_weight = 10.
--殘差平移、旋轉分量,值越大,越不相信和地圖匹配的效果,而是越相信先驗位姿的結果
TRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight = 1.
--如果imu不好,接入后地圖旋轉厲害,可以將這里的旋轉權重減小
TRAJECTORY_BUILDER_2D.ceres_scan_matcher.rotation_weight = 1.
-- 2倍的num_range_data以上
POSE_GRAPH.optimize_every_n_nodes = 70.
-- 如果添加的約束與潛在約束的比例低于此比例,則將添加約束
POSE_GRAPH.constraint_builder.sampling_ratio = 0.3
-- 在子圖附近考慮姿勢的閾值,大于這個值將被略過
POSE_GRAPH.constraint_builder.max_constraint_distance = 15.
-- 回環檢測閾值,如果不穩定有錯誤匹配,可以提高這兩個值,場景重復可以降低或者關倍訓環
POSE_GRAPH.constraint_builder.min_score = 0.55
POSE_GRAPH.constraint_builder.global_localization_min_score = 0.60
【完】
在前面的文章中,介紹了資料的發布,和引數配置,下一節就開始介紹使用自己的資料,在cartographer進行建圖和定位,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/500316.html
標籤:其他
