YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ImplementCurrentControl.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_IMPLEMENTCURRENTCONTROL_H
7#define YARP_DEV_IMPLEMENTCURRENTCONTROL_H
8
10#include <yarp/dev/api.h>
11
12namespace yarp::dev {
13class ImplementCurrentControl;
14}
15
16namespace yarp::dev::impl {
17
18template <typename T>
19class FixedSizeBuffersManager;
20
21} // namespace yarp::dev::impl
22
24{
25protected:
27 void* m_helper=nullptr;
28 std::vector<int> m_buffer_ints;
29 std::vector<double> m_buffer_doubles;
30 std::vector<double> m_buffer_doubles2;
31 std::mutex m_imp_mutex;
38 bool initialize(int size, const int *amap, const double* ampsToSens);
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
57
59 yarp::dev::ReturnValue getRefCurrent(int j, double *) override;
60 yarp::dev::ReturnValue getRefCurrents(double *t) override;
61 yarp::dev::ReturnValue setRefCurrents(const double *t) override;
62 yarp::dev::ReturnValue setRefCurrent(int j, double t) override;
63 yarp::dev::ReturnValue setRefCurrents(const int n_joint, const int *joints, const double *t) override;
64 yarp::dev::ReturnValue getCurrents(double *t) override;
65 yarp::dev::ReturnValue getCurrent(int j, double *t) override;
66 yarp::dev::ReturnValue getCurrentRange(int j, double *min, double *max) override;
67 yarp::dev::ReturnValue getCurrentRanges(double *min, double *max) override;
68};
69
70#endif // YARP_DEV_IMPLEMENTCURRENTCONTROL_H
Interface for control boards implementing current control.
Interface for control boards implementing current control.
bool uninitialize()
Clean up internal data and memory.
yarp::dev::ReturnValue getCurrents(double *t) override
Get the instantaneous current measurement for all motors.
yarp::dev::ReturnValue getCurrentRange(int j, double *min, double *max) override
Get the full scale of the current measurement for a given motor (e.g.
yarp::dev::ReturnValue getCurrent(int j, double *t) override
Get the instantaneous current measurement for a single motor.
yarp::dev::ReturnValue getRefCurrents(double *t) override
Get the reference value of the currents for all motors.
bool initialize(int size, const int *amap, const double *ampsToSens)
Initialize the internal data and alloc memory.
yarp::dev::ReturnValue getCurrentRanges(double *min, double *max) override
Get the full scale of the current measurements for all motors motor (e.g.
yarp::dev::ReturnValue getNumberOfMotors(int *ax) override
Retrieves the number of controlled axes from the current physical interface.
yarp::dev::ReturnValue setRefCurrent(int j, double t) override
Set the reference value of the current for a single motor.
yarp::dev::ReturnValue setRefCurrents(const double *t) override
Set the reference value of the currents for all motors.
yarp::dev::ReturnValue getRefCurrent(int j, double *) override
Get the reference value of the current for a single 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