31 #include <ArmarXCore/interface/core/RemoteObjectNode.h>
33 #include <RobotComponents/interface/components/MotionPlanning/Tasks/PathCollection/Task.h>
35 #include "../MotionPlanningTask.h"
36 #include "../../util/Metrics.h"
45 public virtual TaskBase,
49 Task(
const std::string& taskName =
"PathCollection")
51 this->taskName = taskName;
54 ~Task()
override =
default;
57 PathWithCost
getPathWithCost(
const Ice::Current& = Ice::emptyCurrent)
const override
65 Path getPath(
const Ice::Current& = Ice::emptyCurrent)
const override
70 void abortTask(
const Ice::Current& = Ice::emptyCurrent)
override
74 CSpaceBasePtr
getCSpace(
const Ice::Current& = Ice::emptyCurrent)
const override
83 void run(
const RemoteObjectNodePrxList&,
const Ice::Current& = Ice::emptyCurrent)
override;
87 return maximalPlanningTimeInSeconds;
94 PathWithCost
getBestPath(
const Ice::Current& = Ice::emptyCurrent)
const override
100 if (
static_cast<std::size_t
>(n) < paths.size())
104 return {{}, std::numeric_limits<float>::infinity(),
"Path_" +
to_string(n)};
114 for (std::size_t i = 0; i + 1 < p.nodes.size(); ++i)
116 len +=
euclideanDistance(p.nodes.at(i).begin(), p.nodes.at(i).end(), p.nodes.at(i + 1).begin());
118 addPath(PathWithCost {std::move(p.nodes), len, std::move(p.pathName)});
122 paths.emplace_back(std::move(p));