Skip to content

Commit bc62aa5

Browse files
ajtudelaSakshayMahna
authored andcommitted
Remove unused code in BT utils (ros-navigation#5048)
* Clean set port Signed-off-by: Alberto Tudela <[email protected]> * Remove set Signed-off-by: Alberto Tudela <[email protected]> --------- Signed-off-by: Alberto Tudela <[email protected]> Signed-off-by: Sakshay Mahna <[email protected]>
1 parent d01728e commit bc62aa5

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

nav2_behavior_tree/include/nav2_behavior_tree/bt_utils.hpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -210,24 +210,6 @@ inline std::chrono::milliseconds convertFromString<std::chrono::milliseconds>(co
210210
return std::chrono::milliseconds(std::stoul(key.data()));
211211
}
212212

213-
/**
214-
* @brief Parse XML string to std::set<int>
215-
* @param key XML string
216-
* @return std::set<int>
217-
*/
218-
template<>
219-
inline std::set<int> convertFromString(StringView key)
220-
{
221-
// Real numbers separated by semicolons
222-
auto parts = splitString(key, ';');
223-
224-
std::set<int> set;
225-
for (const auto part : parts) {
226-
set.insert(convertFromString<int>(part));
227-
}
228-
return set;
229-
}
230-
231213
/**
232214
* @brief Return parameter value from behavior tree node or ros2 parameter file.
233215
* @param node rclcpp::Node::SharedPtr

nav2_behavior_tree/test/test_bt_utils.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <gtest/gtest.h>
1717
#include <memory>
1818
#include <chrono>
19-
#include <set>
2019

2120
#include "geometry_msgs/msg/point.hpp"
2221
#include "geometry_msgs/msg/quaternion.hpp"
@@ -419,29 +418,6 @@ TEST(MillisecondsPortTest, test_correct_syntax)
419418
EXPECT_EQ(value.count(), 123);
420419
}
421420

422-
TEST(ErrorCodePortTest, test_correct_syntax)
423-
{
424-
std::string xml_txt =
425-
R"(
426-
<root BTCPP_format="4">
427-
<BehaviorTree ID="MainTree">
428-
<ErrorCodePort test="100;204;212"/>
429-
</BehaviorTree>
430-
</root>)";
431-
432-
BT::BehaviorTreeFactory factory;
433-
factory.registerNodeType<TestNode<std::set<int>>>("ErrorCodePort");
434-
auto tree = factory.createTreeFromText(xml_txt);
435-
436-
tree = factory.createTreeFromText(xml_txt);
437-
std::set<int> value;
438-
tree.rootNode()->getInput("test", value);
439-
440-
EXPECT_TRUE(value.find(100) != value.end());
441-
EXPECT_TRUE(value.find(204) != value.end());
442-
EXPECT_TRUE(value.find(212) != value.end());
443-
}
444-
445421
TEST(deconflictPortAndParamFrameTest, test_correct_syntax)
446422
{
447423
std::string xml_txt =

0 commit comments

Comments
 (0)