企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 9.3 Karto ## 9.3.1 Karto SLAM计算图 Karto SLAM和Gmapping SLAM在工作方式上非常类似,如下图所示 ![slam_gmapping](https://img.kancloud.cn/95/16/95168bde043b0b3f5e796819b48396df_1280x592.png) 输入的Topic同样是`/tf`和`/scan`,其中`/tf`里要连通`odom_frame`与`base_frame`,还有`laser_frame`。这里和Gmapping完全一样。 唯一不同的地方是输出,slam_karto的输出少相比slam_gmapping了一个位姿估计的分散程度. ## 9.3.2 服务 与Gmapping相同,提供`/dynamic_map`服务 ## 9.3.3 参数 这里以`ROS-Academy-for-Beginners`中的`karto_slam`为例,选取了它的参数文件`slam_sim_demo/param/karto_params.yaml`,关键位置做了注释: ``` # General Parameters use_scan_matching: true use_scan_barycenter: true minimum_travel_distance: 0.2 minimum_travel_heading: 0.174 #in radians scan_buffer_size: 70 scan_buffer_maximum_scan_distance: 20.0 link_match_minimum_response_fine: 0.8 link_scan_maximum_distance: 10.0 loop_search_maximum_distance: 4.0 do_loop_closing: true loop_match_minimum_chain_size: 10 loop_match_maximum_variance_coarse: 0.4 # gets squared later loop_match_minimum_response_coarse: 0.8 loop_match_minimum_response_fine: 0.8 # Correlation Parameters - Correlation Parameters correlation_search_space_dimension: 0.3 correlation_search_space_resolution: 0.01 correlation_search_space_smear_deviation: 0.03 # Correlation Parameters - Loop Closure Parameters loop_search_space_dimension: 8.0 loop_search_space_resolution: 0.05 loop_search_space_smear_deviation: 0.03 # Scan Matcher Parameters distance_variance_penalty: 0.3 # gets squared later angle_variance_penalty: 0.349 # in degrees (gets converted to radians then squared) fine_search_angle_offset: 0.00349 # in degrees (gets converted to radians) coarse_search_angle_offset: 0.349 # in degrees (gets converted to radians) coarse_angle_resolution: 0.0349 # in degrees (gets converted to radians) minimum_angle_penalty: 0.9 minimum_distance_penalty: 0.5 use_response_expansion: false ``` ### 演示截图 ![](https://img.kancloud.cn/b9/0a/b90a18a6490ab13df2334b637d21c6b4_926x894.png)