Loading files
#include "actions/do_something.hpp"
DoSomething::DoSomething(
const std::string &name,
const BT::NodeConfiguration &config,
rclcpp::Node *parent
)
: BT::SyncActionNode(name, config), parent_{parent} {}
BT::PortsList DoSomething::providedPorts() {
return {BT::InputPort<std::string>("target")};
}
BT::NodeStatus DoSomething::tick() {
auto target = getInput<std::string>("target").value_or("world");
RCLCPP_INFO(
parent_->get_logger(), "[DoSomething] working on %s", target.c_str()
);
std::this_thread::sleep_for(std::chrono::milliseconds(50));
return BT::NodeStatus::SUCCESS;
}6854ad9caThis file is pinned to the selected release. Download the original to open it in your design tool.