YARP
Yet Another Robot Platform
ImplementPositionControl.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_IPOSITIONCONTROLIMPL_H
7 #define YARP_DEV_IPOSITIONCONTROLIMPL_H
8 
9 
11 
12 namespace yarp{
13  namespace dev {
14  class ImplementPositionControl;
15  class StubImplPositionControlRaw;
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;
43 
53  bool initialize (int size, const int *amap, const double *enc, const double *zos);
54 
59  bool uninitialize ();
60 
61 public:
68 
72  virtual ~ImplementPositionControl();
73 
74 
80  bool getAxes(int *axis) override;
81 
82  bool positionMove(int j, double ref) override;
83  bool positionMove(const int n_joint, const int *joints, const double *refs) override;
84  bool positionMove(const double *refs) override;
85  bool relativeMove(int j, double delta) override;
86  bool relativeMove(const int n_joint, const int *joints, const double *deltas) override;
87  bool relativeMove(const double *deltas) override;
88  bool checkMotionDone(bool *flag) override;
89  bool checkMotionDone(const int n_joint, const int *joints, bool *flags) override;
90  bool checkMotionDone(int j, bool *flag) override;
91  bool setRefSpeed(int j, double sp) override;
92  bool setRefSpeeds(const int n_joint, const int *joints, const double *spds) override;
93  bool setRefSpeeds(const double *spds) override;
94  bool setRefAcceleration(int j, double acc) override;
95  bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override;
96  bool setRefAccelerations(const double *accs) override;
97  bool getRefSpeed(int j, double *ref) override;
98  bool getRefSpeeds(const int n_joint, const int *joints, double *spds) override;
99  bool getRefSpeeds(double *spds) override;
100  bool getRefAcceleration(int j, double *acc) override;
101  bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override;
102  bool getRefAccelerations(double *accs) override;
103  bool stop(int j) override;
104  bool stop(const int n_joint, const int *joints) override;
105  bool stop() override;
106  bool getTargetPosition(const int joint, double *ref) override;
107  bool getTargetPositions(double *refs) override;
108  bool getTargetPositions(const int n_joint, const int *joints, double *refs) override;
109 };
110 
126 {
127 private:
132  bool NOT_YET_IMPLEMENTED(const char *func=0);
133 
134 public:
136 
137  bool getAxes(int *ax) override
138  {return NOT_YET_IMPLEMENTED("getAxes");}
139 
140  bool positionMoveRaw(int j, double ref) override
141  {return NOT_YET_IMPLEMENTED("positionMoveRaw");}
142 
143  bool positionMoveRaw(const int n_joint, const int *joints, const double *refs) override
144  {return NOT_YET_IMPLEMENTED("positionMoveRaw");}
145 
146  bool positionMoveRaw(const double *refs) override
147  {return NOT_YET_IMPLEMENTED("positionMoveRaw");}
148 
149  bool relativeMoveRaw(int j, double delta) override
150  {return NOT_YET_IMPLEMENTED("relativeMoveRaw");}
151 
152  bool relativeMoveRaw(const int n_joint, const int *joints, const double *refs) override
153  {return NOT_YET_IMPLEMENTED("relativeMoveRaw");}
154 
155  bool relativeMoveRaw(const double *deltas) override
156  {return NOT_YET_IMPLEMENTED("relativeMoveRaw");}
157 
158  bool checkMotionDoneRaw(int j, bool *flag) override
159  {return NOT_YET_IMPLEMENTED("checkMotionDoneRaw");}
160 
161  bool checkMotionDoneRaw(const int n_joint, const int *joints, bool *flags) override
162  {return NOT_YET_IMPLEMENTED("checkMotionDoneRaw");}
163 
164  bool checkMotionDoneRaw(bool *flag) override
165  {return NOT_YET_IMPLEMENTED("checkMotionDoneRaw");}
166 
167  bool setRefSpeedRaw(int j, double sp) override
168  {return NOT_YET_IMPLEMENTED("setRefSpeedRaw");}
169 
170  bool setRefSpeedsRaw(const int n_joint, const int *joints, const double *spds) override
171  {return NOT_YET_IMPLEMENTED("setRefSpeedsRaw");}
172 
173  bool setRefSpeedsRaw(const double *spds) override
174  {return NOT_YET_IMPLEMENTED("setRefSpeedsRaw");}
175 
176  bool setRefAccelerationRaw(int j, double acc) override
177  {return NOT_YET_IMPLEMENTED("setRefAccelerationRaw");}
178 
179  bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
180  {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
181 
182  bool setRefAccelerationsRaw(const double *accs) override
183  {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
184 
185  bool getRefSpeedRaw(int j, double *ref) override
186  {return NOT_YET_IMPLEMENTED("getRefSpeedRaw");}
187 
188  bool getRefSpeedsRaw(const int n_joint, const int *joints, double *spds) override
189  {return NOT_YET_IMPLEMENTED("getRefSpeedsRaw");}
190 
191  bool getRefSpeedsRaw(double *spds) override
192  {return NOT_YET_IMPLEMENTED("getRefSpeedsRaw");}
193 
194  bool getRefAccelerationRaw(int j, double *acc) override
195  {return NOT_YET_IMPLEMENTED("getRefAccelerationRaw");}
196 
197  bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
198  {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
199 
200  bool getRefAccelerationsRaw(double *accs) override
201  {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
202 
203  bool stopRaw(int j) override
204  {return NOT_YET_IMPLEMENTED("stopRaw");}
205 
206  bool stopRaw(const int n_joint, const int *joints) override
207  {return NOT_YET_IMPLEMENTED("stopRaw");}
208 
209  bool stopRaw() override
210  {return NOT_YET_IMPLEMENTED("stopRaw");}
211 
212  bool getTargetPositionRaw(const int joint, double *ref) override
213  {return NOT_YET_IMPLEMENTED("stopRaw");}
214 
215  bool getTargetPositionsRaw(double *refs) override
216  {return NOT_YET_IMPLEMENTED("stopRaw");}
217 
218  bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) override
219  {return NOT_YET_IMPLEMENTED("stopRaw");}
220 };
221 
222 #endif // YARP_DEV_IPOSITIONCONTROLIMPL_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.
virtual bool getRefAcceleration(int j, double *acc)=0
Get reference acceleration for a joint.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool setRefSpeed(int j, double sp)=0
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
virtual bool stop()=0
Stop motion, multiple joints.
virtual bool setRefAcceleration(int j, double acc)=0
Set reference acceleration for a joint.
virtual bool relativeMove(int j, double delta)=0
Set relative position.
virtual bool getTargetPosition(const int joint, double *ref)
Get the last position reference for the specified axis.
virtual bool setRefSpeeds(const double *spds)=0
Set reference speed on all joints.
virtual bool checkMotionDone(int j, bool *flag)=0
Check if the current trajectory is terminated.
virtual bool getRefSpeeds(double *spds)=0
Get reference speed of all joints.
virtual bool setRefAccelerations(const double *accs)=0
Set reference acceleration on all joints.
virtual bool getRefAccelerations(double *accs)=0
Get reference acceleration of all joints.
virtual bool getRefSpeed(int j, double *ref)=0
Get reference speed for a joint.
virtual bool positionMove(int j, double ref)=0
Set new reference point for a single axis.
virtual bool getTargetPositions(double *refs)
Get the last position reference for all axes.
Default implementation of the IPositionControl interface.
yarp::dev::impl::FixedSizeBuffersManager< bool > * boolBuffManager
ImplementPositionControl(yarp::dev::IPositionControlRaw *y)
Constructor.
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
bool uninitialize()
Clean up internal data and memory.
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
Stub implementation of IPositionControlRaw interface.
bool positionMoveRaw(int j, double ref) override
Set new reference point for a single axis.
bool checkMotionDoneRaw(const int n_joint, const int *joints, bool *flags) override
Check if the current trajectory is terminated.
bool getTargetPositionsRaw(double *refs) override
Get the last position reference for all axes.
bool getRefSpeedsRaw(double *spds) override
Get reference speed of all joints.
bool setRefSpeedsRaw(const int n_joint, const int *joints, const double *spds) override
Set reference speed on all joints.
bool getRefSpeedsRaw(const int n_joint, const int *joints, double *spds) override
Get reference speed of all joints.
bool stopRaw() override
Stop motion, multiple joints.
bool getRefAccelerationRaw(int j, double *acc) override
Get reference acceleration for a joint.
bool getRefSpeedRaw(int j, double *ref) override
Get reference speed for a joint.
bool relativeMoveRaw(const double *deltas) override
Set relative position, all joints.
bool relativeMoveRaw(int j, double delta) override
Set relative position.
bool positionMoveRaw(const int n_joint, const int *joints, const double *refs) override
Set new reference point for a subset of joints.
bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a joint.
bool getAxes(int *ax) override
Get the number of controlled axes.
bool stopRaw(const int n_joint, const int *joints) override
Stop motion for subset of joints.
bool setRefAccelerationsRaw(const double *accs) override
Set reference acceleration on all joints.
bool checkMotionDoneRaw(bool *flag) override
Check if the current trajectory is terminated.
bool setRefSpeedsRaw(const double *spds) override
Set reference speed on all joints.
bool positionMoveRaw(const double *refs) override
Set new reference point for all axes.
bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) override
Get the last position reference for the specified group of axes.
bool setRefSpeedRaw(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
bool getTargetPositionRaw(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration on all joints.
bool getRefAccelerationsRaw(double *accs) override
Get reference acceleration of all joints.
bool stopRaw(int j) override
Stop motion, single joint.
bool relativeMoveRaw(const int n_joint, const int *joints, const double *refs) override
Set relative position for a subset of joints.
bool checkMotionDoneRaw(int j, bool *flag) override
Check if the current trajectory is terminated.
bool setRefAccelerationRaw(int j, double acc) override
Set reference acceleration for a joint.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18