"Turn left at the vague instruction, then replan before dignity runs out."
A Navigation Policy In A Blocked Hallway
This section assumes familiarity with path-planning fundamentals from section 30.1 and the language-grounding loop introduced in section 31.1. If you are comfortable with those foundations, you can skim the Theory subsection and move directly to the Worked Example. The replanning constraint-logging pattern developed here recurs in section 59.3, where a similar recovery mechanism is applied to vision-based manipulation.
A delivery robot receives the instruction "go to the kitchen and avoid the wet floor near the sink." Halfway there, a cart blocks the corridor. The original plan is dead. Can the robot recover the intent of the instruction, not just recompute a path, while keeping the sink-avoidance constraint intact? This is the unsolved edge that separates brittle rule-followers from genuinely useful indoor agents. Language models can now parse nuanced spatial instructions; LiDAR planners can reroute in milliseconds. The open challenge is closing the loop between them. In this capstone project you build a system that does exactly that: parse an instruction, execute it, detect failure, and replan without losing the user's original intent.
Your robot is forty seconds into "go to the kitchen and avoid the wet floor near the sink" when a cleaning cart rolls across the only corridor and the plan dies on the spot: does the agent recover the user's intent, or does it quietly forget the sink and barrel toward it? That single moment is what this section builds a system to survive. The path runs from a defined object of study, to its place in the agent loop, to a compact implementation that tests it. Figure 59.2A sketches the full loop you will build: instruction parsing into waypoints, segment execution under local obstacle avoidance, and an LLM replanner that fires only when the agent detects it is lost or blocked.
The pipeline diagram above traces the four stages this contract must specify: the LLM parser turns the instruction into (waypoint, constraint) pairs, the metric planner executes them against the occupancy grid, the replan trigger fires when path cost exceeds 1.5x the best alternative (in other words, when the current route has become at least 50% more expensive than the cheapest known alternative), and the LLM replanner emits revised symbolic constraints that feed back into the planner without ever touching the grid directly. The key question is practical: what must the agent know, what can it observe, what action is available, and what evidence shows that the action worked under the stated conditions?
Language-guided navigation with replanning should be judged by the action it improves. A section claim is strong when it names the decision, the measurement, and the failure mode before a larger model or simulator is introduced.
Theory
For language-guided navigation with replanning, pin the interface between the language model and the costmap planner (where a costmap is a grid whose cells carry a traversal cost, high near obstacles and low in open space, that a planner minimizes over) before any optimization begins. The LLM outputs a list of (waypoint, constraint) pairs in map-frame coordinates. The Nav2 NavfnPlanner (the ROS 2 Navigation stack's default metric path planner, chosen here because it ships with Nav2 and needs no extra dependency) receives those pairs together with the current OccupancyGrid (the ROS 2 message type holding the 2-D grid of traversal costs described above as a costmap). Every replanning call must log four things: the timestamp, the LiDAR scan that triggered the check, the old and new path costs in meters, and whether each soft constraint held or relaxed. On a TurtleBot 4 running Nav2 Humble (ROS 2, 2022 LTS), the parse-to-costmap-update round trip takes roughly 80 ms at 5 Hz LiDAR. A spike above 200 ms typically signals that the language-grounding step, not the planner, is the bottleneck. The replan trigger referenced throughout this section, a path-cost ratio compared against a fixed multiple, is defined formally later in this section under Topic-Native Deepening; for now, treat it as "replan when the current route gets much more expensive than the best alternative."
The mechanism in language-guided navigation with replanning is the handoff between two heterogeneous representations: a token sequence from the language model and a 2-D occupancy grid from onboard sensors. The language model produces symbolic constraints (landmark order, exclusion zones, preferred room sequence); the costmap planner consumes metric coordinates and scalar cost weights. The assumption that makes this handoff valid is that the scene's semantic map agrees with the current LiDAR snapshot well enough that a named room or landmark can be resolved to a grid cell within one replan cycle. If that assumption breaks, for instance when a Spot robot enters a room it has never scanned before, the constraint is silently ungrounded and the route ignores the instruction. The log entry that reveals this failure is a constraint whose cell-lookup returned None rather than a grid coordinate.
Checkpoint
So far: the LLM parser turns an instruction into (waypoint, constraint) pairs on a costmap, the Nav2 planner executes them against the OccupancyGrid, and the two representations stay in sync only as long as the semantic map's named regions can be resolved to grid cells; the worked example below shows this pipeline running on one concrete rollout.
Worked Example
The silent-ungrounding failure the mechanism warns about is easiest to see when you watch a single episode unfold, so the next step is to trace one concrete rollout end to end.
Keep one concrete rollout in view. A sensor reading becomes an estimate, the estimate constrains an action, the action changes the world, and the next observation confirms or contradicts the assumption. The section's idea is useful only if it improves that loop.
Tracing one rollout in scene "17DRP5sb8fy"
Consider a specific case: an agent in the Habitat MP3D scene "17DRP5sb8fy" receives the instruction "Go to the kitchen, avoid the wet-floor area near the sink, and stop by the blue fridge." The planner converts this into three waypoints: (1) navigate to kitchen centroid at grid cell (14, 22), (2) route around a 1.2 m radius exclusion zone at (16, 19), and (3) halt within 0.5 m of the object detector's "refrigerator-blue" bounding box.
At step 47 of the episode, a newly spawned obstacle blocks the corridor between the living room and kitchen. The replanner triggers because the next-waypoint distance spikes from 2.1 m to 8.4 m via the only remaining open path. The LLM replanner receives the current map, the blocked-node annotation, and the original instruction string. It then outputs a revised waypoint sequence that routes through the dining room and preserves the sink-avoidance constraint. Total replans: 1; path inflation: 34%; constraint violations: 0. This single rollout gives you a concrete artifact to inspect: which node caused the trigger, which phrase in the instruction forced the constraint into the new route, and what the inflation cost was.
Use Habitat, VLN-CE style interfaces, ROS 2 Nav2, or a small Gymnasium wrapper for replanning. The preserved fields are instruction parse, map state, local obstacle update, planner revision, executed waypoint, and language-grounding failure label.
Step-Through: cost-ratio replanning trigger
Trace the trigger with concrete numbers from the "17DRP5sb8fy" rollout. The robot is at grid cell (10, 22) heading toward the kitchen centroid (14, 22). At step 46 the planner returns two candidate path lengths. Before the obstacle: current-plan length to next waypoint = 2.1 m, best-alternative length = 2.0 m, so the ratio is 2.1 / 2.0 = 1.05. Since 1.05 < 1.5, no replan fires; the 0.1 m deviation is treated as costmap noise. At step 47 a cart spawns in the corridor. The next compute_path_to_pose call now returns current-plan length = 8.4 m (the only open route wraps around), while the best-alternative length computed after clearing the blocked cell stays 2.0 m. The ratio jumps to 8.4 / 2.0 = 4.2. Since 4.2 > 1.5, the trigger fires, the LLM replanner reparses the instruction, and the new dining-room route comes back at 2.8 m with the sink-exclusion zone still weighted. Final inflation = (2.8 - 2.1) / 2.1 = 33%, constraint violations = 0, replans = 1.
Practical Recipe
- Write the observation, action, and success metric before choosing a model.
- Build a baseline that is simple enough to debug by inspection.
- Add the library implementation only after the baseline behavior is understood.
- Record failures as structured cases: perception error, state error, planning error, control error, or evaluation error.
- Run at least one perturbation test before trusting the result.
Step two of that recipe, the simple debuggable baseline, only stays debuggable if you assign each component the right job, and the most common way teams get that wrong is by overloading the language model.
A common assumption is that the language model itself decides the new route when an obstacle is encountered, treating the LLM as a geometric planner that replaces the costmap solver. This is wrong in embodied AI: the LLM operates on tokens and has no access to the live occupancy grid, current sensor readings, or metric path costs. It can only reparse the instruction and emit revised symbolic constraints (waypoints, exclusion zone labels, landmark order), which are then handed to a metric planner such as Nav2 to compute an actual collision-free path. The correct mental model is a strict division of labor: the LLM translates language into a symbolic plan, and the metric planner translates that symbolic plan into executable geometry, with each layer responsible only for its own representation.
A language model that cannot see the occupancy grid is not a path planner; it is a constraint translator, and the moment you confuse the two roles, the robot walks into walls.
Two failure modes dominate real deployments. First, grounding ambiguity: the instruction "avoid the busy area" maps to no node in the costmap, so the constraint is silently dropped and the route ignores the user's intent entirely. This appears as a zero-violation score even though the instruction was never obeyed. Second, replanning oscillation: a low replanning-cost weight causes the planner to reroute at every new LiDAR scan, producing a path that constantly changes direction and never converges. Check for oscillation by counting replans per meter traveled; more than one replan per 3 m of progress in an uncluttered environment typically indicates a tuning error rather than a genuine obstacle field, though a cluttered or narrow environment can push this threshold higher and should be recalibrated per scene.
Grounding ambiguity matters in embodied AI because a robot cannot pause indefinitely while the language layer resolves a vague term. A delivery robot that drops "avoid the busy area" may enter the crowded corridor the constraint was meant to prevent, causing collisions or mission failure with no log entry marking the instruction as unresolvable. Unlike a software query that returns an error, a physical agent keeps moving under the degraded plan, so the cost surfaces as collisions, blocked paths, and lost user trust rather than exception messages.
The grounding mechanism works in two stages. First, a semantic map associates names and descriptions with regions: a vocabulary encoder (such as CLIP or a sentence encoder) computes a similarity score between the instruction phrase and candidate region labels stored at planning time. The region with the highest score above a confidence threshold is selected and its bounding box is converted to a set of costmap cells. Second, those cells receive an inflated cost weight, turning the spatial constraint into a number the planner can optimize against. If no region score clears the threshold, the constraint has no cell assignment and is silently absent from the costmap. Logging the threshold check explicitly at each replan is the only reliable way to detect this failure before it propagates into the trajectory.
Think of semantic grounding like a chef reading a recipe that says "use a sharp knife." The chef scans the knife block, scores each blade against the word "sharp," and picks the one with the highest match. If every knife is blunt, the instruction goes unexecuted and the dish is cut badly with no error message. The robot's grounding layer does exactly the same: it scores every labeled map region against the instruction phrase and assigns the best match an inflated cost weight. If no region clears the confidence threshold, the constraint is simply absent from the plan, and the robot proceeds as if the phrase was never spoken.
A team building a TurtleBot 4 delivery agent on Nav2 Humble starts by fixing the instruction panel (say, 50 templates over the Habitat MP3D scene "17DRP5sb8fy"), not by reaching for the largest VLM. They keep three runs in one result folder: a classical baseline (CLIP-grounded constraints plus NavfnPlanner), a maintained-tool run (NaVILA as the replanning oracle), and a perturbation run with a cart injected at corridor cell (14, 22) mid-episode. The comparison is accepted only when the path trace, the four metrics (success, replans, path inflation, constraint violations), and the grounding-failure labels all come from one rollout script, so a 0-violation score cannot hide a silently dropped sink-avoidance constraint.
Real-World Application: warehouse logistics
Amazon's warehouse drive units run exactly this division of labor: a fleet planner converts task strings like "retrieve pod A7 then route to packing station 3" into ordered waypoints with no-go constraints around human work zones, and a local costmap planner aboard each unit executes them while rerouting around stopped robots and dropped items. When a corridor blocks, the unit replans geometrically against the live grid but keeps the human-exclusion constraint intact, the same constraint-preserving recovery this section builds.
Treat language-guided navigation with replanning like a control-room label. If the label does not tell a future debugger what moved, what sensed, or what failed, it is decoration rather than engineering knowledge.
Vision-language models as online replanning oracles. Work such as NaVILA (Cheng et al., 2024, UC San Diego / UCSD) and NavGPT-2 (Zhou et al., 2024) shows that a vision-language model (VLM) queried at each blocked waypoint can regenerate a revised symbolic plan that preserves soft constraints better than pure metric replanning, but the latency penalty (300-800 ms per call) is still a bottleneck in real deployments. Active direction: speculative pre-computation of likely replan branches during movement.
Uncertainty-aware grounding with open-vocabulary maps. Systems that combine CLIP-style encoders with 3-D semantic maps (e.g., the MapGPT line from CASIA and NUS, 2024) can ground novel instruction phrases to unseen rooms, but calibration of the grounding confidence threshold remains unsolved: a threshold tuned in Habitat MP3D fails silently on out-of-distribution scenes. Active direction: online threshold recalibration from recovered grounding errors.
Mixed-initiative clarification during navigation. Rather than silently relaxing an ungroundable constraint, an agent can ask a targeted clarifying question mid-trajectory (Kuang et al., "Talk2Nav", ECCV 2024). Current systems have difficulty deciding when the cost of pausing to ask outweighs the cost of proceeding with a degraded plan. Active direction: a principled stopping criterion that balances temporal cost of query against expected constraint-violation penalty.
Open problem for PhD students. No published benchmark evaluates constraint preservation under dynamic replanning across more than a handful of instruction templates and scene types. A student could build a controlled benchmark (fixed instruction set, reproducible obstacle injection, held-out scene split) that isolates whether current LLM-planner pipelines actually encode language constraints into the replanned route or merely replan geometrically while discarding instruction intent.
Can you name the observation, action, protected assumption, success metric, and one likely failure case? If any field is vague, rewrite the contract before adding model complexity.
Topic-Native Deepening
Language-guided navigation becomes a capstone when the language instruction remains active throughout movement rather than only at the start. The hard cases happen when the instruction is underspecified, the map changes, or the original route becomes impossible and replanning must preserve the user intent.
That makes the project more than shortest-path planning. It is a grounding and recovery system whose score should reward progress under changing conditions, not only arrival at a goal point.
Language-guided navigation with replanning becomes teachable once the student can state the operative variables, the decision boundary, and the evidence artifact. The section should therefore be read together with Chapter 31 on language for embodied agents and Chapter 30 on planning, where the same loop is developed from adjacent angles.
Given instruction \(g\), belief state \(b_t\) (where the belief state is the agent's current probability estimate over its pose and the environment, given all observations so far), and map \(m_t\), the planner chooses \(a_t \sim \pi(a_t\mid b_t,m_t,g)\) while minimizing \(\sum_t c_{\text{travel}}(a_t)+\lambda c_{\text{instruction}}(b_t,g)+\mu c_{\text{replan}}(t)\).
The instruction cost penalizes routes that technically reach a location but violate the language intent, such as taking an unsafe path or missing the requested landmark sequence. Replanning cost matters because constant replanning can look intelligent while actually indicating instability.
Replanning should fire when the agent's belief that the current plan remains feasible drops below a practical threshold, not on every sensor update. A workable rule: trigger replanning when the expected cost to the next waypoint under the current plan exceeds 1.5 times the cost of the best alternative path computed over the current map, a heuristic known as the cost-ratio replanning trigger. In practice, below that ratio, route variance is typically noise; above it, the obstacle is usually real enough to warrant a new plan. Without this threshold, a naive per-scan trigger can fire on the order of tens of times per meter of travel in a cluttered room, in the TurtleBot 4 / Nav2 setup described above; with the 1.5x ratio, that drops to 1 or 2 replans for the entire corridor crossing.
The language constraint must be re-evaluated at each replan. If the new route no longer satisfies a soft constraint such as a landmark preference, the agent should log a constraint-relaxation event rather than silently drop the requirement. This logging is what separates a language-guided system from a geometric planner with decorative instruction text.
When using ROS 2 Nav2, the 1.5x cost ratio cannot be read directly from NavfnPlanner because it returns only a full path, not a cost scalar. Instead, compare the path length in meters returned by two back-to-back compute_path_to_pose calls: one with the current costmap and one after clearing the blocked cell. Set use_final_approach_orientation: false in the planner server to avoid spurious length inflation from orientation alignment. If the ratio of the two returned path lengths exceeds your threshold, trigger replanning; otherwise, treat the deviation as costmap noise and continue on the current plan.
- Define instruction categories, such as landmark following, room finding, and constraint-aware movement.
- Implement a classical baseline with symbolic grounding and a map planner.
- Add a learned language-grounding module or multimodal planner.
- Inject map changes or blocked passages that require replanning while preserving instruction intent.
- Score navigation success, replans, path inflation, and instruction-constraint violations together.
| Dimension | What To Specify | Why It Matters |
|---|---|---|
| Grounding | How are words mapped to places, objects, or constraints? | This is the first source of failure. |
| Replanning trigger | Blocked path, uncertainty spike, or new observation | Prevents arbitrary rerouting. |
| Evaluation | Same panel of instructions and perturbations for all methods | Keeps comparisons honest. |
| Deliverable | Replay with instruction text, map state, and replan reasons | Lets graders inspect why replanning happened. |
def validate_card(payload: dict[str, object]) -> dict[str, object]:
assert payload, "payload must not be empty"
return payload
# Instruction-aware navigation project card.
card = {
"instruction": "Go to the kitchen, avoid the wet floor, then stop near the blue fridge",
"blocked_corridor": True,
"metrics": ["success", "replans", "constraint_violations", "path_inflation"],
}
print(validate_card(card))
{'instruction': 'Go to the kitchen, avoid the wet floor, then stop near the blue fridge', 'blocked_corridor': True, 'metrics': ['success', 'replans', 'constraint_violations', 'path_inflation']}validate_card asserts the project card is non-empty, then prints the navigation card holding the instruction string, the blocked_corridor perturbation flag, and the four-metric evaluation panel (success, replans, constraint_violations, path_inflation).The expected output should make the perturbation explicit. If a project does not reveal what forced replanning, the reader cannot tell whether the algorithm solved a real problem or merely reran the planner unnecessarily.
After the from-scratch contract is clear, the practical route uses Nav2, Habitat, ROS 2, sentence encoders, CLIP, costmaps, OMPL. The payoff is that standard interfaces, logging, batching, and replay support move from ad hoc glue code into maintained infrastructure, while the evidence schema stays the same.
A robust capstone includes at least one instruction with a soft constraint, such as avoiding a room or preferring a landmark, because those cases expose whether the language layer affects planning or is only decorative text around a geometric path planner.
An active frontier is instruction-conditioned recovery, where the robot explains why it is replanning and asks for clarification only when its belief becomes too uncertain. That moves the project toward mixed-initiative embodied interaction.
For language-guided navigation, the artifact should show which instruction phrase changed the route, where replanning happened, and whether the final path obeyed both geometry and language constraints.
Project Ideas
Beginner (weekend): Build a Gymnasium wrapper around a gridworld where a text instruction such as "go to the blue cell, avoid the red zone" is parsed into waypoints and a simple A* planner executes it; the key challenge is converting free-form room names to grid coordinates without a semantic map, forcing you to confront grounding ambiguity immediately with no simulator overhead. Intermediate (1-2 weeks): Implement the cost-ratio replanning trigger in a ROS2 Nav2 stack on a TurtleBot 4 (or in Habitat with a virtual TurtleBot), where an LLM parses a natural-language instruction into (waypoint, constraint) pairs and a Nav2 NavfnPlanner computes paths; the key challenge is re-evaluating soft constraints such as landmark ordering at each replan cycle and logging constraint-relaxation events rather than silently dropping them when the rerouted path cannot satisfy the original instruction. Advanced (3-4 weeks): Extend the intermediate project into a full benchmark using the Habitat MP3D scene set or Isaac Lab, injecting dynamic obstacles mid-episode and scoring navigation success, replans per meter, path inflation, and instruction-constraint violations across at least 50 instruction variants; the key challenge is producing a reproducible evaluation panel where the same script generates the baseline, the language-guided policy, and the perturbation results as a single artifact.
Lab: Tune the cost-ratio replanning trigger
Goal: measure how the replanning threshold controls the trade-off between path stability and obstacle responsiveness, and find the value where the agent stops oscillating without ignoring real blockages.
Tools needed: Python 3.11+, gymnasium, numpy, and a simple grid A* (about 30 lines, or pathfinding from PyPI). No simulator or GPU required; a 20x20 occupancy grid is enough.
Setup: create a gridworld with a start, a goal, and a corridor. Parse the instruction "go to the goal, avoid the red zone" into a goal waypoint plus an exclusion-cost region. Run an episode where, at step 10, you inject an obstacle that blocks the shortest corridor. At each step compute the current-plan length and the best-alternative length, then replan only when their ratio exceeds a threshold r.
What to vary: sweep r over {1.0, 1.1, 1.5, 2.0, 4.0} and, separately, the obstacle severity (partial vs full corridor block).
What to observe: for each r, record replans per meter traveled, total path inflation, and whether the red-zone constraint was ever violated. You should see r = 1.0 oscillate (many replans per meter), r = 4.0 ignore the partial block (constraint or collision risk), and a stable basin around 1.5 that matches the heuristic in the Topic-Native Deepening section. Plot replans-per-meter against r to make the basin visible.
- Language-guided navigation with replanning matters when it changes an embodied agent's action under a stated observation and metric.
- Make instructions executable by grounding them in map state, obstacles, and recovery choices.
- Strong evidence is saved as one artifact containing the baseline, the maintained-tool path, the metric panel, and labeled failures.
Design a method-matched experiment for Language-guided navigation with replanning. Specify the environment, observation schema, action interface, metric, and one perturbation that targets the section's core assumption.
Section References
Cadene, R. et al. LeRobot: State-of-the-art Machine Learning for Real-World Robotics in Pytorch. GitHub project and technical documentation, 2024.
Use for dataset conversion, policy training, and capstone projects built around open robot-learning workflows.
Savva, M. et al. Habitat: A Platform for Embodied AI Research. ICCV, 2019.
Use for simulated navigation projects, reproducible scene tasks, and embodied evaluation loops.
What's Next?
Next, continue with section-59.3. Carry forward the artifact contract from Language-guided navigation with replanning, but change exactly one design axis before comparing results: embodiment, action interface, evaluation panel, or safety risk.