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