odom, AMCL, and EKFPrerequisite: 06 — Nav2 Local Control And Cmdvel, 02 — Nav2 Bringup Lifecycle Actions, 01 — Nav2 System Architecture Unlocks: Faster TF diagnosis, cleaner localization architecture choices, fewer fake planner/controller investigations, better AMR incident triage under drift and jump conditions
Many Nav2 incidents are blamed on the wrong layer because localization defects surface as navigation symptoms:
odom but is globally wrong in mapNav2 does not create localization truth. It consumes the transform and pose contracts you provide.
If those contracts are vague, duplicated, or time-incoherent, the whole navigation stack becomes noisy in ways that look unrelated.
The usual contract is:
map -> odom -> base_link -> sensor frames
Nav2 depends on each link meaning something specific.
| Frame | Meaning | What should be true |
|---|---|---|
map |
globally anchored world frame | stable against the map or global reference |
odom |
locally smooth motion frame | continuous, drift allowed, no sudden jumps |
base_link |
robot body frame | immediate pose of the robot body |
If your system uses those names but not those meanings, debugging becomes much harder than it should be.
map and odom Must Stay Distinctmap and odom solve different problems.
odom should be smooth enough for control.
map should be globally corrected enough for navigation over the environment.
That means:
odom may drift gradually without breaking local control immediatelymap may jump slightly when localization corrects global errorWhen teams collapse these concepts into one frame, they usually trade away either control stability or global correctness.
Common AMR arrangement:
wheel odom + IMU + maybe other local sensors
-> robot_localization EKF
-> publishes odom -> base_link
AMCL on static map
-> publishes map -> odom
This is not the only legal architecture, but it is common because it preserves the separation between local smoothness and global correction.
Wheel odometry provides short-horizon motion continuity.
Strengths:
Weaknesses:
Nav2 can operate with wheel odometry for local behavior, but not reliably for global map navigation on a production AMR without some form of global correction.
IMU mainly helps stabilize rotational estimation and short-term motion dynamics.
Useful contributions:
Common mistakes:
IMU improves local estimation. It does not replace a global localization source.
robot_localization EKF or UKFrobot_localization usually owns the local fused estimate.
Typical responsibilities:
odom -> base_link transformWhat it should not do casually:
Duplicate TF publishers are one of the fastest ways to create non-repeatable Nav2 behavior.
AMCL usually owns the global correction against a known 2D map.
It answers:
where is the robot in the map, given sensor observations and a prior pose estimate?
Operationally, AMCL should correct global drift while preserving the local smoothness contract through the map -> odom edge.
If AMCL is unstable, Nav2 may:
Nav2 needs both:
If global correctness is missing, the planner lies. If smoothness is missing, the controller panics.
That is why map and odom must cooperate instead of competing.
A transform that exists eventually is not good enough.
Nav2 needs transforms that are:
If transform timing is poor, you will see symptoms such as:
This often looks random because the data is present, just not aligned in time.
Nav2 does not reason about covariance in the same deep way a localization stack does, but covariance quality still matters because it signals whether pose confidence is believable.
When localization becomes noisy or unstable, downstream effects often include:
A pose that is smooth but wrong is often more dangerous operationally than one that is obviously broken.
odom Is Smooth but Globally WrongThis is a classic warehouse failure mode.
Symptoms:
Typical causes:
This is not a controller-tuning issue.
map -> odom JumpsSudden AMCL correction or unstable global localization can create jumps.
Downstream symptoms:
If jumps are frequent, first diagnose localization stability and observation quality before touching controller settings.
Two common integration bugs:
Consequences include:
If the same run behaves differently after restart, inspect TF ownership immediately.
Transforms can be logically correct and still operationally unusable.
Watch for:
The controller and costmaps are especially sensitive to this because they run continuously and expect recent transforms.
AMCL is not your main short-horizon motion estimator.
It is a global localization component against a map.
If you try to treat AMCL as the whole localization stack for a production AMR without understanding the smoothness implications, local control quality usually suffers.
A local EKF can be beautifully smooth and still wrong over time.
That means:
This is why AMCL plus local filtering is such a common pairing.
Use a local fusion source such as robot_localization when:
odom -> base_linkUse AMCL when:
If you do not have a good map-matching story, do not pretend Nav2 will make one up.
When Nav2 looks confused, verify:
odom -> base_linkmap -> odomThis is faster than reading parameter files blindly.
Ask two questions:
Is local motion tracking smooth?
Is global map alignment correct?
That gives you a quick classification:
| Local smoothness | Global correctness | Likely issue |
|---|---|---|
| good | bad | AMCL or map alignment problem |
| bad | good | local estimator, IMU, or timing problem |
| bad | bad | broader localization or TF integration failure |
This table is far more useful in incidents than memorizing package names.
If localization contracts are bad, planner and controller complaints are downstream artifacts.
Do not tune around them.
Examples of bad compensations:
Those changes usually create new failures elsewhere.
odom -> base_link smooth enough for control even when global localization is imperfectmap -> odom globally meaningful even if it corrects drift slowlyIf the robot replans forever:
map alignment firstIf the robot oscillates near the goal:
If the robot cannot pass a corridor that looks open:
If RViz looks different every launch:
A strong answer explains why:
odom must be smoothmap must be globally meaningfulIf you can explain those cleanly, you understand the real Nav2 localization contract.
Continue to 08 — Nav2 Recoveries Progress And Goal Checkers. That lesson turns controller and localization failure symptoms into explicit retry, recovery, and escalation policy for production AMRs.