YARP
Yet Another Robot Platform
ImplementPositionDirect.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_IPOSITIONDIRECTIMPL_H
10 #define YARP_IPOSITIONDIRECTIMPL_H
11 
12 
14 
15 namespace yarp{
16  namespace dev {
17  class ImplementPositionDirect;
18  class StubImplPositionDirectRaw;
19  }
20 }
21 
22 namespace yarp {
23 namespace dev {
24 namespace impl {
25 
26 template <typename T>
27 class FixedSizeBuffersManager;
28 
29 } // namespace impl
30 } // namespace dev
31 } // namespace yarp
32 
39 {
40 protected:
42  void *helper;
45 
55  bool initialize (int size, const int *amap, const double *enc, const double *zos);
56 
61  bool uninitialize ();
62 
63 public:
70 
74  virtual ~ImplementPositionDirect();
75 
76  bool getAxes(int *axes) override;
77  bool setPosition(int j, double ref) override;
78  bool setPositions(const int n_joint, const int *joints, const double *refs) override;
79  bool setPositions(const double *refs) override;
80  bool getRefPosition(const int joint, double *ref) override;
81  bool getRefPositions(double *refs) override;
82  bool getRefPositions(const int n_joint, const int *joints, double *refs) override;
83 };
84 
85 
101 {
102 private:
107  bool NOT_YET_IMPLEMENTED(const char *func=0);
108 
109 public:
111 
112  bool getAxes(int *axis) override
113  {return NOT_YET_IMPLEMENTED("getAxes");}
114 
115  bool setPosition(int j, double ref) override
116  {return NOT_YET_IMPLEMENTED("setPosition");}
117 
118  bool setPositions(const int n_joint, const int *joints, const double *refs) override
119  {return NOT_YET_IMPLEMENTED("setPositions");}
120 
121  bool setPositions(const double *refs) override
122  {return NOT_YET_IMPLEMENTED("setPositions");}
123 };
124 
125 #endif // YARP_IPOSITIONDIRECTIMPL_H
yarp::dev::ImplementPositionDirect::~ImplementPositionDirect
virtual ~ImplementPositionDirect()
Destructor.
Definition: ImplementPositionDirect.cpp:29
yarp::dev::StubImplPositionDirectRaw
Stub implementation of IPositionControl2Raw interface.
Definition: ImplementPositionDirect.h:101
yarp::dev::StubImplPositionDirectRaw::~StubImplPositionDirectRaw
virtual ~StubImplPositionDirectRaw()
Definition: ImplementPositionDirect.h:110
yarp::dev::ImplementPositionDirect::setPosition
bool setPosition(int j, double ref) override
Set new position for a single axis.
Definition: ImplementPositionDirect.cpp:80
IPositionDirect.h
yarp::dev::ImplementPositionDirect::iPDirect
IPositionDirectRaw * iPDirect
Definition: ImplementPositionDirect.h:41
yarp::dev::impl::FixedSizeBuffersManager< int >
yarp::dev::ImplementPositionDirect::setPositions
bool setPositions(const int n_joint, const int *joints, const double *refs) override
Set new reference point for all axes.
Definition: ImplementPositionDirect.cpp:89
yarp::dev::StubImplPositionDirectRaw::setPositions
bool setPositions(const int n_joint, const int *joints, const double *refs) override
Set new reference point for all axes.
Definition: ImplementPositionDirect.h:118
NOT_YET_IMPLEMENTED
bool NOT_YET_IMPLEMENTED(const char *txt)
Definition: DynamixelAX12FtdiDriver.cpp:25
yarp::dev::StubImplPositionDirectRaw::getAxes
bool getAxes(int *axis) override
Get the number of controlled axes.
Definition: ImplementPositionDirect.h:112
yarp::dev::ImplementPositionDirect::getRefPositions
bool getRefPositions(double *refs) override
Get the last position reference for all axes.
Definition: ImplementPositionDirect.cpp:162
yarp::dev::StubImplPositionDirectRaw::setPosition
bool setPosition(int j, double ref) override
Set new position for a single axis.
Definition: ImplementPositionDirect.h:115
yarp::dev::ImplementPositionDirect::getRefPosition
bool getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
Definition: ImplementPositionDirect.cpp:123
yarp::dev::IPositionDirectRaw
Interface for a generic control board device implementing position control in encoder coordinates.
Definition: IPositionDirect.h:118
yarp::dev::ImplementPositionDirect::intBuffManager
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
Definition: ImplementPositionDirect.h:43
yarp::dev::ImplementPositionDirect::helper
void * helper
Definition: ImplementPositionDirect.h:42
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::ImplementPositionDirect::initialize
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
Definition: ImplementPositionDirect.cpp:34
yarp::dev::StubImplPositionDirectRaw::setPositions
bool setPositions(const double *refs) override
Set new position for a set of axis.
Definition: ImplementPositionDirect.h:121
yarp::dev::IPositionDirect
Interface for a generic control board device implementing position control.
Definition: IPositionDirect.h:32
yarp::dev::ImplementPositionDirect::doubleBuffManager
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
Definition: ImplementPositionDirect.h:44
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::ImplementPositionDirect::getAxes
bool getAxes(int *axes) override
Get the number of controlled axes.
Definition: ImplementPositionDirect.cpp:74
yarp::dev::ImplementPositionDirect
Default implementation of the IPositionDirect interface.
Definition: ImplementPositionDirect.h:39
yarp::dev::ImplementPositionDirect::uninitialize
bool uninitialize()
Clean up internal data and memory.
Definition: ImplementPositionDirect.cpp:51
yarp::dev::ImplementPositionDirect::ImplementPositionDirect
ImplementPositionDirect(yarp::dev::IPositionDirectRaw *y)
Constructor.
Definition: ImplementPositionDirect.cpp:21