YARP
Yet Another Robot Platform
ImplementCurrentControl.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_IMPLEMENTCURRENTCONTROL_H
7 #define YARP_DEV_IMPLEMENTCURRENTCONTROL_H
8 
10 #include <yarp/dev/api.h>
11 
12 namespace yarp {
13  namespace dev {
14  class ImplementCurrentControl;
15  }
16 }
17 
18 namespace yarp {
19 namespace dev {
20 namespace impl {
21 
22 template <typename T>
23 class FixedSizeBuffersManager;
24 
25 } // namespace impl
26 } // namespace dev
27 } // namespace yarp
28 
30 {
31 protected:
33  void *helper;
36 
43  bool initialize(int size, const int *amap, const double* ampsToSens);
44 
49  bool uninitialize();
50 
51 public:
52  /* Constructor.
53  * @param y is the pointer to the class instance inheriting from this
54  * implementation.
55  */
57 
61  virtual ~ImplementCurrentControl();
62 
63  bool getNumberOfMotors(int *ax) override;
64  bool getRefCurrent(int j, double *) override;
65  bool getRefCurrents(double *t) override;
66  bool setRefCurrents(const double *t) override;
67  bool setRefCurrent(int j, double t) override;
68  bool setRefCurrents(const int n_joint, const int *joints, const double *t) override;
69  bool getCurrents(double *t) override;
70  bool getCurrent(int j, double *t) override;
71  bool getCurrentRange(int j, double *min, double *max) override;
72  bool getCurrentRanges(double *min, double *max) override;
73 };
74 
75 #endif // YARP_DEV_IMPLEMENTCURRENTCONTROL_H
float t
Interface for control boards implementing current control.
Interface for control boards implementing current control.
virtual bool getCurrents(double *currs)=0
Get the instantaneous current measurement for all motors.
virtual bool setRefCurrent(int m, double curr)=0
Set the reference value of the current for a single motor.
virtual bool getRefCurrents(double *currs)=0
Get the reference value of the currents for all motors.
virtual bool getNumberOfMotors(int *ax)=0
Retrieves the number of controlled axes from the current physical interface.
virtual bool setRefCurrents(const double *currs)=0
Set the reference value of the currents for all motors.
virtual bool getCurrent(int m, double *curr)=0
Get the instantaneous current measurement for a single motor.
virtual bool getCurrentRange(int m, double *min, double *max)=0
Get the full scale of the current measurement for a given motor (e.g.
virtual bool getRefCurrent(int m, double *curr)=0
Get the reference value of the current for a single motor.
virtual bool getCurrentRanges(double *min, double *max)=0
Get the full scale of the current measurements for all motors motor (e.g.
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
ImplementCurrentControl(yarp::dev::ICurrentControlRaw *y)
bool uninitialize()
Clean up internal data and memory.
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
yarp::dev::ICurrentControlRaw * iCurrentRaw
bool initialize(int size, const int *amap, const double *ampsToSens)
Initialize the internal data and alloc memory.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18