YARP
Yet Another Robot Platform
IPidControl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_PIDCONTROL_H
10 #define YARP_DEV_PIDCONTROL_H
11 
12 #include <yarp/os/Vocab.h>
13 #include <yarp/dev/api.h>
14 #include <yarp/dev/GenericVocabs.h>
15 #include <yarp/dev/PidEnums.h>
17 
18 namespace yarp
19 {
20  namespace dev
21  {
22  class IPidControlRaw;
23  class IPidControl;
24  }
25 }
26 
27 
32 {
33 public:
37  virtual ~IPidControlRaw() {}
38 
40 
46  virtual bool setPidRaw(const PidControlTypeEnum& pidtype, int j, const Pid &pid) = 0;
47 
53  virtual bool setPidsRaw(const PidControlTypeEnum& pidtype, const Pid *pids) = 0;
54 
65  virtual bool setPidReferenceRaw(const PidControlTypeEnum& pidtype, int j, double ref) = 0;
66 
76  virtual bool setPidReferencesRaw(const PidControlTypeEnum& pidtype, const double *refs) = 0;
77 
84  virtual bool setPidErrorLimitRaw(const PidControlTypeEnum& pidtype, int j, double limit) = 0;
85 
91  virtual bool setPidErrorLimitsRaw(const PidControlTypeEnum& pidtype, const double *limits) = 0;
92 
99  virtual bool getPidErrorRaw(const PidControlTypeEnum& pidtype, int j, double *err) = 0;
100 
105  virtual bool getPidErrorsRaw(const PidControlTypeEnum& pidtype, double *errs) = 0;
106 
113  virtual bool getPidOutputRaw(const PidControlTypeEnum& pidtype, int j, double *out) = 0;
114 
119  virtual bool getPidOutputsRaw(const PidControlTypeEnum& pidtype, double *outs) = 0;
120 
127  virtual bool getPidRaw(const PidControlTypeEnum& pidtype, int j, Pid *pid) = 0;
128 
134  virtual bool getPidsRaw(const PidControlTypeEnum& pidtype, Pid *pids) = 0;
135 
142  virtual bool getPidReferenceRaw(const PidControlTypeEnum& pidtype, int j, double *ref) = 0;
143 
148  virtual bool getPidReferencesRaw(const PidControlTypeEnum& pidtype, double *refs) = 0;
149 
156  virtual bool getPidErrorLimitRaw(const PidControlTypeEnum& pidtype, int j, double *limit) = 0;
157 
163  virtual bool getPidErrorLimitsRaw(const PidControlTypeEnum& pidtype, double *limits) = 0;
164 
171  virtual bool resetPidRaw(const PidControlTypeEnum& pidtype, int j) = 0;
172 
178  virtual bool disablePidRaw(const PidControlTypeEnum& pidtype, int j) = 0;
179 
185  virtual bool enablePidRaw(const PidControlTypeEnum& pidtype, int j) = 0;
186 
193  virtual bool setPidOffsetRaw(const PidControlTypeEnum& pidtype, int j, double v) = 0;
194 
201  virtual bool isPidEnabledRaw(const PidControlTypeEnum& pidtype, int j, bool* enabled) = 0;
202 };
203 
211 {
212 public:
216  virtual ~IPidControl() {}
217 
219 
225  virtual bool setPid(const PidControlTypeEnum& pidtype, int j, const Pid &pid) = 0;
226 
232  virtual bool setPids(const PidControlTypeEnum& pidtype, const Pid *pids) = 0;
233 
244  virtual bool setPidReference(const PidControlTypeEnum& pidtype, int j, double ref) = 0;
245 
255  virtual bool setPidReferences(const PidControlTypeEnum& pidtype, const double *refs) = 0;
256 
263  virtual bool setPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double limit) = 0;
264 
270  virtual bool setPidErrorLimits(const PidControlTypeEnum& pidtype, const double *limits) = 0;
271 
278  virtual bool getPidError(const PidControlTypeEnum& pidtype, int j, double *err) = 0;
279 
284  virtual bool getPidErrors(const PidControlTypeEnum& pidtype, double *errs) = 0;
285 
292  virtual bool getPidOutput(const PidControlTypeEnum& pidtype, int j, double *out) = 0;
293 
298  virtual bool getPidOutputs(const PidControlTypeEnum& pidtype, double *outs) = 0;
299 
306  virtual bool getPid(const PidControlTypeEnum& pidtype, int j, Pid *pid) = 0;
307 
313  virtual bool getPids(const PidControlTypeEnum& pidtype, Pid *pids) = 0;
314 
321  virtual bool getPidReference(const PidControlTypeEnum& pidtype, int j, double *ref) = 0;
322 
327  virtual bool getPidReferences(const PidControlTypeEnum& pidtype, double *refs) = 0;
328 
335  virtual bool getPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double *limit) = 0;
336 
342  virtual bool getPidErrorLimits(const PidControlTypeEnum& pidtype, double *limits) = 0;
343 
350  virtual bool resetPid(const PidControlTypeEnum& pidtype, int j) = 0;
351 
357  virtual bool disablePid(const PidControlTypeEnum& pidtype, int j) = 0;
358 
364  virtual bool enablePid(const PidControlTypeEnum& pidtype, int j) = 0;
365 
372  virtual bool setPidOffset(const PidControlTypeEnum& pidtype, int j, double v) = 0;
373 
380  virtual bool isPidEnabled(const PidControlTypeEnum& pidtype, int j, bool* enabled) = 0;
381 };
382 
383 // interface IPositionControl gets
386 
387 
388 #endif // YARP_DEV_CONTROLBOARDINTERFACES_H
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
yarp::dev::IPidControl::getPidErrorLimits
virtual bool getPidErrorLimits(const PidControlTypeEnum &pidtype, double *limits)=0
Get the error limit for all controllers.
yarp::dev::IPidControl::setPid
virtual bool setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
Set new pid value for a joint axis.
yarp::dev::IPidControlRaw::getPidErrorLimitRaw
virtual bool getPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double *limit)=0
Get the error limit for the controller on a specific joint.
yarp::dev::IPidControlRaw::setPidReferenceRaw
virtual bool setPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double ref)=0
Set the controller reference for a given axis.
yarp::dev::IPidControl::disablePid
virtual bool disablePid(const PidControlTypeEnum &pidtype, int j)=0
Disable the pid computation for a joint.
yarp::dev::IPidControl::enablePid
virtual bool enablePid(const PidControlTypeEnum &pidtype, int j)=0
Enable the pid computation for a joint.
yarp::dev::IPidControlRaw::setPidOffsetRaw
virtual bool setPidOffsetRaw(const PidControlTypeEnum &pidtype, int j, double v)=0
Set an offset value on the ourput of pid controller.
yarp::dev::IPidControlRaw::~IPidControlRaw
virtual ~IPidControlRaw()
Destructor.
Definition: IPidControl.h:37
yarp::dev::IPidControlRaw::isPidEnabledRaw
virtual bool isPidEnabledRaw(const PidControlTypeEnum &pidtype, int j, bool *enabled)=0
Get the current status (enabled/disabled) of the pid controller.
yarp::dev::IPidControlRaw::setPidRaw
virtual bool setPidRaw(const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
Set new pid value for a joint axis.
yarp::dev::IPidControl::getPids
virtual bool getPids(const PidControlTypeEnum &pidtype, Pid *pids)=0
Get current pid value for a specific joint.
yarp::dev::IPidControlRaw::resetPidRaw
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 ...
PidEnums.h
yarp::dev::IPidControl::getPidOutputs
virtual bool getPidOutputs(const PidControlTypeEnum &pidtype, double *outs)=0
Get the output of the controllers (e.g.
yarp::dev::IPidControlRaw::disablePidRaw
virtual bool disablePidRaw(const PidControlTypeEnum &pidtype, int j)=0
Disable the pid computation for a joint.
yarp::dev::IPidControl::setPidOffset
virtual bool setPidOffset(const PidControlTypeEnum &pidtype, int j, double v)=0
Set offset value for a given controller.
yarp::dev::IPidControlRaw::getPidErrorLimitsRaw
virtual bool getPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, double *limits)=0
Get the error limit for all controllers.
yarp::dev::IPidControl::getPidErrors
virtual bool getPidErrors(const PidControlTypeEnum &pidtype, double *errs)=0
Get the error of all joints.
yarp::dev::IPidControlRaw::setPidErrorLimitsRaw
virtual bool setPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, const double *limits)=0
Get the error limit for the controller on all joints.
yarp::dev::IPidControl::setPidReferences
virtual bool setPidReferences(const PidControlTypeEnum &pidtype, const double *refs)=0
Set the controller reference, multiple axes.
yarp::dev::IPidControl::setPids
virtual bool setPids(const PidControlTypeEnum &pidtype, const Pid *pids)=0
Set new pid value on multiple axes.
yarp::dev::IPidControlRaw::getPidOutputRaw
virtual bool getPidOutputRaw(const PidControlTypeEnum &pidtype, int j, double *out)=0
Get the output of the controller (e.g.
yarp::dev::IPidControl::getPidReferences
virtual bool getPidReferences(const PidControlTypeEnum &pidtype, double *refs)=0
Get the current reference of all pid controllers.
yarp::dev::IPidControl::setPidReference
virtual bool setPidReference(const PidControlTypeEnum &pidtype, int j, double ref)=0
Set the controller reference for a given axis.
yarp::dev::PidControlTypeEnum
PidControlTypeEnum
Definition: PidEnums.h:21
yarp::dev::IPidControl::getPidErrorLimit
virtual bool getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *limit)=0
Get the error limit for the controller on a specific joint.
yarp::dev::IPidControlRaw::setPidsRaw
virtual bool setPidsRaw(const PidControlTypeEnum &pidtype, const Pid *pids)=0
Set new pid value on multiple axes.
yarp::dev::IPidControlRaw::getPidRaw
virtual bool getPidRaw(const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
Get current pid value for a specific joint.
yarp::dev::IPidControl::getPidOutput
virtual bool getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out)=0
Get the output of the controller (e.g.
yarp::dev::IPidControlRaw::setPidErrorLimitRaw
virtual bool setPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double limit)=0
Set the error limit for the controller on a specific joint.
yarp::dev::IPidControl::resetPid
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 ...
yarp::dev::IPidControl::getPid
virtual bool getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
Get current pid value for a specific joint.
yarp::dev::IPidControl::getPidReference
virtual bool getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref)=0
Get the current reference of the pid controller for a specific joint.
yarp::dev::IPidControl::setPidErrorLimits
virtual bool setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits)=0
Get the error limit for the controller on all joints.
yarp::dev::IPidControlRaw
Interface for a generic control board device implementing a PID controller.
Definition: IPidControl.h:32
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IPidControl::getPidError
virtual bool getPidError(const PidControlTypeEnum &pidtype, int j, double *err)=0
Get the current error for a joint.
yarp::dev::IPidControlRaw::getPidReferencesRaw
virtual bool getPidReferencesRaw(const PidControlTypeEnum &pidtype, double *refs)=0
Get the current reference of all pid controllers.
yarp::dev::IPidControlRaw::setPidReferencesRaw
virtual bool setPidReferencesRaw(const PidControlTypeEnum &pidtype, const double *refs)=0
Set the controller reference, multiple axes.
VOCAB_PIDS
constexpr yarp::conf::vocab32_t VOCAB_PIDS
Definition: IPidControl.h:385
yarp::dev::IPidControl
Interface for a generic control board device implementing a PID controller, with scaled arguments.
Definition: IPidControl.h:211
ControlBoardPid.h
define control board standard interfaces
yarp::dev::IPidControlRaw::getPidOutputsRaw
virtual bool getPidOutputsRaw(const PidControlTypeEnum &pidtype, double *outs)=0
Get the output of the controllers (e.g.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
Vocab.h
yarp::dev::IPidControl::setPidErrorLimit
virtual bool setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit)=0
Set the error limit for the controller on a specifi joint.
VOCAB_PID
constexpr yarp::conf::vocab32_t VOCAB_PID
Definition: IPidControl.h:384
yarp::dev::IPidControl::~IPidControl
virtual ~IPidControl()
Destructor.
Definition: IPidControl.h:216
yarp::dev::Pid
Contains the parameters for a PID.
Definition: ControlBoardPid.h:29
yarp::dev::IPidControlRaw::enablePidRaw
virtual bool enablePidRaw(const PidControlTypeEnum &pidtype, int j)=0
Enable the pid computation for a joint.
yarp::dev::IPidControlRaw::getPidErrorRaw
virtual bool getPidErrorRaw(const PidControlTypeEnum &pidtype, int j, double *err)=0
Get the current error for a joint.
yarp::dev::IPidControlRaw::getPidErrorsRaw
virtual bool getPidErrorsRaw(const PidControlTypeEnum &pidtype, double *errs)=0
Get the error of all joints.
yarp::dev::IPidControlRaw::getPidsRaw
virtual bool getPidsRaw(const PidControlTypeEnum &pidtype, Pid *pids)=0
Get current pid value for a specific joint.
GenericVocabs.h
api.h
yarp::dev::IPidControlRaw::getPidReferenceRaw
virtual bool getPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double *ref)=0
Get the current reference of the pid controller for a specific joint.
yarp::dev::IPidControl::isPidEnabled
virtual bool isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool *enabled)=0
Get the current status (enabled/disabled) of the pid.