15#define JOINTIDCHECK if (j >= castToMapper(helper)->axes()){yError("joint id out of bound"); return false;}
20doubleBuffManager(nullptr),
21pidBuffManager(nullptr)
198 for (
int j = 0;
j < nj;
j++)
yarp::dev::ControlBoardHelper * castToMapper(void *p)
void set_pid_conversion_units(const PidControlTypeEnum &pidtype, const PidFeedbackUnitsEnum fbk_conv_units, const PidOutputUnitsEnum out_conv_units)
Interface for a generic control board device implementing a PID controller.
virtual bool enablePidRaw(const PidControlTypeEnum &pidtype, int j)=0
Enable the pid computation for a joint.
virtual bool setPidRaw(const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
Set new pid value for a joint axis.
virtual bool getPidOutputRaw(const PidControlTypeEnum &pidtype, int j, double *out)=0
Get the output of the controller (e.g.
virtual bool setPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double ref)=0
Set the controller reference for a given axis.
virtual bool setPidOffsetRaw(const PidControlTypeEnum &pidtype, int j, double v)=0
Set an offset value on the ourput of pid controller.
virtual bool disablePidRaw(const PidControlTypeEnum &pidtype, int j)=0
Disable the pid computation for a joint.
virtual bool getPidsRaw(const PidControlTypeEnum &pidtype, Pid *pids)=0
Get current pid value for a specific joint.
virtual bool getPidReferencesRaw(const PidControlTypeEnum &pidtype, double *refs)=0
Get the current reference of all pid controllers.
virtual bool getPidErrorsRaw(const PidControlTypeEnum &pidtype, double *errs)=0
Get the error of all joints.
virtual bool getPidRaw(const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
Get current pid value for a specific joint.
virtual bool getPidOutputsRaw(const PidControlTypeEnum &pidtype, double *outs)=0
Get the output of the controllers (e.g.
virtual bool setPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, const double *limits)=0
Get the error limit for the controller on all joints.
virtual bool getPidErrorRaw(const PidControlTypeEnum &pidtype, int j, double *err)=0
Get the current error for a joint.
virtual bool getPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double *limit)=0
Get the error limit for the controller on a specific joint.
virtual bool isPidEnabledRaw(const PidControlTypeEnum &pidtype, int j, bool *enabled)=0
Get the current status (enabled/disabled) of the pid controller.
virtual bool getPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double *ref)=0
Get the current reference of the pid controller for a specific joint.
virtual bool getPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, double *limits)=0
Get the error limit for all controllers.
virtual bool setPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double limit)=0
Set the error limit for the controller on a specific joint.
virtual bool setPidsRaw(const PidControlTypeEnum &pidtype, const Pid *pids)=0
Set new pid value on multiple axes.
virtual bool setPidReferencesRaw(const PidControlTypeEnum &pidtype, const double *refs)=0
Set the controller reference, multiple axes.
virtual bool resetPidRaw(const PidControlTypeEnum &pidtype, int j)=0
Reset the controller of a given joint, usually sets the current status of the joint as the reference ...
bool resetPid(const PidControlTypeEnum &pidtype, int j) override
Reset the controller of a given joint, usually sets the current status of the joint as the reference ...
bool enablePid(const PidControlTypeEnum &pidtype, int j) override
Enable the pid computation for a joint.
virtual ~ImplementPidControl()
bool setPids(const PidControlTypeEnum &pidtype, const Pid *pids) override
Set new pid value on multiple axes.
bool isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool *enabled) override
Get the current status (enabled/disabled) of the pid.
bool setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit) override
Set the error limit for the controller on a specifi joint.
bool uninitialize()
Clean up internal data and memory.
bool getPidReferences(const PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all pid controllers.
bool getPidError(const PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
bool getPids(const PidControlTypeEnum &pidtype, Pid *pids) override
Get current pid value for a specific joint.
bool getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid) override
Get current pid value for a specific joint.
bool getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *ref) override
Get the error limit for the controller on a specific joint.
bool setPidOffset(const PidControlTypeEnum &pidtype, int j, double v) override
Set offset value for a given controller.
bool initialize(int size, const int *amap, const double *enc, const double *zos, const double *newtons, const double *amps, const double *dutys)
Initialize the internal data and alloc memory.
ImplementPidControl(yarp::dev::IPidControlRaw *y)
bool getPidErrorLimits(const PidControlTypeEnum &pidtype, double *refs) override
Get the error limit for all controllers.
bool getPidErrors(const PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
bool getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref) override
Get the current reference of the pid controller for a specific joint.
bool disablePid(const PidControlTypeEnum &pidtype, int j) override
Disable the pid computation for a joint.
bool getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
bool setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
yarp::dev::impl::FixedSizeBuffersManager< yarp::dev::Pid > * pidBuffManager
bool setPidReference(const PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
bool setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid) override
Set new pid value for a joint axis.
bool setPidReferences(const PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
bool getPidOutputs(const PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
bool setConversionUnits(const PidControlTypeEnum &pidtype, const PidFeedbackUnitsEnum fbk_conv_units, const PidOutputUnitsEnum out_conv_units)
Contains the parameters for a PID.
Buffer contains info about a buffer of type T and it is used to exchange information with yarp::dev::...
A manager of fixed size buffers in multi-thread environment.
Buffer< T > getBuffer()
Get a buffer and fill its information in @buffer.
void releaseBuffer(Buffer< T > &buffer)
Release a buffer.
A mini-server for performing network communication in the background.
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.