# 9.3. 微調指南

對不同的環境，Gmapping可有許多參數來改變其效能。你可以在 [**ROS Wiki**](http://wiki.ros.org/gmapping) 網頁了解全部的參數，或參考 ROS Robot Programming 書的 Chapter 11 章。

本調整指南提供一些提示，供您配置一些重要參數。如果你想改變 SLAM 效能則會取決於你的環境，這些提示可能會幫助你並節省你的時間。

**maxUrange**&#x20;

* turtlebot3\_slam/launch/turtlebot3\_gmapping.launch
* 此參數設定光達最大可用範圍

**map\_update\_interval**

* &#x20;turtlebot3\_slam/launch/turtlebot3\_gmapping.launch
* &#x20;地圖更新的時間(以秒為單位)。如果此設置較低，地圖將更新更頻繁，但需要更大的計算量。設置這個參數取決於你的環境。

![](https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lkwu_G-fXuormTUn1lh%2F-Lkx5mounN-7X9XKQZP2%2Ftuning_map_update_interval.png?alt=media\&token=76069648-995e-4526-b6cc-8ab35c790af5)

**minimumScore**

* turtlebot3\_slam/launch/turtlebot3\_gmapping.launch
* 為獲得好的掃瞄匹配結果的最低分數。這個參數可以避免出現 jumping pose estimates 問題。如果設置正確，可以看到以下資訊。

```
Average Scan Matching Score=278.965
neff= 100
Registering Scans:Done
update frame 6
update ld=2.95935e-05 ad=0.000302522
Laser Pose= -0.0320253 -5.36882e-06 -3.14142
```

如果設置太高，則會看到下列警示

```
Scan Matching Failed, using odometry. Likelihood=0
lp:-0.0306155 5.75314e-06 -3.14151
op:-0.0306156 5.90277e-06 -3.14151
```

**linearUpdate**

* turtlebot3\_slam/launch/turtlebot3\_gmapping.launch
* 當機器人移動多遠掃描一次

**angularUpdate**

* turtlebot3\_slam/launch/turtlebot3\_gmapping.launch
* 當機器人轉動時掃描一次。最好設數值小於 linearUpdate 較佳。
