YARP
Yet Another Robot Platform
IEncoders.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 #ifndef YARP_DEV_IENCODERS_H
7 #define YARP_DEV_IENCODERS_H
8 
9 #include <yarp/os/Vocab.h>
10 #include <yarp/dev/api.h>
11 
12 namespace yarp {
13  namespace dev {
14  class IEncodersRaw;
15  class IEncoders;
16  }
17 }
18 
25 {
26 public:
30  virtual ~IEncodersRaw() {}
31 
37  virtual bool getAxes(int *ax) = 0;
38 
44  virtual bool resetEncoderRaw(int j)=0;
45 
50  virtual bool resetEncodersRaw()=0;
51 
58  virtual bool setEncoderRaw(int j, double val)=0;
59 
65  virtual bool setEncodersRaw(const double *vals)=0;
66 
73  virtual bool getEncoderRaw(int j, double *v)=0;
74 
80  virtual bool getEncodersRaw(double *encs)=0;
81 
88  virtual bool getEncoderSpeedRaw(int j, double *sp)=0;
89 
95  virtual bool getEncoderSpeedsRaw(double *spds)=0;
96 
102  virtual bool getEncoderAccelerationRaw(int j, double *spds)=0;
103 
109  virtual bool getEncoderAccelerationsRaw(double *accs)=0;
110 };
111 
118 {
119 public:
123  virtual ~IEncoders() {}
124 
130  virtual bool getAxes(int *ax) = 0;
131 
137  virtual bool resetEncoder(int j)=0;
138 
143  virtual bool resetEncoders()=0;
144 
151  virtual bool setEncoder(int j, double val)=0;
152 
158  virtual bool setEncoders(const double *vals)=0;
159 
166  virtual bool getEncoder(int j, double *v)=0;
167 
173  virtual bool getEncoders(double *encs)=0;
174 
181  virtual bool getEncoderSpeed(int j, double *sp)=0;
182 
188  virtual bool getEncoderSpeeds(double *spds)=0;
189 
195  virtual bool getEncoderAcceleration(int j, double *spds)=0;
196 
202  virtual bool getEncoderAccelerations(double *accs)=0;
203 };
204 
205 // interface IEncoders sets
210 
211 // interface IEncoders gets
216 
217 #endif // YARP_DEV_IENCODERS_H
constexpr yarp::conf::vocab32_t VOCAB_E_RESET
Definition: IEncoders.h:206
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATIONS
Definition: IEncoders.h:215
constexpr yarp::conf::vocab32_t VOCAB_ENCODER
Definition: IEncoders.h:208
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEEDS
Definition: IEncoders.h:213
constexpr yarp::conf::vocab32_t VOCAB_E_RESETS
Definition: IEncoders.h:207
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEED
Definition: IEncoders.h:212
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATION
Definition: IEncoders.h:214
constexpr yarp::conf::vocab32_t VOCAB_ENCODERS
Definition: IEncoders.h:209
Control board, encoder interface.
Definition: IEncoders.h:25
virtual bool getEncoderSpeedsRaw(double *spds)=0
Read the instantaneous acceleration of an axis.
virtual bool resetEncoderRaw(int j)=0
Reset encoder, single joint.
virtual bool setEncoderRaw(int j, double val)=0
Set the value of the encoder for a given joint.
virtual bool getEncoderSpeedRaw(int j, double *sp)=0
Read the instantaneous speed of an axis.
virtual bool getEncoderAccelerationsRaw(double *accs)=0
Read the instantaneous acceleration of all axes.
virtual bool getEncodersRaw(double *encs)=0
Read the position of all axes.
virtual bool getEncoderRaw(int j, double *v)=0
Read the value of an encoder.
virtual bool getEncoderAccelerationRaw(int j, double *spds)=0
Read the instantaneous acceleration of an axis.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool resetEncodersRaw()=0
Reset encoders.
virtual bool setEncodersRaw(const double *vals)=0
Set the value of all encoders.
virtual ~IEncodersRaw()
Destructor.
Definition: IEncoders.h:30
Control board, encoder interface.
Definition: IEncoders.h:118
virtual bool getEncoderSpeed(int j, double *sp)=0
Read the istantaneous speed of an axis.
virtual bool getEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all axes.
virtual bool setEncoder(int j, double val)=0
Set the value of the encoder for a given joint.
virtual bool getEncoder(int j, double *v)=0
Read the value of an encoder.
virtual ~IEncoders()
Destructor.
Definition: IEncoders.h:123
virtual bool resetEncoder(int j)=0
Reset encoder, single joint.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool setEncoders(const double *vals)=0
Set the value of all encoders.
virtual bool getEncoders(double *encs)=0
Read the position of all axes.
virtual bool getEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all axes.
virtual bool getEncoderAcceleration(int j, double *spds)=0
Read the instantaneous acceleration of an axis.
virtual bool resetEncoders()=0
Reset encoders.
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