Skip to content

Commit 4961998

Browse files
Merge pull request #703 from galou/export_xsd
Export xsd
2 parents 7b95a8a + 73266bf commit 4961998

File tree

3 files changed

+328
-11
lines changed

3 files changed

+328
-11
lines changed

include/behaviortree_cpp/tree_node.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@ inline Result TreeNode::getInput(const std::string& key, T& destination) const
399399
auto remap_it = config().input_ports.find(key);
400400
if (remap_it == config().input_ports.end())
401401
{
402-
return nonstd::make_unexpected(StrCat("getInput() failed because "
402+
return nonstd::make_unexpected(StrCat("getInput() of node `", fullPath(),
403+
"` failed because "
403404
"NodeConfig::input_ports "
404405
"does not contain the key: [",
405406
key, "]"));

include/behaviortree_cpp/xml_parsing.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ void VerifyXML(const std::string& xml_text,
6060
std::string writeTreeNodesModelXML(const BehaviorTreeFactory& factory,
6161
bool include_builtin = false);
6262

63+
/**
64+
* @brief writeTreeXSD generates an XSD for the nodes defined in the factory
65+
*
66+
* @param factory the factory with the registered types
67+
*
68+
* @return string containing the XML.
69+
*/
70+
[[nodiscard]]
71+
std::string writeTreeXSD(const BehaviorTreeFactory& factory);
72+
6373
/**
6474
* @brief WriteTreeToXML create a string that contains the XML that corresponds to a given tree.
6575
* When using this function with a logger, you should probably set both add_metadata and

0 commit comments

Comments
 (0)