YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ImplementPidControl.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_IMPLEMENTPIDCONTROL_H
7#define YARP_DEV_IMPLEMENTPIDCONTROL_H
8
10
11namespace yarp::dev {
12class ImplementPidControl;
13}
14
15namespace yarp::dev::impl {
16
17template <typename T>
18class FixedSizeBuffersManager;
19
20} // namespace yarp::dev::impl
21
23{
24protected:
26 void *helper;
29
36 bool initialize(int size, const int *amap, const double *enc, const double *zos, const double* newtons, const double* amps, const double* dutys);
37
42 bool uninitialize();
43
44 bool setConversionUnits(const PidControlTypeEnum& pidtype, const PidFeedbackUnitsEnum fbk_conv_units, const PidOutputUnitsEnum out_conv_units);
45
46public:
47 /* Constructor.
48 * @param y is the pointer to the class instance inheriting from this
49 * implementation.
50 */
52
53 /* Destructor.
54 */
55 virtual ~ImplementPidControl();
56
57 bool setPid(const PidControlTypeEnum& pidtype, int j, const Pid &pid) override;
58 bool setPids(const PidControlTypeEnum& pidtype, const Pid *pids) override;
59 bool setPidReference(const PidControlTypeEnum& pidtype, int j, double ref) override;
60 bool setPidReferences(const PidControlTypeEnum& pidtype, const double *refs) override;
61 bool setPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double limit) override;
62 bool setPidErrorLimits(const PidControlTypeEnum& pidtype, const double *limits) override;
63 bool getPidError(const PidControlTypeEnum& pidtype, int j, double *err) override;
64 bool getPidErrors(const PidControlTypeEnum& pidtype, double *errs) override;
65 bool getPidOutput(const PidControlTypeEnum& pidtype, int j, double *out) override;
66 bool getPidOutputs(const PidControlTypeEnum& pidtype, double *outs) override;
67 bool getPid(const PidControlTypeEnum& pidtype, int j, Pid *pid) override;
68 bool getPids(const PidControlTypeEnum& pidtype, Pid *pids) override;
69 bool getPidReference(const PidControlTypeEnum& pidtype, int j, double *ref) override;
70 bool getPidReferences(const PidControlTypeEnum& pidtype, double *refs) override;
71 bool getPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double *ref) override;
72 bool getPidErrorLimits(const PidControlTypeEnum& pidtype, double *refs) override;
73 bool resetPid(const PidControlTypeEnum& pidtype, int j) override;
74 bool enablePid(const PidControlTypeEnum& pidtype, int j) override;
75 bool disablePid(const PidControlTypeEnum& pidtype, int j) override;
76 bool setPidOffset(const PidControlTypeEnum& pidtype, int j, double v) override;
77 bool isPidEnabled(const PidControlTypeEnum& pidtype, int j, bool* enabled) override;
78 void b();
79};
80
81#endif // YARP_DEV_IMPLEMENTPIDCONTROL_H
Interface for a generic control board device implementing a PID controller.
Definition IPidControl.h:27
Interface for a generic control board device implementing a PID controller, with scaled arguments.
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.
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.
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.
A manager of fixed size buffers in multi-thread environment.
For streams capable of holding different kinds of content, check what they actually have.
PidOutputUnitsEnum
Definition PidEnums.h:31
PidControlTypeEnum
Definition PidEnums.h:15
PidFeedbackUnitsEnum
Definition PidEnums.h:25
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18