From 0165d7bc22626aff2f53bad98c895178cf821dc2 Mon Sep 17 00:00:00 2001 From: b-adkins Date: Fri, 1 Nov 2024 00:41:28 -0700 Subject: [PATCH 1/7] Improved XML parsing error message to say where in the XML the offending port is found. (#876) Example output: a port with name [ball_pose] is found in the XML (, line 7) but not in the providedPorts() of its registered node type. --- src/xml_parsing.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xml_parsing.cpp b/src/xml_parsing.cpp index 2e950e4d9..32a1e42ab 100644 --- a/src/xml_parsing.cpp +++ b/src/xml_parsing.cpp @@ -667,8 +667,10 @@ TreeNode::Ptr XMLParser::PImpl::createNodeFromXML(const XMLElement* element, if(port_model_it == manifest->ports.end()) { throw RuntimeError(StrCat("a port with name [", port_name, - "] is found in the XML, but not in the " - "providedPorts()")); + "] is found in the XML (<", element->Name(), + ">, line ", std::to_string(att->GetLineNum()), + ") but not in the providedPorts() of its " + "registered node type.")); } else { From 2bc72fdbf67bae7a4561cc0cea50b723d5acb672 Mon Sep 17 00:00:00 2001 From: Antoine Hoarau Date: Fri, 1 Nov 2024 08:42:04 +0100 Subject: [PATCH 2/7] put minitrace in the build_interface link library (#874) fixes the cmake export set when building behavior tree on standard cmake: CMake Error: install(EXPORT "behaviortree_cppTargets" ...) includes target "behaviortree_cpp" which requires target "minitrace" that is not in any export set. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16993735a..722e102b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,7 +165,7 @@ target_link_libraries(${BTCPP_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS} $ - minitrace + $ PUBLIC ${BTCPP_EXTRA_LIBRARIES} ) From 945a34d093a4319a77218aaf5d9db51edbcdacca Mon Sep 17 00:00:00 2001 From: Michele Tartari <37861893+m-tartari@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:23:35 +0100 Subject: [PATCH 3/7] fix(examples): update t11_groot_howto log filename (#886) --- examples/t11_groot_howto.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/t11_groot_howto.cpp b/examples/t11_groot_howto.cpp index da974947c..14713cbac 100644 --- a/examples/t11_groot_howto.cpp +++ b/examples/t11_groot_howto.cpp @@ -120,7 +120,7 @@ int main() // Both formats are compatible with Groot2 // Logging with lightweight serialization - BT::FileLogger2 logger2(tree, "t12_logger2.btlog"); + BT::FileLogger2 logger2(tree, "t11_groot_howto.btlog"); BT::MinitraceLogger minilog(tree, "minitrace.json"); while(1) From f5e98fd751523fd2797e5353cb9f1cc765587cb4 Mon Sep 17 00:00:00 2001 From: Tony Najjar Date: Mon, 25 Nov 2024 16:20:31 +0100 Subject: [PATCH 4/7] Expose return value of wait_for (#887) --- include/behaviortree_cpp/bt_factory.h | 12 ++++++++---- src/bt_factory.cpp | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/behaviortree_cpp/bt_factory.h b/include/behaviortree_cpp/bt_factory.h index 99b27d4ba..f7d7a8b1c 100644 --- a/include/behaviortree_cpp/bt_factory.h +++ b/include/behaviortree_cpp/bt_factory.h @@ -118,10 +118,14 @@ class Tree [[nodiscard]] TreeNode* rootNode() const; - /// Sleep for a certain amount of time. - /// This sleep could be interrupted by the method - /// TreeNode::emitWakeUpSignal() - void sleep(std::chrono::system_clock::duration timeout); + /** + * @brief Sleep for a certain amount of time. This sleep could be interrupted by the method TreeNode::emitWakeUpSignal() + * + * @param timeout duration of the sleep + * @return true if the timeout was NOT reached and the signal was received. + * + * */ + bool sleep(std::chrono::system_clock::duration timeout); ~Tree(); diff --git a/src/bt_factory.cpp b/src/bt_factory.cpp index 30fa25e2b..acf39492c 100644 --- a/src/bt_factory.cpp +++ b/src/bt_factory.cpp @@ -586,9 +586,10 @@ TreeNode* Tree::rootNode() const return subtree_nodes.empty() ? nullptr : subtree_nodes.front().get(); } -void Tree::sleep(std::chrono::system_clock::duration timeout) +bool Tree::sleep(std::chrono::system_clock::duration timeout) { - wake_up_->waitFor(std::chrono::duration_cast(timeout)); + return wake_up_->waitFor( + std::chrono::duration_cast(timeout)); } Tree::~Tree() From 40d535d3de793936f3884bb34d66ca60b7cd9a45 Mon Sep 17 00:00:00 2001 From: Aglargil <34728006+Aglargil@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:20:20 +0800 Subject: [PATCH 5/7] fix script parse error while 'A==-1' (#896) Co-authored-by: wangzheng --- examples/t09_scripting.cpp | 2 +- include/behaviortree_cpp/scripting/operators.hpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/t09_scripting.cpp b/examples/t09_scripting.cpp index c8be35c5a..bca9774bb 100644 --- a/examples/t09_scripting.cpp +++ b/examples/t09_scripting.cpp @@ -10,7 +10,7 @@ static const char* xml_text = R"(