YARP
Yet Another Robot Platform
IPositionDirect.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 
7 #ifndef YARP_IPOSITIONDIRECT_H
8 #define YARP_IPOSITIONDIRECT_H
9 
10 #include <yarp/os/Vocab.h>
11 #include <yarp/dev/api.h>
12 
13 namespace yarp {
14  namespace dev {
15  class IPositionDirect;
16  class IPositionDirectRaw;
17  }
18 }
19 
29 {
30 
31 public:
35  virtual ~IPositionDirect() {}
36 
42  virtual bool getAxes(int *ax)=0;
43 
49  virtual bool setPosition(int j, double ref)=0;
50 
62  virtual bool setPositions(const int n_joint, const int *joints, const double *refs)=0;
63 
68  virtual bool setPositions(const double *refs)=0;
69 
79  virtual bool getRefPosition(const int joint, double *ref) {return false;}
80 
90  virtual bool getRefPositions(double *refs) {return false;}
91 
101  virtual bool getRefPositions(const int n_joint, const int *joints, double *refs) {return false;}
102 };
103 
104 
105 
115 {
116 public:
120  virtual ~IPositionDirectRaw() {}
121 
127  virtual bool getAxes(int *axes) = 0;
128 
134  virtual bool setPositionRaw(int j, double ref)=0;
135 
146  virtual bool setPositionsRaw(const int n_joint, const int *joints, const double *refs)=0;
147 
148 
153  virtual bool setPositionsRaw(const double *refs)=0;
154 
164  virtual bool getRefPositionRaw(const int joint, double *ref) {return false;}
165 
175  virtual bool getRefPositionsRaw(double *refs) {return false;};
176 
177 
187  virtual bool getRefPositionsRaw(const int n_joint, const int *joints, double *refs) {return false;}
188 };
189 
193 
194 #endif // YARP_IPOSITIONDIRECT_H
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECTS
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT_GROUP
Interface for a generic control board device implementing position control in encoder coordinates.
virtual bool getAxes(int *axes)=0
Get the number of controlled axes.
virtual bool setPositionsRaw(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for all axes.
virtual bool setPositionsRaw(const double *refs)=0
Set new position for a set of axes.
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 setPositionRaw(int j, double ref)=0
Set new position for a single axis.
virtual bool getRefPositionsRaw(double *refs)
Get the last position reference for all axes.
virtual bool getRefPositionRaw(const int joint, double *ref)
Get the last position reference for the specified axis.
virtual ~IPositionDirectRaw()
Destructor.
Interface for a generic control board device implementing position control.
virtual bool getRefPositions(const int n_joint, const int *joints, double *refs)
Get the last position reference for the specified group of axes.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool getRefPositions(double *refs)
Get the last position reference for all axes.
virtual bool setPositions(const double *refs)=0
Set new position for a set of axis.
virtual bool setPositions(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for all axes.
virtual ~IPositionDirect()
Destructor.
virtual bool setPosition(int j, double ref)=0
Set new position for a single axis.
virtual bool getRefPosition(const int joint, double *ref)
Get the last position reference for the specified axis.
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