YARP
Yet Another Robot Platform
IPositionDirect.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 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
yarp::dev::IPositionDirectRaw::setPositionsRaw
virtual bool setPositionsRaw(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for all axes.
api.h
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::IPositionDirect::setPositions
virtual bool setPositions(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for all axes.
VOCAB_POSITION_DIRECTS
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECTS
Definition: IPositionDirect.h:194
yarp::dev::IPositionDirect::setPosition
virtual bool setPosition(int j, double ref)=0
Set new position for a single axis.
yarp::dev::IPositionDirectRaw::getRefPositionsRaw
virtual bool getRefPositionsRaw(const int n_joint, const int *joints, double *refs)
Get the last position reference for the specified group of axes.
Definition: IPositionDirect.h:190
yarp::dev::IPositionDirectRaw::getRefPositionRaw
virtual bool getRefPositionRaw(const int joint, double *ref)
Get the last position reference for the specified axis.
Definition: IPositionDirect.h:167
yarp::dev::IPositionDirectRaw::setPositionRaw
virtual bool setPositionRaw(int j, double ref)=0
Set new position for a single axis.
yarp::dev::IPositionDirectRaw
Definition: IPositionDirect.h:117
VOCAB_POSITION_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT
Definition: IPositionDirect.h:193
yarp::dev::IPositionDirect::getRefPositions
virtual bool getRefPositions(double *refs)
Get the last position reference for all axes.
Definition: IPositionDirect.h:93
yarp::dev::IPositionDirect::getRefPositions
virtual bool getRefPositions(const int n_joint, const int *joints, double *refs)
Get the last position reference for the specified group of axes.
Definition: IPositionDirect.h:104
yarp::dev::IPositionDirectRaw::getRefPositionsRaw
virtual bool getRefPositionsRaw(double *refs)
Get the last position reference for all axes.
Definition: IPositionDirect.h:178
yarp::dev::IPositionDirectRaw::~IPositionDirectRaw
virtual ~IPositionDirectRaw()
Destructor.
Definition: IPositionDirect.h:123
yarp::dev::IPositionDirect
Definition: IPositionDirect.h:31
yarp
Definition: numeric.h:47
yarp::dev::IPositionDirect::getAxes
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
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::IPositionDirect::~IPositionDirect
virtual ~IPositionDirect()
Destructor.
Definition: IPositionDirect.h:38
yarp::dev::IPositionDirect::getRefPosition
virtual bool getRefPosition(const int joint, double *ref)
Get the last position reference for the specified axis.
Definition: IPositionDirect.h:82
yarp::dev::IPositionDirectRaw::getAxes
virtual bool getAxes(int *axes)=0
Get the number of controlled axes.
VOCAB_POSITION_DIRECT_GROUP
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT_GROUP
Definition: IPositionDirect.h:195