ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Unable to change Nav2 BT tree

asked 2022-07-19 12:28:05 -0500

marpeja gravatar image

Hi!

I want to change the BT Nav2 is using, but it seems it doesn't change when I change it in the yaml file. I am using Ros2 Foxy, so here it is my bt_navigator configuration, where I define the xml file with default_bt_xml_filename:

bt_navigator:
  ros__parameters:
    use_sim_time: True
    global_frame: map
    robot_base_frame: base_link
    odom_topic: "odom/unfiltered"
    enable_groot_monitoring: True
    groot_zmq_publisher_port: 1666
    groot_zmq_server_port: 1667
    default_bt_xml_filename: "navigate_w_replannning_and_round_robin_recovery.xml"
    plugin_lib_names:
    - nav2_compute_path_to_pose_action_bt_node
    - nav2_follow_path_action_bt_node
    - nav2_back_up_action_bt_node
    - nav2_spin_action_bt_node
    - nav2_wait_action_bt_node
    - nav2_clear_costmap_service_bt_node
    - nav2_is_stuck_condition_bt_node
    - nav2_goal_reached_condition_bt_node
    - nav2_goal_updated_condition_bt_node
    - nav2_initial_pose_received_condition_bt_node
    - nav2_reinitialize_global_localization_service_bt_node
    - nav2_rate_controller_bt_node
    - nav2_distance_controller_bt_node
    - nav2_speed_controller_bt_node
    - nav2_truncate_path_action_bt_node
    - nav2_goal_updater_node_bt_node
    - nav2_recovery_node_bt_node
    - nav2_pipeline_sequence_bt_node
    - nav2_round_robin_node_bt_node
    - nav2_transform_available_condition_bt_node
    - nav2_time_expired_condition_bt_node
    - nav2_distance_traveled_condition_bt_node

As you see, I am using the navigate_w_replannning_and_round_robin_recovery.xml from the predefined behavior trees. However, when I launch Groot in Control mode, this is the BT I get, which in fact is the navigate_w_replanning_and_recovery.xml:

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-07-19 13:58:46 -0500

Check your launch file, we remap it in the launch file so you can use python to evaluate which package to find it in rather than being forced to use absolute paths in the yaml file. However, you can always still define it in the yaml file with absolute paths. This is noted in the default navigation config file:

# 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
# nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
# nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
# They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
edit flag offensive delete link more

Comments

Thanks Steve! I forgot to change it in the launch file. However I needed to set the new BT path in both the launch file (full path of the file) and the yaml file (only the name of the xml file)

marpeja gravatar image marpeja  ( 2022-07-20 05:24:51 -0500 )edit

You shouldn't need to do anything in the launc hfile if the yaml file contains the full path. If the yaml is only a file name, then yes, in your launch file you'd have to tell it where its located.

stevemacenski gravatar image stevemacenski  ( 2022-07-20 16:25:48 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-07-19 12:28:05 -0500

Seen: 287 times

Last updated: Jul 19 '22