YARP
Yet Another Robot Platform
ImplementPositionControl.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_IPOSITIONCONTROLIMPL_H
10 #define YARP_DEV_IPOSITIONCONTROLIMPL_H
11 
12 
14 
15 namespace yarp{
16  namespace dev {
17  class ImplementPositionControl;
18  class StubImplPositionControlRaw;
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;
46 
56  bool initialize (int size, const int *amap, const double *enc, const double *zos);
57 
62  bool uninitialize ();
63 
64 public:
71 
75  virtual ~ImplementPositionControl();
76 
77 
83  bool getAxes(int *axis) override;
84 
85  bool positionMove(int j, double ref) override;
86  bool positionMove(const int n_joint, const int *joints, const double *refs) override;
87  bool positionMove(const double *refs) override;
88  bool relativeMove(int j, double delta) override;
89  bool relativeMove(const int n_joint, const int *joints, const double *deltas) override;
90  bool relativeMove(const double *deltas) override;
91  bool checkMotionDone(bool *flag) override;
92  bool checkMotionDone(const int n_joint, const int *joints, bool *flags) override;
93  bool checkMotionDone(int j, bool *flag) override;
94  bool setRefSpeed(int j, double sp) override;
95  bool setRefSpeeds(const int n_joint, const int *joints, const double *spds) override;
96  bool setRefSpeeds(const double *spds) override;
97  bool setRefAcceleration(int j, double acc) override;
98  bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override;
99  bool setRefAccelerations(const double *accs) override;
100  bool getRefSpeed(int j, double *ref) override;
101  bool getRefSpeeds(const int n_joint, const int *joints, double *spds) override;
102  bool getRefSpeeds(double *spds) override;
103  bool getRefAcceleration(int j, double *acc) override;
104  bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override;
105  bool getRefAccelerations(double *accs) override;
106  bool stop(int j) override;
107  bool stop(const int n_joint, const int *joints) override;
108  bool stop() override;
109  bool getTargetPosition(const int joint, double *ref) override;
110  bool getTargetPositions(double *refs) override;
111  bool getTargetPositions(const int n_joint, const int *joints, double *refs) override;
112 };
113 
129 {
130 private:
135  bool NOT_YET_IMPLEMENTED(const char *func=0);
136 
137 public:
139 
140  bool getAxes(int *ax) override
141  {return NOT_YET_IMPLEMENTED("getAxes");}
142 
143  bool positionMoveRaw(int j, double ref) override
144  {return NOT_YET_IMPLEMENTED("positionMoveRaw");}
145 
146  bool positionMoveRaw(const int n_joint, const int *joints, const double *refs) override
147  {return NOT_YET_IMPLEMENTED("positionMoveRaw");}
148 
149  bool positionMoveRaw(const double *refs) override
150  {return NOT_YET_IMPLEMENTED("positionMoveRaw");}
151 
152  bool relativeMoveRaw(int j, double delta) override
153  {return NOT_YET_IMPLEMENTED("relativeMoveRaw");}
154 
155  bool relativeMoveRaw(const int n_joint, const int *joints, const double *refs) override
156  {return NOT_YET_IMPLEMENTED("relativeMoveRaw");}
157 
158  bool relativeMoveRaw(const double *deltas) override
159  {return NOT_YET_IMPLEMENTED("relativeMoveRaw");}
160 
161  bool checkMotionDoneRaw(int j, bool *flag) override
162  {return NOT_YET_IMPLEMENTED("checkMotionDoneRaw");}
163 
164  bool checkMotionDoneRaw(const int n_joint, const int *joints, bool *flags) override
165  {return NOT_YET_IMPLEMENTED("checkMotionDoneRaw");}
166 
167  bool checkMotionDoneRaw(bool *flag) override
168  {return NOT_YET_IMPLEMENTED("checkMotionDoneRaw");}
169 
170  bool setRefSpeedRaw(int j, double sp) override
171  {return NOT_YET_IMPLEMENTED("setRefSpeedRaw");}
172 
173  bool setRefSpeedsRaw(const int n_joint, const int *joints, const double *spds) override
174  {return NOT_YET_IMPLEMENTED("setRefSpeedsRaw");}
175 
176  bool setRefSpeedsRaw(const double *spds) override
177  {return NOT_YET_IMPLEMENTED("setRefSpeedsRaw");}
178 
179  bool setRefAccelerationRaw(int j, double acc) override
180  {return NOT_YET_IMPLEMENTED("setRefAccelerationRaw");}
181 
182  bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
183  {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
184 
185  bool setRefAccelerationsRaw(const double *accs) override
186  {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
187 
188  bool getRefSpeedRaw(int j, double *ref) override
189  {return NOT_YET_IMPLEMENTED("getRefSpeedRaw");}
190 
191  bool getRefSpeedsRaw(const int n_joint, const int *joints, double *spds) override
192  {return NOT_YET_IMPLEMENTED("getRefSpeedsRaw");}
193 
194  bool getRefSpeedsRaw(double *spds) override
195  {return NOT_YET_IMPLEMENTED("getRefSpeedsRaw");}
196 
197  bool getRefAccelerationRaw(int j, double *acc) override
198  {return NOT_YET_IMPLEMENTED("getRefAccelerationRaw");}
199 
200  bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
201  {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
202 
203  bool getRefAccelerationsRaw(double *accs) override
204  {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
205 
206  bool stopRaw(int j) override
207  {return NOT_YET_IMPLEMENTED("stopRaw");}
208 
209  bool stopRaw(const int n_joint, const int *joints) override
210  {return NOT_YET_IMPLEMENTED("stopRaw");}
211 
212  bool stopRaw() override
213  {return NOT_YET_IMPLEMENTED("stopRaw");}
214 
215  bool getTargetPositionRaw(const int joint, double *ref) override
216  {return NOT_YET_IMPLEMENTED("stopRaw");}
217 
218  bool getTargetPositionsRaw(double *refs) override
219  {return NOT_YET_IMPLEMENTED("stopRaw");}
220 
221  bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) override
222  {return NOT_YET_IMPLEMENTED("stopRaw");}
223 };
224 
225 #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: environment.h:18
#define YARP_dev_API
Definition: api.h:19