YARP
Yet Another Robot Platform
ControlBoardWrapperPidControl Class Reference

#include <ControlBoardWrapper/ControlBoardWrapperPidControl.h>

+ Inheritance diagram for ControlBoardWrapperPidControl:

Public Member Functions

bool setPid (const yarp::dev::PidControlTypeEnum &pidtype, int j, const yarp::dev::Pid &p) override
 Set new pid value for a joint axis. More...
 
bool setPids (const yarp::dev::PidControlTypeEnum &pidtype, const yarp::dev::Pid *ps) override
 Set new pid value on multiple axes. More...
 
bool setPidReference (const yarp::dev::PidControlTypeEnum &pidtype, int j, double ref) override
 Set the controller reference for a given axis. More...
 
bool setPidReferences (const yarp::dev::PidControlTypeEnum &pidtype, const double *refs) override
 Set the controller reference, multiple axes. More...
 
bool setPidErrorLimit (const yarp::dev::PidControlTypeEnum &pidtype, int j, double limit) override
 Set the error limit for the controller on a specifi joint. More...
 
bool setPidErrorLimits (const yarp::dev::PidControlTypeEnum &pidtype, const double *limits) override
 Get the error limit for the controller on all joints. More...
 
bool getPidError (const yarp::dev::PidControlTypeEnum &pidtype, int j, double *err) override
 Get the current error for a joint. More...
 
bool getPidErrors (const yarp::dev::PidControlTypeEnum &pidtype, double *errs) override
 Get the error of all joints. More...
 
bool getPidOutput (const yarp::dev::PidControlTypeEnum &pidtype, int j, double *out) override
 Get the output of the controller (e.g. More...
 
bool getPidOutputs (const yarp::dev::PidControlTypeEnum &pidtype, double *outs) override
 Get the output of the controllers (e.g. More...
 
bool setPidOffset (const yarp::dev::PidControlTypeEnum &pidtype, int j, double v) override
 Set offset value for a given controller. More...
 
bool getPid (const yarp::dev::PidControlTypeEnum &pidtype, int j, yarp::dev::Pid *p) override
 Get current pid value for a specific joint. More...
 
bool getPids (const yarp::dev::PidControlTypeEnum &pidtype, yarp::dev::Pid *pids) override
 Get current pid value for a specific joint. More...
 
bool getPidReference (const yarp::dev::PidControlTypeEnum &pidtype, int j, double *ref) override
 Get the current reference of the pid controller for a specific joint. More...
 
bool getPidReferences (const yarp::dev::PidControlTypeEnum &pidtype, double *refs) override
 Get the current reference of all pid controllers. More...
 
bool getPidErrorLimit (const yarp::dev::PidControlTypeEnum &pidtype, int j, double *limit) override
 Get the error limit for the controller on a specific joint. More...
 
bool getPidErrorLimits (const yarp::dev::PidControlTypeEnum &pidtype, double *limits) override
 Get the error limit for all controllers. More...
 
bool resetPid (const yarp::dev::PidControlTypeEnum &pidtype, int j) override
 Reset the controller of a given joint, usually sets the current status of the joint as the reference value for the PID, and resets the integrator. More...
 
bool disablePid (const yarp::dev::PidControlTypeEnum &pidtype, int j) override
 Disable the pid computation for a joint. More...
 
bool enablePid (const yarp::dev::PidControlTypeEnum &pidtype, int j) override
 Enable the pid computation for a joint. More...
 
bool isPidEnabled (const yarp::dev::PidControlTypeEnum &pidtype, int j, bool *enabled) override
 Get the current status (enabled/disabled) of the pid. More...
 
- Public Member Functions inherited from ControlBoardWrapperCommon
bool getAxes (int *ax)
 
bool setRefAcceleration (int j, double acc)
 
bool setRefAccelerations (const double *accs)
 
bool setRefAccelerations (const int n_joints, const int *joints, const double *accs)
 
bool getRefAcceleration (int j, double *acc)
 
bool getRefAccelerations (double *accs)
 
bool getRefAccelerations (const int n_joints, const int *joints, double *accs)
 
bool stop (int j)
 
bool stop ()
 
bool stop (const int n_joint, const int *joints)
 
bool getNumberOfMotors (int *num)
 
bool getCurrent (int m, double *curr)
 
bool getCurrents (double *currs)
 
void printError (const std::string &func_name, const std::string &info, bool result)
 
- Public Member Functions inherited from yarp::dev::IPidControl
virtual ~IPidControl ()
 Destructor. More...
 

Additional Inherited Members

- Public Attributes inherited from ControlBoardWrapperCommon
WrappedDevice device
 
size_t controlledJoints {0}
 
std::string partName
 
std::mutex rpcDataMutex
 
MultiJointData rpcData
 
std::mutex timeMutex
 
yarp::os::Stamp time
 

Detailed Description

Definition at line 16 of file ControlBoardWrapperPidControl.h.

Member Function Documentation

◆ disablePid()

bool ControlBoardWrapperPidControl::disablePid ( const yarp::dev::PidControlTypeEnum pidtype,
int  j 
)
overridevirtual

Disable the pid computation for a joint.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
Returns
true on success, false on failure.

Implements yarp::dev::IPidControl.

Definition at line 461 of file ControlBoardWrapperPidControl.cpp.

◆ enablePid()

bool ControlBoardWrapperPidControl::enablePid ( const yarp::dev::PidControlTypeEnum pidtype,
int  j 
)
overridevirtual

Enable the pid computation for a joint.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
Returns
true on success, false on failure.

Implements yarp::dev::IPidControl.

Definition at line 484 of file ControlBoardWrapperPidControl.cpp.

◆ getPid()

bool ControlBoardWrapperPidControl::getPid ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
yarp::dev::Pid pid 
)
overridevirtual

Get current pid value for a specific joint.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
pidpointer to storage for the return value.
Returns
success/failure

Implements yarp::dev::IPidControl.

Definition at line 288 of file ControlBoardWrapperPidControl.cpp.

◆ getPidError()

bool ControlBoardWrapperPidControl::getPidError ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
double *  err 
)
overridevirtual

