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
yarp::dev::IMotor::getTemperatures
virtual bool getTemperatures(double *vals)=0
Get temperature of all the motors.
yarp::dev::ImplementMotor::uninitialize
bool uninitialize()
Clean up internal data and memory.
Definition: ImplementMotor.cpp:49
yarp::dev::ImplementMotor::imotor
IMotorRaw * imotor
Definition: ImplementMotor.h:35
yarp::dev::IMotor::getGearboxRatio
virtual bool getGearboxRatio(int m, double *val)
Get the gearbox ratio for a specific motor.
Definition: IMotor.h:152
yarp::dev::impl::FixedSizeBuffersManager< double >
yarp::dev::IMotorRaw
Control board, encoder interface.
Definition: IMotor.h:29
yarp::dev::ImplementMotor
Definition: ImplementMotor.h:33
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IMotor
Control board, encoder interface.
Definition: IMotor.h:99
yarp::dev::IMotor::setTemperatureLimit
virtual bool setTemperatureLimit(int m, const double temp)=0
Set the temperature limit for a specific motor.
yarp::dev::ImplementMotor::ImplementMotor
ImplementMotor(yarp::dev::IMotorRaw *y)
Definition: ImplementMotor.cpp:20
yarp::dev::IMotor::getTemperature
virtual bool getTemperature(int m, double *val)=0
Get temperature of a motor.
yarp::dev::ImplementMotor::~ImplementMotor
virtual ~ImplementMotor()
Definition: ImplementMotor.cpp:26
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::IMotor::getNumberOfMotors
virtual bool getNumberOfMotors(int *num)=0
Get the number of available motors.
yarp::dev::IMotor::getTemperatureLimit
virtual bool getTemperatureLimit(int m, double *temp)=0
Retreives the current temperature limit for a specific motor.
yarp::dev::ImplementMotor::helper
void * helper
Definition: ImplementMotor.h:36
yarp::dev::ImplementMotor::doubleBuffManager
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
Definition: ImplementMotor.h:38
yarp::dev::ImplementMotor::initialize
bool initialize(int size, const int *amap)
Initialize the internal data and alloc memory.
Definition: ImplementMotor.cpp:31
yarp::dev::IMotor::setGearboxRatio
virtual bool setGearboxRatio(int m, const double val)
Set the gearbox ratio for a specific motor.
Definition: IMotor.h:160
IMotor.h