YARP
Yet Another Robot Platform
ICurrentControl.h
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 
9 #ifndef YARP_DEV_ICURRENTCONTROL_H
10 #define YARP_DEV_ICURRENTCONTROL_H
11 
12 #include <yarp/os/Vocab.h>
13 #include <yarp/dev/api.h>
14 
15 namespace yarp {
16  namespace dev {
17  class ICurrentControlRaw;
18  class ICurrentControl;
19  }
20 }
21 
28 {
29 public:
33  virtual ~ICurrentControl() {}
34 
40  virtual bool getNumberOfMotors(int *ax) = 0;
41 
47  virtual bool getCurrent(int m, double *curr) = 0;
48 
53  virtual bool getCurrents(double *currs) = 0;
54 
63  virtual bool getCurrentRange(int m, double *min, double *max) = 0;
64 
72  virtual bool getCurrentRanges(double *min, double *max) = 0;
73 
78  virtual bool setRefCurrents(const double *currs) = 0;
79 
85  virtual bool setRefCurrent(int m, double curr) = 0;
86 
93  virtual bool setRefCurrents(const int n_motor, const int *motors, const double *currs) = 0;
94 
99  virtual bool getRefCurrents(double *currs) = 0;
100 
106  virtual bool getRefCurrent(int m, double *curr) = 0;
107 };
108 
114 {
115 public:
119  virtual ~ICurrentControlRaw() {}
120 
126  virtual bool getNumberOfMotorsRaw(int *number) = 0;
127 
133  virtual bool getCurrentRaw(int m, double *curr)=0;
134 
139  virtual bool getCurrentsRaw(double *currs)=0;
140 
149  virtual bool getCurrentRangeRaw(int m, double *min, double *max)=0;
150 
158  virtual bool getCurrentRangesRaw(double *min, double *max)=0;
159 
164  virtual bool setRefCurrentsRaw(const double *currs)=0;
165 
171  virtual bool setRefCurrentRaw(int m, double curr)=0;
172 
179  virtual bool setRefCurrentsRaw(const int n_motor, const int *motors, const double *currs) = 0;
180 
185  virtual bool getRefCurrentsRaw(double *currs)=0;
186 
192  virtual bool getRefCurrentRaw(int m, double *curr)=0;
193 };
194 
195 // Interface name
197 // methods names
198 
204 
205 #endif // YARP_DEV_ICURRENTCONTROL_H
VOCAB_CURRENT_RANGE
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGE
Definition: ICurrentControl.h:202
yarp::dev::ICurrentControl::getRefCurrent
virtual bool getRefCurrent(int m, double *curr)=0
Get the reference value of the current for a single motor.
yarp::dev::ICurrentControlRaw::getRefCurrentsRaw
virtual bool getRefCurrentsRaw(double *currs)=0
Get the reference value of the currents for all motors.
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
VOCAB_CURRENT_REF_GROUP
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF_GROUP
Definition: ICurrentControl.h:201
yarp::dev::ICurrentControlRaw::getCurrentRangeRaw
virtual bool getCurrentRangeRaw(int m, double *min, double *max)=0
Get the full scale of the current measurement for a given motor (e.g.
yarp::dev::ICurrentControlRaw::getNumberOfMotorsRaw
virtual bool getNumberOfMotorsRaw(int *number)=0
Retrieves the number of controlled motors from the current physical interface.
yarp::dev::ICurrentControlRaw::getCurrentRangesRaw
virtual bool getCurrentRangesRaw(double *min, double *max)=0
Get the full scale of the current measurements for all motors motor (e.g.
yarp::dev::ICurrentControlRaw::setRefCurrentRaw
virtual bool setRefCurrentRaw(int m, double curr)=0
Set the reference value of the current for a single motor.
yarp::dev::ICurrentControl::setRefCurrents
virtual bool setRefCurrents(const double *currs)=0
Set the reference value of the currents for all motors.
yarp::dev::ICurrentControl::getCurrents
virtual bool getCurrents(double *currs)=0
Get the instantaneous current measurement for all motors.
yarp::dev::ICurrentControlRaw
Interface for control boards implementing current control.
Definition: ICurrentControl.h:114
yarp::dev::ICurrentControlRaw::~ICurrentControlRaw
virtual ~ICurrentControlRaw()
Destructor.
Definition: ICurrentControl.h:119
yarp::dev::ICurrentControl::getCurrent
virtual bool getCurrent(int m, double *curr)=0
Get the instantaneous current measurement for a single motor.
VOCAB_CURRENT_REFS
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REFS
Definition: ICurrentControl.h:200
yarp::dev::ICurrentControlRaw::getCurrentsRaw
virtual bool getCurrentsRaw(double *currs)=0
Get the instantaneous current measurement for all motors.
yarp::dev::ICurrentControl::getRefCurrents
virtual bool getRefCurrents(double *currs)=0
Get the reference value of the currents for all motors.
yarp::dev::ICurrentControlRaw::setRefCurrentsRaw
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.
yarp::dev::ICurrentControlRaw::getRefCurrentRaw
virtual bool getRefCurrentRaw(int m, double *curr)=0
Get the reference value of the current for a single motor.
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::ICurrentControlRaw::setRefCurrentsRaw
virtual bool setRefCurrentsRaw(const double *currs)=0
Set the reference value of the currents for all motors.
VOCAB_CURRENTCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_CURRENTCONTROL_INTERFACE
Definition: ICurrentControl.h:196
yarp::dev::ICurrentControl
Interface for control boards implementing current control.
Definition: ICurrentControl.h:28
yarp::dev::ICurrentControl::setRefCurrent
virtual bool setRefCurrent(int m, double curr)=0
Set the reference value of the current for a single motor.
yarp::dev::ICurrentControl::getCurrentRange
virtual bool getCurrentRange(int m, double *min, double *max)=0
Get the full scale of the current measurement for a given motor (e.g.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
yarp::dev::ICurrentControl::getNumberOfMotors
virtual bool getNumberOfMotors(int *ax)=0
Retrieves the number of controlled axes from the current physical interface.
yarp::dev::ICurrentControl::~ICurrentControl
virtual ~ICurrentControl()
Destructor.
Definition: ICurrentControl.h:33
Vocab.h
yarp::dev::ICurrentControlRaw::getCurrentRaw
virtual bool getCurrentRaw(int m, double *curr)=0
Get the instantaneous current measurement for a single motor.
yarp::dev::ICurrentControl::getCurrentRanges
virtual bool getCurrentRanges(double *min, double *max)=0
Get the full scale of the current measurements for all motors motor (e.g.
yarp::dev::ICurrentControl::setRefCurrents
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.
VOCAB_CURRENT_RANGES
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGES
Definition: ICurrentControl.h:203
api.h
VOCAB_CURRENT_REF
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF
Definition: ICurrentControl.h:199