YARP
Yet Another Robot Platform
ImplementMotor.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_IMPLEMENTMOTOR_H
7 #define YARP_DEV_IMPLEMENTMOTOR_H
8 
9 #include <yarp/dev/IMotor.h>
10 
11 namespace yarp {
12  namespace dev {
13  class ImplementMotor;
14  }
15 }
16 
17 namespace yarp {
18 namespace dev {
19 namespace impl {
20 
21 template <typename T>
22 class FixedSizeBuffersManager;
23 
24 } // namespace impl
25 } // namespace dev
26 } // namespace yarp
27 
28 
30 {
31 protected:
33  void *helper;
34 
36 
43  bool initialize (int size, const int *amap);
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 
58 
59  virtual ~ImplementMotor();
60 
61  bool getNumberOfMotors(int *num) override;
62 
63  bool getTemperature (int m, double* val) override;
64  bool getTemperatures (double *vals) override;
65  bool getTemperatureLimit (int m, double* val) override;
66  bool setTemperatureLimit (int m, const double val) override;
67  bool getGearboxRatio (int m, double* val) override;
68  bool setGearboxRatio (int m, const double val) override;
69 };
70 
71 #endif // YARP_DEV_IMPLEMENTMOTOR_H
Control board, encoder interface.
Definition: IMotor.h:26
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 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
bool uninitialize()
Clean up internal data and memory.
ImplementMotor(yarp::dev::IMotorRaw *y)
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
bool initialize(int size, const int *amap)
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