Prerequisite: 01 — Nav2 System Architecture, 02 — Nav2 Bringup Lifecycle Actions, 03 — Nav2 Architecture Unlocks: BT debugging, safe tree customization, better recovery design, clearer separation between policy bugs and algorithm bugs
Two robots can run the same planner and controller plugins yet behave very differently because their BehaviorTrees make different decisions.
That is why BT understanding matters. The tree decides:
If a warehouse AMR spins six times in a blocked aisle before giving up, that is not merely a controller story. It is a policy story encoded in BT XML.
bt_navigator REALLY DOESbt_navigator receives high-level navigation actions such as NavigateToPose and executes a BehaviorTree that orchestrates lower-level action servers.
Think of it like this:
planner_server = route computation
controller_server = path execution
behavior_server = recovery behaviors
bt_navigator = policy and sequencing across all of them
Without bt_navigator, you still have useful primitives, but you do not have a coherent navigation workflow.
The XML is not just configuration fluff. It is executable policy.
It defines:
Changing XML can alter field behavior as much as changing controller parameters.
Every BT node returns one of three states:
SUCCESS
FAILURE
RUNNING
That sounds simple, but most debugging confusion comes from forgetting what RUNNING means.
RUNNING means the node is still in progress and will be ticked again on later cycles. This is normal for long-running actions like path following or spinning.
SequenceRun children in order. Failure in one child fails the sequence.
Fallback or ReactiveFallbackTry children in order until one succeeds.
RecoveryNodeWrap a primary behavior plus a fallback recovery subtree with a retry budget.
PipelineSequenceCritical in Nav2 because it enables planning and following to coexist over repeated ticks.
RateControllerModify how often or under what condition a child is ticked.
The blackboard is the shared runtime key-value space for the tree.
Typical values include:
goalpathIf you misunderstand blackboard ports, you can build a tree that looks structurally valid but passes stale data between nodes.
Example: a planner writes a new path, but the controller is still wired to an old key or incompatible branch path.
A common Nav2 pattern looks roughly like this:
<RecoveryNode number_of_retries="6" name="NavigateRecovery">
<PipelineSequence name="NavigateWithReplanning">
<RateController hz="1.0">
<ComputePathToPose goal="{goal}" path="{path}"/>
</RateController>
<FollowPath path="{path}" controller_id="FollowPath"/>
</PipelineSequence>
<ReactiveFallback name="RecoveryFallback">
<GoalUpdated/>
<SequenceWithMemory name="RecoveryActions">
<ClearEntireCostmap .../>
<Spin .../>
<Wait .../>
<BackUp .../>
</SequenceWithMemory>
</ReactiveFallback>
</RecoveryNode>
This tells you several important things immediately:
You should be able to narrate a few ticks by hand.
Tick 1:
plan -> SUCCESS
follow path -> RUNNING
Tick 2:
planner may be skipped by RateController
follow path -> RUNNING
Tick N:
planner replans
follow path keeps running with updated path
If path following fails:
main pipeline -> FAILURE
RecoveryNode enters fallback subtree
GoalUpdated? if yes, switch back toward new goal handling
otherwise run recovery actions in sequence
This tick-level reasoning is how you debug real BT behavior.
PipelineSequence MattersPipelineSequence is one of the most operationally important Nav2 control nodes.
It supports the common requirement:
keep following the current path
while occasionally computing a newer better path
Without this, you tend to get one of two bad extremes:
For warehouse AMRs in dynamic aisles, replanning cadence is a real throughput and stability decision.
Customize the BT when the problem is about policy.
Examples:
Do not reach for BT XML first when the real issue is:
That is the line between policy and mechanism.
Suppose your AMR operates in narrow one-way aisles where backing up is preferable to spinning because spinning increases footprint conflict with pallet edges.
A policy adjustment might be:
That is a BT concern because you are changing what the robot tries next.
Suppose the local costmap keeps retaining stale obstacles because sensor clearing settings are wrong.
Replacing the recovery subtree to clear costmaps more often may reduce symptoms, but it does not fix the cause. That is a costmap or perception integration problem.
Overusing BT customization to mask upstream faults produces brittle navigation behavior.
GoalUpdatedThis condition is crucial for systems with frequent rerouting.
It allows the tree to say, effectively:
if a new goal arrived, stop spending time on the current recovery path
and switch focus to the latest task intent
Without this kind of condition, the robot can keep executing outdated recovery logic after the mission layer already changed priorities.
ClearEntireCostmapUseful when the world model may contain stale or bad obstacle information.
Dangerous when abused, because repeated clearing can:
Use it as a recovery tool, not as the main operating mode.
Wait, Spin, BackUpThese are not morally equal options. They embody different assumptions.
| Recovery | Good for | Risk |
|---|---|---|
Wait |
temporary human blockage, aisle crossing traffic | throughput loss if used too often |
Spin |
improving sensor coverage, breaking local minima in open space | poor choice in tight racks or near protrusions |
BackUp |
freeing local controller in front-obstructed spaces | unsafe if rear space assumptions are wrong |
Recovery order should match operating geometry, safety constraints, and product behavior.
Robot waits politely for transient obstruction, then replans, then waits again, then replans forever. No single step is irrational, but the total policy is operationally bad.
This is a BT design issue when the tree lacks escalation logic.
Possible fixes:
Robot alternates between spin and back-up without meaningfully changing conditions.
This often means:
The BT is where the visible loop lives, even if root cause is partly elsewhere.
Teams often respond to repeated BT failure by tuning controller parameters or swapping planners. Sometimes that helps. Often it just moves the symptom.
The discipline is to ask:
Is this failure about navigation policy,
world model correctness,
or execution mechanics?
Only the first category belongs primarily in BT XML.
You should now be able to explain:
bt_navigator is responsible forPipelineSequence and RateController are central to Nav2 behaviorContinue to 04 — Nav2 Costmaps And Layers.
That lesson covers the shared world model beneath planning, control, and many BT recovery outcomes.