Error with nav_through_poses_bt_xml

Hello, when I try to use a “custom behavior tree” for the navigation_through_poses action, it loads but is not being executed and the default’s behavior nav2 is being executed. I would like to know if
anyone knows how to configure or what I need to change in the configuration to be able to use a custom behavior tree in the node bt_navigator.

launch :

Node(
            package='nav2_bt_navigator',
            executable='bt_navigator',
            name='bt_navigator',
            output='screen',
            # parameters=[bt_navigator_yaml, {'default_bt_xml_filename': default_bt_xml_path}]),
            parameters=[bt_navigator_yaml, {'default_nav_through_poses_bt_xml': default_bt_xml_path}]),

(I already treat them both with "default_bt_xml_filename’: default_bt_xml_path " and bt_navigator_yaml, {‘default_nav_through_poses_bt_xml’: default_bt_xml_path)

yaml configuration:
bt_navigator:
  ros__parameters:
    use_sim_time: True
    global_frame: map
    robot_base_frame: base_link
    odom_topic: /odom
    bt_loop_duration: 10
    default_server_timeout: 20
    # default_nav_through_poses_bt_xml: $(find-pkg-share path_planner_server)/config/mp600_behavior.xml
    navigators: ['navigate_through_poses']
    navigate_through_poses:
      plugin: "nav2_bt_navigator::NavigateThroughPosesNavigator"
    plugin_lib_names:
    - nav2_compute_path_to_pose_action_bt_node
    - nav2_compute_path_through_poses_action_bt_node
    - nav2_follow_path_action_bt_node
    .......

Version do ros2 : humble

Hi @alejandroRobo46, I’ve encountered this problem and the easy fix is to set the full path for the default_nav_through_poses_bt_xml file.

Hi @roalgoal, I tried that too, but it didn’t work. Now I’m using the library:
“from nav2_common.launch import RewrittenYaml” with the following code:

param_substitutions = {
        "default_nav_to_pose_bt_xml": pose_bt_xml_path,
        "default_nav_through_poses_bt_xml": poses_bt_xml_path,
    }

    bt_navigator_updated_config = RewrittenYaml(
        # configured_params = RewrittenYaml(
        source_file=bt_navigator_yaml,
        root_key="",
        param_rewrites=param_substitutions,
        convert_types=True,
    )

I passed bt_navigator_updated_config as a parameter, and with that, it worked. It is important to highlight that this approach rewrites the original behavior trees of the NavigateToPose and NavigateThroughPoses actions

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.