# Error with nav\_through\_poses\_bt\_xml

**URL:** <https://get-help.theconstruct.ai/t/error-with-nav-through-poses-bt-xml/33509>\
**Category:** Open Discussions\
**Tags:** error, ros2, navigation\
**Created:** [November 14, 2024, 4:48pm UTC](https://get-help.theconstruct.ai/t/error-with-nav-through-poses-bt-xml/33509 "2024-11-14T16:48:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alejandroRobo46](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/alejandrorobo46/32/9782_2.png) [@alejandroRobo46](https://get-help.theconstruct.ai/u/alejandroRobo46)\
**Post date:** [November 14, 2024, 4:48pm UTC](https://get-help.theconstruct.ai/t/error-with-nav-through-poses-bt-xml/33509/1 "2024-11-14T16:48:22Z")

</div>

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 :

```python
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
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

---

<div class="post-metadata">

**Author:** ![roalgoal](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/roalgoal/32/7280_2.png) [@roalgoal](https://get-help.theconstruct.ai/u/roalgoal)\
**Post date:** [November 20, 2024, 9:13am UTC](https://get-help.theconstruct.ai/t/error-with-nav-through-poses-bt-xml/33509/2 "2024-11-20T09:13:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![alejandroRobo46](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/alejandrorobo46/32/9782_2.png) [@alejandroRobo46](https://get-help.theconstruct.ai/u/alejandroRobo46)\
**Post date:** [November 20, 2024, 12:57pm UTC](https://get-help.theconstruct.ai/t/error-with-nav-through-poses-bt-xml/33509/3 "2024-11-20T12:57:17Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![system](https://get-help.theconstruct.ai/uploads/default/original/2X/9/9d3ce8305cc0d0d9b6e07d15767a6f245c526f1b.jpeg) [@system](https://get-help.theconstruct.ai/u/system)\
**Post date:** [November 27, 2024, 12:57pm UTC](https://get-help.theconstruct.ai/t/error-with-nav-through-poses-bt-xml/33509/4 "2024-11-27T12:57:34Z")

</div>

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