YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IPositionControl.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_DEV_IPOSITIONCONTROL_H
8#define YARP_DEV_IPOSITIONCONTROL_H
9
10#include <yarp/dev/api.h>
11#include <yarp/os/Vocab.h>
12
13namespace yarp::dev {
14class IPositionControlRaw;
15class IPositionControl;
16}
17
25{
26public:
31
38 virtual bool getAxes(int *ax) = 0;
39
45 virtual bool positionMoveRaw(int j, double ref)=0;
46
51 virtual bool positionMoveRaw(const double *refs)=0;
52
59 virtual bool relativeMoveRaw(int j, double delta)=0;
60
65 virtual bool relativeMoveRaw(const double *deltas)=0;
66
73 virtual bool checkMotionDoneRaw(int j, bool *flag)=0;
74
80 virtual bool checkMotionDoneRaw(bool *flag)=0;
81
88 virtual bool setRefSpeedRaw(int j, double sp)=0;
89
95 virtual bool setRefSpeedsRaw(const double *spds)=0;
96
103 virtual bool setRefAccelerationRaw(int j, double acc)=0;
104
110 virtual bool setRefAccelerationsRaw(const double *accs)=0;
111
118 virtual bool getRefSpeedRaw(int j, double *ref)=0;
119
124 virtual bool getRefSpeedsRaw(double *spds)=0;
125
132 virtual bool getRefAccelerationRaw(int j, double *acc)=0;
133
139 virtual bool getRefAccelerationsRaw(double *accs)=0;
140
145 virtual bool stopRaw(int j)=0;
146
150 virtual bool stopRaw()=0;
151
157 virtual bool positionMoveRaw(const int n_joint, const int *joints, const double *refs)=0;
158
164 virtual bool relativeMoveRaw(const int n_joint, const int *joints, const double *deltas)=0;
165
172 virtual bool checkMotionDoneRaw(const int n_joint, const int *joints, bool *flags)=0;
173
180 virtual bool setRefSpeedsRaw(const int n_joint, const int *joints, const double *spds)=0;
181
188 virtual bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs)=0;
189
196 virtual bool getRefSpeedsRaw(const int n_joint, const int *joints, double *spds)=0;
197
204 virtual bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs)=0;
205
210 virtual bool stopRaw(const int n_joint, const int *joints)=0;
211
221 virtual bool getTargetPositionRaw(const int joint, double *ref) { return false;}
222
232 virtual bool getTargetPositionsRaw(double *refs) { return false;}
233
243 virtual bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) { return false;}
244};
245
252{
253public:
257 virtual ~IPositionControl() {}
258
265 virtual bool getAxes(int *ax) = 0;
266
272 virtual bool positionMove(int j, double ref)=0;
273
278 virtual bool positionMove(const double *refs)=0;
279
286 virtual bool relativeMove(int j, double delta)=0;
287
292 virtual bool relativeMove(const double *deltas)=0;
293
300 virtual bool checkMotionDone(int j, bool *flag)=0;
301
307 virtual bool checkMotionDone(bool *flag)=0;
308
315 virtual bool setRefSpeed(int j, double sp)=0;
316
322 virtual bool setRefSpeeds(const double *spds)=0;
323
330 virtual bool setRefAcceleration(int j, double acc)=0;
331
337 virtual bool setRefAccelerations(const double *accs)=0;
338
345 virtual bool getRefSpeed(int j, double *ref)=0;
346
351 virtual bool getRefSpeeds(double *spds)=0;
352
359 virtual bool getRefAcceleration(int j, double *acc)=0;
360
366 virtual bool getRefAccelerations(double *accs)=0;
367
372 virtual bool stop(int j)=0;
373
377 virtual bool stop()=0;
378
384 virtual bool positionMove(const int n_joint, const int *joints, const double *refs)=0;
385
391 virtual bool relativeMove(const int n_joint, const int *joints, const double *deltas)=0;
392
398 virtual bool checkMotionDone(const int n_joint, const int *joints, bool *flag)=0;
399
406 virtual bool setRefSpeeds(const int n_joint, const int *joints, const double *spds)=0;
407
414 virtual bool setRefAccelerations(const int n_joint, const int *joints, const double *accs)=0;
415
422 virtual bool getRefSpeeds(const int n_joint, const int *joints, double *spds)=0;
423
430 virtual bool getRefAccelerations(const int n_joint, const int *joints, double *accs)=0;
431
436 virtual bool stop(const int n_joint, const int *joints)=0;
437
447 virtual bool getTargetPosition(const int joint, double *ref) { return false;}
448
458 virtual bool getTargetPositions(double *refs) { return false;}
459
469 virtual bool getTargetPositions(const int n_joint, const int *joints, double *refs) { return false;}
470};
471
478
479#endif // YARP_DEV_IPOSITIONCONTROL_H
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATION_GROUP
constexpr yarp::conf::vocab32_t VOCAB_STOP_GROUP
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEED_GROUP
Interface for a generic control board device implementing position control in encoder coordinates.
virtual bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs)=0
Set reference acceleration on all joints.
virtual bool getRefSpeedsRaw(const int n_joint, const int *joints, double *spds)=0
Get reference speed of all joints.
virtual bool positionMoveRaw(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for a subset of joints.
virtual bool positionMoveRaw(const double *refs)=0
Set new reference point for all axes.
virtual bool getRefAccelerationRaw(int j, double *acc)=0
Get reference acceleration for a joint.
virtual bool setRefSpeedsRaw(const int n_joint, const int *joints, const double *spds)=0
Set reference speed on all joints.
virtual bool stopRaw()=0
Stop motion, multiple joints.
virtual bool stopRaw(int j)=0
Stop motion, single joint.
virtual bool getRefSpeedsRaw(double *spds)=0
Get reference speed of all joints.
virtual bool relativeMoveRaw(int j, double delta)=0
Set relative position.
virtual bool getTargetPositionsRaw(double *refs)
Get the last position reference for all axes.
virtual bool checkMotionDoneRaw(bool *flag)=0
Check if the current trajectory is terminated.
virtual bool relativeMoveRaw(const int n_joint, const int *joints, const double *deltas)=0
Set relative position for a subset of joints.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool setRefAccelerationRaw(int j, double acc)=0
Set reference acceleration for a joint.
virtual bool checkMotionDoneRaw(int j, bool *flag)=0
Check if the current trajectory is terminated.
virtual bool getRefSpeedRaw(int j, double *ref)=0
Get reference speed for a joint.
virtual bool checkMotionDoneRaw(const int n_joint, const int *joints, bool *flags)=0
Check if the current trajectory is terminated.
virtual bool setRefAccelerationsRaw(const double *accs)=0
Set reference acceleration on all joints.
virtual bool positionMoveRaw(int j, double ref)=0
Set new reference point for a single axis.
virtual bool stopRaw(const int n_joint, const int *joints)=0
Stop motion for subset of joints.
virtual bool getTargetPositionRaw(const int joint, double *ref)
Get the last position reference for the specified axis.
virtual bool setRefSpeedsRaw(const double *spds)=0
Set reference speed on all joints.
virtual bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs)=0
Get reference acceleration for a joint.
virtual ~IPositionControlRaw()
Destructor.
virtual bool getRefAccelerationsRaw(double *accs)=0
Get reference acceleration of all joints.
virtual bool relativeMoveRaw(const double *deltas)=0
Set relative position, all joints.
virtual bool setRefSpeedRaw(int j, double sp)=0
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
virtual bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs)
Get the last position reference for the specified group of axes.
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 checkMotionDone(const int n_joint, const int *joints, bool *flag)=0
Check if the current trajectory is terminated.
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 ~IPositionControl()
Destructor.
virtual bool getRefSpeeds(const int n_joint, const int *joints, double *spds)=0
Get reference speed of all joints.
virtual bool relativeMove(int j, double delta)=0
Set relative position.
virtual bool stop(const int n_joint, const int *joints)=0
Stop motion for subset of joints.
virtual bool getTargetPositions(const int n_joint, const int *joints, double *refs)
Get the last position reference for the specified group of axes.
virtual bool relativeMove(const int n_joint, const int *joints, const double *deltas)=0
Set relative position for a subset of joints.
virtual bool getRefAccelerations(const int n_joint, const int *joints, double *accs)=0
Get reference acceleration for a joint.
virtual bool positionMove(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for a subset of joints.
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 int n_joint, const int *joints, const double *accs)=0
Set reference acceleration on all joints.
virtual bool stop(int j)=0
Stop motion, single joint.
virtual bool setRefAccelerations(const double *accs)=0
Set reference acceleration on all joints.
virtual bool relativeMove(const double *deltas)=0
Set relative position, 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 setRefSpeeds(const int n_joint, const int *joints, const double *spds)=0
Set reference speed on all joints.
virtual bool checkMotionDone(bool *flag)=0
Check if the current trajectory is terminated.
virtual bool getTargetPositions(double *refs)
Get the last position reference for all axes.
virtual bool positionMove(const double *refs)=0
Set new reference point for all axes.
std::int32_t vocab32_t
Definition numeric.h:78
For streams capable of holding different kinds of content, check what they actually have.
Definition jointData.cpp:13
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition Vocab.h:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18