YARP
Yet Another Robot Platform
ImplementPositionDirect.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_IPOSITIONDIRECTIMPL_H
7 #define YARP_IPOSITIONDIRECTIMPL_H
8 
9 
11 
12 namespace yarp{
13  namespace dev {
14  class ImplementPositionDirect;
15  class StubImplPositionDirectRaw;
16  }
17 }
18 
19 namespace yarp {
20 namespace dev {
21 namespace impl {
22 
23 template <typename T>
24 class FixedSizeBuffersManager;
25 
26 } // namespace impl
27 } // namespace dev
28 } // namespace yarp
29 
36 {
37 protected:
39  void *helper;
42 
52  bool initialize (int size, const int *amap, const double *enc, const double *zos);
53 
58  bool uninitialize ();
59 
60 public:
67 
71  virtual ~ImplementPositionDirect();
72 
73  bool getAxes(int *axes) override;
74  bool setPosition(int j, double ref) override;
75  bool setPositions(const int n_joint, const int *joints, const double *refs) override;
76  bool setPositions(const double *refs) override;
77  bool getRefPosition(const int joint, double *ref) override;
78  bool getRefPositions(double *refs) override;
79  bool getRefPositions(const int n_joint, const int *joints, double *refs) override;
80 };
81 
82 
98 {
99 private:
104  bool NOT_YET_IMPLEMENTED(const char *func=0);
105 
106 public:
108 
109  bool getAxes(int *axis) override
110  {return NOT_YET_IMPLEMENTED("getAxes");}
111 
112  bool setPosition(int j, double ref) override
113  {return NOT_YET_IMPLEMENTED("setPosition");}
114 
115  bool setPositions(const int n_joint, const int *joints, const double *refs) override
116  {return NOT_YET_IMPLEMENTED("setPositions");}
117 
118  bool setPositions(const double *refs) override
119  {return NOT_YET_IMPLEMENTED("setPositions");}
120 };
121 
122 #endif // YARP_IPOSITIONDIRECTIMPL_H
bool NOT_YET_IMPLEMENTED(const char *txt)
Interface for a generic control board device implementing position control in encoder coordinates.
Interface for a generic control board device implementing position control.
Default implementation of the IPositionDirect interface.
bool getRefPositions(double *refs) override
Get the last position reference for all axes.
ImplementPositionDirect(yarp::dev::IPositionDirectRaw *y)
Constructor.
bool setPositions(const int n_joint, const int *joints, const double *refs) override
Set new reference point for all axes.
bool getAxes(int *axes) override
Get the number of controlled axes.
bool uninitialize()
Clean up internal data and memory.
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
bool setPosition(int j, double ref) override
Set new position for a single axis.
bool getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
Stub implementation of IPositionControl2Raw interface.
bool setPosition(int j, double ref) override
Set new position for a single axis.
bool setPositions(const int n_joint, const int *joints, const double *refs) override
Set new reference point for all axes.
bool getAxes(int *axis) override
Get the number of controlled axes.
bool setPositions(const double *refs) override
Set new position for a set of axis.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18