Nav2 Writing a New Behavior Plugin
I am running a new behavior plugin tutorial on ros2galactic with reference to the document below. https://navigation.ros.org/plugin_tutorials/docs/writing_new_behavior_plugin.html
Please tell me the reason for the following error.
[bt_navigator-7] [ERROR] [1676352851.699115317] []: Caught exception in callback for transition 13
[bt_navigator-7] [ERROR] [1676352851.699134372] []: Original error: Error at line 37: -> Node not recognized: send_sms
[bt_navigator-7] [WARN] [1676352851.699166162] []: Error occurred while doing error handling.
[bt_navigator-7] [FATAL] [1676352851.699178704] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented
[lifecycle_manager-9] [ERROR] [1676352851.699621767] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator
[lifecycle_manager-9] [ERROR] [1676352851.699658466] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.
The main branch of the navigationtutorial project is humble, but galactic can be found below. https://github.com/ros-planning/navigation2tutorials/tree/126902457c5c646b136569886d6325f070c1073d/nav2smsrecovery Putting this code in ros2_ws/src made the build successful.
Next, I added send_sms after the recovery actions Spin, Wait, BackUp in the XML file of the behavior tree as shown below.
<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"/>
<ReactiveFallback name="ComputePathToPoseRecoveryFallback">
<GoalUpdated/>
<ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
</ReactiveFallback>
</RecoveryNode>
</RateController>
<RecoveryNode number_of_retries="1" name="FollowPath">
<FollowPath path="{path}" controller_id="FollowPath"/>
<ReactiveFallback name="FollowPathRecoveryFallback">
<GoalUpdated/>
<ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
</ReactiveFallback>
</RecoveryNode>
</PipelineSequence>
<ReactiveFallback name="RecoveryFallback">
<GoalUpdated/>
<RoundRobin name="RecoveryActions">
<Sequence name="ClearingActions">
<ClearEntireCostmap name="ClearLocalCostmap-Subtree" service_name="local_costmap/clear_entirely_local_costmap"/>
<ClearEntireCostmap name="ClearGlobalCostmap-Subtree" service_name="global_costmap/clear_entirely_global_costmap"/>
</Sequence>
<Spin spin_dist="1.57"/>
<Wait wait_duration="5"/>
<BackUp backup_dist="0.15" backup_speed="0.025"/>
<send_sms/>
</RoundRobin>
</ReactiveFallback>
</RecoveryNode>
</BehaviorTree>
</root>
And replaced the params file with:
recoveries_server:
ros_parameters:
costmap_topic: local_costmap/costmap_raw
footprint_topic: local_costmap/published_footprint
cycle_frequency: 10.0
recovery_plugins: [spin, backup, wait, send_sms]
spin:
plugin: nav2_recoveries/Spin
backup:
plugin: nav2_recoveries/BackUp
wait:
plugin: nav2_recoveries/Wait
send_sms:
# plugin: nav2_sms_behavior/SendSms
plugin: nav2_sms_recovery/SMSRecovery
account_sid: A*********
auth_token: a*********
from_number: "**********"
to_number: "**********"
I build and try to start navigation, but I get the following error:
[bt_navigator-7] [ERROR] [1676352851.699115317] []: Caught exception in callback for transition 13
[bt_navigator-7] [ERROR] [1676352851.699134372] []: Original error: Error at line 37: -> Node not recognized: send_sms
[bt_navigator-7] [WARN] [1676352851.699166162] []: Error occurred while doing error handling.
[bt_navigator-7] [FATAL] [1676352851.699178704] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented
[lifecycle_manager-9] [ERROR] [1676352851.699621767] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator
[lifecycle_manager-9] [ERROR] [1676352851.699658466] [lifecycle_manager_navigation]: Failed to bring up all requested nodes.
Please let me know if you know the cause.
Asked by Yuki Miyake on 2023-02-14 00:59:52 UTC
Answers
[bt_navigator-7] [ERROR] [1676352851.699134372] []: Original error: Error at line 37: -> Node not recognized: send_sms
The BT navigator parsing the file doesn't know the node you've marked as send_sms
. You need to have that plugin registered with the BT Navigator for use. See BT Nav's documentation for the plugins list parameter for the associated BT node you've created.
Asked by stevemacenski on 2023-02-14 12:54:01 UTC
Comments
I am also facing same issue for a decorator node
Asked by Vignesh T on 2023-07-25 05:27:12 UTC