Get the current error for a joint.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
errpointer to the storage for the return value
Returns
true/false on success failure

Implements yarp::dev::IPidControl.

Definition at line 163 of file ControlBoardWrapperPidControl.cpp.

◆ getPidErrorLimit()

bool ControlBoardWrapperPidControl::getPidErrorLimit ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
double *  limit 
)
overridevirtual

Get the error limit for the controller on a specific joint.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
limitpointer to storage
Returns
success/failure

Implements yarp::dev::IPidControl.

Definition at line 388 of file ControlBoardWrapperPidControl.cpp.

◆ getPidErrorLimits()

bool ControlBoardWrapperPidControl::getPidErrorLimits ( const yarp::dev::PidControlTypeEnum pidtype,
double *  limits 
)
overridevirtual

Get the error limit for all controllers.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
limitspointer to the array that will store the output
Returns
success or failure

Implements yarp::dev::IPidControl.

Definition at line 411 of file ControlBoardWrapperPidControl.cpp.

◆ getPidErrors()

bool ControlBoardWrapperPidControl::getPidErrors ( const yarp::dev::PidControlTypeEnum pidtype,
double *  errs 
)
overridevirtual

Get the error of all joints.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
errspointer to the vector that will store the errors

Implements yarp::dev::IPidControl.

Definition at line 187 of file ControlBoardWrapperPidControl.cpp.

◆ getPidOutput()

bool ControlBoardWrapperPidControl::getPidOutput ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
double *  out 
)
overridevirtual

Get the output of the controller (e.g.

pwm value)

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
outpointer to storage for return value
Returns
success/failure

Implements yarp::dev::IPidControl.

Definition at line 214 of file ControlBoardWrapperPidControl.cpp.

◆ getPidOutputs()

bool ControlBoardWrapperPidControl::getPidOutputs ( const yarp::dev::PidControlTypeEnum pidtype,
double *  outs 
)
overridevirtual

Get the output of the controllers (e.g.

pwm value)

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
outspinter to the vector that will store the output values

Implements yarp::dev::IPidControl.

Definition at line 238 of file ControlBoardWrapperPidControl.cpp.

◆ getPidReference()

bool ControlBoardWrapperPidControl::getPidReference ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
double *  ref 
)
overridevirtual

Get the current reference of the pid controller for a specific joint.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
refpointer to storage for return value
Returns
reference value

Implements yarp::dev::IPidControl.

Definition at line 339 of file ControlBoardWrapperPidControl.cpp.

◆ getPidReferences()

bool ControlBoardWrapperPidControl::getPidReferences ( const yarp::dev::PidControlTypeEnum pidtype,
double *  refs 
)
overridevirtual

Get the current reference of all pid controllers.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
refsvector that will store the output.

Implements yarp::dev::IPidControl.

Definition at line 361 of file ControlBoardWrapperPidControl.cpp.

