Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DESCARTES_CORE_PATH_PLANNER_BASE_H_
00009 #define DESCARTES_CORE_PATH_PLANNER_BASE_H_
00010
00011 #include <descartes_core/trajectory_pt.h>
00012 #include <descartes_core/robot_model.h>
00013 #include <vector>
00014
00015 namespace descartes_core
00016 {
00017 namespace PlannerErrors
00018 {
00019 enum PlannerError
00020 {
00021 OK = 1,
00022 IK_NOT_AVAILABLE = -1,
00023 FX_NOT_AVAILABLE = -2,
00024 SELF_COLLISION_FOUND = -3,
00025 ENVIRONMENT_COLLISION_FOUND = -4,
00026 PLANNING_TIMEOUT = -5,
00027 EMPTY_PATH = -6,
00028 SPEED_LIMIT_EXCEEDED = -7,
00029 ACCELERATION_LIMIT_EXCEEDED = -8,
00030 MAX_TRAJECTORY_SIZE_EXCEEDED = -9,
00031 UNINITIALIZED = -10,
00032 INVALID_ID = -11,
00033 INCOMPLETE_PATH = -12,
00034 INVALID_CONFIGURATION_PARAMETER = -13,
00035 UKNOWN = -99
00036 };
00037 }
00038 typedef PlannerErrors::PlannerError PlannerError;
00039
00040 typedef std::map<std::string, std::string> PlannerConfig;
00041
00042 DESCARTES_CLASS_FORWARD(PathPlannerBase);
00043 class PathPlannerBase
00044 {
00045 public:
00046 virtual ~PathPlannerBase()
00047 {
00048 }
00049
00055 virtual bool initialize(RobotModelConstPtr model) = 0;
00056
00061 virtual bool setConfig(const PlannerConfig& config) = 0;
00062
00067 virtual void getConfig(PlannerConfig& config) const = 0;
00068
00074 virtual bool planPath(const std::vector<TrajectoryPtPtr>& traj) = 0;
00075
00080 virtual bool getPath(std::vector<TrajectoryPtPtr>& path) const = 0;
00081
00086 virtual bool addAfter(const TrajectoryPt::ID& ref_id, TrajectoryPtPtr tp) = 0;
00087
00092 virtual bool addBefore(const TrajectoryPt::ID& ref_id, TrajectoryPtPtr tp) = 0;
00093
00098 virtual bool remove(const TrajectoryPt::ID& ref_id) = 0;
00099
00104 virtual bool modify(const TrajectoryPt::ID& ref_id, TrajectoryPtPtr tp) = 0;
00105
00109 virtual int getErrorCode() const = 0;
00110
00115 virtual bool getErrorMessage(int error_code, std::string& msg) const = 0;
00116
00117 protected:
00118 PathPlannerBase()
00119 {
00120 }
00121 };
00122 }
00123
00124 #endif