/cmd_velPrerequisite: 05 — Nav2 Global Planning, 04 — Nav2 Costmaps And Layers, 01 — Nav2 System Architecture Unlocks: Cleaner controller selection, faster motion-quality diagnosis, better docking approaches, fewer oscillation and slowdown incidents in narrow aisles
Most field complaints about Nav2 are not really about planning. They sound like this instead:
Those are local-control and command-chain problems.
The global planner answers “where should I go?” The controller answers “what velocity command is safe and useful right now?”
If you cannot separate controller behavior from path quality, localization quality, and downstream velocity handling, every motion problem becomes random parameter fiddling.
The controller consumes:
and produces a motion command, typically a geometry_msgs/Twist.
Conceptually:
global path + current pose + local obstacles + velocity limits
-> controller_server
-> /cmd_vel or intermediate velocity topic
-> smoother / safety / base controller
-> wheel motion
The controller does not own mission policy, localization generation, or wheel-level control. It sits in the middle and is judged by the quality of the whole chain.
Poor motion quality can come from any of these layers:
| Layer | Typical symptom | Common false accusation |
|---|---|---|
| Global path quality | path enters corners badly or hugs shelves | “DWB is bad” |
| Localization | path tracking looks noisy or unstable near goal | “RPP lookahead is wrong” |
| Local controller | oscillation, corner cutting, sluggish approach | “planner is wrong” |
| Velocity smoother | stop-start motion, delayed acceleration | “controller is indecisive” |
| Safety or base control | command clipping or zeroing | “Nav2 stopped publishing” |
Production rule: before tuning controller parameters, prove the command path from controller output to wheel motion is intact and unsurprising.
/cmd_vel ContractIn many AMRs, Nav2 does not talk to the motors directly.
Typical chain:
controller_server -> /cmd_vel_nav
velocity_smoother -> /cmd_vel
collision monitor / safety layer -> filtered command
base controller -> wheel commands
If one of those stages rewrites, delays, or clips commands, the robot can look like it has a controller problem when it actually has a downstream policy problem.
Check all of these before blaming the controller:
DWB samples candidate velocity commands, simulates short trajectory rollouts, scores them with critics, and picks the best legal option.
Think of it as:
generate candidate twists
-> simulate short forward trajectories
-> score each trajectory with critics
-> reject unsafe ones
-> publish best remaining command
This makes DWB flexible and debuggable, but also sensitive to critic balance.
Different critic sets vary by configuration, but the common ideas are stable:
This is why DWB can look brilliant in one corridor and terrible in another. The chosen command is a weighted compromise between several partial truths.
| Field symptom | Likely driver |
|---|---|
| robot oscillates left-right in open space | competing critics, noisy pose, weak forward preference |
| robot hugs one shelf edge | path or obstacle critic balance too weak or footprint/inflation mismatch |
| robot stalls before entering a narrow aisle | obstacle scoring too conservative or footprint too large upstream |
| robot rotates too much near goal | goal heading logic and rotate-to-goal behavior dominate too early |
| robot makes tiny indecisive commands | sample resolution, critic balance, or downstream deadband |
Do not read those as one-to-one parameter names. They are diagnosis categories first.
DWB is often a good fit when:
It is less pleasant when the team wants cargo-cult defaults with no appetite for understanding critic interactions.
Regulated Pure Pursuit follows the path by choosing a lookahead point and generating curvature toward it, then regulating speed according to path geometry, obstacle proximity, and approach state.
Conceptually:
pick lookahead point on path
-> compute curvature toward it
-> scale linear speed based on path shape and constraints
-> slow down near goal, sharp turns, or nearby obstacles
RPP often feels smoother and easier to reason about for aisle following and longer continuous motion.
Common reasons:
This does not mean it is universally better. It means its mental model is closer to “follow the path cleanly” than “score many tiny trajectory samples.”
| Field symptom | Likely driver |
|---|---|
| corner cutting near shelves | lookahead too large, path too coarse, localization offset |
| jerky low-speed docking approach | lookahead too short, poor downstream velocity smoothing, base deadband |
| over-conservative slowdown everywhere | regulation too strong or obstacle/cost scaling too defensive |
| overshoot on final heading | approach logic weak, goal checker mismatch, poor velocity floor handling |
| good aisle following but weak tight-turn entry | lookahead and curvature settings not matched to footprint and path shape |
RPP frequently exposes path-quality problems more clearly because it tries to follow path geometry consistently.
RPP is often attractive when:
It is not a magic answer for bad localization, bad paths, or downstream command clipping.
A velocity smoother can improve jerk and protect the base, but it can also hide the controller’s true intent.
Possible outcomes:
If motion is poor, compare the controller output topic and the final base command topic before tuning the controller itself.
Many bases ignore very small linear or angular commands.
That creates a nasty pattern:
This is not a progress-checker bug. It is a control-chain contract bug.
No local controller rescues a globally bad path for free.
Examples:
Always ask whether the controller is failing on a bad request.
| Symptom | First thing to verify | If verified, next suspect |
|---|---|---|
| oscillation in open aisle | localization smoothness and heading noise | controller critic/lookahead tuning |
| robot tracks path in RViz but not on floor | downstream /cmd_vel chain |
base deadband or safety layer |
| too slow near obstacles | local costmap/inflation realism | controller regulation or critics |
| overshoot near goal | goal checker tolerances and approach mode | final heading control parameters |
| repeated stuck detection | real motion at wheel/base layer | progress checker thresholds |
The order matters. Do not start from parameters if the robot’s actual motion disagrees with commanded motion.
When a robot “moves badly,” do this in order:
This is the shortest path to root cause on most AMR incidents.
Do not tune for them as if they are identical.
| Scenario | Dominant concern |
|---|---|
| tight turn in aisle network | curvature, footprint clearance, path shape |
| aisle entry from open space | heading capture without over-slowing |
| final docking approach | slow-speed stability, goal checking, downstream deadband |
One controller can handle all three, but the validation cases must stay separate.
Choose DWB when:
Choose RPP when:
If neither controller looks good quickly, do not assume both are bad. Re-check path and localization contracts.
Use this order instead of changing everything at once:
This avoids cargo-cult parameter piles.
For a production AMR, good local control usually means:
If the same route looks different every run, suspect localization or world-model instability before tuning more.
map -> odom -> base_link timing is unstableIf you remember those five, you will avoid a large fraction of useless controller retuning.
If asked how to debug poor Nav2 motion quality on an AMR, a strong answer separates:
If you jump straight to “I would tune DWB critics,” that answer is incomplete.
Continue to 07 — Nav2 Localization Odom Amcl Ekf. That lesson explains why many controller and planner complaints are actually localization and TF contract failures upstream.