From 1b2f264b83b325bc247870a9e411f9c8b1cbb9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20M=C3=BCller?= Date: Tue, 10 Dec 2024 21:42:40 +0000 Subject: [PATCH] Make suggested change to TreeNode::setOuput --- include/behaviortree_cpp/tree_node.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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"); } }