YARP
Yet Another Robot Platform
ImplementMotorEncoders.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_IMPLEMENTMOTORENCODERS_H
7 #define YARP_DEV_IMPLEMENTMOTORENCODERS_H
8 
10 
11 namespace yarp {
12  namespace dev {
13  class ImplementMotorEncoders;
14  }
15 }
16 
17 namespace yarp {
18 namespace dev {
19 namespace impl {
20 
21 template <typename T>
22 class FixedSizeBuffersManager;
23 
24 } // namespace impl
25 } // namespace dev
26 } // namespace yarp
27 
29 {
30 protected:
32  void *helper;
34 
35 
44  bool initialize (int size, const int *amap, const double *enc, const double *zos);
45 
50  bool uninitialize ();
51 
52 public:
53  /* Constructor.
54  * @param y is the pointer to the class instance inheriting from this
55  * implementation.
56  */
58 
59 
60  virtual ~ImplementMotorEncoders();
61 
62  bool getNumberOfMotorEncoders(int *num) override;
63 
64  bool resetMotorEncoder(int m) override;
65  bool resetMotorEncoders() override;
66  bool setMotorEncoder(int m, const double val) override;
67  bool setMotorEncoders(const double *vals) override;
68  bool setMotorEncoderCountsPerRevolution(int m, const double cpr) override;
69  bool getMotorEncoderCountsPerRevolution(int m, double *cpr) override;
70  bool getMotorEncoder(int m, double *v) override;
71  bool getMotorEncodersTimed(double *encs, double *time) override;
72  bool getMotorEncoderTimed(int m, double *v, double *t) override;
73  bool getMotorEncoders(double *encs) override;
74  bool getMotorEncoderSpeed(int m, double *spds) override;
75  bool getMotorEncoderSpeeds(double *spds) override;
76  bool getMotorEncoderAcceleration(int m, double *spds) override;
77  bool getMotorEncoderAccelerations(double *accs) override;
78 };
79 
80 #endif // YARP_DEV_IMPLEMENTMOTORENCODERS_H
float t
Control board, encoder interface.
Control board, encoder interface.
virtual bool getMotorEncodersTimed(double *encs, double *time)=0
Read the instantaneous position of all motor encoders.
virtual bool getMotorEncoderCountsPerRevolution(int m, double *cpr)=0
Gets number of counts per revolution for motor encoder m.
virtual bool setMotorEncoderCountsPerRevolution(int m, const double cpr)=0
Sets number of counts per revolution for motor encoder m.
virtual bool resetMotorEncoder(int m)=0
Reset motor encoder, single motor.
virtual bool getMotorEncoderSpeed(int m, double *sp)=0
Read the istantaneous speed of a motor encoder.
virtual bool getMotorEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all motor encoders.
virtual bool getMotorEncoderTimed(int m, double *encs, double *time)=0
Read the instantaneous position of a motor encoder.
virtual bool getMotorEncoderAcceleration(int m, double *acc)=0
Read the instantaneous acceleration of a motor encoder.
virtual bool getMotorEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all motor encoders.
virtual bool getNumberOfMotorEncoders(int *num)=0
Get the number of available motor encoders.
virtual bool setMotorEncoders(const double *vals)=0
Set the value of all motor encoders.
virtual bool getMotorEncoders(double *encs)=0
Read the position of all motor encoders.
virtual bool resetMotorEncoders()=0
Reset motor encoders.
virtual bool setMotorEncoder(int m, const double val)=0
Set the value of the motor encoder for a given motor.
virtual bool getMotorEncoder(int m, double *v)=0
Read the value of a motor encoder.
ImplementMotorEncoders(yarp::dev::IMotorEncodersRaw *y)
bool uninitialize()
Clean up internal data and memory.
yarp::dev::impl::FixedSizeBuffersManager< double > * buffManager
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18