Replies: 7 comments 9 replies
-
Thanks a lot @MarqRazz for this. I would love to eventually merge this into BehaviorTree.ROS2 as a "stadard way to solve this problem. Some initial random feedback:
I will dig more into the code, to see if I have more specific remarks |
Beta Was this translation helpful? Give feedback.
-
First quick scan of the code: LoopWheen looping, I suggest using StatusCarefull, the state SKIPPED could also be returned! Creating tresshttps://github.com/MarqRazz/ActionServer.BT/blob/main/action_server_bt/src/action_server_bt.cpp#L98 Some users reported that creating trees with a lot of Action Clients is slow because of... yes, you quessed correctly, DDS (discovery). LoggingWe should think about other mechanism to add logging, since some users have custom loggers.
|
Beta Was this translation helpful? Give feedback.
-
Also, but this is something I can do myself, we should be able to add a default Blackboard for the root node, here: https://github.com/MarqRazz/ActionServer.BT/blob/main/action_server_bt/src/action_server_bt.cpp#L98 There is a new design pattern that I am working on that makes that mandatory. But as I said, I can foxus on this myself once we discussed the other topics. |
Beta Was this translation helpful? Give feedback.
-
No, you should still have the same rate, but under SOME conditions, you may react faster that means ticking more frequently (but never less frequently). |
Beta Was this translation helpful? Give feedback.
-
I prefer personally dependency injections with |
Beta Was this translation helpful? Give feedback.
-
Here is a PR to address some of your feedback. Let me know what you think. |
Beta Was this translation helpful? Give feedback.
-
Other rename suggestions for the library/repo: |
Beta Was this translation helpful? Give feedback.
-
I am proposing a ROS2 Action Server that can be used as a standard executor for Behaviors written with BehaviorTree.CPP. It offers the ability to load BehaviorTree.CPP plugins, including ROS based Behaviors, and execute them by calling the ROS action with the name of the Tree to execute.
As I wrote this tool some of my goals were to:
ros2 param get action_server_bt plugins
ros2 param set action_server_bt plugins [....]
The user can create Behavior plugins by implementing the BT_REGISTER_NODES(factory) or CreateRosNodePlugin(MyClassName, "MyClassName") functions inside the .cpp file of the Behavior. When building the package they can create the shared object with
target_compile_definitions(my_plugin_target PRIVATE BT_PLUGIN_EXPORT )
and export them to a location that is easy for other packages to find.Once the plugins have been built the user can create a yaml file for ActionServer.BT to load. They can specify as many
package_name/subfolder
directories as they wish to load all of the Behaviors needed for their system (see here for documentation on the plugin yaml parameters). They can also load a list of directories that contain BehaviorTree.xml files to load.** Not supported right now but I may extend the
package_name/subfolder
lists to also allow users to setpackage_name/subfolder/plugin_name
so that they have complete control over the plugins they wish to load.As ActionServer.BT starts it will print the name of the ROS action that the user has chosen and a list of plugins/BehaviorTree.xml files it has loaded into the factory.
Now that the system is running you can call the Action from other programs or from the command line.
To call the CrossDoor Behavior tree:
ros2 action send_goal /behavior_server action_server_bt_msgs/action/ActionTree "{target_tree: CrossDoor}"
or you can also try the ROS based SleepActionSample:
ros2 action send_goal /behavior_server action_server_bt_msgs/action/ActionTree "{target_tree: SleepActionSample}"
Please let me know if you have any questions or suggestions on this proposal.
Marq
Beta Was this translation helpful? Give feedback.
All reactions