YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
13namespace yarp::dev {
14class IMotorRaw;
15class IMotor;
16}
17
24{
25public:
29 virtual ~IMotorRaw() {}
30
36 virtual bool getNumberOfMotorsRaw(int *num) = 0;
37
44 virtual bool getTemperatureRaw(int m, double* val)=0;
45
51 virtual bool getTemperaturesRaw(double *vals)=0;
52
60 virtual bool getTemperatureLimitRaw(int m, double *temp)=0;
61
69 virtual bool setTemperatureLimitRaw(int m, const double temp)=0;
70
77 virtual bool getGearboxRatioRaw(int m, double *val) { yWarning("getGearboxRatioRaw() not implemented"); return false; };
78
85 virtual bool setGearboxRatioRaw(int m, const double val) { yWarning("setGearboxRatioRaw() not implemented"); return false; };
86};
87
94{
95public:
99 virtual ~IMotor() {}
100
106 virtual bool getNumberOfMotors(int *num) = 0;
107
114 virtual bool getTemperature(int m, double *val)=0;
115
121 virtual bool getTemperatures(double *vals)=0;
122
130 virtual bool getTemperatureLimit(int m, double *temp)=0;
131
139 virtual bool setTemperatureLimit(int m, const double temp)=0;
140
147 virtual bool getGearboxRatio(int m, double *val) { yError("getGearboxRatioRaw() not implemented"); return false; };
148
155 virtual bool setGearboxRatio(int m, const double val) { yError("setGearboxRatio() not implemented"); return false; };
156};
157
158// interface IMotorEncoders gets
164
165
166#endif // YARP_DEV_IMOTOR_H
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURES
Definition IMotor.h:162
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE_LIMIT
Definition IMotor.h:163
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE
Definition IMotor.h:160
constexpr yarp::conf::vocab32_t VOCAB_GEARBOX_RATIO
Definition IMotor.h:161
constexpr yarp::conf::vocab32_t VOCAB_MOTORS_NUMBER
Definition IMotor.h:159
#define yError(...)
Definition Log.h:361
#define yWarning(...)
Definition Log.h:340
Control board, encoder interface.
Definition IMotor.h:24
virtual ~IMotorRaw()
Destructor.
Definition IMotor.h:29
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:85
virtual bool getGearboxRatioRaw(int m, double *val)
Get the gearbox ratio for a specific motor.
Definition IMotor.h:77
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:94
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:99
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:147
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:155
std::int32_t vocab32_t
Definition numeric.h:78
For streams capable of holding different kinds of content, check what they actually have.
Definition jointData.cpp:13
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:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18