30 #include "../../util/Metrics.h"
34 const armarx::rrtconnect::NodeId armarx::rrtconnect::Tree::ROOT_NODE_ID
42 if (nodes.at(0).empty())
48 nodes.at(0).at(0).cfg = root;
54 std::vector<ConfigType> path;
55 while (nodeId != ROOT_NODE_ID)
57 const auto& node = getNode(nodeId);
58 path.emplace_back(node.cfg);
61 path.emplace_back(getNode(ROOT_NODE_ID).cfg);
67 std::vector<ConfigType> path = getReversedPathTo(nodeId);
74 float minDistance = std::numeric_limits<float>::infinity();
76 for (std::size_t workerId = 0; workerId < nodes.size(); ++workerId)
78 const auto& workerNodes = nodes.at(workerId);
79 for (std::size_t nodeSubId = 0; nodeSubId < workerNodes.size(); ++nodeSubId)
81 NodeId currentNodeId {
static_cast<Ice::Long>(workerId),
static_cast<Ice::Long>(nodeSubId)};
82 const auto& node = getNode(currentNodeId);
83 float currentDistance =
euclideanDistance(cfg.data(), cfg.data() + cfg.size(), node.cfg.data());
84 if (currentDistance < minDistance)
86 minDistance = currentDistance;
87 nearesNode = currentNodeId;