Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Ros2 Navigation Nav2 Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-ros2-navigation-nav2-knowledge-patch-nevaberry-plugins)
---
name: ros2-navigation-nav2-knowledge-patch
description: Nav2
version: "1.3.12"
license: MIT
metadata:
author: Nevaberry
---
# Nav2 Migration and Configuration
Load this skill when migrating Nav2 configurations or custom plugins, composing
navigation behavior trees, or configuring planning, control, collision monitoring,
costmaps, localization, routing, docking, and behaviors.
Use the topic references for complete settings and configuration examples.
## Reference index
| Reference | Topics |
| --- | --- |
| [Behavior Trees](references/behavior-trees.md) | Navigator parameters, node migration, selectors, recovery, control flow, pause/resume, multi-pose actions |
| [Collision Monitor](references/collision-monitor.md) | Velocity wiring, freshness, runtime controls, zones, observation sources, Collision Detector |
| [Costmaps, Localization, and Mapping](references/costmaps-localization-and-mapping.md) | AMCL, footprints, transforms, layers, filters, map inputs, inflation, clearing |
| [Migration and Integration](references/migration-and-integration.md) | Distribution context, launch, simulation, lifecycle interfaces, introspection, RViz, tests |
| [Planning and Control](references/planning-and-control.md) | Plugin APIs, path handlers, checkers, timing, Smac, DWB, RPP, Rotation Shim, MPPI, smoothers |
| [Routing, Docking, and Behaviors](references/routing-docking-and-behaviors.md) | Route Server installation and operations, behavior collision inputs, teleoperation, dock plugins, following |
## Breaking changes and configuration migrations
### Bringup, velocity commands, and navigator errors
From Kilted, update the base driver and simulator for
`geometry_msgs/msg/TwistStamped` on the existing velocity-command topics.
To retain `Twist`, set `enable_stamped_cmd_vel: false` on every participating
Nav2 publisher and subscriber.
In Kilted, remove `use_namespace` from bringup calls and pass `namespace`
directly (default `/`). Use relative topic names for per-robot topics in shared
Nav2 and RViz configurations.
Replace `error_code_names` with `error_code_name_prefixes` in Kilted's
`bt_navigator` parameters: the old key causes a startup exception. Bind each
action's `error_code_id` and `error_msg` outputs to its configured
`<prefix>_error_code` and `<prefix>_error_msg` blackboard keys.
### Lifecycle and custom plugin interfaces
For Lyrical, depend on `nav2_ros_common` and use `nav2::LifecycleNode` for
custom Nav2 plugins and servers. Its factories provide publisher/subscription
QoS overrides through `allow_parameter_qos_overrides` and service/action
introspection through `introspection_mode`.
The subscription factory takes the callback before optional QoS. For service
clients, `async_call()` replaces `async_send_request()`; service callbacks
take an `rmw_request_id_t` header before the request and response. Remove
`action_server_result_timeout` from Nav2 action-server configurations.
See the integration reference for factory call examples and action interfaces.
Lyrical custom `BaseGlobalPlanner` implementations must add the
`std::vector<geometry_msgs::msg::PoseStamped>` viapoints argument to
`createPath()` for `ComputePathToPose`. `ComputePathThroughPoses` still connects
plans for consecutive poses end to end.
### Controller path handling
In Lyrical, configure pruning and optional inversion or rotation handling on the
Controller Server's path handler. Update custom plugin APIs as follows:
| API | Change |
| --- | --- |
| `GoalChecker::isGoalReached()` | Add the transformed and pruned `const nav_msgs::msg::Path &` argument. |
| `Controller::setPlan()` | Replace with `newPathReceived(const nav_msgs::msg::Path & raw_global_path)`. |
| `computeVelocityCommands()` | Add the processed path and final `const geometry_msgs::msg::PoseStamped & global_goal`. |
Remove `transform_tolerance` from DWB, RPP, Graceful, and MPPI plugin configs,
and `max_robot_pose_search_dist` from RPP, Graceful, and MPPI. Move MPPI's
`prune_distance`, `enforce_path_inversion`, `inversion_xy_tolerance`, and
`inversion_yaw_tolerance` into the handler. The planning reference also lists
DWB's removed path parameters and its added `path_length_tolerance`.
Register handler IDs with `path_handler_plugins: [PathHandler]`, matching the
handler parameter block. Select a registered handler or goal checker through
`path_handler_id` or `goal_checker_id` in the `FollowPath` action goal.
### Controller and smoother settings
| Component | Migration |
| --- | --- |
| RPP in Lyrical | Rename `desired_linear_vel` to `max_linear_vel` (default `0.5` m/s); align the velocity smoother's `max_velocity`, `min_velocity`, `max_accel`, and `max_decel` with controller limits. |
| Goal statefulness | Kilted's RPP `stateful: true` latches XY convergence for yaw alignment. In Lyrical, set `stateful` on the goal checker; `isGoalXYReached` shares the behavior across RPP, Graceful, and Rotation Shim. |
| Rotation Shim in Lyrical | Make `primary_controller` a map containing the underlying controller's `plugin` and parameters. |
| MPPI in Lyrical | Replace built-in `DiffDrive`, `Omni`, and `Ackermann` names with a plugin ID and nested class declaration, even for default ID `diff_drive`. |
| MPPI statistics in Lyrical | `visualize: true` automatically publishes `~/critics_stats`, replacing `publish_critics_stats`. |
| Graceful in Kilted | Replace `motion_target_dist` with `min_lookahead` and `max_lookahead`; migrate `final_rotation` to `prefer_final_rotation`. |
| Controller Server in Kilted | Configure loop frequency before running; dynamic parameter updates can no longer change it. |
| Constrained Smoother in Lyrical | Retune weights: the objective uses each weight times squared cost, replacing squared weight times the fourth power of cost. |
### Behavior trees and multi-pose actions
In Lyrical, move blackboard-ID parameters into each navigator plugin namespace
within `bt_navigator`. Use `goal_blackboard_id` under `navigate_to_pose`,
`goals_blackboard_id` and `waypoint_statuses_blackboard_id` under
`navigate_through_poses`, and `path_blackboard_id` under each applicable navigator.
| Lyrical BT change | Action |
| --- | --- |
| Condition nodes become actions | Replace `IsStopped`, `IsPathValid`, and `IsPoseOccupied` with `CheckStopStatus`, `ValidatePath`, and `CheckPoseOccupancy`; these nodes can return `RUNNING`. |
| Path validation | For `ValidatePath` and the `IsPathValid` service, replace `check_full_path` with its inverse, `stop_at_first_collision` (default `true`). |
| Local truncation | Rename `TruncatePathLocal` input `robot_frame` to `robot_base_frame`; omission uses the navigator's `robot_base_frame` parameter. |
| Recovery cycling | `RoundRobin` defaults to `wrap_around="false"` and fails when its last child fails; set `wrap_around="true"` to preserve wrapping to the first child. |
In Kilted, multi-pose action arrays become `nav_msgs/msg/Goals` messages with
a header: populate `goal.poses.goals` for `NavigateThroughPoses` and
`goal.goals.goals` for `ComputePathThroughPoses`.
`NavigateThroughPoses` feedback and results contain one `WaypointStatus` entry
per original goal, even as the active list shrinks. Connect both status ports on
`RemovePassedGoals` and `RemoveInCollisionGoals` to the blackboard key selected
by `waypoint_statuses_blackboard_id`. Waypoint Follower also replaces
`MissedWaypoint` with `WaypointStatus` in Kilted.
### Costmaps, docking, and lifecycle defaults
In Kilted, put `map_topic` under the Static Layer's plugin ID; the costmap
node's own key was removed. Replace the docking server's `dock_backwards`
boolean with each plugin's `dock_direction: backward` or `forward` (default).
Lyrical custom `ChargingDock` and `NonChargingDock` plugins must implement
`startDetectionProcess` and `stopDetectionProcess`, returning `true` if no
detector work is needed. Simple dock plugins now apply external-detection
offsets in X, Y, Z rotation order using `setRPY()` instead of Z, X, Y.
Recalibrate offsets combining nonzero yaw with nonzero roll or pitch.
Lyrical raises `bond_heartbeat_period` from `0.1` to `0.25` seconds for Nav2
lifecycle nodes, including the lifecycle manager. Update explicit overrides in
both places when adopting the new period.
## Runtime configuration quick reference
### Navigation trees and recovery
The default tree uses topic-based plugin selectors. Pass planner selection to
`ComputePathToPose.planner_id` and controller selection to
`FollowPath.controller_id`; the BT reference includes all five selector nodes.
The default `NavigateToPose` tree reuses its path when the goal is unchanged,
`IsGoalNearby` succeeds, and validation succeeds on the forward remainder.
Contextual planner and controller recoveries gate costmap clearing through
their matching recovery-help conditions, with one retry each. The default tree
allows up to six navigation retries and enters system recovery only if either
recovery-help condition succeeds. A new goal halts active recovery through `GoalUpdated`.
Lyrical can load trees by ID or filepath from `bt_search_directories`. Give each
tree a unique ID for ID-based selection or multi-file subtrees.
### Server timing and collision monitoring
| Setting | Behavior and default |
| --- | --- |
| `costmap_update_timeout` | Bounds the wait for a current costmap: `1.0` s on `planner_server`, `0.3` s on `controller_server`. |
| `failure_tolerance` | Controller velocity-computation failure tolerance in seconds: `0.0` aborts on the first failure; `-1.0` allows indefinite retries. |
| `odom_duration` | Controller odometry buffer duration; default `0.3` s. |
| `search_window` | Controller closest-point search distance along the path; default `2.0` m. |
| `source_timeout` | Collision Monitor stops for stale enabled sources after `2.0` s by default; `0.0` skips freshness checks at the configured scope. |
| `stop_pub_timeout` | Collision Monitor continues publishing zero commands after stopping for `1.0` s by default. |
Collision Monitor's `min_points` is inclusive and defaults to `4`. When migrating
Humble's `max_points`, use its old value plus one. Consecutive trigger and release
cycles are controlled by `trigger_consecutive_points` and
`release_consecutive_points`, both defaulting to one.
Velocity-dependent polygons use the first matching sub-polygon. Put a polygon
covering the full command range last as a fallback. With `holonomic: false`,
linear bounds match signed x velocity; with `holonomic: true`, they match
nonnegative planar speed and can constrain direction in radians.
### Planning, control, and route operations
Lyrical's dynamic `allow_partial_planning: true` accepts a path ending at the
last reachable input pose; inspect `last_reached_index` in the
`ComputePathThroughPoses` result. Multiple Smac instances can coexist for
runtime planner selection. State Lattice detects `motion_model: "omni"` in
primitive metadata, uses holonomic analytic expansion and smoothing, and
disables `allow_reverse_expansion`.
Lyrical validates MPPI's winning trajectory through an
`OptimalTrajectoryValidator` plugin; the default
`DefaultOptimalTrajectoryValidator` checks collisions. `open_loop: true`
initializes velocity from the last command. Axis delay settings and trajectory
visualization details are in the planning reference.
Use route tracking for progress feedback or operations triggered by entering or
leaving nodes or edges. Lyrical's `smooth_corners: true` uses `smoothing_radius`
to size tangent circular arcs, skipping nearly straight transitions and arcs
that would extend beyond either edge.
### Localization, layers, and behavior inputs
Set AMCL `random_seed` to a nonnegative integer for repeatable particle sampling;
negative values, including default `-1`, seed from the clock. AMCL can reuse
its last pose after reset by default; `always_reset_initial_pose: true` requires
an initial pose on the `initial_pose` topic or through the `initial_pose`
parameters with `set_initial_pose: true`.
Costmap `filters` run after ordinary `plugins` layers are combined. In Lyrical,
costmap-clearing requests can select layer IDs through `plugins: [obstacle_layer]`;
an empty list clears all eligible layers, and an unknown or non-clearable ID
fails the whole request. Keep the footprint-derived `custom_inscribed_radius`
setting for global planners and footprint-dependent configurations.
The Behavior Server uses separate local/global raw costmap and footprint
topics. Its server-level `simulate_ahead_time` controls collision lookahead for
Spin, BackUp, and DriveOnHeading. BackUp and DriveOnHeading acceleration limits
are positive, deceleration limits negative, and `minimum_speed` positive.
The behavior reference includes the AssistedTeleop plugin and projection setup.