27#include <yarp/os/Bottle.h>
28#include <yarp/sig/Vector.h>
29#include <yarp/sig/Matrix.h>
57 yarp::sig::Matrix
lim;
62 yarp::sig::Vector
saturate(
const yarp::sig::Vector &v);
75 Integrator(
const double _Ts,
const yarp::sig::Vector &y0,
const yarp::sig::Matrix &_lim);
83 Integrator(
const double _Ts,
const yarp::sig::Vector &y0);
104 const yarp::sig::Vector&
integrate(
const yarp::sig::Vector &
x);
123 void setTs(
const double _Ts);
129 void setLim(
const yarp::sig::Matrix &_lim);
148 void reset(
const yarp::sig::Vector &y0);
154 const yarp::sig::Vector&
get()
const {
return y; }
176 static void addVectorToOption(yarp::os::Bottle &option,
const char *key,
const yarp::sig::Vector &val);
190 static bool getVectorFromOption(
const yarp::os::Bottle &options,
const char *key, yarp::sig::Vector &val,
int &size);
217 yarp::sig::Vector
Kp;
218 yarp::sig::Vector
Ki;
219 yarp::sig::Vector
Kd;
221 yarp::sig::Vector
Wp;
222 yarp::sig::Vector
Wi;
223 yarp::sig::Vector
Wd;
226 yarp::sig::Vector
Tt;
259 const yarp::sig::Vector &_Kp,
const yarp::sig::Vector &_Ki,
const yarp::sig::Vector &_Kd,
260 const yarp::sig::Vector &_Wp,
const yarp::sig::Vector &_Wi,
const yarp::sig::Vector &_Wd,
261 const yarp::sig::Vector &_N,
const yarp::sig::Vector &_Tt,
const yarp::sig::Matrix &_satLim);
269 virtual const yarp::sig::Vector&
compute(
const yarp::sig::Vector &ref,
const yarp::sig::Vector &fb);
275 virtual void reset(
const yarp::sig::Vector &u0);
286 virtual void getOptions(yarp::os::Bottle &options);
301 virtual void setOptions(
const yarp::os::Bottle &options);
330 yarp::sig::Vector
Kp;
331 yarp::sig::Vector
Ti;
332 yarp::sig::Vector
Kd;
364 const yarp::sig::Vector &_Kp,
const yarp::sig::Vector &_Ti,
const yarp::sig::Vector &_Kd,
365 const yarp::sig::Vector &_N,
const yarp::sig::Matrix &_satLim);
373 virtual const yarp::sig::Vector&
compute(
const yarp::sig::Vector &ref,
const yarp::sig::Vector &fb);
378 virtual void reset();
389 virtual void getOptions(yarp::os::Bottle &options);
404 virtual void setOptions(
const yarp::os::Bottle &options);
A class for defining a saturated integrator based on Tustin formula: .
const yarp::sig::Vector & get() const
Returns the current output vector.
const yarp::sig::Matrix & getLim()
Returns the constraints matrix.
Integrator(const double _Ts, const yarp::sig::Vector &y0)
Constructor.
const yarp::sig::Vector & integrate(const yarp::sig::Vector &x)
Executes one-step integration of input vector.
Integrator & operator=(const Integrator &I)
Copies a Integrator object into the current one.
void setSaturation(bool _applySat)
Sets the saturation status.
Integrator(const double _Ts, const yarp::sig::Vector &y0, const yarp::sig::Matrix &_lim)
Constructor.
void reset(const yarp::sig::Vector &y0)
Resets the internal state and sets the output vector to the given value.
void allocate(const Integrator &I)
yarp::sig::Vector saturate(const yarp::sig::Vector &v)
void setTs(const double _Ts)
Sets the sample time.
double getTs()
Returns the sample time.
bool getSaturation()
Returns the current saturation status.
void setLim(const yarp::sig::Matrix &_lim)
Sets the output vector constraints matrix.
Integrator(const Integrator &I)
Creates a new Integrator from an already existing object.
Helper class providing useful methods to deal with pid options.
static void addVectorToOption(yarp::os::Bottle &option, const char *key, const yarp::sig::Vector &val)
Add the data contained in the specified vector to the specified bottle, using property-like form (i....
static bool getVectorFromOption(const yarp::os::Bottle &options, const char *key, yarp::sig::Vector &val, int &size)
Fill the specified vector with the data associated with the specified key in the specified property-l...
General structure of parallel (non-interactive) PID.
virtual void getOptions(yarp::os::Bottle &options)
Returns the current options used by the pid.
~parallelPID()
Destructor.
virtual void setOptions(const yarp::os::Bottle &options)
Update the options used by the pid.
parallelPID(const double _Ts, const yarp::sig::Vector &_Kp, const yarp::sig::Vector &_Ki, const yarp::sig::Vector &_Kd, const yarp::sig::Vector &_Wp, const yarp::sig::Vector &_Wi, const yarp::sig::Vector &_Wd, const yarp::sig::Vector &_N, const yarp::sig::Vector &_Tt, const yarp::sig::Matrix &_satLim)
Constructor.
std::deque< Filter * > Der
virtual void reset(const yarp::sig::Vector &u0)
Resets the internal state of integral and derivative part.
virtual const yarp::sig::Vector & compute(const yarp::sig::Vector &ref, const yarp::sig::Vector &fb)
Computes the PID output.
General structure of series (interactive) PID.
virtual void setOptions(const yarp::os::Bottle &options)
Update the options used by the pid.
seriesPID(const double _Ts, const yarp::sig::Vector &_Kp, const yarp::sig::Vector &_Ti, const yarp::sig::Vector &_Kd, const yarp::sig::Vector &_N, const yarp::sig::Matrix &_satLim)
Constructor.
std::deque< Filter * > Int
virtual void reset()
Resets the internal state of integral and derivative part.
virtual const yarp::sig::Vector & compute(const yarp::sig::Vector &ref, const yarp::sig::Vector &fb)
Computes the PID output.
std::deque< Filter * > Der
virtual void getOptions(yarp::os::Bottle &options)
Returns the current options used by the pid.
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.