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:
- I have completed all the sections of the project.
- All programs that I have programmed are working correctly.
-
PathPlanner
’sbt_navigator
fails after one or two/navigate_to_pose
actions. - Not tried on Real Robot TurtleBot yet. Working only with simulation currently.
What I am doing:
- After Mapping and Saving Spots on the map, I launch the
PathPlanner
package.
PathPlanner
launch file launches {map_server
andamcl
} withlifecycle_manager_localization
node and {planner
,controller
,recoveries
andbt_navigator
} withlifecycle_manager_pathplanning
node, in a single launch file. - I start the action client with the name of location saved.
- 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