◆ getPids()

bool ControlBoardWrapperPidControl::getPids ( const yarp::dev::PidControlTypeEnum pidtype,
yarp::dev::Pid pids 
)
overridevirtual

Get current pid value for a specific joint.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
pidsvector that will store the values of the pids.
Returns
success/failure

Implements yarp::dev::IPidControl.

Definition at line 312 of file ControlBoardWrapperPidControl.cpp.

◆ isPidEnabled()

bool ControlBoardWrapperPidControl::isPidEnabled ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
bool *  enabled 
)
overridevirtual

Get the current status (enabled/disabled) of the pid.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
enabledthe current status of the pid controller.
Returns
true on success, false on failure.

Implements yarp::dev::IPidControl.

Definition at line 507 of file ControlBoardWrapperPidControl.cpp.

◆ resetPid()

bool ControlBoardWrapperPidControl::resetPid ( const yarp::dev::PidControlTypeEnum pidtype,
int  j 
)
overridevirtual

Reset the controller of a given joint, usually sets the current status of the joint as the reference value for the PID, and resets the integrator.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
Returns
true on success, false on failure.

Implements yarp::dev::IPidControl.

Definition at line 438 of file ControlBoardWrapperPidControl.cpp.

◆ setPid()

bool ControlBoardWrapperPidControl::setPid ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
const yarp::dev::Pid pid 
)
overridevirtual

Set new pid value for a joint axis.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
pidnew pid value
Returns
true/false on success/failure

Implements yarp::dev::IPidControl.

Definition at line 17 of file ControlBoardWrapperPidControl.cpp.

◆ setPidErrorLimit()

bool ControlBoardWrapperPidControl::setPidErrorLimit ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
double  limit 
)
overridevirtual

Set the error limit for the controller on a specifi joint.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
limitlimit value
Returns
true/false on success/failure

Implements yarp::dev::IPidControl.

Definition at line 117 of file ControlBoardWrapperPidControl.cpp.

◆ setPidErrorLimits()

bool ControlBoardWrapperPidControl::setPidErrorLimits ( const yarp::dev::PidControlTypeEnum pidtype,
const double *  limits 
)
overridevirtual

Get the error limit for the controller on all joints.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
limitspointer to the vector with the new limits
Returns
true/false on success/failure

Implements yarp::dev::IPidControl.

Definition at line 140 of file ControlBoardWrapperPidControl.cpp.

◆ setPidOffset()

bool ControlBoardWrapperPidControl::setPidOffset ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
double  v 
)
overridevirtual

Set offset value for a given controller.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
vthe offset to be added to the output of the pid controller
Returns
true on success, false on failure.

Implements yarp::dev::IPidControl.

Definition at line 265 of file ControlBoardWrapperPidControl.cpp.

◆ setPidReference()

bool ControlBoardWrapperPidControl::setPidReference ( const yarp::dev::PidControlTypeEnum pidtype,
int  j,
double  ref 
)
overridevirtual

Set the controller reference for a given axis.

Warning this method can result in very large torques and should be used carefully. If you do not understand this warning you should avoid using this method. Have a look at other interfaces (e.g. position control).

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
jjoint number
refnew reference point
Returns
true/false upon success/failure

Implements yarp::dev::IPidControl.

Definition at line 67 of file ControlBoardWrapperPidControl.cpp.

◆ setPidReferences()

bool ControlBoardWrapperPidControl::setPidReferences ( const yarp::dev::PidControlTypeEnum pidtype,
const double *  refs 
)
overridevirtual

Set the controller reference, multiple axes.

Warning this method can result in very large torques and should be used carefully. If you do not understand this warning you should avoid using this method. Have a look at other interfaces (e.g. position control).

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
refspointer to the vector that contains the new reference points.
Returns
true/false upon success/failure

Implements yarp::dev::IPidControl.

Definition at line 94 of file ControlBoardWrapperPidControl.cpp.

◆ setPids()

bool ControlBoardWrapperPidControl::setPids ( const yarp::dev::PidControlTypeEnum pidtype,
const yarp::dev::Pid pids 
)
overridevirtual

Set new pid value on multiple axes.

Parameters
pidtypethe id of the pid that will be affected by the command (e.g. position, velocity etc)
pidspointer to a vector of pids
Returns
true/false upon success/failure

Implements yarp::dev::IPidControl.

Definition at line 44 of file ControlBoardWrapperPidControl.cpp.


The documentation for this class was generated from the following files: