MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.ROS2 / RegisterPlugins

Function RegisterPlugins

behaviortree_ros2/src/bt_utils.cpp:134–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void RegisterPlugins(bt_server::Params& params, BT::BehaviorTreeFactory& factory,
135 rclcpp::Node::SharedPtr node)
136{
137 BT::RosNodeParams ros_params;
138 ros_params.nh = node;
139 ros_params.server_timeout = std::chrono::milliseconds(params.ros_plugins_timeout);
140 ros_params.wait_for_server_timeout = ros_params.server_timeout;
141
142 for(const auto& plugin : params.plugins)
143 {
144 const auto plugin_directory = GetDirectoryPath(plugin);
145 // skip invalid plugins directories
146 if(plugin_directory.empty())
147 {
148 continue;
149 }
150 using std::filesystem::directory_iterator;
151
152 for(const auto& entry : directory_iterator(plugin_directory))
153 {
154 if(entry.path().extension() == ".so")
155 {
156 LoadPlugin(factory, entry.path(), ros_params);
157 }
158 }
159 }
160}
161
162void RegisterBehaviorTrees(bt_server::Params& params, BT::BehaviorTreeFactory& factory,
163 rclcpp::Node::SharedPtr node)

Callers 1

executeRegistrationMethod · 0.85

Calls 2

GetDirectoryPathFunction · 0.85
LoadPluginFunction · 0.85

Tested by

no test coverage detected