44 namespace task_constructor {
46 class ContainerBasePrivate;
52 using pointer = std::unique_ptr<ContainerBase>;
56 bool pruning()
const {
return properties().
get<
bool>(
"pruning"); }
58 size_t numChildren()
const;
59 Stage* findChild(
const std::string& name)
const;
60 Stage* operator[](
int index)
const;
71 void add(Stage::pointer&& stage);
73 virtual void insert(Stage::pointer&& stage,
int before = -1);
74 virtual Stage::pointer remove(
int pos);
75 virtual Stage::pointer remove(
Stage* child);
79 void init(
const moveit::core::RobotModelConstPtr& robot_model)
override;
81 virtual bool canCompute()
const = 0;
82 virtual void compute() = 0;
83 void explainFailure(std::ostream& os)
const override;
91 std::ostream& operator<<(std::ostream& os,
const ContainerBase& stage);
93 class SerialContainerPrivate;
101 bool canCompute()
const override;
102 void compute()
override;
110 class ParallelContainerBasePrivate;
153 bool canCompute()
const override;
154 void compute()
override;
159 class FallbacksPrivate;
168 inline void replaceImpl();
172 Fallbacks(
const std::string& name =
"fallbacks");
174 void reset()
override;
175 void init(
const moveit::core::RobotModelConstPtr& robot_model)
override;
183 bool canCompute()
const final {
return false; }
184 void compute()
final {}
193 Merger(
const std::string& name =
"merger");
195 void reset()
override;
196 void init(
const core::RobotModelConstPtr& robot_model)
override;
197 bool canCompute()
const override;
198 void compute()
override;
201 Merger(MergerPrivate* impl);
205 class WrapperBasePrivate;
217 WrapperBase(
const std::string& name =
"wrapper", Stage::pointer&& child = Stage::pointer());
220 void insert(Stage::pointer&& stage,
int before = -1)
override;
226 bool canCompute()
const override;
227 void compute()
override;
230 WrapperBase(WrapperBasePrivate* impl, Stage::pointer&& child = Stage::pointer());
Definition: container.h:149
void onNewSolution(const SolutionBase &s) override
called by a (direct) child when a new solution becomes available
Definition: container.cpp:858
Definition: container.h:49
void reset() override
reset stage, clearing all solutions, interfaces, inherited properties.
void init(const moveit::core::RobotModelConstPtr &robot_model) override
bool traverseRecursively(const StageCallback &processor) const
traverse all children of this container recursively
std::function< bool(const Stage &, unsigned int)> StageCallback
Definition: container.h:65
bool traverseChildren(const StageCallback &processor) const
traverse direct children of this container, calling the callback for each of them
void setPruning(bool pruning)
Explicitly enable/disable pruning.
Definition: container.h:55
virtual void onNewSolution(const SolutionBase &s)=0
called by a (direct) child when a new solution becomes available
Definition: container.h:167
void init(const moveit::core::RobotModelConstPtr &robot_model) override
Definition: container.cpp:871
void reset() override
reset stage, clearing all solutions, interfaces, inherited properties.
Definition: container.cpp:866
void onNewSolution(const SolutionBase &s) override
called by a (direct) child when a new solution becomes available
Definition: container.cpp:876
Definition: container.h:190
void onNewSolution(const SolutionBase &s) override
called by a (direct) child when a new solution becomes available
Definition: container.cpp:1147
void reset() override
reset stage, clearing all solutions, interfaces, inherited properties.
Definition: container.cpp:1121
Definition: container.h:120
void liftSolution(const SolutionBase &solution, double cost)
lift child solution to external interface, adapting the costs
Definition: container.h:131
void sendBackward(InterfaceState &&from, const InterfaceState &to, SubTrajectory &&trajectory)
propagate a solution backwards
Definition: container.cpp:811
void liftSolution(const SolutionBase &solution)
lift unmodified child solution (useful for simple filtering)
Definition: container.h:129
void sendForward(const InterfaceState &from, InterfaceState &&to, SubTrajectory &&trajectory)
propagate a solution forwards
Definition: container.cpp:807
void spawn(InterfaceState &&state, SubTrajectory &&trajectory)
spawn a new solution with given state as start and end
Definition: container.cpp:803
const boost::any & get(const std::string &name) const
Get the value of a property. Throws undeclared if unknown name.
Definition: properties.cpp:254
Definition: container.h:96
void onNewSolution(const SolutionBase &s) override
called by a (direct) child when a new solution becomes available
Definition: container.cpp:511
abstract base class for solutions (primitive and sequences)
Definition: storage.h:269
PropertyMap & properties()
Get the stage's property map.
Definition: stage.cpp:444
Stage(StagePrivate *impl)
Stage can only be instantiated through derived classes.
Definition: stage.cpp:309
void setProperty(const std::string &name, const boost::any &value)
Set a previously declared property to a new value.
Definition: stage.cpp:448
SubTrajectory connects interface states of ComputeStages.
Definition: storage.h:348
Definition: container.h:214
Stage * wrapped()
access the single wrapped child, NULL if still empty
Definition: container.cpp:833
void insert(Stage::pointer &&stage, int before=-1) override
insertion is only allowed if children() is empty
Definition: container.cpp:826