YARP
Yet Another Robot Platform
ImplementEncoders.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_IMPLEMENTENCODERS_H
7 #define YARP_DEV_IMPLEMENTENCODERS_H
8 
10 #include <yarp/dev/api.h>
11 
12 namespace yarp
13 {
14  namespace dev
15  {
16  class ImplementEncoders;
17  }
18 }
19 
21 {
22 protected:
24  void *helper;
25  double *temp;
26 
35  bool initialize (int size, const int *amap, const double *enc, const double *zos);
36 
41  bool uninitialize ();
42 
43 public:
44  /* Constructor.
45  * @param y is the pointer to the class instance inheriting from this
46  * implementation.
47  */
49 
53  virtual ~ImplementEncoders();
54 
55 
61  bool getAxes(int *ax) override;
62 
68  bool resetEncoder(int j) override;
69 
74  bool resetEncoders() override;
75 
82  bool setEncoder(int j, double val) override;
83 
89  bool setEncoders(const double *vals) override;
90 
97  bool getEncoder(int j, double *v) override;
98 
104  bool getEncoders(double *encs) override;
105 
112  bool getEncoderSpeed(int j, double *spds) override;
113 
119  bool getEncoderSpeeds(double *spds) override;
120 
126  bool getEncoderAcceleration(int j, double *spds) override;
127 
133  bool getEncoderAccelerations(double *accs) override;
134 };
135 
136 #endif // YARP_DEV_IMPLEMENTENCODERS_H
define control board standard interfaces
Control board, encoder interface.
Definition: IEncoders.h:25
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 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: dirs.h:16
#define YARP_dev_API
Definition: api.h:18