Klamp't  0.8.1
4 #include "JointTrackingController.h"
5 #include <Klampt/Modeling/DynamicPath.h>
6 #include <KrisLibrary/spline/PiecewisePolynomial.h>
7 #include <list>
38 {
39 public:
41  virtual ~PolynomialMotionQueue() {}
44  void SetLimits(const Robot& robot);
46  void SetConstant(const Config& x);
48  void SetPath(const Spline::PiecewisePolynomialND& path);
50  void SetPath(const ParabolicRamp::DynamicPath& path);
53  void SetPiecewiseLinear(const vector<Config>& milestones,const vector<Real>& times);
56  void SetPiecewiseCubic(const vector<Config>& milestones,const vector<Vector>& velocities,const vector<Real>& times);
60  void SetPiecewiseLinearRamp(const vector<Config>& milestones);
62  void Advance(Real dt);
66  void Append(const Spline::PiecewisePolynomialND& path);
68  void Append(const ParabolicRamp::DynamicPath& path);
71  void AppendLinear(const Config& config,Real dt);
74  void AppendCubic(const Config& x,const Config& v,Real dt);
76  void AppendRamp(const Config& x);
79  void AppendLinearRamp(const Config& x);
82  void AppendRamp(const Config& x,const Vector& v);
84  void GetPath(Spline::PiecewisePolynomialND& path) const;
87  void Cut(Real time,bool relative=true);
89  Real CurTime() const;
91  Config CurConfig() const;
93  Config CurVelocity() const;
95  Config Endpoint() const;
97  Vector EndpointVelocity() const;
100  void Eval(Real time,Config& x,bool relative=true) const;
103  void Deriv(Real time,Config& dx,bool relative=true) const;
105  bool Done() const;
107  Real TimeRemaining() const;
109  Real pathOffset;
110  Spline::PiecewisePolynomialND path;
114  Vector qMin,qMax,velMax,accMax;
115 };
124 {
125  public:
127  virtual ~PolynomialPathController() {}
129  virtual const char* Type() const { return "PolynomialPathController"; }
130  virtual void GetDesiredState(Config& q_des,Vector& dq_des);
131  virtual void Update(Real dt);
132  virtual void Reset();
133  virtual bool ReadState(File& f);
134  virtual bool WriteState(File& f) const;
136  //commands
137  virtual vector<string> Commands() const;
138  virtual bool SendCommand(const string& name,const string& str);
139 };
141 #endif
void Eval(Real time, Config &x, bool relative=true) const
Vector qMin
Definition: PathController.h:114
The main robot type used in RobotSim.
Definition: Robot.h:79
void Advance(Real dt)
Moves forward the internal time marker.
void Deriv(Real time, Config &dx, bool relative=true) const
void AppendLinear(const Config &config, Real dt)
void SetPiecewiseLinear(const vector< Config > &milestones, const vector< Real > &times)
Config CurVelocity() const
Returns the velocity at the current time y&#39;(t0)
void SetPath(const Spline::PiecewisePolynomialND &path)
Sets the trajectory from a PiecewisePolynomialND.
A bounded-velocity, bounded-acceleration trajectory consisting of parabolic ramps.
Definition: DynamicPath.h:114
void Cut(Real time, bool relative=true)
void AppendLinearRamp(const Config &x)
Config Endpoint() const
Returns the configuration at the end time y(t0+T)
Real CurTime() const
Returns the current time t0.
void GetPath(Spline::PiecewisePolynomialND &path) const
Retrieves the path, defined on the range [t0,t0+T].
A controller that uses a piecewise polynomial trajectory.
Definition: PathController.h:123
void SetPiecewiseCubic(const vector< Config > &milestones, const vector< Vector > &velocities, const vector< Real > &times)
Real TimeRemaining() const
Returns the duration of the trajectory remaining to be executed.
void SetPiecewiseLinearRamp(const vector< Config > &milestones)
void SetConstant(const Config &x)
Sets a constant trajectory.
void Append(const Spline::PiecewisePolynomialND &path)
Vector EndpointVelocity() const
Returns the velocity at the end time y&#39;(t0+T)
void AppendRamp(const Config &x)
Appends a time-optimal ramp from the end configuration/velocity to x.
Config CurConfig() const
Returns the configuration at the current time y(t0)
A motion queue that runs on a piecewise polynomial path. Can be commanded to reach configurations (wi...
Definition: PathController.h:37
A controller base class that reads out a desired servo position and velocity using the method GetDesi...
Definition: JointTrackingController.h:9
bool Done() const
Returns true if there is no more trajectory to be executed.
void SetLimits(const Robot &robot)
void AppendCubic(const Config &x, const Config &v, Real dt)