YARP
Yet Another Robot Platform
IVelocityControl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2019 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
#define YARP_dev_API
Definition: api.h:19
virtual bool getRefVelocities(double *vels)
Get the last reference speed set by velocityMove for all joints.
virtual bool getRefVelocitiesRaw(double *vels)
Get the last reference speed set by velocityMove for all joints.
virtual ~IVelocityControl()
Destructor.
virtual ~IVelocityControlRaw()
Destructor.
std::int32_t vocab32_t
Definition: numeric.h:52
virtual bool getRefVelocityRaw(const int joint, double *vel)
Get the last reference speed set by velocityMove for single joint.
The main, catch-all namespace for YARP.
Definition: numeric.h:47
constexpr yarp::conf::vocab32_t VOCAB_VEL_PID
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
virtual bool getRefVelocity(const int joint, double *vel)
Get the last reference speed set by velocityMove for single joint.
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.
Interface for control boards implementing velocity control.
Interface for control boards implementig velocity control in encoder coordinates. ...
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE_GROUP
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.
constexpr yarp::conf::vocab32_t VOCAB_VEL_PIDS