YARP
Yet Another Robot Platform
ImplementMotor.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_IMPLEMENTMOTOR_H
10 #define YARP_DEV_IMPLEMENTMOTOR_H
11 
12 #include <yarp/dev/IMotor.h>
13 
14 namespace yarp {
15  namespace dev {
16  class ImplementMotor;
17  }
18 }
19 
20 namespace yarp {
21 namespace dev {
22 namespace impl {
23 
24 template <typename T>
25 class FixedSizeBuffersManager;
26 
27 } // namespace impl
28 } // namespace dev
29 } // namespace yarp
30 
31 
33 {
34 protected:
36  void *helper;
37 
39 
46  bool initialize (int size, const int *amap);
47 
52  bool uninitialize ();
53 
54 public:
55  /* Constructor.
56  * @param y is the pointer to the class instance inheriting from this
57  * implementation.
58  */
60 
61 
62  virtual ~ImplementMotor();
63 
64  bool getNumberOfMotors(int *num) override;
65 
66  bool getTemperature (int m, double* val) override;
67  bool getTemperatures (double *vals) override;
68  bool getTemperatureLimit (int m, double* val) override;
69  bool setTemperatureLimit (int m, const double val) override;
70  bool getGearboxRatio (int m, double* val) override;
71  bool setGearboxRatio (int m, const double val) override;
72 };
73 
74 #endif // YARP_DEV_IMPLEMENTMOTOR_H
Control board, encoder interface.
Definition: IMotor.h:29
Control board, encoder interface.
Definition: IMotor.h:99
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:152
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:160
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: environment.h:18
#define YARP_dev_API
Definition: api.h:19