YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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 <vector>
10
11#include <yarp/os/Vocab.h>
12#include <yarp/dev/api.h>
14#include <yarp/dev/PidEnums.h>
18
19namespace yarp::dev {
20class IPidControlRaw;
21class IPidControl;
22}
23
24
31{
32public:
36 virtual ~IPidControlRaw() {}
37
39
45 virtual yarp::dev::ReturnValue getAvailablePidsRaw(int j, std::vector<PidControlTypeEnum>& avail) = 0;
46
53 virtual yarp::dev::ReturnValue setPidRaw(const PidControlTypeEnum& pidtype, int j, const Pid &pid) = 0;
54
60 virtual yarp::dev::ReturnValue setPidsRaw(const PidControlTypeEnum& pidtype, const Pid *pids) = 0;
61
72 virtual yarp::dev::ReturnValue setPidReferenceRaw(const PidControlTypeEnum& pidtype, int j, double ref) = 0;
73
83 virtual yarp::dev::ReturnValue setPidReferencesRaw(const PidControlTypeEnum& pidtype, const double *refs) = 0;
84
91 virtual yarp::dev::ReturnValue setPidErrorLimitRaw(const PidControlTypeEnum& pidtype, int j, double limit) = 0;
92
98 virtual yarp::dev::ReturnValue setPidErrorLimitsRaw(const PidControlTypeEnum& pidtype, const double *limits) = 0;
99
106 virtual yarp::dev::ReturnValue getPidErrorRaw(const PidControlTypeEnum& pidtype, int j, double *err) = 0;
107
112 virtual yarp::dev::ReturnValue getPidErrorsRaw(const PidControlTypeEnum& pidtype, double *errs) = 0;
113
120 virtual yarp::dev::ReturnValue getPidOutputRaw(const PidControlTypeEnum& pidtype, int j, double *out) = 0;
121
126 virtual yarp::dev::ReturnValue getPidOutputsRaw(const PidControlTypeEnum& pidtype, double *outs) = 0;
127
134 virtual yarp::dev::ReturnValue getPidRaw(const PidControlTypeEnum& pidtype, int j, Pid *pid) = 0;
135
141 virtual yarp::dev::ReturnValue getPidsRaw(const PidControlTypeEnum& pidtype, Pid *pids) = 0;
142
150
156 virtual yarp::dev::ReturnValue getPidExtraInfosRaw(const PidControlTypeEnum& pidtype, std::vector<yarp::dev::PidExtraInfo>& info) = 0;
157
164 virtual yarp::dev::ReturnValue getPidReferenceRaw(const PidControlTypeEnum& pidtype, int j, double *ref) = 0;
165
170 virtual yarp::dev::ReturnValue getPidReferencesRaw(const PidControlTypeEnum& pidtype, double *refs) = 0;
171
178 virtual yarp::dev::ReturnValue getPidErrorLimitRaw(const PidControlTypeEnum& pidtype, int j, double *limit) = 0;
179
185 virtual yarp::dev::ReturnValue getPidErrorLimitsRaw(const PidControlTypeEnum& pidtype, double *limits) = 0;
186
193 virtual yarp::dev::ReturnValue resetPidRaw(const PidControlTypeEnum& pidtype, int j) = 0;
194
200 virtual yarp::dev::ReturnValue disablePidRaw(const PidControlTypeEnum& pidtype, int j) = 0;
201
207 virtual yarp::dev::ReturnValue enablePidRaw(const PidControlTypeEnum& pidtype, int j) = 0;
208
215 virtual yarp::dev::ReturnValue setPidOffsetRaw(const PidControlTypeEnum& pidtype, int j, double v) = 0;
216
223 virtual yarp::dev::ReturnValue setPidFeedforwardRaw(const PidControlTypeEnum& pidtype, int j, double v) = 0;
224
231 virtual yarp::dev::ReturnValue getPidOffsetRaw(const PidControlTypeEnum& pidtype, int j, double& v) = 0;
232
239 virtual yarp::dev::ReturnValue getPidFeedforwardRaw(const PidControlTypeEnum& pidtype, int j, double& v) = 0;
240
247 virtual yarp::dev::ReturnValue isPidEnabledRaw(const PidControlTypeEnum& pidtype, int j, bool& enabled) = 0;
248};
249
257{
258public:
262 virtual ~IPidControl() {}
263
265
271 virtual yarp::dev::ReturnValue getAvailablePids(int j, std::vector<PidControlTypeEnum>& avail) = 0;
272
279 virtual yarp::dev::ReturnValue setPid(const PidControlTypeEnum& pidtype, int j, const Pid &pid) = 0;
280
286 virtual yarp::dev::ReturnValue setPids(const PidControlTypeEnum& pidtype, const Pid *pids) = 0;
287
298 virtual yarp::dev::ReturnValue setPidReference(const PidControlTypeEnum& pidtype, int j, double ref) = 0;
299
309 virtual yarp::dev::ReturnValue setPidReferences(const PidControlTypeEnum& pidtype, const double *refs) = 0;
310
317 virtual yarp::dev::ReturnValue setPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double limit) = 0;
318
324 virtual yarp::dev::ReturnValue setPidErrorLimits(const PidControlTypeEnum& pidtype, const double *limits) = 0;
325
332 virtual yarp::dev::ReturnValue getPidError(const PidControlTypeEnum& pidtype, int j, double *err) = 0;
333
338 virtual yarp::dev::ReturnValue getPidErrors(const PidControlTypeEnum& pidtype, double *errs) = 0;
339
346 virtual yarp::dev::ReturnValue getPidOutput(const PidControlTypeEnum& pidtype, int j, double *out) = 0;
347
352 virtual yarp::dev::ReturnValue getPidOutputs(const PidControlTypeEnum& pidtype, double *outs) = 0;
353
360 virtual yarp::dev::ReturnValue getPid(const PidControlTypeEnum& pidtype, int j, Pid *pid) = 0;
361
367 virtual yarp::dev::ReturnValue getPids(const PidControlTypeEnum& pidtype, Pid *pids) = 0;
368
376
382 virtual yarp::dev::ReturnValue getPidExtraInfos(const PidControlTypeEnum& pidtype, std::vector<yarp::dev::PidExtraInfo>& info) = 0;
383
390 virtual yarp::dev::ReturnValue getPidReference(const PidControlTypeEnum& pidtype, int j, double *ref) = 0;
391
396 virtual yarp::dev::ReturnValue getPidReferences(const PidControlTypeEnum& pidtype, double *refs) = 0;
397
404 virtual yarp::dev::ReturnValue getPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double *limit) = 0;
405
411 virtual yarp::dev::ReturnValue getPidErrorLimits(const PidControlTypeEnum& pidtype, double *limits) = 0;
412
419 virtual yarp::dev::ReturnValue resetPid(const PidControlTypeEnum& pidtype, int j) = 0;
420
426 virtual yarp::dev::ReturnValue disablePid(const PidControlTypeEnum& pidtype, int j) = 0;
427
433 virtual yarp::dev::ReturnValue enablePid(const PidControlTypeEnum& pidtype, int j) = 0;
434
441 virtual yarp::dev::ReturnValue setPidOffset(const PidControlTypeEnum& pidtype, int j, double v) = 0;
442
449 virtual yarp::dev::ReturnValue setPidFeedforward(const PidControlTypeEnum& pidtype, int j, double v) = 0;
450
457 virtual yarp::dev::ReturnValue getPidOffset(const PidControlTypeEnum& pidtype, int j, double& v) = 0;
458
465 virtual yarp::dev::ReturnValue getPidFeedforward(const PidControlTypeEnum& pidtype, int j, double& v) = 0;
466
473 virtual yarp::dev::ReturnValue isPidEnabled(const PidControlTypeEnum& pidtype, int j, bool& enabled) = 0;
474};
475
476// Interface name
478
479// interface IPidControl
482
485
486
487#endif // YARP_DEV_CONTROLBOARDINTERFACES_H
defines yarp::dev::Pid datatype
constexpr yarp::conf::vocab32_t VOCAB_PIDCONTROL_SET_FEEDFORWARD
constexpr yarp::conf::vocab32_t VOCAB_PIDS
constexpr yarp::conf::vocab32_t VOCAB_PIDCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_PIDCONTROL_SET_OFFSET
constexpr yarp::conf::vocab32_t VOCAB_PID
Interface for a generic control board device implementing a PID controller.
Definition IPidControl.h:31
virtual yarp::dev::ReturnValue getPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, double *limits)=0
Get the error limit for all controllers.
virtual yarp::dev::ReturnValue getPidRaw(const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
Get current PID value for a specific joint.
virtual yarp::dev::ReturnValue getPidReferencesRaw(const PidControlTypeEnum &pidtype, double *refs)=0
Get the current reference of all PID controllers.
virtual yarp::dev::ReturnValue setPidRaw(const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
Set new PID value for a joint axis.
virtual yarp::dev::ReturnValue setPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double ref)=0
Set the controller reference for a given axis.
virtual yarp::dev::ReturnValue getPidOutputsRaw(const PidControlTypeEnum &pidtype, double *outs)=0
Get the output of the controllers (e.g.
virtual yarp::dev::ReturnValue getPidOutputRaw(const PidControlTypeEnum &pidtype, int j, double *out)=0
Get the output of the controller (e.g.
virtual yarp::dev::ReturnValue getPidExtraInfosRaw(const PidControlTypeEnum &pidtype, std::vector< yarp::dev::PidExtraInfo > &info)=0
Get PID extra info and measurement units for a specific joint.
virtual yarp::dev::ReturnValue isPidEnabledRaw(const PidControlTypeEnum &pidtype, int j, bool &enabled)=0
Get the current status (enabled/disabled) of the PID controller.
virtual yarp::dev::ReturnValue getPidExtraInfoRaw(const PidControlTypeEnum &pidtype, int j, yarp::dev::PidExtraInfo &info)=0
Get PID extra info and measurement units for a specific joint.
virtual yarp::dev::ReturnValue getAvailablePidsRaw(int j, std::vector< PidControlTypeEnum > &avail)=0
Return a list of available pid types mode for the given joint.
virtual yarp::dev::ReturnValue enablePidRaw(const PidControlTypeEnum &pidtype, int j)=0
Enable the PID computation for a joint.
virtual yarp::dev::ReturnValue setPidReferencesRaw(const PidControlTypeEnum &pidtype, const double *refs)=0
Set the controller reference, multiple axes.
virtual yarp::dev::ReturnValue setPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, const double *limits)=0
Get the error limit for the controller on all joints.
virtual ~IPidControlRaw()
Destructor.
Definition IPidControl.h:36
virtual yarp::dev::ReturnValue getPidErrorRaw(const PidControlTypeEnum &pidtype, int j, double *err)=0
Get the current error for a joint.
virtual yarp::dev::ReturnValue getPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double *ref)=0
Get the current reference of the PID controller for a specific joint.
virtual yarp::dev::ReturnValue getPidFeedforwardRaw(const PidControlTypeEnum &pidtype, int j, double &v)=0
Get the currently set feedforward value for the specified PID controller.
virtual yarp::dev::ReturnValue getPidsRaw(const PidControlTypeEnum &pidtype, Pid *pids)=0
Get current PID value for a specific joint.
virtual yarp::dev::ReturnValue getPidOffsetRaw(const PidControlTypeEnum &pidtype, int j, double &v)=0
Get the currently set offset value for the specified PID controller.
virtual yarp::dev::ReturnValue setPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double limit)=0
Set the error limit for the controller on a specific joint.
virtual yarp::dev::ReturnValue disablePidRaw(const PidControlTypeEnum &pidtype, int j)=0
Disable the PID computation for a joint.
virtual yarp::dev::ReturnValue 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 ...
virtual yarp::dev::ReturnValue getPidErrorsRaw(const PidControlTypeEnum &pidtype, double *errs)=0
Get the error of all joints.
virtual yarp::dev::ReturnValue setPidFeedforwardRaw(const PidControlTypeEnum &pidtype, int j, double v)=0
Set the feedforward value for the specified PID controller.
virtual yarp::dev::ReturnValue getPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double *limit)=0
Get the error limit for the controller on a specific joint.
virtual yarp::dev::ReturnValue setPidOffsetRaw(const PidControlTypeEnum &pidtype, int j, double v)=0
Set an offset value for a given controller.
virtual yarp::dev::ReturnValue setPidsRaw(const PidControlTypeEnum &pidtype, const Pid *pids)=0
Set new PID value on multiple axes.
Interface for a generic control board device implementing a PID controller, with scaled arguments.
virtual yarp::dev::ReturnValue disablePid(const PidControlTypeEnum &pidtype, int j)=0
Disable the PID computation for a joint.
virtual yarp::dev::ReturnValue getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *limit)=0
Get the error limit for the controller on a specific joint.
virtual yarp::dev::ReturnValue getPidErrorLimits(const PidControlTypeEnum &pidtype, double *limits)=0
Get the error limit for all controllers.
virtual yarp::dev::ReturnValue setPids(const PidControlTypeEnum &pidtype, const Pid *pids)=0
Set new PID value on multiple axes.
virtual yarp::dev::ReturnValue setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits)=0
Get the error limit for the controller on all joints.
virtual yarp::dev::ReturnValue getPidErrors(const PidControlTypeEnum &pidtype, double *errs)=0
Get the error of all joints.
virtual yarp::dev::ReturnValue getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out)=0
Get the output of the controller (e.g.
virtual yarp::dev::ReturnValue getPidFeedforward(const PidControlTypeEnum &pidtype, int j, double &v)=0
Get the currently set feedforward value for the specified PID controller.
virtual yarp::dev::ReturnValue getPidOffset(const PidControlTypeEnum &pidtype, int j, double &v)=0
Get the currently set offset value for the specified PID controller.
virtual yarp::dev::ReturnValue getPidExtraInfos(const PidControlTypeEnum &pidtype, std::vector< yarp::dev::PidExtraInfo > &info)=0
Get PID extra info and measurement units for a specific joint.
virtual yarp::dev::ReturnValue isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool &enabled)=0
Get the current status (enabled/disabled) of the PID.
virtual yarp::dev::ReturnValue 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 yarp::dev::ReturnValue getAvailablePids(int j, std::vector< PidControlTypeEnum > &avail)=0
Return a list of available pid types mode for the given joint.
virtual yarp::dev::ReturnValue getPids(const PidControlTypeEnum &pidtype, Pid *pids)=0
Get current PID value for a specific joint.
virtual yarp::dev::ReturnValue getPidExtraInfo(const PidControlTypeEnum &pidtype, int j, yarp::dev::PidExtraInfo &info)=0
Get PID extra info and measurement units for a specific joint.
virtual yarp::dev::ReturnValue setPidReferences(const PidControlTypeEnum &pidtype, const double *refs)=0
Set the controller reference, multiple axes.
virtual yarp::dev::ReturnValue setPidReference(const PidControlTypeEnum &pidtype, int j, double ref)=0
Set the controller reference for a given axis.
virtual yarp::dev::ReturnValue setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit)=0
Set the error limit for the controller on a specific joint.
virtual yarp::dev::ReturnValue setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
Set new PID value for a joint axis.
virtual yarp::dev::ReturnValue getPidError(const PidControlTypeEnum &pidtype, int j, double *err)=0
Get the current error for a joint.
virtual yarp::dev::ReturnValue getPidReferences(const PidControlTypeEnum &pidtype, double *refs)=0
Get the current reference of all PID controllers.
virtual yarp::dev::ReturnValue setPidFeedforward(const PidControlTypeEnum &pidtype, int j, double v)=0
Set the feedforward value for the specified PID controller.
virtual yarp::dev::ReturnValue enablePid(const PidControlTypeEnum &pidtype, int j)=0
Enable the PID computation for a joint.
virtual yarp::dev::ReturnValue getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref)=0
Get the current reference of the PID controller for a specific joint.
virtual yarp::dev::ReturnValue getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
Get current PID value for a specific joint.
virtual yarp::dev::ReturnValue setPidOffset(const PidControlTypeEnum &pidtype, int j, double v)=0
Set an offset value for a given controller.
virtual yarp::dev::ReturnValue getPidOutputs(const PidControlTypeEnum &pidtype, double *outs)=0
Get the output of the controllers (e.g.
virtual ~IPidControl()
Destructor.
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 Vocab32.h:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18