ROS2 Navigation Rosject - bt_navigator and navigate_to_pose keeps failing

Hi The Construct team,

Summary:
After spending about 6 hours straight with ROS2 Navigation Rosject, I am still struggling to understand why navigation to goal pose fails after one or two successful attempts to reach goal.

Highlights:

  1. I have completed all the sections of the project.
  2. All programs that I have programmed are working correctly.
  3. PathPlanner’s bt_navigator fails after one or two /navigate_to_pose actions.
  4. Not tried on Real Robot TurtleBot yet. Working only with simulation currently.

What I am doing:

  1. After Mapping and Saving Spots on the map, I launch the PathPlanner package.
    PathPlanner launch file launches { map_server and amcl } with lifecycle_manager_localization node and { planner, controller, recoveries and bt_navigator } with lifecycle_manager_pathplanning node, in a single launch file.
  2. I start the action client with the name of location saved.
  3. The robot moves to the goal pose during the first call to goal pose (and sometimes in the second call), and then the robot never moves to the goal pose, on or after the third call.

The problem seems to be with the bt_navigator and it keeps failing prematurely (noted from the error messages on the terminal).

This is my behavior.xml file:

<!--
  This Behavior Tree replans the global path periodically at 1 Hz, and has
  recovery actions. Obtained from the official Nav2 package
-->

<!-- Foxy Version -->
<root main_tree_to_execute="MainTree">
  <BehaviorTree ID="MainTree">
    <RecoveryNode number_of_retries="6" name="NavigateRecovery">
      <PipelineSequence name="NavigateWithReplanning">
        <RateController hz="1.0">
          <RecoveryNode number_of_retries="1" name="ComputePathToPose">
            <ComputePathToPose goal="{goal}" path="{path}" planner_id="GridBased"/>
            <ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
          </RecoveryNode>
        </RateController>
        <RecoveryNode number_of_retries="1" name="FollowPath">
          <FollowPath path="{path}" controller_id="FollowPath"/>
          <ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
        </RecoveryNode>
      </PipelineSequence>
      <ReactiveFallback name="RecoveryFallback">
        <GoalUpdated/>
        <SequenceStar name="RecoveryActions">
          <ClearEntireCostmap name="ClearLocalCostmap-Subtree" service_name="local_costmap/clear_entirely_local_costmap"/>
          <ClearEntireCostmap name="ClearGlobalCostmap-Subtree" service_name="global_costmap/clear_entirely_global_costmap"/>
          <Spin spin_dist="1.57"/>
          <Wait wait_duration="5"/>
        </SequenceStar>
      </ReactiveFallback>
    </RecoveryNode>
  </BehaviorTree>
</root>

<!-- Galactic Version
<root main_tree_to_execute="MainTree">
  <BehaviorTree ID="MainTree">
    <RecoveryNode number_of_retries="6" name="NavigateRecovery">
      <PipelineSequence name="NavigateWithReplanning">
        <RateController hz="1.0">
          <RecoveryNode number_of_retries="1" name="ComputePathToPose">
            <ComputePathToPose goal="{goal}" path="{path}" planner_id="GridBased"/>
            <ClearEntireCostmap service_name="global_costmap/clear_entirely_global_costmap"/>
          </RecoveryNode>
        </RateController>
        <RecoveryNode number_of_retries="1" name="FollowPath">
          <FollowPath path="{path}" controller_id="FollowPath"/>
          <ClearEntireCostmap service_name="local_costmap/clear_entirely_local_costmap"/>
        </RecoveryNode>
      </PipelineSequence>
      <SequenceStar name="RecoveryActions">
        <ClearEntireCostmap service_name="local_costmap/clear_entirely_local_costmap"/>
        <ClearEntireCostmap service_name="global_costmap/clear_entirely_global_costmap"/>
        <Spin spin_dist="1.57"/>
        <Wait wait_duration="5"/>
      </SequenceStar>
    </RecoveryNode>
  </BehaviorTree>
</root>
-->

<!-- End of File -->

This is my bt_navigator.yaml file:

# Foxy Version
bt_navigator:
  ros__parameters:
    use_sim_time: True
    global_frame: map
    robot_base_frame: base_footprint # base_link
    odom_topic: /odom
    enable_groot_monitoring: True
    groot_zmq_publisher_port: 1666
    groot_zmq_server_port: 1667
    default_bt_xml_filename: "/home/user/ros2_ws/src/my_turtlebot_pathplanning/config/behavior.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

# Galactic Version
# bt_navigator:
#   ros__parameters:
#     use_sim_time: True
#     global_frame: map
#     robot_base_frame: base_footprint # base_link
#     odom_topic: /odom
#     bt_loop_duration: 10
#     default_server_timeout: 20
#     default_bt_xml_filename: "/home/user/ros2_ws/src/my_turtlebot_pathplanning/config/behavior.xml"
#     default_nav_to_pose_bt_xml: "/home/user/ros2_ws/src/my_turtlebot_pathplanning/config/behavior.xml"
#     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
#     - 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
#     - nav2_single_trigger_bt_node
#     - nav2_is_battery_low_condition_bt_node
#     - nav2_navigate_through_poses_action_bt_node
#     - nav2_navigate_to_pose_action_bt_node
#     - nav2_remove_passed_goals_action_bt_node

# End of File

I need some assistance / guidance in getting this working.

Thanks,
Girish

Solution:
This problem can never be solved !
This seems to be an issue with ROS2 Foxy version. Only update to Galactic or newer version can fix this issue. Came to know this after spending quite some time on Google.

Information acquired:

  1. ROS2 Foxy was still in developmental stages - ROS2 Navigation Stack had some issues.
  2. This issue was never fixed in any ROS2 Foxy updates / patches.
  3. Rviz2 is also unstable - expected to shutdown abruptly.
  4. ROS2 Navigation Stack must be restarted if navigate_to_pose fails. There is no workaround.
  5. Navigation to Goal Pose is bound to fail with ROS2 Foxy, after 1 - 3 successful attempts.

Links Visited:

  1. bt_navigator failing with error `Action server failed while executing action callback: "send_goal failed"` - ROS Answers: Open Source Q&A Forum
  2. [bt_navigator]: Action server failed while executing action callback: "One of the children of a DecoratorNode or ControlNode is nullptr" - ROS Answers: Open Source Q&A Forum
  3. Stability regression since the recent foxy sync (Patch Release 4) #1074
  4. Path planning error - ROS2 Navigation course
  5. Navigation and SLAM Using the ROS 2 Navigation Stack – Automatic Addison

Marking this issue as solved. :neutral_face:

– Girish

1 Like

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