| 132 | } |
| 133 | |
| 134 | void 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 | |
| 162 | void RegisterBehaviorTrees(bt_server::Params& params, BT::BehaviorTreeFactory& factory, |
| 163 | rclcpp::Node::SharedPtr node) |
no test coverage detected