YARP
Yet Another Robot Platform
IEncoders.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 #ifndef YARP_DEV_IENCODERS_H
10 #define YARP_DEV_IENCODERS_H
11 
12 #include <yarp/os/Vocab.h>
13 #include <yarp/dev/api.h>
14 
15 namespace yarp {
16  namespace dev {
17  class IEncodersRaw;
18  class IEncoders;
19  }
20 }
21 
28 {
29 public:
33  virtual ~IEncodersRaw() {}
34 
40  virtual bool getAxes(int *ax) = 0;
41 
47  virtual bool resetEncoderRaw(int j)=0;
48 
53  virtual bool resetEncodersRaw()=0;
54 
61  virtual bool setEncoderRaw(int j, double val)=0;
62 
68  virtual bool setEncodersRaw(const double *vals)=0;
69 
76  virtual bool getEncoderRaw(int j, double *v)=0;
77 
83  virtual bool getEncodersRaw(double *encs)=0;
84 
91  virtual bool getEncoderSpeedRaw(int j, double *sp)=0;
92 
98  virtual bool getEncoderSpeedsRaw(double *spds)=0;
99 
105  virtual bool getEncoderAccelerationRaw(int j, double *spds)=0;
106 
112  virtual bool getEncoderAccelerationsRaw(double *accs)=0;
113 };
114 
121 {
122 public:
126  virtual ~IEncoders() {}
127 
133  virtual bool getAxes(int *ax) = 0;
134 
140  virtual bool resetEncoder(int j)=0;
141 
146  virtual bool resetEncoders()=0;
147 
154  virtual bool setEncoder(int j, double val)=0;
155 
161  virtual bool setEncoders(const double *vals)=0;
162 
169  virtual bool getEncoder(int j, double *v)=0;
170 
176  virtual bool getEncoders(double *encs)=0;
177 
184  virtual bool getEncoderSpeed(int j, double *sp)=0;
185 
191  virtual bool getEncoderSpeeds(double *spds)=0;
192 
198  virtual bool getEncoderAcceleration(int j, double *spds)=0;
199 
205  virtual bool getEncoderAccelerations(double *accs)=0;
206 };
207 
208 // interface IEncoders sets
213 
214 // interface IEncoders gets
219 
220 #endif // YARP_DEV_IENCODERS_H
yarp::dev::IEncodersRaw::setEncoderRaw
virtual bool setEncoderRaw(int j, double val)=0
Set the value of the encoder for a given joint.
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::IEncodersRaw::getEncoderAccelerationRaw
virtual bool getEncoderAccelerationRaw(int j, double *spds)=0
Read the instantaneous acceleration of an axis.
VOCAB_ENCODER_SPEEDS
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEEDS
Definition: IEncoders.h:216
VOCAB_ENCODER_ACCELERATIONS
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATIONS
Definition: IEncoders.h:218
yarp::dev::IEncoders::~IEncoders
virtual ~IEncoders()
Destructor.
Definition: IEncoders.h:126
yarp::dev::IEncoders
Control board, encoder interface.
Definition: IEncoders.h:121
VOCAB_ENCODER
constexpr yarp::conf::vocab32_t VOCAB_ENCODER
Definition: IEncoders.h:211
yarp::dev::IEncoders::setEncoders
virtual bool setEncoders(const double *vals)=0
Set the value of all encoders.
VOCAB_E_RESET
constexpr yarp::conf::vocab32_t VOCAB_E_RESET
Definition: IEncoders.h:209
yarp::dev::IEncodersRaw::getEncoderAccelerationsRaw
virtual bool getEncoderAccelerationsRaw(double *accs)=0
Read the instantaneous acceleration of all axes.
yarp::dev::IEncodersRaw::getAxes
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
VOCAB_ENCODER_SPEED
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEED
Definition: IEncoders.h:215
yarp::dev::IEncodersRaw::getEncoderSpeedsRaw
virtual bool getEncoderSpeedsRaw(double *spds)=0
Read the instantaneous acceleration of an axis.
yarp::dev::IEncodersRaw
Control board, encoder interface.
Definition: IEncoders.h:28
yarp::dev::IEncoders::resetEncoder
virtual bool resetEncoder(int j)=0
Reset encoder, single joint.
yarp::dev::IEncodersRaw::getEncodersRaw
virtual bool getEncodersRaw(double *encs)=0
Read the position of all axes.
yarp::dev::IEncoders::getEncoderAcceleration
virtual bool getEncoderAcceleration(int j, double *spds)=0
Read the instantaneous acceleration of an axis.
yarp::dev::IEncodersRaw::~IEncodersRaw
virtual ~IEncodersRaw()
Destructor.
Definition: IEncoders.h:33
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
VOCAB_ENCODER_ACCELERATION
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATION
Definition: IEncoders.h:217
yarp::dev::IEncodersRaw::getEncoderRaw
virtual bool getEncoderRaw(int j, double *v)=0
Read the value of an encoder.
VOCAB_ENCODERS
constexpr yarp::conf::vocab32_t VOCAB_ENCODERS
Definition: IEncoders.h:212
yarp::dev::IEncoders::getEncoderAccelerations
virtual bool getEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all axes.
yarp::dev::IEncoders::getAxes
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
yarp::dev::IEncodersRaw::resetEncodersRaw
virtual bool resetEncodersRaw()=0
Reset encoders.
yarp::dev::IEncodersRaw::setEncodersRaw
virtual bool setEncodersRaw(const double *vals)=0
Set the value of all encoders.
yarp::dev::IEncodersRaw::getEncoderSpeedRaw
virtual bool getEncoderSpeedRaw(int j, double *sp)=0
Read the instantaneous speed of an axis.
yarp::dev::IEncoders::getEncoder
virtual bool getEncoder(int j, double *v)=0
Read the value of an encoder.
VOCAB_E_RESETS
constexpr yarp::conf::vocab32_t VOCAB_E_RESETS
Definition: IEncoders.h:210
yarp::dev::IEncodersRaw::resetEncoderRaw
virtual bool resetEncoderRaw(int j)=0
Reset encoder, single joint.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
Vocab.h
yarp::dev::IEncoders::setEncoder
virtual bool setEncoder(int j, double val)=0
Set the value of the encoder for a given joint.
yarp::dev::IEncoders::getEncoderSpeeds
virtual bool getEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all axes.
api.h
yarp::dev::IEncoders::getEncoderSpeed
virtual bool getEncoderSpeed(int j, double *sp)=0
Read the istantaneous speed of an axis.
yarp::dev::IEncoders::resetEncoders
virtual bool resetEncoders()=0
Reset encoders.
yarp::dev::IEncoders::getEncoders
virtual bool getEncoders(double *encs)=0
Read the position of all axes.