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> 49 void SetPath(
const Spline::PiecewisePolynomialND& path);
57 void SetPiecewiseCubic(
const vector<Config>& milestones,
const vector<Vector>& velocities,
const vector<Real>& times);
67 void Append(
const Spline::PiecewisePolynomialND& path);
75 void AppendCubic(
const Config& x,
const Config& v,Real dt);
83 void AppendRamp(
const Config& x,
const Vector& v);
85 void GetPath(Spline::PiecewisePolynomialND& path)
const;
88 void Cut(Real time,
bool relative=
true);
101 void Eval(Real time,Config& x,
bool relative=
true)
const;
104 void Deriv(Real time,Config& dx,
bool relative=
true)
const;
111 Spline::PiecewisePolynomialND path;
115 Vector
qMin,qMax,velMax,accMax;
130 virtual const char* Type()
const {
return "PolynomialPathController"; }
131 virtual void GetDesiredState(Config& q_des,Vector& dq_des);
132 virtual void Update(Real dt);
133 virtual void Reset();
134 virtual bool ReadState(File& f);
135 virtual bool WriteState(File& f)
const;
138 virtual vector<string> Commands()
const;
139 virtual bool SendCommand(
const string& name,
const string& str);
Vector qMin
Definition: PathController.h:115
A motion queue that runs on a piecewise polynomial path. Can be commanded to reach configurations (wi...
Definition: PathController.h:38
void AppendLinearRamp(const Config &x)
void Deriv(Real time, Config &dx, bool relative=true) const
Config CurConfig() const
Returns the configuration at the current time y(t0)
A controller base class that reads out a desired servo position and velocity using the method GetDesi...
Definition: JointTrackingController.h:11
void SetPiecewiseLinear(const vector< Config > &milestones, const vector< Real > ×)
A bounded-velocity, bounded-acceleration trajectory consisting of parabolic ramps.
Definition: DynamicPath.h:114
A controller that uses a piecewise polynomial trajectory.
Definition: PathController.h:124
Config CurVelocity() const
Returns the velocity at the current time y'(t0)
void SetPiecewiseLinearRamp(const vector< Config > &milestones)
Vector EndpointVelocity() const
Returns the velocity at the end time y'(t0+T)
void Cut(Real time, bool relative=true)
void AppendCubic(const Config &x, const Config &v, Real dt)
void Advance(Real dt)
Moves forward the internal time marker.
void AppendRamp(const Config &x)
Appends a time-optimal ramp from the end configuration/velocity to x.
Config Endpoint() const
Returns the configuration at the end time y(t0+T)
bool Done() const
Returns true if there is no more trajectory to be executed.
void SetPiecewiseCubic(const vector< Config > &milestones, const vector< Vector > &velocities, const vector< Real > ×)
The main robot type used in RobotSim.
Definition: Robot.h:83
void AppendLinear(const Config &config, Real dt)
void Append(const Spline::PiecewisePolynomialND &path)
void Eval(Real time, Config &x, bool relative=true) const
Real TimeRemaining() const
Returns the duration of the trajectory remaining to be executed.
void SetConstant(const Config &x)
Sets a constant trajectory.
Real CurTime() const
Returns the current time t0.
void GetPath(Spline::PiecewisePolynomialND &path) const
Retrieves the path, defined on the range [t0,t0+T].
void SetLimits(const RobotModel &robot)
void SetPath(const Spline::PiecewisePolynomialND &path)
Sets the trajectory from a PiecewisePolynomialND.
Definition: ContactDistance.h:6