YARP
Yet Another Robot Platform
IPidControl.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_PIDCONTROL_H
7#define YARP_DEV_PIDCONTROL_H
8
9#include <yarp/os/Vocab.h>
10#include <yarp/dev/api.h>
12#include <yarp/dev/PidEnums.h>
14
15namespace yarp::dev {
16class IPidControlRaw;
17class IPidControl;
18}
19
20
25{
26public:
30 virtual ~IPidControlRaw() {}
31
33
39 virtual bool setPidRaw(const PidControlTypeEnum& pidtype, int j, const Pid &pid) = 0;
40
46 virtual bool setPidsRaw(const PidControlTypeEnum& pidtype, const Pid *pids) = 0;
47
58 virtual bool setPidReferenceRaw(const PidControlTypeEnum& pidtype, int j, double ref) = 0;
59
69 virtual bool setPidReferencesRaw(const PidControlTypeEnum& pidtype, const double *refs) = 0;
70
77 virtual bool setPidErrorLimitRaw(const PidControlTypeEnum& pidtype, int j, double limit) = 0;
78
84 virtual bool setPidErrorLimitsRaw(const PidControlTypeEnum& pidtype, const double *limits) = 0;
85
92 virtual bool getPidErrorRaw(const PidControlTypeEnum& pidtype, int j, double *err) = 0;
93
98 virtual bool getPidErrorsRaw(const PidControlTypeEnum& pidtype, double *errs) = 0;
99
106 virtual bool getPidOutputRaw(const PidControlTypeEnum& pidtype, int j, double *out) = 0;
107
112 virtual bool getPidOutputsRaw(const PidControlTypeEnum& pidtype, double *outs) = 0;
113
120 virtual bool getPidRaw(const PidControlTypeEnum& pidtype, int j, Pid *pid) = 0;
121
127 virtual bool getPidsRaw(const PidControlTypeEnum& pidtype, Pid *pids) = 0;
128
135 virtual bool getPidReferenceRaw(const PidControlTypeEnum& pidtype, int j, double *ref) = 0;
136
141 virtual bool getPidReferencesRaw(const PidControlTypeEnum& pidtype, double *refs) = 0;
142
149 virtual bool getPidErrorLimitRaw(const PidControlTypeEnum& pidtype, int j, double *limit) = 0;
150
156 virtual bool getPidErrorLimitsRaw(const PidControlTypeEnum& pidtype, double *limits) = 0;
157
164 virtual bool resetPidRaw(const PidControlTypeEnum& pidtype, int j) = 0;
165
171 virtual bool disablePidRaw(const PidControlTypeEnum& pidtype, int j) = 0;
172
178 virtual bool enablePidRaw(const PidControlTypeEnum& pidtype, int j) = 0;
179
186 virtual bool setPidOffsetRaw(const PidControlTypeEnum& pidtype, int j, double v) = 0;
187
194 virtual bool isPidEnabledRaw(const PidControlTypeEnum& pidtype, int j, bool* enabled) = 0;
195};
196
204{
205public:
209 virtual ~IPidControl() {}
210
212
218 virtual bool setPid(const PidControlTypeEnum& pidtype, int j, const Pid &pid) = 0;
219
225 virtual bool setPids(const PidControlTypeEnum& pidtype, const Pid *pids) = 0;
226
237 virtual bool setPidReference(const PidControlTypeEnum& pidtype, int j, double ref) = 0;
238
248 virtual bool setPidReferences(const PidControlTypeEnum& pidtype, const double *refs) = 0;
249
256 virtual bool setPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double limit) = 0;
257
263 virtual bool setPidErrorLimits(const PidControlTypeEnum& pidtype, const double *limits) = 0;
264
271 virtual bool getPidError(const PidControlTypeEnum& pidtype, int j, double *err) = 0;
272
277 virtual bool getPidErrors(const PidControlTypeEnum& pidtype, double *errs) = 0;
278
285 virtual bool getPidOutput(const PidControlTypeEnum& pidtype, int j, double *out) = 0;
286
291 virtual bool getPidOutputs(const PidControlTypeEnum& pidtype, double *outs) = 0;
292
299 virtual bool getPid(const PidControlTypeEnum& pidtype, int j, Pid *pid) = 0;
300
306 virtual bool getPids(const PidControlTypeEnum& pidtype, Pid *pids) = 0;
307
314 virtual bool getPidReference(const PidControlTypeEnum& pidtype, int j, double *ref) = 0;
315
320 virtual bool getPidReferences(const PidControlTypeEnum& pidtype, double *refs) = 0;
321
328 virtual bool getPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double *limit) = 0;
329
335 virtual bool getPidErrorLimits(const PidControlTypeEnum& pidtype, double *limits) = 0;
336
343 virtual bool resetPid(const PidControlTypeEnum& pidtype, int j) = 0;
344
350 virtual bool disablePid(const PidControlTypeEnum& pidtype, int j) = 0;
351
357 virtual bool enablePid(const PidControlTypeEnum& pidtype, int j) = 0;
358
365 virtual bool setPidOffset(const PidControlTypeEnum& pidtype, int j, double v) = 0;
366
373 virtual bool isPidEnabled(const PidControlTypeEnum& pidtype, int j, bool* enabled) = 0;
374};
375
376// interface IPositionControl gets
379
380
381#endif // YARP_DEV_CONTROLBOARDINTERFACES_H
define control board standard interfaces
constexpr yarp::conf::vocab32_t VOCAB_PIDS
Definition: IPidControl.h:378
constexpr yarp::conf::vocab32_t VOCAB_PID
Definition: IPidControl.h:377
Interface for a generic control board device implementing a PID controller.
Definition: IPidControl.h:25
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 ~IPidControlRaw()
Destructor.
Definition: IPidControl.h:30
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 ...
Interface for a generic control board device implementing a PID controller, with scaled arguments.
Definition: IPidControl.h:204
virtual bool setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
Set new pid value for a joint axis.
virtual bool getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref)=0
Get the current reference of the pid controller for a specific joint.
virtual bool getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out)=0
Get the output of the controller (e.g.
virtual bool getPidReferences(const PidControlTypeEnum &pidtype, double *refs)=0
Get the current reference of all pid controllers.
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 ...
virtual bool setPidOffset(const PidControlTypeEnum &pidtype, int j, double v)=0
Set offset value for a given controller.
virtual bool getPidErrorLimits(const PidControlTypeEnum &pidtype, double *limits)=0
Get the error limit for all controllers.
virtual bool getPidError(const PidControlTypeEnum &pidtype, int j, double *err)=0
Get the current error for a joint.
virtual bool getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *limit)=0
Get the error limit for the controller on a specific joint.
virtual bool setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit)=0
Set the error limit for the controller on a specifi joint.
virtual bool disablePid(const PidControlTypeEnum &pidtype, int j)=0
Disable the pid computation for a joint.
virtual bool setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits)=0
Get the error limit for the controller on all joints.
virtual bool getPidOutputs(const PidControlTypeEnum &pidtype, double *outs)=0
Get the output of the controllers (e.g.
virtual bool setPidReference(const PidControlTypeEnum &pidtype, int j, double ref)=0
Set the controller reference for a given axis.
virtual bool setPidReferences(const PidControlTypeEnum &pidtype, const double *refs)=0
Set the controller reference, multiple axes.
virtual bool getPidErrors(const PidControlTypeEnum &pidtype, double *errs)=0
Get the error of all joints.
virtual ~IPidControl()
Destructor.
Definition: IPidControl.h:209
virtual bool setPids(const PidControlTypeEnum &pidtype, const Pid *pids)=0
Set new pid value on multiple axes.
virtual bool enablePid(const PidControlTypeEnum &pidtype, int j)=0
Enable the pid computation for a joint.
virtual bool isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool *enabled)=0
Get the current status (enabled/disabled) of the pid.
virtual bool getPids(const PidControlTypeEnum &pidtype, Pid *pids)=0
Get current pid value for a specific joint.
virtual bool getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
Get current pid value for a specific joint.
Contains the parameters for a PID.
std::int32_t vocab32_t
Definition: numeric.h:78
For streams capable of holding different kinds of content, check what they actually have.
PidControlTypeEnum
Definition: PidEnums.h:15
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition: Vocab.h:27
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18