32 #include "../../util/Metrics.h"
34 const armarx::rrtconnect::NodeId armarx::rrtconnect::Tree::ROOT_NODE_ID{0, 0};
40 if (nodes.at(0).empty())
46 nodes.at(0).at(0).cfg = root;
50 std::vector<armarx::rrtconnect::Tree::ConfigType>
53 std::vector<ConfigType> path;
54 while (nodeId != ROOT_NODE_ID)
56 const auto& node = getNode(nodeId);
57 path.emplace_back(node.cfg);
60 path.emplace_back(getNode(ROOT_NODE_ID).cfg);
64 std::vector<armarx::rrtconnect::Tree::ConfigType>
67 std::vector<ConfigType> path = getReversedPathTo(nodeId);
72 armarx::rrtconnect::NodeId
75 float minDistance = std::numeric_limits<float>::infinity();
77 for (std::size_t workerId = 0; workerId < nodes.size(); ++workerId)
79 const auto& workerNodes = nodes.at(workerId);
80 for (std::size_t nodeSubId = 0; nodeSubId < workerNodes.size(); ++nodeSubId)
82 NodeId currentNodeId{
static_cast<Ice::Long>(workerId),
84 const auto& node = getNode(currentNodeId);
85 float currentDistance =
87 if (currentDistance < minDistance)
89 minDistance = currentDistance;
90 nearesNode = currentNodeId;