Skip to content

Wiki

Difference between Humble and Jazzy navigation

About 5 min read

Existing English translations were reused. 1 current source blocks remain in Simplified Chinese, without triggering paid translation.

1.Referenced official Jazzy example

  • /opt/ros/jazzy/share/nav2_bringup/params/nav2_params.yaml
  • /opt/ros/jazzy/share/nav2_bt_navigator/behavior_trees/navigate_to_pose_w_replanning_and_recovery.xml
  • /opt/ros/jazzy/share/nav2_bt_navigator/behavior_trees/navigate_through_poses_w_replanning_and_recovery.xml

2.Modify content

You can copy a Humble feature package and name it mycar_navigation2_jazzyand then modify this feature package.

  1. 将功能包名保持为 mycar_navigation2_jazzy,并在相关位置补充修改边界注释。

    • package.xml
    • CMakeLists.txt
  2. 将 _jazzy 包内 launch 文件的包路径查询保持为 mycar_navigation2_jazzy,并补充修改边界注释。

    • launch/nav2.launch.py
    • launch/bringup.launch.py
    • launch/auto_slam.launch.py
  3. 对照 Jazzy 官方 bt_navigator 示例更新 params/bt.yaml。

    • 删除 Humble 时代列出的 Nav2 内置 BT 插件列表。
    • Jazzy 会自动加载 Nav2 内置 BT 插件,plugin_lib_names 只保留自定义 BT 插件。
    • 没有自定义 BT 插件时不传 plugin_lib_names,避免空列表被解析成无类型参数。
    • 新增 navigators、navigate_to_pose、navigate_through_poses。
    • 新增 error_code_names,用于配合 Jazzy 官方行为树里的 error code blackboard 变量。
  4. 对照 Jazzy 官方 pluginlib 类名更新 planner 和 behavior 插件。

    • nav2_navfn_planner/NavfnPlanner 改为 nav2_navfn_planner::NavfnPlanner
    • nav2_behaviors/Spin 等改为 nav2_behaviors::Spin 等
  5. 对照 Jazzy 官方行为树更新自定义 BT XML。

    • 添加 BTCPP_format="4"。
    • 添加 PlannerSelector 和 ControllerSelector。
    • ComputePathToPose、ComputePathThroughPoses、FollowPath 添加 error_code_id。
    • 添加 WouldAPlannerRecoveryHelp 和 WouldAControllerRecoveryHelp。
  6. 对照 Jazzy 官方 controller 参数名更新进度检查器参数。

    • progress_checker_plugin 改为 progress_checker_plugins: ["progress_checker"]
  7. 整理 planner/controller 参数文件的 YAML 结构。

    • 将重复的 /** 顶层键合并成一个。
    • global_costmap 和 local_costmap 挂在同一个 /** 根键下,避免参数解析时覆盖 server 参数。

3.Main issues fixed

Error on startup:

Failed to create navigator id navigate_to_pose. Exception: ID [ComputePathToPose] already registered

The reason is that the Humble configuration manually lists Nav2's built-in BT plugins in plugin_lib_names , whereas Jazzy already automatically loads these built-in plugins, causing ComputePathToPose to be registered repeatedly.

4.Usage

Rebuild and source:

colcon build --symlink-install --packages-select mycar_navigation2_jazzy
source install/setup.bash

Start Jazzy version:

ros2 launch mycar_navigation2_jazzy bringup.launch.py use_sim_time:=True

5.Verified

Executed:

colcon build --symlink-install --packages-select mycar_navigation2_jazzy
ros2 launch mycar_navigation2_jazzy nav2.launch.py --show-args
ros2 launch mycar_navigation2_jazzy bringup.launch.py --show-args

Additionally, a short startup check was performed with timeout:

ros2 launch mycar_navigation2_jazzy bringup.launch.py use_sim_time:=True

Result:

  • bt_navigator Successfully created navigate_to_pose and navigate_through_poses.
  • planner_server Successfully loaded nav2_navfn_planner::NavfnPlanner.
  • controller_server Successfully loaded DWB and all critics.
  • behavior_server Successfully loaded nav2_behaviors::... plugin.
  • In a short startup environment without Gazebo/robot_state_publisher/TF, it finally stopped waiting for base_link -> map TF; this is an expected missing runtime environment, not a configuration fatal.