mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
- allow hierarchical organization of stages (serially for now) - validate correctness of tree (at composition time, i.e. runtime) - derive Task from SerialContainer - fix pimpl_func(), PRIVATE_CLASS declaration in "public" section to allow access in tests
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "subtask.h"
|
|
|
|
namespace moveit { namespace task_constructor {
|
|
|
|
class ContainerBasePrivate;
|
|
class ContainerBase : public SubTask
|
|
{
|
|
public:
|
|
PRIVATE_CLASS(ContainerBase)
|
|
typedef std::unique_ptr<SubTask> value_type;
|
|
|
|
typedef std::function<bool(const SubTask&, int depth)> StageCallback;
|
|
typedef std::function<bool(const std::vector<SubTrajectory*>&)> SolutionCallback;
|
|
|
|
virtual bool canInsert(const value_type& stage, int before = -1) const = 0;
|
|
virtual bool insert(value_type&& stage, int before = -1) = 0;
|
|
virtual void clear();
|
|
|
|
bool traverseStages(const StageCallback &processor) const;
|
|
|
|
protected:
|
|
ContainerBase(ContainerBasePrivate* impl);
|
|
};
|
|
|
|
class SerialContainerPrivate;
|
|
class SerialContainer : public ContainerBase
|
|
{
|
|
public:
|
|
PRIVATE_CLASS(SerialContainer)
|
|
SerialContainer(const std::string& name);
|
|
|
|
bool canInsert(const value_type& stage, int before = -1) const override;
|
|
bool insert(value_type&& stage, int before = -1) override;
|
|
|
|
bool canCompute() const override;
|
|
bool compute() override;
|
|
|
|
protected:
|
|
SerialContainer(SerialContainerPrivate* impl);
|
|
};
|
|
|
|
} }
|