KrisLibrary  1.0.0
TimedPath.h
1 #ifndef ROBOTICS_TIMED_PATH_H
2 #define ROBOTICS_TIMED_PATH_H
3 
4 #include "Path.h"
5 
7 {
8 public:
9  bool Empty() const { return edges.empty(); }
10  bool IsConstant() const { return edges.size()==1 && edges[0]->Start()==edges[0]->End(); }
11  CSpace* Space() const { return edges[0]->Space(); }
12  const Config& Begin() const { return edges[0]->Start(); }
13  const Config& End() const { return edges.back()->End(); }
14  inline int NumMilestones() const { return edges.size()+1; }
15  inline const Config& GetMilestone(int i) const {
16  if(i<(int)edges.size()) return edges[i]->Start();
17  else return End();
18  }
19  virtual Real Length() const;
20  virtual void Eval(Real t,Config& q) const { Eval2(t,q); }
21  virtual Real ParamStart() const { return 0.0; }
22  virtual Real ParamEnd() const;
23 
24  void SetConstant(const Config& q,CSpace* space);
25  void Set(const MilestonePath& path,int timeIndex=-1);
26  void Set(const EdgePlannerPtr& e,int timeIndex=-1);
27  void Append(const EdgePlannerPtr& e,int timeIndex=-1);
28  void AppendDelay(Real t);
29  void Clear();
30  void Concat(const TimedMilestonePath& path);
31  //returns the edge index (-1 if before the path begins, or edges.size() if after the path ends)
32  int Eval2(Real t,Config& q) const;
33  void Split(Real time,TimedMilestonePath& before,TimedMilestonePath& after) const;
34 
35  std::vector<EdgePlannerPtr> edges;
36  std::vector<Real> durations;
37 };
38 
39 #endif
40 
Vector Config
an alias for Vector
Definition: RobotKinematics3D.h:14
Motion planning configuration space base class. The configuration space implements an interpolation s...
Definition: CSpace.h:34
A sequence of locally planned paths between milestones.
Definition: planning/Path.h:15
A base class for all 1D interpolators.
Definition: Interpolator.h:10
Definition: TimedPath.h:6