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
define control board standard interfaces
Control board, encoder interface.
Definition: IEncoders.h:28
Control board, encoder interface.
Definition: IEncoders.h:121
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 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.
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
ImplementEncoders(yarp::dev::IEncodersRaw *y)
virtual ~ImplementEncoders()
Destructor.
bool uninitialize()
Clean up internal data and memory.
The main, catch-all namespace for YARP.
Definition: environment.h:18
#define YARP_dev_API
Definition: api.h:19