YARP
Yet Another Robot Platform
IPositionDirect.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 
10 #ifndef YARP_IPOSITIONDIRECT_H
11 #define YARP_IPOSITIONDIRECT_H
12 
13 #include <yarp/os/Vocab.h>
14 #include <yarp/dev/api.h>
15 
16 namespace yarp {
17  namespace dev {
18  class IPositionDirect;
19  class IPositionDirectRaw;
20  }
21 }
22 
32 {
33 
34 public:
38  virtual ~IPositionDirect() {}
39 
45  virtual bool getAxes(int *ax)=0;
46 
52  virtual bool setPosition(int j, double ref)=0;
53 
65  virtual bool setPositions(const int n_joint, const int *joints, const double *refs)=0;
66 
71  virtual bool setPositions(const double *refs)=0;
72 
82  virtual bool getRefPosition(const int joint, double *ref) {return false;}
83 
93  virtual bool getRefPositions(double *refs) {return false;}
94 
104  virtual bool getRefPositions(const int n_joint, const int *joints, double *refs) {return false;}
105 };
106 
107 
108 
118 {
119 public:
123  virtual ~IPositionDirectRaw() {}
124 
130  virtual bool getAxes(int *axes) = 0;
131 
137  virtual bool setPositionRaw(int j, double ref)=0;
138 
149  virtual bool setPositionsRaw(const int n_joint, const int *joints, const double *refs)=0;
150 
151 
156  virtual bool setPositionsRaw(const double *refs)=0;
157 
167  virtual bool getRefPositionRaw(const int joint, double *ref) {return false;}
168 
178  virtual bool getRefPositionsRaw(double *refs) {return false;};
179 
180 
190  virtual bool getRefPositionsRaw(const int n_joint, const int *joints, double *refs) {return false;}
191 };
192 
196 
197 #endif // YARP_IPOSITIONDIRECT_H
#define YARP_dev_API
Definition: api.h:19
virtual bool getRefPositionsRaw(const int n_joint, const int *joints, double *refs)
Get the last position reference for the specified group of axes.
virtual bool getRefPositions(const int n_joint, const int *joints, double *refs)
Get the last position reference for the specified group of axes.
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECTS
std::int32_t vocab32_t
Definition: numeric.h:52
virtual bool getRefPositionsRaw(double *refs)
Get the last position reference for all axes.
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT_GROUP
The main, catch-all namespace for YARP.
Definition: numeric.h:47
virtual ~IPositionDirect()
Destructor.
virtual ~IPositionDirectRaw()
Destructor.
Interface for a generic control board device implementing position control.
Interface for a generic control board device implementing position control in encoder coordinates...
virtual bool getRefPosition(const int joint, double *ref)
Get the last position reference for the specified axis.
virtual bool getRefPositions(double *refs)
Get the last position reference for all axes.
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
virtual bool getRefPositionRaw(const int joint, double *ref)
Get the last position reference for the specified axis.