YARP
Yet Another Robot Platform
IMotor.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_IMOTOR_H
7 #define YARP_DEV_IMOTOR_H
8 
9 #include <yarp/os/Vocab.h>
10 #include <yarp/os/Log.h>
11 #include <yarp/dev/api.h>
12 
13 namespace yarp {
14  namespace dev {
15  class IMotorRaw;
16  class IMotor;
17  }
18 }
19 
26 {
27 public:
31  virtual ~IMotorRaw() {}
32 
38  virtual bool getNumberOfMotorsRaw(int *num) = 0;
39 
46  virtual bool getTemperatureRaw(int m, double* val)=0;
47 
53  virtual bool getTemperaturesRaw(double *vals)=0;
54 
62  virtual bool getTemperatureLimitRaw(int m, double *temp)=0;
63 
71  virtual bool setTemperatureLimitRaw(int m, const double temp)=0;
72 
79  virtual bool getGearboxRatioRaw(int m, double *val) { yWarning("getGearboxRatioRaw() not implemented"); return false; };
80 
87  virtual bool setGearboxRatioRaw(int m, const double val) { yWarning("setGearboxRatioRaw() not implemented"); return false; };
88 };
89 
96 {
97 public:
101  virtual ~IMotor() {}
102 
108  virtual bool getNumberOfMotors(int *num) = 0;
109 
116  virtual bool getTemperature(int m, double *val)=0;
117 
123  virtual bool getTemperatures(double *vals)=0;
124 
132  virtual bool getTemperatureLimit(int m, double *temp)=0;
133 
141  virtual bool setTemperatureLimit(int m, const double temp)=0;
142 
149  virtual bool getGearboxRatio(int m, double *val) { yError("getGearboxRatioRaw() not implemented"); return false; };
150 
157  virtual bool setGearboxRatio(int m, const double val) { yError("setGearboxRatio() not implemented"); return false; };
158 };
159 
160 // interface IMotorEncoders gets
166 
167 
168 #endif // YARP_DEV_IMOTOR_H
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURES
Definition: IMotor.h:164
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE_LIMIT
Definition: IMotor.h:165
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE
Definition: IMotor.h:162
constexpr yarp::conf::vocab32_t VOCAB_GEARBOX_RATIO
Definition: IMotor.h:163
constexpr yarp::conf::vocab32_t VOCAB_MOTORS_NUMBER
Definition: IMotor.h:161
#define yError(...)
Definition: Log.h:279
#define yWarning(...)
Definition: Log.h:268
Control board, encoder interface.
Definition: IMotor.h:26
virtual ~IMotorRaw()
Destructor.
Definition: IMotor.h:31
virtual bool getNumberOfMotorsRaw(int *num)=0
Get the number of available motors.
virtual bool getTemperatureRaw(int m, double *val)=0
Get temperature of a motor.
virtual bool getTemperatureLimitRaw(int m, double *temp)=0
Retreives the current temperature limit for a specific motor.
virtual bool setGearboxRatioRaw(int m, const double val)
Set the gearbox ratio for a specific motor.
Definition: IMotor.h:87
virtual bool getGearboxRatioRaw(int m, double *val)
Get the gearbox ratio for a specific motor.
Definition: IMotor.h:79
virtual bool setTemperatureLimitRaw(int m, const double temp)=0
Set the temperature limit for a specific motor.
virtual bool getTemperaturesRaw(double *vals)=0
Get temperature of all the motors.
Control board, encoder interface.
Definition: IMotor.h:96
virtual bool getTemperature(int m, double *val)=0
Get temperature of a motor.
virtual bool getTemperatures(double *vals)=0
Get temperature of all the motors.
virtual bool getNumberOfMotors(int *num)=0
Get the number of available motors.
virtual ~IMotor()
Destructor.
Definition: IMotor.h:101
virtual bool getTemperatureLimit(int m, double *temp)=0
Retreives the current temperature limit for a specific motor.
virtual bool getGearboxRatio(int m, double *val)
Get the gearbox ratio for a specific motor.
Definition: IMotor.h:149
virtual bool setTemperatureLimit(int m, const double temp)=0
Set the temperature limit for a specific motor.
virtual bool setGearboxRatio(int m, const double val)
Set the gearbox ratio for a specific motor.
Definition: IMotor.h:157
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