1 #ifndef PATH_CONTROLLER_H 2 #define PATH_CONTROLLER_H 4 #include "JointTrackingController.h" 5 #include <Klampt/Modeling/DynamicPath.h> 6 #include <KrisLibrary/spline/PiecewisePolynomial.h> 48 void SetPath(
const Spline::PiecewisePolynomialND& path);
56 void SetPiecewiseCubic(
const vector<Config>& milestones,
const vector<Vector>& velocities,
const vector<Real>& times);
66 void Append(
const Spline::PiecewisePolynomialND& path);
74 void AppendCubic(
const Config& x,
const Config& v,Real dt);
82 void AppendRamp(
const Config& x,
const Vector& v);
84 void GetPath(Spline::PiecewisePolynomialND& path)
const;
87 void Cut(Real time,
bool relative=
true);
100 void Eval(Real time,Config& x,
bool relative=
true)
const;
103 void Deriv(Real time,Config& dx,
bool relative=
true)
const;
110 Spline::PiecewisePolynomialND path;
114 Vector
qMin,qMax,velMax,accMax;
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;
137 virtual vector<string> Commands()
const;
138 virtual bool SendCommand(
const string& name,
const string& str);
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 > ×)
Config CurVelocity() const
Returns the velocity at the current time y'(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 > ×)
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'(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)