Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 930ff41

Browse files
committed
Fix writeTreeNodesModelXML
Signed-off-by: Gaël Écorchard <[email protected]>
1 parent 4603c1c commit 930ff41

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/behaviortree_cpp/tree_node.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,12 @@ inline void assignDefaultRemapping(NodeConfig& config)
450450
const auto direction = it.second.direction();
451451
if (direction != PortDirection::OUTPUT)
452452
{
453+
// PortDirection::{INPUT,INOUT}
453454
config.input_ports[port_name] = "=";
454455
}
455456
if (direction != PortDirection::INPUT)
456457
{
458+
// PortDirection::{OUTPUT,INOUT}
457459
config.output_ports[port_name] = "=";
458460
}
459461
}

src/xml_parsing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ void addNodeModelToXML(const TreeNodeManifest& model,
886886
{
887887
port_element->SetAttribute("type", BT::demangle(port_info.type()).c_str());
888888
}
889-
if (!port_info.defaultValue())
889+
if (port_info.defaultValue().has_value())
890890
{
891891
port_element->SetAttribute("default", port_info.defaultValue()->c_str());
892892
}

0 commit comments

Comments
 (0)