YARP
Yet Another Robot Platform
ImplementPidControl.cpp
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 
11 #include <yarp/os/LogStream.h>
13 
14 #include <cmath>
15 
16 using namespace yarp::dev;
17 using namespace yarp::os;
18 #define JOINTIDCHECK if (j >= castToMapper(helper)->axes()){yError("joint id out of bound"); return false;}
19 
22 helper(nullptr),
23 doubleBuffManager(nullptr),
24 pidBuffManager(nullptr)
25 {
26  iPid= dynamic_cast<IPidControlRaw *> (y);
27 }
28 
30 {
31  uninitialize();
32 }
33 
34 bool ImplementPidControl:: initialize (int size, const int *amap, const double *enc, const double *zos, const double* newtons, const double* amps, const double* dutys)
35 {
36  if (helper!=nullptr)
37  return false;
38 
39  helper=(void *)(new ControlBoardHelper(size, amap, enc, zos,newtons,amps,nullptr,dutys));
40  yAssert (helper != nullptr);
41 
43  yAssert (doubleBuffManager != nullptr);
44 
46  yAssert (pidBuffManager != nullptr);
47 
48  return true;
49 }
50 
56 {
57  if (helper!=nullptr)
58  {
59  delete castToMapper(helper);
60  helper=nullptr;
61  }
62 
64  {
65  delete doubleBuffManager;
66  doubleBuffManager=nullptr;
67  }
68 
69  if(pidBuffManager)
70  {
71  delete pidBuffManager;
72  pidBuffManager=nullptr;
73  }
74 
75  return true;
76 }
77 
78 bool ImplementPidControl::setPid(const PidControlTypeEnum& pidtype, int j, const Pid &pid)
79 {
81  Pid pid_machine;
82  int k;
84  cb_helper->convert_pid_to_machine(pidtype, pid, j, pid_machine, k);
85  return iPid->setPidRaw(pidtype, k, pid_machine);
86 }
87 
88 bool ImplementPidControl::setPids(const PidControlTypeEnum& pidtype, const Pid *pids)
89 {
91  int nj= cb_helper->axes();
93  for(int j=0;j<nj;j++)
94  {
95  Pid pid_machine;
96  int k;
97  cb_helper->convert_pid_to_machine(pidtype, pids[j], j, pid_machine, k);
98  buffValues[k] = pid_machine;
99  }
100 
101 
102  bool ret = iPid->setPidsRaw(pidtype, buffValues.getData());
103  pidBuffManager->releaseBuffer(buffValues);
104  return ret;
105 }
106 
107 bool ImplementPidControl::setPidReference(const PidControlTypeEnum& pidtype, int j, double ref)
108 {
110  int k=0;
111  double raw;
112  ControlBoardHelper* cb_helper = castToMapper(helper);
113  cb_helper->convert_pidunits_to_machine(pidtype,ref,j,raw,k);
114  return iPid->setPidReferenceRaw(pidtype, k, raw);
115 }
116 
117 bool ImplementPidControl::setPidReferences(const PidControlTypeEnum& pidtype, const double *refs)
118 {
119  ControlBoardHelper* cb_helper = castToMapper(helper);
121  cb_helper->convert_pidunits_to_machine(pidtype,refs,buffValues.getData());
122  bool ret = iPid->setPidReferencesRaw(pidtype, buffValues.getData());
123  doubleBuffManager->releaseBuffer(buffValues);
124  return ret;
125 }
126 
127 bool ImplementPidControl::setPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double limit)
128 {
130  int k;
131  double raw;
132  ControlBoardHelper* cb_helper = castToMapper(helper);
133  cb_helper->convert_pidunits_to_machine(pidtype,limit,j,raw,k);
134  return iPid->setPidErrorLimitRaw(pidtype, k, raw);
135 }
136 
137 bool ImplementPidControl::setPidErrorLimits(const PidControlTypeEnum& pidtype, const double *limits)
138 {
139  ControlBoardHelper* cb_helper = castToMapper(helper);
141  cb_helper->convert_pidunits_to_machine(pidtype,limits,buffValues.getData());
142  bool ret = iPid->setPidErrorLimitsRaw(pidtype, buffValues.getData());
143  doubleBuffManager->releaseBuffer(buffValues);
144  return ret;
145 }
146 
147 
148 bool ImplementPidControl::getPidError(const PidControlTypeEnum& pidtype, int j, double *err)
149 {
151  int k;
152  double raw;
153  ControlBoardHelper* cb_helper = castToMapper(helper);
154  k=castToMapper(helper)->toHw(j);
155 
156  bool ret=iPid->getPidErrorRaw(pidtype, k, &raw);
157 
158  cb_helper->convert_pidunits_to_user(pidtype,raw,err,k);
159  return ret;
160 }
161 
162 bool ImplementPidControl::getPidErrors(const PidControlTypeEnum& pidtype, double *errs)
163 {
164  bool ret;
165  ControlBoardHelper* cb_helper = castToMapper(helper);
167  ret=iPid->getPidErrorsRaw(pidtype, buffValues.getData());
168  cb_helper->convert_pidunits_to_user(pidtype,buffValues.getData(),errs);
169  doubleBuffManager->releaseBuffer(buffValues);
170  return ret;
171 }
172 
173 bool ImplementPidControl::getPidOutput(const PidControlTypeEnum& pidtype, int j, double *out)
174 {
176  bool ret;
177  int k_raw;
178  double raw;
179  k_raw = castToMapper(helper)->toHw(j);
180  ret = iPid->getPidOutputRaw(pidtype, k_raw, &raw);
181  if (ret)
182  {
183  ControlBoardHelper* cb_helper = castToMapper(helper);
184  double output_conversion_units_user2raw = cb_helper->get_pidoutput_conversion_factor_user2raw(pidtype, j);
185  *out = raw / output_conversion_units_user2raw;
186  return true;
187  }
188  return false;
189 }
190 
191 bool ImplementPidControl::getPidOutputs(const PidControlTypeEnum& pidtype, double *outs)
192 {
193  ControlBoardHelper* cb_helper = castToMapper(helper);
194  int nj = cb_helper->axes();
196  bool ret = iPid->getPidOutputsRaw(pidtype, buffValues.getData());
197  if (ret)
198  {
199  castToMapper(cb_helper)->toUser(buffValues.getData(), outs);
200  for (int j = 0; j < nj; j++)
201  {
202  double output_conversion_units_user2raw = cb_helper->get_pidoutput_conversion_factor_user2raw(pidtype, j);
203  outs[j] = outs[j] / output_conversion_units_user2raw;
204  }
205  }
206  doubleBuffManager->releaseBuffer(buffValues);
207  return ret;
208 }
209 
210 bool ImplementPidControl::getPid(const PidControlTypeEnum& pidtype, int j, Pid *pid)
211 {
213  ControlBoardHelper* cb_helper = castToMapper(helper);
214  int k_raw;
215  k_raw=cb_helper->toHw(j);
216  Pid rawPid;
217  bool ret = iPid->getPidRaw(pidtype, k_raw, &rawPid);
218  if (ret)
219  {
220  cb_helper->convert_pid_to_user(pidtype, rawPid, k_raw, *pid, j);
221  return true;
222  }
223  return false;
224 }
225 
227 {
229  if(!iPid->getPidsRaw(pidtype, buffValues.getData()))
230  {
231  pidBuffManager->releaseBuffer(buffValues);
232  return false;
233  }
234 
235  ControlBoardHelper* cb_helper = castToMapper(helper);
236  int nj=cb_helper->axes();
237 
238  for (int k_raw = 0; k_raw < nj; k_raw++)
239  {
240  int j_usr;
241  Pid outpid;
242  cb_helper->convert_pid_to_user(pidtype, buffValues[k_raw], k_raw, outpid, j_usr);
243  pids[j_usr] = outpid;
244  }
245  pidBuffManager->releaseBuffer(buffValues);
246  return true;
247 }
248 
249 bool ImplementPidControl::getPidReference(const PidControlTypeEnum& pidtype, int j, double *ref)
250 {
252  bool ret;
253  int k;
254  double raw;
255  ControlBoardHelper* cb_helper = castToMapper(helper);
256  k=castToMapper(helper)->toHw(j);
257 
258  ret=iPid->getPidReferenceRaw(pidtype, k, &raw);
259 
260  cb_helper->convert_pidunits_to_user(pidtype,raw,ref,k);
261  return ret;
262 }
263 
265 {
266  bool ret;
267  ControlBoardHelper* cb_helper = castToMapper(helper);
269  ret=iPid->getPidReferencesRaw(pidtype, buffValues.getData());
270 
271  cb_helper->convert_pidunits_to_user(pidtype,buffValues.getData(),refs);
272  doubleBuffManager->releaseBuffer(buffValues);
273  return ret;
274 }
275 
276 bool ImplementPidControl::getPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double *ref)
277 {
279  bool ret;
280  int k;
281  double raw;
282  ControlBoardHelper* cb_helper = castToMapper(helper);
283  k=castToMapper(helper)->toHw(j);
284 
285  ret=iPid->getPidErrorLimitRaw(pidtype, k, &raw);
286 
287  cb_helper->convert_pidunits_to_user(pidtype,raw,ref,k);
288  return ret;
289 }
290 
292 {
293  bool ret;
294  ControlBoardHelper* cb_helper = castToMapper(helper);
296  ret=iPid->getPidErrorLimitsRaw(pidtype, buffValues.getData());
297 
298  cb_helper->convert_pidunits_to_user(pidtype,buffValues.getData(),refs);
299  return ret;
300 }
301 
303 {
305  int k=0;
306  k=castToMapper(helper)->toHw(j);
307 
308  return iPid->resetPidRaw(pidtype, k);
309 }
310 
312 {
314  int k=0;
315  k=castToMapper(helper)->toHw(j);
316 
317  return iPid->enablePidRaw(pidtype, k);
318 }
319 
321 {
323  int k=0;
324  k=castToMapper(helper)->toHw(j);
325 
326  return iPid->disablePidRaw(pidtype, k);
327 }
328 
329 bool ImplementPidControl::setPidOffset(const PidControlTypeEnum& pidtype, int j, double off)
330 {
332  int k = 0;
333  double rawoff;
334  ControlBoardHelper* cb_helper = castToMapper(helper);
335  double output_conversion_units_user2raw = cb_helper->get_pidoutput_conversion_factor_user2raw(pidtype,j);
336  rawoff = off * output_conversion_units_user2raw;
337  return iPid->setPidOffsetRaw(pidtype, k, rawoff);
338 }
339 
340 bool ImplementPidControl::isPidEnabled(const PidControlTypeEnum& pidtype, int j, bool* enabled)
341 {
343  int k=0;
344  k=castToMapper(helper)->toHw(j);
345 
346  return iPid->isPidEnabledRaw(pidtype, k, enabled);
347 }
348 
349 bool ImplementPidControl::setConversionUnits(const PidControlTypeEnum& pidtype, const PidFeedbackUnitsEnum fbk_conv_units, const PidOutputUnitsEnum out_conv_units)
350 {
351  castToMapper(helper)->set_pid_conversion_units(pidtype, fbk_conv_units, out_conv_units);
352  return true;
353 }
LogStream.h
yarp::dev::ImplementPidControl::helper
void * helper
Definition: ImplementPidControl.h:35
yarp::dev::ControlBoardHelper::convert_pidunits_to_machine
void convert_pidunits_to_machine(const yarp::dev::PidControlTypeEnum &pidtype, double userval, int j, double &machineval, int &k)
Definition: ControlBoardHelper.cpp:858
yarp::dev::ControlBoardHelper::toHw
int toHw(int axis)
Definition: ControlBoardHelper.cpp:245
yarp::dev::ControlBoardHelper::convert_pid_to_machine
void convert_pid_to_machine(const yarp::dev::PidControlTypeEnum &pidtype, const Pid &in_usr, int j_usr, Pid &out_raw, int &k_raw)
Definition: ControlBoardHelper.cpp:834
yarp::dev::ControlBoardHelper::get_pidoutput_conversion_factor_user2raw
double get_pidoutput_conversion_factor_user2raw(const yarp::dev::PidControlTypeEnum &pidtype, int j)
Definition: ControlBoardHelper.cpp:767
yarp::dev::ImplementPidControl::setPidErrorLimits
bool setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
Definition: ImplementPidControl.cpp:137
yarp::dev::ImplementPidControl::doubleBuffManager
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
Definition: ImplementPidControl.h:36
yarp::dev::ControlBoardHelper::toUser
int toUser(int axis)
Definition: ControlBoardHelper.cpp:248
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::ImplementPidControl::~ImplementPidControl
virtual ~ImplementPidControl()
Definition: ImplementPidControl.cpp:29
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::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::isPidEnabledRaw
virtual bool isPidEnabledRaw(const PidControlTypeEnum &pidtype, int j, bool *enabled)=0
Get the current status (enabled/disabled) of the pid controller.
yarp::dev::impl::Buffer::getData
T * getData()
Return the data pointer.
Definition: FixedSizeBuffersManager-inl.h:29
yarp::dev::PidOutputUnitsEnum
PidOutputUnitsEnum
Definition: PidEnums.h:37
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::impl::FixedSizeBuffersManager< double >
yarp::dev::impl::FixedSizeBuffersManager::getBuffer
Buffer< T > getBuffer()
Get a buffer and fill its information in @buffer.
Definition: FixedSizeBuffersManager-inl.h:87
yarp::dev::ImplementPidControl::getPids
bool getPids(const PidControlTypeEnum &pidtype, Pid *pids) override
Get current pid value for a specific joint.
Definition: ImplementPidControl.cpp:226
yarp::dev::ImplementPidControl::setPidOffset
bool setPidOffset(const PidControlTypeEnum &pidtype, int j, double v) override
Set offset value for a given controller.
Definition: ImplementPidControl.cpp:329
ret
bool ret
Definition: ImplementAxisInfo.cpp:72
yarp::dev::ImplementPidControl::isPidEnabled
bool isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool *enabled) override
Get the current status (enabled/disabled) of the pid.
Definition: ImplementPidControl.cpp:340
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 ...
yarp::dev
An interface for the device drivers.
Definition: audioBufferSizeData.cpp:17
yarp::dev::IPidControlRaw::disablePidRaw
virtual bool disablePidRaw(const PidControlTypeEnum &pidtype, int j)=0
Disable the pid computation for a joint.
yarp::dev::ImplementPidControl::iPid
IPidControlRaw * iPid
Definition: ImplementPidControl.h:34
yarp::dev::IPidControlRaw::getPidErrorLimitsRaw
virtual bool getPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, double *limits)=0
Get the error limit for all controllers.
yarp::dev::ImplementPidControl::getPidReferences
bool getPidReferences(const PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all pid controllers.
Definition: ImplementPidControl.cpp:264
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::ImplementPidControl::getPidOutput
bool getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
Definition: ImplementPidControl.cpp:173
yarp::dev::ImplementPidControl::setPid
bool setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid) override
Set new pid value for a joint axis.
Definition: ImplementPidControl.cpp:78
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::ImplementPidControl::enablePid
bool enablePid(const PidControlTypeEnum &pidtype, int j) override
Enable the pid computation for a joint.
Definition: ImplementPidControl.cpp:311
yarp::dev::PidControlTypeEnum
PidControlTypeEnum
Definition: PidEnums.h:21
yarp::dev::IPidControlRaw::setPidsRaw
virtual bool setPidsRaw(const PidControlTypeEnum &pidtype, const Pid *pids)=0
Set new pid value on multiple axes.
JOINTIDCHECK
#define JOINTIDCHECK
Definition: ImplementPidControl.cpp:18
yarp::dev::ImplementPidControl::resetPid
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 ...
Definition: ImplementPidControl.cpp:302
yarp::dev::ImplementPidControl::uninitialize
bool uninitialize()
Clean up internal data and memory.
Definition: ImplementPidControl.cpp:55
FixedSizeBuffersManager.h
yarp::dev::impl::Buffer
Buffer contains info about a buffer of type T and it is used to exchange information with yarp::dev::...
Definition: FixedSizeBuffersManager.h:27
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::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::ImplementPidControl::getPidErrorLimits
bool getPidErrorLimits(const PidControlTypeEnum &pidtype, double *refs) override
Get the error limit for all controllers.
Definition: ImplementPidControl.cpp:291
yarp::dev::ImplementPidControl::setPids
bool setPids(const PidControlTypeEnum &pidtype, const Pid *pids) override
Set new pid value on multiple axes.
Definition: ImplementPidControl.cpp:88
yarp::dev::ImplementPidControl::pidBuffManager
yarp::dev::impl::FixedSizeBuffersManager< yarp::dev::Pid > * pidBuffManager
Definition: ImplementPidControl.h:37
ControlBoardHelper.h
yarp::dev::ImplementPidControl::ImplementPidControl
ImplementPidControl(yarp::dev::IPidControlRaw *y)
Definition: ImplementPidControl.cpp:21
yarp::dev::ImplementPidControl::setConversionUnits
bool setConversionUnits(const PidControlTypeEnum &pidtype, const PidFeedbackUnitsEnum fbk_conv_units, const PidOutputUnitsEnum out_conv_units)
Definition: ImplementPidControl.cpp:349
yarp::dev::IPidControlRaw
Interface for a generic control board device implementing a PID controller.
Definition: IPidControl.h:32
yarp::dev::impl::FixedSizeBuffersManager::releaseBuffer
void releaseBuffer(Buffer< T > &buffer)
Release a buffer.
Definition: FixedSizeBuffersManager-inl.h:156
yarp::dev::ImplementPidControl::setPidReferences
bool setPidReferences(const PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
Definition: ImplementPidControl.cpp:117
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.
yarp::dev::PidFeedbackUnitsEnum
PidFeedbackUnitsEnum
Definition: PidEnums.h:31
yarp::dev::ImplementPidControl::getPidErrors
bool getPidErrors(const PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
Definition: ImplementPidControl.cpp:162
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
yarp::dev::IPidControlRaw::getPidOutputsRaw
virtual bool getPidOutputsRaw(const PidControlTypeEnum &pidtype, double *outs)=0
Get the output of the controllers (e.g.
castToMapper
yarp::dev::ControlBoardHelper * castToMapper(void *p)
Definition: ControlBoardHelper.h:180
yarp::dev::ImplementPidControl::disablePid
bool disablePid(const PidControlTypeEnum &pidtype, int j) override
Disable the pid computation for a joint.
Definition: ImplementPidControl.cpp:320
yarp::dev::ControlBoardHelper
Definition: ControlBoardHelper.h:60
yarp::dev::ControlBoardHelper::convert_pid_to_user
void convert_pid_to_user(const yarp::dev::PidControlTypeEnum &pidtype, const Pid &in_raw, int j_raw, Pid &out_usr, int &k_usr)
Definition: ControlBoardHelper.cpp:802
yarp::dev::ImplementPidControl::setPidErrorLimit
bool setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit) override
Set the error limit for the controller on a specifi joint.
Definition: ImplementPidControl.cpp:127
yarp::dev::ImplementPidControl::getPid
bool getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid) override
Get current pid value for a specific joint.
Definition: ImplementPidControl.cpp:210
yarp::dev::ImplementPidControl::getPidReference
bool getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref) override
Get the current reference of the pid controller for a specific joint.
Definition: ImplementPidControl.cpp:249
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::ImplementPidControl::initialize
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.
Definition: ImplementPidControl.cpp:34
yarp::dev::ControlBoardHelper::axes
int axes()
Definition: ControlBoardHelper.cpp:762
yarp::dev::ImplementPidControl::getPidError
bool getPidError(const PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
Definition: ImplementPidControl.cpp:148
ImplementPidControl.h
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::ControlBoardHelper::set_pid_conversion_units
void set_pid_conversion_units(const PidControlTypeEnum &pidtype, const PidFeedbackUnitsEnum fbk_conv_units, const PidOutputUnitsEnum out_conv_units)
Definition: ControlBoardHelper.cpp:958
yarp::dev::IPidControlRaw::getPidsRaw
virtual bool getPidsRaw(const PidControlTypeEnum &pidtype, Pid *pids)=0
Get current pid value for a specific joint.
yarp::dev::ImplementPidControl::setPidReference
bool setPidReference(const PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
Definition: ImplementPidControl.cpp:107
yAssert
#define yAssert(x)
Definition: Log.h:297
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::ImplementPidControl::getPidErrorLimit
bool getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *ref) override
Get the error limit for the controller on a specific joint.
Definition: ImplementPidControl.cpp:276
yarp::dev::ControlBoardHelper::convert_pidunits_to_user
void convert_pidunits_to_user(const yarp::dev::PidControlTypeEnum &pidtype, const double machineval, double *userval, int k)
Definition: ControlBoardHelper.cpp:908
yarp::dev::ImplementPidControl::getPidOutputs
bool getPidOutputs(const PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
Definition: ImplementPidControl.cpp:191