Go to the documentation of this file.
13 #ifndef ACTION_SETBLACKBOARD_NODE_H
14 #define ACTION_SETBLACKBOARD_NODE_H
47 return {
InputPort(
"value",
"Value to be written int othe output_key"),
49 "value should be written") };
55 std::string output_key;
56 if(!
getInput(
"output_key", output_key))
66 std::shared_ptr<Blackboard::Entry> dst_entry =
71 const auto input_key = std::string(stripped_key);
72 std::shared_ptr<Blackboard::Entry> src_entry =
77 throw RuntimeError(
"Can't find the port referred by [value]");
85 out_value = src_entry->value;
97 if(dst_entry && dst_entry->info.type() !=
typeid(std::string) && out_value.
isString())
101 out_value = dst_entry->info.parseString(out_value.
cast<std::string>());
103 catch(
const std::exception& e)
105 throw LogicError(
"Can't convert string [", out_value.
cast<std::string>(),
Result getInput(const std::string &key, T &destination) const
std::string demangle(char const *name)
const NodeConfig & config() const
std::string_view StringView
SetBlackboardNode(const std::string &name, const NodeConfig &config)
std::pair< std::string, PortInfo > InputPort(StringView name, StringView description={})
PortsRemapping input_ports
The SetBlackboard is action used to store a string into an entry of the Blackboard specified in "outp...
std::pair< std::string, PortInfo > BidirectionalPort(StringView name, StringView description={})
Blackboard::Ptr blackboard
std::unordered_map< std::string, PortInfo > PortsList
static PortsList providedPorts()
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
bool empty() const noexcept
void setRegistrationID(StringView ID)
const std::string & name() const
Name of the instance, not the type.
static bool isBlackboardPointer(StringView str, StringView *stripped_pointer=nullptr)
Check a string and return true if it matches the pattern: {...}.
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...