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...
 
virtual bool setPid (const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
 Set new pid value for a joint axis. More...
 
virtual bool setPids (const PidControlTypeEnum &pidtype, const Pid *pids)=0
 Set new pid value on multiple axes. More...
 
virtual bool setPidReference (const PidControlTypeEnum &pidtype, int j, double ref)=0
 Set the controller reference for a given axis. More...
 
virtual bool setPidReferences (const PidControlTypeEnum &pidtype, const double *refs)=0
 Set the controller reference, multiple axes. More...
 
virtual bool setPidErrorLimit (const PidControlTypeEnum &pidtype, int j, double limit)=0
 Set the error limit for the controller on a specifi joint. More...
 
virtual bool setPidErrorLimits (const PidControlTypeEnum &pidtype, const double *limits)=0
 Get the error limit for the controller on all joints. More...
 
virtual bool getPidError (const PidControlTypeEnum &pidtype, int j, double *err)=0
 Get the current error for a joint. More...
 
virtual bool getPidErrors (const PidControlTypeEnum &pidtype, double *errs)=0
 Get the error of all joints. More...
 
virtual bool getPidOutput (const PidControlTypeEnum &pidtype, int j, double *out)=0
 Get the output of the controller (e.g. More...
 
virtual bool getPidOutputs (const PidControlTypeEnum &pidtype, double *outs)=0
 Get the output of the controllers (e.g. More...
 
virtual bool getPid (const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
 Get current pid value for a specific joint. More...
 
virtual bool getPids (const PidControlTypeEnum &pidtype, Pid *pids)=0
 Get current pid value for a specific joint. More...
 
virtual bool getPidReference (const PidControlTypeEnum &pidtype, int j, double *ref)=0
 Get the current reference of the pid controller for a specific joint. More...
 
virtual bool getPidReferences (const PidControlTypeEnum &pidtype, double *refs)=0
 Get the current reference of all pid controllers. More...
 
virtual bool getPidErrorLimit (const PidControlTypeEnum &pidtype, int j, double *limit)=0
 Get the error limit for the controller on a specific joint. More...
 
virtual bool getPidErrorLimits (const PidControlTypeEnum &pidtype, double *limits)=0
 Get the error limit for all controllers. More...
 
virtual bool resetPid (const PidControlTypeEnum &pidtype, int j)=0
 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...
 
virtual bool disablePid (const PidControlTypeEnum &pidtype, int j)=0
 Disable the pid computation for a joint. More...
 
virtual bool enablePid (const PidControlTypeEnum &pidtype, int j)=0
 Enable the pid computation for a joint. More...
 
virtual bool setPidOffset (const PidControlTypeEnum &pidtype, int j, double v)=0
 Set offset value for a given controller. More...
 
virtual bool isPidEnabled (const PidControlTypeEnum &pidtype, int j, bool *enabled)=0
 Get the current status (enabled/disabled) of the pid. 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 13 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 458 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 481 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 285 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 160 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 385 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 408 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 184 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 211 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 235 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 336 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 358 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 309 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 504 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 435 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 14 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 114 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 137 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 262 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 64 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 91 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 41 of file ControlBoardWrapperPidControl.cpp.


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