YARP
Yet Another Robot Platform
IPositionControl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_DEV_IPOSITIONCONTROL_H
11 #define YARP_DEV_IPOSITIONCONTROL_H
12 
13 #include <yarp/dev/api.h>
14 #include <yarp/os/Vocab.h>
15 
16 namespace yarp {
17  namespace dev {
18  class IPositionControlRaw;
19  class IPositionControl;
20  }
21 }
22 
30 {
31 public:
35  virtual ~IPositionControlRaw() {}
36 
43  virtual bool getAxes(int *ax) = 0;
44 
50  virtual bool positionMoveRaw(int j, double ref)=0;
51 
56  virtual bool positionMoveRaw(const double *refs)=0;
57 
64  virtual bool relativeMoveRaw(int j, double delta)=0;
65 
70  virtual bool relativeMoveRaw(const double *deltas)=0;
71 
78  virtual bool checkMotionDoneRaw(int j, bool *flag)=0;
79 
85  virtual bool checkMotionDoneRaw(bool *flag)=0;
86 
93  virtual bool setRefSpeedRaw(int j, double sp)=0;
94 
100  virtual bool setRefSpeedsRaw(const double *spds)=0;
101 
108  virtual bool setRefAccelerationRaw(int j, double acc)=0;
109 
115  virtual bool setRefAccelerationsRaw(const double *accs)=0;
116 
123  virtual bool getRefSpeedRaw(int j, double *ref)=0;
124 
129  virtual bool getRefSpeedsRaw(double *spds)=0;
130 
137  virtual bool getRefAccelerationRaw(int j, double *acc)=0;
138 
144  virtual bool getRefAccelerationsRaw(double *accs)=0;
145 
150  virtual bool stopRaw(int j)=0;
151 
155  virtual bool stopRaw()=0;
156 
162  virtual bool positionMoveRaw(const int n_joint, const int *joints, const double *refs)=0;
163 
169  virtual bool relativeMoveRaw(const int n_joint, const int *joints, const double *deltas)=0;
170 
177  virtual bool checkMotionDoneRaw(const int n_joint, const int *joints, bool *flags)=0;
178 
185  virtual bool setRefSpeedsRaw(const int n_joint, const int *joints, const double *spds)=0;
186 
193  virtual bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs)=0;
194 
201  virtual bool getRefSpeedsRaw(const int n_joint, const int *joints, double *spds)=0;
202 
209  virtual bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs)=0;
210 
215  virtual bool stopRaw(const int n_joint, const int *joints)=0;
216 
226  virtual bool getTargetPositionRaw(const int joint, double *ref) { return false;}
227 
237  virtual bool getTargetPositionsRaw(double *refs) { return false;}
238 
248  virtual bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) { return false;}
249 };
250 
257 {
258 public:
262  virtual ~IPositionControl() {}
263 
270  virtual bool getAxes(int *ax) = 0;
271 
277  virtual bool positionMove(int j, double ref)=0;
278 
283  virtual bool positionMove(const double *refs)=0;
284 
291  virtual bool relativeMove(int j, double delta)=0;
292 
297  virtual bool relativeMove(const double *deltas)=0;
298 
305  virtual bool checkMotionDone(int j, bool *flag)=0;
306 
312  virtual bool checkMotionDone(bool *flag)=0;
313 
320  virtual bool setRefSpeed(int j, double sp)=0;
321 
327  virtual bool setRefSpeeds(const double *spds)=0;
328 
335  virtual bool setRefAcceleration(int j, double acc)=0;
336 
342  virtual bool setRefAccelerations(const double *accs)=0;
343 
350  virtual bool getRefSpeed(int j, double *ref)=0;
351 
356  virtual bool getRefSpeeds(double *spds)=0;
357 
364  virtual bool getRefAcceleration(int j, double *acc)=0;
365 
371  virtual bool getRefAccelerations(double *accs)=0;
372 
377  virtual bool stop(int j)=0;
378 
382  virtual bool stop()=0;
383 
389  virtual bool positionMove(const int n_joint, const int *joints, const double *refs)=0;
390 
396  virtual bool relativeMove(const int n_joint, const int *joints, const double *deltas)=0;
397 
403  virtual bool checkMotionDone(const int n_joint, const int *joints, bool *flag)=0;
404 
411  virtual bool setRefSpeeds(const int n_joint, const int *joints, const double *spds)=0;
412 
419  virtual bool setRefAccelerations(const int n_joint, const int *joints, const double *accs)=0;
420 
427  virtual bool getRefSpeeds(const int n_joint, const int *joints, double *spds)=0;
428 
435  virtual bool getRefAccelerations(const int n_joint, const int *joints, double *accs)=0;
436 
441  virtual bool stop(const int n_joint, const int *joints)=0;
442 
452  virtual bool getTargetPosition(const int joint, double *ref) { return false;}
453 
463  virtual bool getTargetPositions(double *refs) { return false;}
464 
474  virtual bool getTargetPositions(const int n_joint, const int *joints, double *refs) { return false;}
475 };
476 
483 
484 #endif // YARP_DEV_IPOSITIONCONTROL_H
yarp::dev::IPositionControlRaw::positionMoveRaw
virtual bool positionMoveRaw(int j, double ref)=0
Set new reference point for a single axis.
api.h
VOCAB_RELATIVE_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVE_GROUP
Definition: IPositionControl.h:478
yarp::dev::IPositionControl::setRefAccelerations
virtual bool setRefAccelerations(const double *accs)=0
Set reference acceleration on all joints.
yarp::dev::IPositionControlRaw::getTargetPositionRaw
virtual bool getTargetPositionRaw(const int joint, double *ref)
Get the last position reference for the specified axis.
Definition: IPositionControl.h:226
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
yarp::dev::IPositionControlRaw::setRefAccelerationsRaw
virtual bool setRefAccelerationsRaw(const double *accs)=0
Set reference acceleration on all joints.
yarp::dev::IPositionControl::positionMove
virtual bool positionMove(int j, double ref)=0
Set new reference point for a single axis.
VOCAB_MOTION_DONE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONE_GROUP
Definition: IPositionControl.h:479
yarp::dev::IPositionControlRaw::getRefSpeedRaw
virtual bool getRefSpeedRaw(int j, double *ref)=0
Get reference speed for a joint.
yarp::dev::IPositionControlRaw::setRefAccelerationRaw
virtual bool setRefAccelerationRaw(int j, double acc)=0
Set reference acceleration for a joint.
yarp::dev::IPositionControlRaw::checkMotionDoneRaw
virtual bool checkMotionDoneRaw(int j, bool *flag)=0
Check if the current trajectory is terminated.
yarp::dev::IPositionControl::getRefAcceleration
virtual bool getRefAcceleration(int j, double *acc)=0
Get reference acceleration for a joint.
yarp::dev::IPositionControl::setRefSpeed
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.
yarp::dev::IPositionControl::getRefSpeeds
virtual bool getRefSpeeds(double *spds)=0
Get reference speed of all joints.
VOCAB_REF_SPEED_GROUP
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEED_GROUP
Definition: IPositionControl.h:480
yarp::dev::IPositionControl::setRefAcceleration
virtual bool setRefAcceleration(int j, double acc)=0
Set reference acceleration for a joint.
yarp::dev::IPositionControlRaw::stopRaw
virtual bool stopRaw()=0
Stop motion, multiple joints.
yarp::dev::IPositionControl::getTargetPositions
virtual bool getTargetPositions(const int n_joint, const int *joints, double *refs)
Get the last position reference for the specified group of axes.
Definition: IPositionControl.h:474
yarp::dev::IPositionControl::getRefSpeed
virtual bool getRefSpeed(int j, double *ref)=0
Get reference speed for a joint.
yarp::dev::IPositionControl::checkMotionDone
virtual bool checkMotionDone(int j, bool *flag)=0
Check if the current trajectory is terminated.
yarp::dev::IPositionControlRaw::~IPositionControlRaw
virtual ~IPositionControlRaw()
Destructor.
Definition: IPositionControl.h:35
VOCAB_POSITION_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVE_GROUP
Definition: IPositionControl.h:477
yarp::dev::IPositionControlRaw::setRefSpeedRaw
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.
yarp::dev::IPositionControl::relativeMove
virtual bool relativeMove(int j, double delta)=0
Set relative position.
yarp::dev::IPositionControl::getAxes
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
yarp::dev::IPositionControl::stop
virtual bool stop()=0
Stop motion, multiple joints.
yarp::dev::IPositionControlRaw::relativeMoveRaw
virtual bool relativeMoveRaw(int j, double delta)=0
Set relative position.
yarp::dev::IPositionControl::getTargetPositions
virtual bool getTargetPositions(double *refs)
Get the last position reference for all axes.
Definition: IPositionControl.h:463
yarp::dev::IPositionControl::~IPositionControl
virtual ~IPositionControl()
Destructor.
Definition: IPositionControl.h:262
yarp::dev::IPositionControlRaw
Definition: IPositionControl.h:29
yarp
Definition: numeric.h:47
yarp::dev::IPositionControl::setRefSpeeds
virtual bool setRefSpeeds(const double *spds)=0
Set reference speed on all joints.
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
Vocab.h
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IPositionControlRaw::getTargetPositionsRaw
virtual bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs)
Get the last position reference for the specified group of axes.
Definition: IPositionControl.h:248
VOCAB_REF_ACCELERATION_GROUP
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATION_GROUP
Definition: IPositionControl.h:481
yarp::dev::IPositionControlRaw::getRefSpeedsRaw
virtual bool getRefSpeedsRaw(double *spds)=0
Get reference speed of all joints.
yarp::dev::IPositionControl::getTargetPosition
virtual bool getTargetPosition(const int joint, double *ref)
Get the last position reference for the specified axis.
Definition: IPositionControl.h:452
VOCAB_STOP_GROUP
constexpr yarp::conf::vocab32_t VOCAB_STOP_GROUP
Definition: IPositionControl.h:482
yarp::dev::IPositionControl::getRefAccelerations
virtual bool getRefAccelerations(double *accs)=0
Get reference acceleration of all joints.
yarp::dev::IPositionControlRaw::setRefSpeedsRaw
virtual bool setRefSpeedsRaw(const double *spds)=0
Set reference speed on all joints.
yarp::dev::IPositionControl
Definition: IPositionControl.h:256
yarp::dev::IPositionControlRaw::getTargetPositionsRaw
virtual bool getTargetPositionsRaw(double *refs)
Get the last position reference for all axes.
Definition: IPositionControl.h:237
yarp::dev::IPositionControlRaw::getRefAccelerationsRaw
virtual bool getRefAccelerationsRaw(double *accs)=0
Get reference acceleration of all joints.
yarp::dev::IPositionControlRaw::getAxes
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
yarp::dev::IPositionControlRaw::getRefAccelerationRaw
virtual bool getRefAccelerationRaw(int j, double *acc)=0
Get reference acceleration for a joint.