Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions nav2_behavior_tree/include/nav2_behavior_tree/bt_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,24 +210,6 @@ inline std::chrono::milliseconds convertFromString<std::chrono::milliseconds>(co
return std::chrono::milliseconds(std::stoul(key.data()));
}

/**
* @brief Parse XML string to std::set<int>
* @param key XML string
* @return std::set<int>
*/
template<>
inline std::set<int> convertFromString(StringView key)
{
// Real numbers separated by semicolons
auto parts = splitString(key, ';');

std::set<int> set;
for (const auto part : parts) {
set.insert(convertFromString<int>(part));
}
return set;
}

/**
* @brief Return parameter value from behavior tree node or ros2 parameter file.
* @param node rclcpp::Node::SharedPtr
Expand Down
24 changes: 0 additions & 24 deletions nav2_behavior_tree/test/test_bt_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <gtest/gtest.h>
#include <memory>
#include <chrono>
#include <set>

#include "geometry_msgs/msg/point.hpp"
#include "geometry_msgs/msg/quaternion.hpp"
Expand Down Expand Up @@ -419,29 +418,6 @@ TEST(MillisecondsPortTest, test_correct_syntax)
EXPECT_EQ(value.count(), 123);
}

TEST(ErrorCodePortTest, test_correct_syntax)
{
std::string xml_txt =
R"(
<root BTCPP_format="4">
<BehaviorTree ID="MainTree">
<ErrorCodePort test="100;204;212"/>
</BehaviorTree>
</root>)";

BT::BehaviorTreeFactory factory;
factory.registerNodeType<TestNode<std::set<int>>>("ErrorCodePort");
auto tree = factory.createTreeFromText(xml_txt);

tree = factory.createTreeFromText(xml_txt);
std::set<int> value;
tree.rootNode()->getInput("test", value);

EXPECT_TRUE(value.find(100) != value.end());
EXPECT_TRUE(value.find(204) != value.end());
EXPECT_TRUE(value.find(212) != value.end());
}

TEST(deconflictPortAndParamFrameTest, test_correct_syntax)
{
std::string xml_txt =
Expand Down
Loading