YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
12namespace yarp::dev {
13class ImplementEncoders;
14}
15
17{
18protected:
19 IEncodersRaw* m_iraw=nullptr;
20 void* m_helper=nullptr;
21 std::vector<int> m_buffer_ints;
22 std::vector<double> m_buffer_doubles;
23 std::mutex m_imp_mutex;
24
33 bool initialize (int size, const int *amap, const double *enc, const double *zos);
34
39 bool uninitialize ();
40
41public:
42 /* Constructor.
43 * @param y is the pointer to the class instance inheriting from this
44 * implementation.
45 */
47
51 virtual ~ImplementEncoders();
52
53
59 yarp::dev::ReturnValue getAxes(size_t& ax) override;
60
67
73
80 yarp::dev::ReturnValue setEncoder(int j, double val) override;
81
87 yarp::dev::ReturnValue setEncoders(const double *vals) override;
88
95 yarp::dev::ReturnValue getEncoder(int j, double *v) override;
96
102 yarp::dev::ReturnValue getEncoders(double *encs) override;
103
110 yarp::dev::ReturnValue getEncoderSpeed(int j, double *spds) override;
111
117 yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override;
118
124 yarp::dev::ReturnValue getEncoderAcceleration(int j, double *spds) override;
125
131 yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override;
132};
133
134#endif // YARP_DEV_IMPLEMENTENCODERS_H
define control board standard interfaces
Control board, encoder interface.
Definition IEncoders.h:24
Control board, encoder interface.
Definition IEncoders.h:117
yarp::dev::ReturnValue resetEncoders() override
Reset encoders.
yarp::dev::ReturnValue getAxes(size_t &ax) override
Get the number of controlled axes.
yarp::dev::ReturnValue getEncoders(double *encs) override
Read the position of all axes.
yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
yarp::dev::ReturnValue resetEncoder(int j) override
Reset encoder, single joint.
yarp::dev::ReturnValue getEncoder(int j, double *v) override
Read the value of an encoder.
yarp::dev::ReturnValue getEncoderAcceleration(int j, double *spds) override
Read the instantaneous acceleration of an axis.
yarp::dev::ReturnValue getEncoderSpeed(int j, double *spds) override
Read the instantaneous speed of an axis.
yarp::dev::ReturnValue setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
virtual ~ImplementEncoders()
Destructor.
yarp::dev::ReturnValue setEncoders(const double *vals) override
Set the value of all encoders.
std::vector< double > m_buffer_doubles
yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
bool uninitialize()
Clean up internal data and memory.
For streams capable of holding different kinds of content, check what they actually have.
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18