BehaviorTree / BehaviorTree.ROS2

BehaviorTree.CPP utilities to work with ROS2
Apache License 2.0
144 stars 59 forks source link

Overrided registerNodesIntoFactory doesn't work #61

Closed kenyoshizoe closed 4 months ago

kenyoshizoe commented 4 months ago

Thank you for adding the new and exciting feature, BT::TreeExecutionServer.

I attempted to create my own class by inheriting from BT::TreeExecutionServer, but it seems that the registerNodesIntoFactory I inherited is not functioning properly. When attempting to load a behavior tree containing the Node added within registerNodesIntoFactory, the following error occurs:

[ERROR] [1715003079.255998664] [bt_action_server]: Failed to load BehaviorTree: tree.xml 
 Error at line 7: -> Node not recognized: MyNode

This issue seems to be caused by two reasons:

https://github.com/BehaviorTree/BehaviorTree.ROS2/blob/8790909163f96a0946ef7504aa3379f4d85ced35/behaviortree_ros2/src/tree_execution_server.cpp#L73-L95

https://github.com/BehaviorTree/BehaviorTree.ROS2/blob/8790909163f96a0946ef7504aa3379f4d85ced35/behaviortree_ros2/src/bt_utils.cpp#L137-L167

facontidavide commented 4 months ago

yiu are right!!!! I will fix it