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
12namespace yarp::dev {
13class ImplementPositionControl;
14class StubImplPositionControlRaw;
15}
16
17namespace yarp::dev::impl {
18
19template <typename T>
20class FixedSizeBuffersManager;
21
22} // namespace yarp::dev::impl
23
30{
31protected:
33 void *helper;
37
47 bool initialize (int size, const int *amap, const double *enc, const double *zos);
48
53 bool uninitialize ();
54
55public:
62
67
68
74 bool getAxes(int *axis) override;
75
76 bool positionMove(int j, double ref) override;
77 bool positionMove(const int n_joint, const int *joints, const double *refs) override;
78 bool positionMove(const double *refs) override;
79 bool relativeMove(int j, double delta) override;
80 bool relativeMove(const int n_joint, const int *joints, const double *deltas) override;
81 bool relativeMove(const double *deltas) override;
82 bool checkMotionDone(bool *flag) override;
83 bool checkMotionDone(const int n_joint, const int *joints, bool *flags) override;
84 bool checkMotionDone(int j, bool *flag) override;
85 bool setRefSpeed(int j, double sp) override;
86 bool setRefSpeeds(const int n_joint, const int *joints, const double *spds) override;
87 bool setRefSpeeds(const double *spds) override;
88 bool setRefAcceleration(int j, double acc) override;
89 bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override;
90 bool setRefAccelerations(const double *accs) override;
91 bool getRefSpeed(int j, double *ref) override;
92 bool getRefSpeeds(const int n_joint, const int *joints, double *spds) override;
93 bool getRefSpeeds(double *spds) override;
94 bool getRefAcceleration(int j, double *acc) override;
95 bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override;
96 bool getRefAccelerations(double *accs) override;
97 bool stop(int j) override;
98 bool stop(const int n_joint, const int *joints) override;
99 bool stop() override;
100 bool getTargetPosition(const int joint, double *ref) override;
101 bool getTargetPositions(double *refs) override;
102 bool getTargetPositions(const int n_joint, const int *joints, double *refs) override;
103};
104
120{
121private:
126 bool NOT_YET_IMPLEMENTED(const char *func=0);
127
128public:
130
131 bool getAxes(int *ax) override
132 {return NOT_YET_IMPLEMENTED("getAxes");}
133
134 bool positionMoveRaw(int j, double ref) override
135 {return NOT_YET_IMPLEMENTED("positionMoveRaw");}
136
137 bool positionMoveRaw(const int n_joint, const int *joints, const double *refs) override
138 {return NOT_YET_IMPLEMENTED("positionMoveRaw");}
139
140 bool positionMoveRaw(const double *refs) override
141 {return NOT_YET_IMPLEMENTED("positionMoveRaw");}
142
143 bool relativeMoveRaw(int j, double delta) override
144 {return NOT_YET_IMPLEMENTED("relativeMoveRaw");}
145
146 bool relativeMoveRaw(const int n_joint, const int *joints, const double *refs) override
147 {return NOT_YET_IMPLEMENTED("relativeMoveRaw");}
148
149 bool relativeMoveRaw(const double *deltas) override
150 {return NOT_YET_IMPLEMENTED("relativeMoveRaw");}
151
152 bool checkMotionDoneRaw(int j, bool *flag) override
153 {return NOT_YET_IMPLEMENTED("checkMotionDoneRaw");}
154
155 bool checkMotionDoneRaw(const int n_joint, const int *joints, bool *flags) override
156 {return NOT_YET_IMPLEMENTED("checkMotionDoneRaw");}
157
158 bool checkMotionDoneRaw(bool *flag) override
159 {return NOT_YET_IMPLEMENTED("checkMotionDoneRaw");}
160
161 bool setRefSpeedRaw(int j, double sp) override
162 {return NOT_YET_IMPLEMENTED("setRefSpeedRaw");}
163
164 bool setRefSpeedsRaw(const int n_joint, const int *joints, const double *spds) override
165 {return NOT_YET_IMPLEMENTED("setRefSpeedsRaw");}
166
167 bool setRefSpeedsRaw(const double *spds) override
168 {return NOT_YET_IMPLEMENTED("setRefSpeedsRaw");}
169
170 bool setRefAccelerationRaw(int j, double acc) override
171 {return NOT_YET_IMPLEMENTED("setRefAccelerationRaw");}
172
173 bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
174 {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
175
176 bool setRefAccelerationsRaw(const double *accs) override
177 {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
178
179 bool getRefSpeedRaw(int j, double *ref) override
180 {return NOT_YET_IMPLEMENTED("getRefSpeedRaw");}
181
182 bool getRefSpeedsRaw(const int n_joint, const int *joints, double *spds) override
183 {return NOT_YET_IMPLEMENTED("getRefSpeedsRaw");}
184
185 bool getRefSpeedsRaw(double *spds) override
186 {return NOT_YET_IMPLEMENTED("getRefSpeedsRaw");}
187
188 bool getRefAccelerationRaw(int j, double *acc) override
189 {return NOT_YET_IMPLEMENTED("getRefAccelerationRaw");}
190
191 bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
192 {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
193
194 bool getRefAccelerationsRaw(double *accs) override
195 {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
196
197 bool stopRaw(int j) override
198 {return NOT_YET_IMPLEMENTED("stopRaw");}
199
200 bool stopRaw(const int n_joint, const int *joints) override
201 {return NOT_YET_IMPLEMENTED("stopRaw");}
202
203 bool stopRaw() override
204 {return NOT_YET_IMPLEMENTED("stopRaw");}
205
206 bool getTargetPositionRaw(const int joint, double *ref) override
207 {return NOT_YET_IMPLEMENTED("stopRaw");}
208
209 bool getTargetPositionsRaw(double *refs) override
210 {return NOT_YET_IMPLEMENTED("stopRaw");}
211
212 bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) override
213 {return NOT_YET_IMPLEMENTED("stopRaw");}
214};
215
216#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.
Default implementation of the IPositionControl interface.
bool positionMove(int j, double ref) override
Set new reference point for a single axis.
bool getRefSpeeds(const int n_joint, const int *joints, double *spds) override
Get reference speed of all joints.
bool getRefSpeed(int j, double *ref) override
Get reference speed for a joint.
bool getTargetPositions(double *refs) override
Get the last position reference for all axes.
bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration on all joints.
bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a joint.
bool relativeMove(int j, double delta) override
Set relative position.
bool getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool checkMotionDone(bool *flag) override
Check if the current trajectory is terminated.
bool setRefSpeed(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
yarp::dev::impl::FixedSizeBuffersManager< bool > * boolBuffManager
bool setRefAcceleration(int j, double acc) override
Set reference acceleration for a joint.
ImplementPositionControl(yarp::dev::IPositionControlRaw *y)
Constructor.
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
bool getAxes(int *axis) override
Get the number of controlled axes.
bool stop() override
Stop motion, multiple joints.
bool getRefAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
bool setRefSpeeds(const int n_joint, const int *joints, const double *spds) override
Set reference speed on all joints.
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.
For streams capable of holding different kinds of content, check what they actually have.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18