YARP
Yet Another Robot Platform
IVelocityControl.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_IVELOCITYCONTROL_H
11 #define YARP_DEV_IVELOCITYCONTROL_H
12 
13 #include <yarp/os/Vocab.h>
14 #include <yarp/dev/api.h>
15 
16 namespace yarp {
17  namespace dev {
18  class IVelocityControl;
19  class IVelocityControlRaw;
20  }
21 }
22 
29 {
30 public:
34  virtual ~IVelocityControlRaw() {}
35 
42  virtual bool getAxes(int *axis) = 0;
43 
50  virtual bool velocityMoveRaw(int j, double sp)=0;
51 
57  virtual bool velocityMoveRaw(const double *sp)=0;
58 
65  virtual bool setRefAccelerationRaw(int j, double acc)=0;
66 
72  virtual bool setRefAccelerationsRaw(const double *accs)=0;
73 
80  virtual bool getRefAccelerationRaw(int j, double *acc)=0;
81 
87  virtual bool getRefAccelerationsRaw(double *accs)=0;
88 
93  virtual bool stopRaw(int j)=0;
94 
98  virtual bool stopRaw()=0;
99 
107  virtual bool velocityMoveRaw(const int n_joint, const int *joints, const double *spds)=0;
108 
114  virtual bool getRefVelocityRaw(const int joint, double *vel) {return false;}
115 
120  virtual bool getRefVelocitiesRaw(double *vels) {return false;}
121 
129  virtual bool getRefVelocitiesRaw(const int n_joint, const int *joints, double *vels) { return false;}
130 
137  virtual bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs)=0;
138 
145  virtual bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs)=0;
146 
151  virtual bool stopRaw(const int n_joint, const int *joints)=0;
152 };
153 
160 {
161 public:
165  virtual ~IVelocityControl() {}
166 
173  virtual bool getAxes(int *axes) = 0;
174 
181  virtual bool velocityMove(int j, double sp)=0;
182 
188  virtual bool velocityMove(const double *sp)=0;
189 
196  virtual bool setRefAcceleration(int j, double acc)=0;
197 
203  virtual bool setRefAccelerations(const double *accs)=0;
204 
211  virtual bool getRefAcceleration(int j, double *acc)=0;
212 
218  virtual bool getRefAccelerations(double *accs)=0;
219 
224  virtual bool stop(int j)=0;
225 
229  virtual bool stop()=0;
230 
242  virtual bool velocityMove(const int n_joint, const int *joints, const double *spds)=0;
243 
249  virtual bool getRefVelocity(const int joint, double *vel) {return false;}
250 
255  virtual bool getRefVelocities(double *vels) {return false;}
256 
264  virtual bool getRefVelocities(const int n_joint, const int *joints, double *vels) { return false;}
265 
278  virtual bool setRefAccelerations(const int n_joint, const int *joints, const double *accs)=0;
279 
292  virtual bool getRefAccelerations(const int n_joint, const int *joints, double *accs)=0;
293 
299  virtual bool stop(const int n_joint, const int *joints)=0;
300 };
301 
305 
306 #endif // YARP_DEV_IVELOCITYCONTROL_H
api.h
yarp::dev::IVelocityControl::velocityMove
virtual bool velocityMove(int j, double sp)=0
Start motion at a given speed, single joint.
yarp::dev::IVelocityControlRaw::getRefVelocitiesRaw
virtual bool getRefVelocitiesRaw(double *vels)
Get the last reference speed set by velocityMove for all joints.
Definition: IVelocityControl.h:120
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::IVelocityControlRaw::setRefAccelerationRaw
virtual bool setRefAccelerationRaw(int j, double acc)=0
Set reference acceleration for a joint.
yarp::dev::IVelocityControl::~IVelocityControl
virtual ~IVelocityControl()
Destructor.
Definition: IVelocityControl.h:165
yarp::dev::IVelocityControl::getRefVelocities
virtual bool getRefVelocities(double *vels)
Get the last reference speed set by velocityMove for all joints.
Definition: IVelocityControl.h:255
yarp::dev::IVelocityControl::stop
virtual bool stop()=0
Stop motion, multiple joints.
yarp::dev::IVelocityControlRaw::~IVelocityControlRaw
virtual ~IVelocityControlRaw()
Destructor.
Definition: IVelocityControl.h:34
yarp::dev::IVelocityControl::setRefAcceleration
virtual bool setRefAcceleration(int j, double acc)=0
Set reference acceleration for a joint.
yarp::dev::IVelocityControlRaw::stopRaw
virtual bool stopRaw()=0
Stop motion, multiple joints.
yarp::dev::IVelocityControl::getRefVelocity
virtual bool getRefVelocity(const int joint, double *vel)
Get the last reference speed set by velocityMove for single joint.
Definition: IVelocityControl.h:249
yarp::dev::IVelocityControl::getRefAcceleration
virtual bool getRefAcceleration(int j, double *acc)=0
Get reference acceleration for a joint.
yarp::dev::IVelocityControlRaw::getAxes
virtual bool getAxes(int *axis)=0
Get the number of controlled axes.
VOCAB_VEL_PID
constexpr yarp::conf::vocab32_t VOCAB_VEL_PID
Definition: IVelocityControl.h:303
yarp::dev::IVelocityControlRaw::getRefVelocityRaw
virtual bool getRefVelocityRaw(const int joint, double *vel)
Get the last reference speed set by velocityMove for single joint.
Definition: IVelocityControl.h:114
yarp::dev::IVelocityControl::getRefAccelerations
virtual bool getRefAccelerations(double *accs)=0
Get reference acceleration of all joints.
yarp::dev::IVelocityControl::setRefAccelerations
virtual bool setRefAccelerations(const double *accs)=0
Set reference acceleration on all joints.
yarp::dev::IVelocityControlRaw::getRefAccelerationsRaw
virtual bool getRefAccelerationsRaw(double *accs)=0
Get reference acceleration of all joints.
yarp::dev::IVelocityControl
Definition: IVelocityControl.h:159
yarp::dev::IVelocityControl::getAxes
virtual bool getAxes(int *axes)=0
Get the number of controlled axes.
VOCAB_VEL_PIDS
constexpr yarp::conf::vocab32_t VOCAB_VEL_PIDS
Definition: IVelocityControl.h:304
yarp::dev::IVelocityControlRaw::getRefAccelerationRaw
virtual bool getRefAccelerationRaw(int j, double *acc)=0
Get reference acceleration for a joint.
yarp::dev::IVelocityControlRaw::velocityMoveRaw
virtual bool velocityMoveRaw(int j, double sp)=0
Start motion at a given speed, single joint.
yarp
Definition: numeric.h:47
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
yarp::dev::IVelocityControlRaw::getRefVelocitiesRaw
virtual bool getRefVelocitiesRaw(const int n_joint, const int *joints, double *vels)
Get the last reference speed set by velocityMove for a group of joints.
Definition: IVelocityControl.h:129
Vocab.h
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IVelocityControl::getRefVelocities
virtual bool getRefVelocities(const int n_joint, const int *joints, double *vels)
Get the last reference speed set by velocityMove for a group of joints.
Definition: IVelocityControl.h:264
yarp::dev::IVelocityControlRaw::setRefAccelerationsRaw
virtual bool setRefAccelerationsRaw(const double *accs)=0
Set reference acceleration on all joints.
yarp::dev::IVelocityControlRaw
Definition: IVelocityControl.h:28
VOCAB_VELOCITY_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE_GROUP
Definition: IVelocityControl.h:302