YARP
Yet Another Robot Platform
ImplementEncoders.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_IMPLEMENTENCODERS_H
10 #define YARP_DEV_IMPLEMENTENCODERS_H
11 
13 #include <yarp/dev/api.h>
14 
15 namespace yarp
16 {
17  namespace dev
18  {
19  class ImplementEncoders;
20  }
21 }
22 
24 {
25 protected:
27  void *helper;
28  double *temp;
29 
38  bool initialize (int size, const int *amap, const double *enc, const double *zos);
39 
44  bool uninitialize ();
45 
46 public:
47  /* Constructor.
48  * @param y is the pointer to the class instance inheriting from this
49  * implementation.
50  */
52 
56  virtual ~ImplementEncoders();
57 
58 
64  bool getAxes(int *ax) override;
65 
71  bool resetEncoder(int j) override;
72 
77  bool resetEncoders() override;
78 
85  bool setEncoder(int j, double val) override;
86 
92  bool setEncoders(const double *vals) override;
93 
100  bool getEncoder(int j, double *v) override;
101 
107  bool getEncoders(double *encs) override;
108 
115  bool getEncoderSpeed(int j, double *spds) override;
116 
122  bool getEncoderSpeeds(double *spds) override;
123 
129  bool getEncoderAcceleration(int j, double *spds) override;
130 
136  bool getEncoderAccelerations(double *accs) override;
137 };
138 
139 #endif // YARP_DEV_IMPLEMENTENCODERS_H
yarp::dev::IEncoders
Control board, encoder interface.
Definition: IEncoders.h:121
yarp::dev::ImplementEncoders::uninitialize
bool uninitialize()
Clean up internal data and memory.
Definition: ImplementEncoders.cpp:51
yarp::dev::IEncoders::setEncoders
virtual bool setEncoders(const double *vals)=0
Set the value of all encoders.
ControlBoardInterfaces.h
define control board standard interfaces
yarp::dev::ImplementEncoders::ImplementEncoders
ImplementEncoders(yarp::dev::IEncodersRaw *y)
Definition: ImplementEncoders.cpp:23
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::ImplementEncoders::iEncoders
IEncodersRaw * iEncoders
Definition: ImplementEncoders.h:26
yarp::dev::ImplementEncoders::helper
void * helper
Definition: ImplementEncoders.h:27
yarp::dev::IEncoders::getEncoderAcceleration
virtual bool getEncoderAcceleration(int j, double *spds)=0
Read the instantaneous acceleration of an axis.
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IEncoders::getEncoderAccelerations
virtual bool getEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all axes.
yarp::dev::ImplementEncoders
Definition: ImplementEncoders.h:24
yarp::dev::IEncoders::getAxes
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
yarp::dev::IEncoders::getEncoder
virtual bool getEncoder(int j, double *v)=0
Read the value of an encoder.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::ImplementEncoders::temp
double * temp
Definition: ImplementEncoders.h:28
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::ImplementEncoders::~ImplementEncoders
virtual ~ImplementEncoders()
Destructor.
Definition: ImplementEncoders.cpp:30
yarp::dev::ImplementEncoders::initialize
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
Definition: ImplementEncoders.cpp:35
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.