YARP
Yet Another Robot Platform
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 
13 namespace yarp {
14  namespace dev {
15  class IPositionControlRaw;
16  class IPositionControl;
17  }
18 }
19 
27 {
28 public:
32  virtual ~IPositionControlRaw() {}
33 
40  virtual bool getAxes(int *ax) = 0;
41 
47  virtual bool positionMoveRaw(int j, double ref)=0;
48 
53  virtual bool positionMoveRaw(const double *refs)=0;
54 
61  virtual bool relativeMoveRaw(int j, double delta)=0;
62 
67  virtual bool relativeMoveRaw(const double *deltas)=0;
68 
75  virtual bool checkMotionDoneRaw(int j, bool *flag)=0;
76 
82  virtual bool checkMotionDoneRaw(bool *flag)=0;
83 
90  virtual bool setRefSpeedRaw(int j, double sp)=0;
91 
97  virtual bool setRefSpeedsRaw(const double *spds)=0;
98 
105  virtual bool setRefAccelerationRaw(int j, double acc)=0;
106 
112  virtual bool setRefAccelerationsRaw(const double *accs)=0;
113 
120  virtual bool getRefSpeedRaw(int j, double *ref)=0;
121 
126  virtual bool getRefSpeedsRaw(double *spds)=0;
127 
134  virtual bool getRefAccelerationRaw(int j, double *acc)=0;
135 
141  virtual bool getRefAccelerationsRaw(double *accs)=0;
142 
147  virtual bool stopRaw(int j)=0;
148 
152  virtual bool stopRaw()=0;
153 
159  virtual bool positionMoveRaw(const int n_joint, const int *joints, const double *refs)=0;
160 
166  virtual bool relativeMoveRaw(const int n_joint, const int *joints, const double *deltas)=0;
167 
174  virtual bool checkMotionDoneRaw(const int n_joint, const int *joints, bool *flags)=0;
175 
182  virtual bool setRefSpeedsRaw(const int n_joint, const int *joints, const double *spds)=0;
183 
190  virtual bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs)=0;
191 
198  virtual bool getRefSpeedsRaw(const int n_joint, const int *joints, double *spds)=0;
199 
206  virtual bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs)=0;
207 
212  virtual bool stopRaw(const int n_joint, const int *joints)=0;
213 
223  virtual bool getTargetPositionRaw(const int joint, double *ref) { return false;}
224 
234  virtual bool getTargetPositionsRaw(double *refs) { return false;}
235 
245  virtual bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) { return false;}
246 };
247 
254 {
255 public:
259  virtual ~IPositionControl() {}
260 
267  virtual bool getAxes(int *ax) = 0;
268 
274  virtual bool positionMove(int j, double ref)=0;
275 
280  virtual bool positionMove(const double *refs)=0;
281 
288  virtual bool relativeMove(int j, double delta)=0;
289 
294  virtual bool relativeMove(const double *deltas)=0;
295 
302  virtual bool checkMotionDone(int j, bool *flag)=0;
303 
309  virtual bool checkMotionDone(bool *flag)=0;
310 
317  virtual bool setRefSpeed(int j, double sp)=0;
318 
324  virtual bool setRefSpeeds(const double *spds)=0;
325 
332  virtual bool setRefAcceleration(int j, double acc)=0;
333 
339  virtual bool setRefAccelerations(const double *accs)=0;
340 
347  virtual bool getRefSpeed(int j, double *ref)=0;
348 
353  virtual bool getRefSpeeds(double *spds)=0;
354 
361  virtual bool getRefAcceleration(int j, double *acc)=0;
362 
368  virtual bool getRefAccelerations(double *accs)=0;
369 
374  virtual bool stop(int j)=0;
375 
379  virtual bool stop()=0;
380 
386  virtual bool positionMove(const int n_joint, const int *joints, const double *refs)=0;
387 
393  virtual bool relativeMove(const int n_joint, const int *joints, const double *deltas)=0;
394 
400  virtual bool checkMotionDone(const int n_joint, const int *joints, bool *flag)=0;
401 
408  virtual bool setRefSpeeds(const int n_joint, const int *joints, const double *spds)=0;
409 
416  virtual bool setRefAccelerations(const int n_joint, const int *joints, const double *accs)=0;
417 
424  virtual bool getRefSpeeds(const int n_joint, const int *joints, double *spds)=0;
425 
432  virtual bool getRefAccelerations(const int n_joint, const int *joints, double *accs)=0;
433 
438  virtual bool stop(const int n_joint, const int *joints)=0;
439 
449  virtual bool getTargetPosition(const int joint, double *ref) { return false;}
450 
460  virtual bool getTargetPositions(double *refs) { return false;}
461 
471  virtual bool getTargetPositions(const int n_joint, const int *joints, double *refs) { return false;}
472 };
473 
480 
481 #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
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:28
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18