Previous
Avoid obstacles
The navigation service starts with defaults that work for slow outdoor robots with standard GPS. As you test in your environment, you’ll want to adjust these parameters.
All parameters can be changed in the Viam app without restarting
viam-server. Changes take effect on the next navigation cycle.
| Parameter | Default | What it controls |
|---|---|---|
meters_per_sec | 0.3 | Linear speed. How fast the robot drives in a straight line. |
degs_per_sec | 20.0 | Angular speed. How fast the robot turns. |
When to increase speed: Your robot’s motors and terrain support faster movement, and your obstacle detection polling is fast enough to react at the higher speed. At 1 m/s with 1 Hz obstacle polling, the robot travels 1 meter between obstacle checks.
When to decrease speed: The robot overshoots waypoints, turns are too aggressive, or obstacle detection can’t keep up. Reduce angular speed first if turns are the problem.
| Parameter | Default | What it controls |
|---|---|---|
plan_deviation_m | 2.6 | How far the robot can drift from its planned path (in meters) before the service triggers a replan. |
This is the most important tuning parameter. Set it relative to your GPS accuracy:
| GPS type | GPS error | Recommended plan_deviation_m |
|---|---|---|
| Standard GPS | 2-5m | 5-10m |
| SBAS-enhanced | 1-3m | 3-5m |
| RTK GPS | 1-10cm | 0.5-2m |
If it’s too low (below your GPS error), the robot replans constantly because normal GPS jitter looks like path deviation. You’ll see the robot stop and recalculate frequently, making slow progress.
If it’s too high, the robot tolerates large deviations before correcting. It might cut corners, drift off the intended path, or approach obstacles before replanning.
| Parameter | Default | What it controls |
|---|---|---|
position_polling_frequency_hz | 1.0 | How often to check the robot’s GPS position. |
obstacle_polling_frequency_hz | 1.0 | How often to query obstacle detectors. |
Position polling determines how quickly the service detects that the robot has deviated from its plan. At 1 Hz, a deviation takes up to 1 second to detect. For fast-moving robots, increase this.
Obstacle polling determines how quickly new obstacles are detected. Higher values improve reaction time but increase CPU and camera bandwidth usage. Balance against your robot’s speed: at 0.3 m/s and 1 Hz, the robot moves 30 cm between checks. At 1 m/s, it moves 1 meter.
plan_deviation_m. Watch the Control tab map to
see when replans happen.meters_per_sec gradually. Watch for
overshooting waypoints or unstable turns.obstacle_polling_frequency_hz. If the robot is
slow because of excessive polling, decrease it.Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!