Configure Nav2 for a differential-drive robot: from params.yaml to launch
Atlasbot · 17/8/2026 · 12 min read
Other articles in the section Nav2 explain each concept individually. This unit is the practical — structure params.yaml coupling minimum for Nav2 to run on a real robot differential-drive, the correct type of robot used in the Diff Robot project in the showcase section of this page.
Key concepts
amcl:
ros__parameters:
robot_model_type: "nav2_amcl::DifferentialMotionModel"
controller_server:
ros__parameters:
controller_plugins: ["FollowPath"]
FollowPath:
plugin: "dwb_core::DWBLocalPlanner"
max_vel_x: 0.3
max_vel_theta: 1.0
planner_server:
ros__parameters:
planner_plugins: ["GridBased"]
GridBased:
plugin: "nav2_navfn_planner::NavfnPlanner"
local_costmap:
local_costmap:
ros__parameters:
width: 3
height: 3
resolution: 0.05
global_costmap:
global_costmap:
ros__parameters:
resolution: 0.05
Each block correctly corresponds to a concept learned in separate problems: amcl (article AMCL in Nav2), controller_server/planner_server (article Controller/Planner), local_costmap/global_costmap (article Costmap).
How it works
The specificity point for the robot differential-drive lies in robot_model_type: "nav2_amcl::DifferentialMotionModel"— AMCL needs to know the robot's motion model in order to correctly predict particle movement (step Predict, learned in What is AMCL?). The robot differential-drive cannot move sideways, the motion model correctly reflects that constraint (as opposed to the Mecanum robot needing OmniMotionModel). Choosing the wrong motion model causes AMCL to predict motions that real-world robots can't do, converging less accurately.
In the real-world, most projects use the nav2_bringup launch file pre-installed rather than handwriting each Node(), but understanding the structure of each paired node makes it much easier to read/edit the available launch file, rather than treating it as a black box:
Node(package="nav2_amcl", executable="amcl", parameters=[params_file]),
Node(package="nav2_controller", executable="controller_server", parameters=[params_file]),
Node(package="nav2_planner", executable="planner_server", parameters=[params_file]),
Node(package="nav2_lifecycle_manager", executable="lifecycle_manager",
parameters=[{"autostart": True, "node_names": ["amcl", "controller_server", "planner_server"]}]),
Summarized:
lifecycle_manager(ankle Lifecycle Node ) is always the last node to configure — it coordinatesconfigure/activateto all other Nav2 nodes in the correct order, ensuringamclis available beforecontroller_serverstarts receiving commands.
Technical details
Formulas
max_vel_x/max_vel_theta in controller_server should match the real-world physics limit calculated in Motor selection for AMR — setting them above actual capability makes the controller request speeds the robot cannot achieve:
max_vel_x should be ≤ v_max calculated from motor RPM and wheel radius (Choosing a motor)
Example: 120 RPM motor, 65mm wheel -> theoretical v_max ≈ 0.41 m/s
Set max_vel_x: 0.3 (instead of 0.41), leaving a ~27% safety margin for:
- battery voltage drop under heavy load
- actual friction being higher than ideal
- ensuring the controller can always achieve the requested speed without falling short
Parameters
| Symptom | Check |
|---|---|
| Robot does not take Nav Goal | lifecycle_manager has all nodes activated (ros2 lifecycle get) |
| Robot stays still despite an available path | Check if /cmd_vel has the correct publisher/subscriber (article ros2 topic ) |
| "could not transform" | See Article TF Tree |
| Robots Sailing The Path | See Article Tuning Controller . |
Practical applications
After launch, open RViz2 (article RViz2), use "2D Pose Estimate" to Set the initial Pose (article AMCL in Nav2), then "Nav2 Goal" to submit a — destination point test which, if all the configurations are correct, will calculate the path itself and travel to the destination. This boot procedure (filling the map → set pose → submission test goal) should be the standard validation step every time a large configuration change occurs in params.yaml, before integration into the complete automation application.
Practical example
ros2 launch nav2_bringup bringup_launch.py \
map:=my_map.yaml \
params_file:=nav2_params.yaml
Step-by-step configuration validation:
1. Run the command above and wait for the log to confirm that all nodes activate successfully
2. ros2 lifecycle get /amcl -> should return "active"
3. Open RViz2 and use "2D Pose Estimate" to click the robot's current position
4. Watch /particlecloud cluster (discussed in AMCL in Nav2)
5. Use "Nav2 Goal" to select a nearby goal and watch the robot move
If the robot does not move at step 5: following the Parameters table, check
lifecycle_manager first -> it is usually the most common cause
Common mistakes
- Using
max_vel_xhigher than the real-world physics capabilities of motor— as calculated in Equation, the robot's speed requirement is not achieved, causing poor path-tagging behavior. - Misused
robot_model_typefor the type drive system— as stated,DifferentialMotionModelfor the Mecanum robot (or vice versa) causes AMCL to erroneously predict real-world mobility. - Do not check
lifecycle_managerbefore suspecting another node— as the debug table, which is often the root cause when the robot "does not get Nav Goal" even though the configuration of each individual node is correct. - Photocopying integer
params.yamlfrom another project without adjusting for real-world hardware — costmap size, maximum speed, motion model all need to match the configured robot correctly, not generic default values.
Conclusion
File params.yaml is where every learned Nav2 concept individually —AMCL, Planner, Controller, Costmap — converges to a real-world runable configuration, with robot_model_type and max_vel_x/max_vel_theta being the two points that need to match specifically the robot differential-drive. The next article in the column goes into the Planner — detailing the plugin path planning just configured here.
Get new articles and lessons by email
When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.
Unsubscribe any time with the link in each email. See our Privacy policy.