diff --git a/include/behaviortree_cpp/tree_node.h b/include/behaviortree_cpp/tree_node.h index 537176519..65a677dbf 100644 --- a/include/behaviortree_cpp/tree_node.h +++ b/include/behaviortree_cpp/tree_node.h @@ -585,10 +585,12 @@ inline Result TreeNode::setOutput(const std::string& key, const T& value) if constexpr(std::is_same_v) { - if(config().manifest->ports.at(key).type() != typeid(BT::Any)) + const std::type_index type = config().manifest->ports.at(key).type(); + if(type != typeid(BT::Any) && type != typeid(BT::AnyTypeAllowed)) { - throw LogicError("setOutput is not allowed, unless the port " - "was declared using OutputPort"); + throw LogicError("setOutput is not allowed, unless the port " + "was declared using OutputPort or " + "OutputPort"); } }