YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
11namespace yarp::dev {
12class ImplementMotor;
13}
14
15namespace yarp::dev::impl {
16
17template <typename T>
18class FixedSizeBuffersManager;
19
20} // namespace yarp::dev::impl
21
22
24{
25protected:
26 yarp::dev::IMotorRaw* m_iraw=nullptr;
27 void* m_helper=nullptr;
28 std::vector<int> m_buffer_ints;
29 std::vector<double> m_buffer_doubles;
30 std::mutex m_imp_mutex;
31
38 bool initialize (int size, const int *amap);
39
44 bool uninitialize ();
45
46public:
47 /* Constructor.
48 * @param y is the pointer to the class instance inheriting from this
49 * implementation.
50 */
52
53
54 virtual ~ImplementMotor();
55
56 yarp::dev::ReturnValue getNumberOfMotors (int *num) override;
57 yarp::dev::ReturnValue getTemperature (int m, double* val) override;
58 yarp::dev::ReturnValue getTemperatures (double *vals) override;
59 yarp::dev::ReturnValue getTemperatureLimit (int m, double* val) override;
60 yarp::dev::ReturnValue setTemperatureLimit (int m, const double val) override;
61 yarp::dev::ReturnValue getGearboxRatio (int m, double* val) override;
62 yarp::dev::ReturnValue setGearboxRatio (int m, const double val) override;
63};
64
65#endif // YARP_DEV_IMPLEMENTMOTOR_H
Control board, encoder interface.
Definition IMotor.h:25
Control board, encoder interface.
Definition IMotor.h:95
bool uninitialize()
Clean up internal data and memory.
yarp::dev::ReturnValue getNumberOfMotors(int *num) override
Get the number of available motors.
yarp::dev::ReturnValue setTemperatureLimit(int m, const double val) override
Set the temperature limit for a specific motor.
yarp::dev::ReturnValue setGearboxRatio(int m, const double val) override
Set the gearbox ratio for a specific motor.
yarp::dev::ReturnValue getTemperatures(double *vals) override
Get temperature of all the motors.
std::vector< double > m_buffer_doubles
std::vector< int > m_buffer_ints
bool initialize(int size, const int *amap)
Initialize the internal data and alloc memory.
yarp::dev::ReturnValue getTemperature(int m, double *val) override
Get temperature of a motor.
yarp::dev::ReturnValue getTemperatureLimit(int m, double *val) override
Retrieves the current temperature limit for a specific motor.
yarp::dev::ReturnValue getGearboxRatio(int m, double *val) override
Get the gearbox ratio for a specific motor.
For streams capable of holding different kinds of content, check what they actually have.
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18