YARP
Yet Another Robot Platform
ICurrentControl.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_ICURRENTCONTROL_H
7 #define YARP_DEV_ICURRENTCONTROL_H
8 
9 #include <yarp/os/Vocab.h>
10 #include <yarp/dev/api.h>
11 
12 namespace yarp {
13  namespace dev {
14  class ICurrentControlRaw;
15  class ICurrentControl;
16  }
17 }
18 
25 {
26 public:
30  virtual ~ICurrentControl() {}
31 
37  virtual bool getNumberOfMotors(int *ax) = 0;
38 
44  virtual bool getCurrent(int m, double *curr) = 0;
45 
50  virtual bool getCurrents(double *currs) = 0;
51 
60  virtual bool getCurrentRange(int m, double *min, double *max) = 0;
61 
69  virtual bool getCurrentRanges(double *min, double *max) = 0;
70 
75  virtual bool setRefCurrents(const double *currs) = 0;
76 
82  virtual bool setRefCurrent(int m, double curr) = 0;
83 
90  virtual bool setRefCurrents(const int n_motor, const int *motors, const double *currs) = 0;
91 
96  virtual bool getRefCurrents(double *currs) = 0;
97 
103  virtual bool getRefCurrent(int m, double *curr) = 0;
104 };
105 
111 {
112 public:
116  virtual ~ICurrentControlRaw() {}
117 
123  virtual bool getNumberOfMotorsRaw(int *number) = 0;
124 
130  virtual bool getCurrentRaw(int m, double *curr)=0;
131 
136  virtual bool getCurrentsRaw(double *currs)=0;
137 
146  virtual bool getCurrentRangeRaw(int m, double *min, double *max)=0;
147 
155  virtual bool getCurrentRangesRaw(double *min, double *max)=0;
156 
161  virtual bool setRefCurrentsRaw(const double *currs)=0;
162 
168  virtual bool setRefCurrentRaw(int m, double curr)=0;
169 
176  virtual bool setRefCurrentsRaw(const int n_motor, const int *motors, const double *currs) = 0;
177 
182  virtual bool getRefCurrentsRaw(double *currs)=0;
183 
189  virtual bool getRefCurrentRaw(int m, double *curr)=0;
190 };
191 
192 // Interface name
194 // methods names
195 
201 
202 #endif // YARP_DEV_ICURRENTCONTROL_H
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF_GROUP
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REFS
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGE
constexpr yarp::conf::vocab32_t VOCAB_CURRENTCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGES
Interface for control boards implementing current control.
virtual bool getNumberOfMotorsRaw(int *number)=0
Retrieves the number of controlled motors from the current physical interface.
virtual bool setRefCurrentsRaw(const double *currs)=0
Set the reference value of the currents for all motors.
virtual bool getCurrentRangesRaw(double *min, double *max)=0
Get the full scale of the current measurements for all motors motor (e.g.
virtual bool getCurrentsRaw(double *currs)=0
Get the instantaneous current measurement for all motors.
virtual bool getRefCurrentsRaw(double *currs)=0
Get the reference value of the currents for all motors.
virtual ~ICurrentControlRaw()
Destructor.
virtual bool setRefCurrentsRaw(const int n_motor, const int *motors, const double *currs)=0
Set the reference value of the current for a group of motors.
virtual bool getCurrentRaw(int m, double *curr)=0
Get the instantaneous current measurement for a single motor.
virtual bool setRefCurrentRaw(int m, double curr)=0
Set the reference value of the current for a single motor.
virtual bool getCurrentRangeRaw(int m, double *min, double *max)=0
Get the full scale of the current measurement for a given motor (e.g.
virtual bool getRefCurrentRaw(int m, double *curr)=0
Get the reference value of the current for a single motor.
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 ~ICurrentControl()
Destructor.
virtual bool setRefCurrents(const int n_motor, const int *motors, const double *currs)=0
Set the reference value of the current for a group of motors.
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.
std::int32_t vocab32_t
Definition: numeric.h:78
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:28
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18