YARP
Yet Another Robot Platform
ImplementCurrentControl.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_IMPLEMENTCURRENTCONTROL_H
10 #define YARP_DEV_IMPLEMENTCURRENTCONTROL_H
11 
13 #include <yarp/dev/api.h>
14 
15 namespace yarp {
16  namespace dev {
17  class ImplementCurrentControl;
18  }
19 }
20 
21 namespace yarp {
22 namespace dev {
23 namespace impl {
24 
25 template <typename T>
26 class FixedSizeBuffersManager;
27 
28 } // namespace impl
29 } // namespace dev
30 } // namespace yarp
31 
33 {
34 protected:
36  void *helper;
39 
46  bool initialize(int size, const int *amap, const double* ampsToSens);
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 
64  virtual ~ImplementCurrentControl();
65 
66  bool getNumberOfMotors(int *ax) override;
67  bool getRefCurrent(int j, double *) override;
68  bool getRefCurrents(double *t) override;
69  bool setRefCurrents(const double *t) override;
70  bool setRefCurrent(int j, double t) override;
71  bool setRefCurrents(const int n_joint, const int *joints, const double *t) override;
72  bool getCurrents(double *t) override;
73  bool getCurrent(int j, double *t) override;
74  bool getCurrentRange(int j, double *min, double *max) override;
75  bool getCurrentRanges(double *min, double *max) override;
76 };
77 
78 #endif // YARP_DEV_IMPLEMENTCURRENTCONTROL_H
yarp::dev::ICurrentControl::getRefCurrent
virtual bool getRefCurrent(int m, double *curr)=0
Get the reference value of the current for a single motor.
yarp::dev::ImplementCurrentControl
Definition: ImplementCurrentControl.h:33
yarp::dev::ImplementCurrentControl::helper
void * helper
Definition: ImplementCurrentControl.h:36
t
float t
Definition: FfmpegWriter.cpp:74
yarp::dev::impl::FixedSizeBuffersManager< int >
yarp::dev::ImplementCurrentControl::intBuffManager
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
Definition: ImplementCurrentControl.h:37
yarp::dev::ICurrentControl::setRefCurrents
virtual bool setRefCurrents(const double *currs)=0
Set the reference value of the currents for all motors.
yarp::dev::ImplementCurrentControl::~ImplementCurrentControl
virtual ~ImplementCurrentControl()
Destructor.
Definition: ImplementCurrentControl.cpp:26
yarp::dev::ImplementCurrentControl::iCurrentRaw
yarp::dev::ICurrentControlRaw * iCurrentRaw
Definition: ImplementCurrentControl.h:35
yarp::dev::ICurrentControl::getCurrents
virtual bool getCurrents(double *currs)=0
Get the instantaneous current measurement for all motors.
yarp::dev::ICurrentControlRaw
Interface for control boards implementing current control.
Definition: ICurrentControl.h:114
yarp::dev::ICurrentControl::getCurrent
virtual bool getCurrent(int m, double *curr)=0
Get the instantaneous current measurement for a single motor.
yarp::dev::ICurrentControl::getRefCurrents
virtual bool getRefCurrents(double *currs)=0
Get the reference value of the currents for all motors.
yarp::dev::ImplementCurrentControl::doubleBuffManager
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
Definition: ImplementCurrentControl.h:38
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::ImplementCurrentControl::initialize
bool initialize(int size, const int *amap, const double *ampsToSens)
Initialize the internal data and alloc memory.
Definition: ImplementCurrentControl.cpp:31
yarp::dev::ICurrentControl
Interface for control boards implementing current control.
Definition: ICurrentControl.h:28
ICurrentControl.h
yarp::dev::ICurrentControl::setRefCurrent
virtual bool setRefCurrent(int m, double curr)=0
Set the reference value of the current for a single motor.
yarp::dev::ICurrentControl::getCurrentRange
virtual bool getCurrentRange(int m, double *min, double *max)=0
Get the full scale of the current measurement for a given motor (e.g.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::ICurrentControl::getNumberOfMotors
virtual bool getNumberOfMotors(int *ax)=0
Retrieves the number of controlled axes from the current physical interface.
yarp::dev::ICurrentControl::getCurrentRanges
virtual bool getCurrentRanges(double *min, double *max)=0
Get the full scale of the current measurements for all motors motor (e.g.
api.h
yarp::dev::ImplementCurrentControl::uninitialize
bool uninitialize()
Clean up internal data and memory.
Definition: ImplementCurrentControl.cpp:48
yarp::dev::ImplementCurrentControl::ImplementCurrentControl
ImplementCurrentControl(yarp::dev::ICurrentControlRaw *y)
Definition: ImplementCurrentControl.cpp:19