26 #include "../../CSpace/CSpace.h"
52 catch (Ice::Exception& e)
54 ARMARX_ERROR_S <<
"The worker thread of worker " << workerId <<
" had an Ice::Exception! \nStack trace:\n"
55 << e.ice_stackTrace();
72 <<
"] request for update " << updateId <<
" (of " <<
localUpdates.size() <<
")";
119 cspace->initCollisionTest();
122 const auto cspaceDims = cspace->getDimensionsBounds();
123 std::vector<std::pair<float, float>> dimensionBounds {};
126 cspaceDims.begin(), cspaceDims.end(),
127 std::back_inserter(dimensionBounds),
128 [](
const FloatRange & dim)
130 return std::make_pair(dim.min, dim.max);
143 auto cspaceDerived = CSpacePtr::dynamicCast(cspace);
151 return cspaceDerived->isCollisionFree(cfg);
177 (*sampler)(randomCfg.data());
179 const auto nearId = primTree.getNearestNeighbour(randomCfg);
180 const auto& nearNode = primTree.getNode(nearId);
182 const auto reachCfg = steer(nearNode.cfg, randomCfg);
183 if (reachCfg != nearNode.cfg)
188 const auto nearSecondId = secnTree.getNearestNeighbour(reachCfg);
189 const auto& nearSecondNode = secnTree.getNode(nearSecondId);
191 const auto reachSecondCfg = steer(nearSecondNode.cfg, reachCfg);
192 if (reachSecondCfg != nearSecondNode.cfg)
196 if (reachSecondCfg == reachCfg)
206 std::move(pPart2.begin(), pPart2.end(), std::back_inserter(p));
207 task->setPath({p,
"Path"});
220 task->workerHasAborted(workerId);
248 cspace->initCollisionTest();
250 tree.addNode(cfg, parent, workerId);
254 localUpdates.back().updatesPerTree.at(treeId).nodes.emplace_back(NodeCreationUpdate {cfg, parent});
257 return {workerId,
static_cast<Ice::Long>(tree.getNodes().at(workerId).size()) - 1};