YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ImplementEncodersTimed.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_IMPLEMENTENCODERSTIMED_H
7#define YARP_DEV_IMPLEMENTENCODERSTIMED_H
8
10
11namespace yarp::dev {
12class ImplementEncodersTimed;
13}
14
15namespace yarp::dev::impl {
16
17template <typename T>
18class FixedSizeBuffersManager;
19
20} // namespace yarp::dev::impl
21
23{
24protected:
25 IEncodersTimedRaw* m_iraw=nullptr;
26 void* m_helper=nullptr;
27 std::vector<int> m_buffer_ints;
28 std::vector<double> m_buffer_doubles;
29 std::vector<double> m_buffer_doubles2;
30 std::mutex m_imp_mutex;
31
32
41 bool initialize (int size, const int *amap, const double *enc, const double *zos);
42
47 bool uninitialize ();
48
49public:
50 /* Constructor.
51 * @param y is the pointer to the class instance inheriting from this
52 * implementation.
53 */
55
56
58
59 yarp::dev::ReturnValue getAxes(size_t& ax) override;
60
63 yarp::dev::ReturnValue setEncoder(int j, double val) override;
64 yarp::dev::ReturnValue setEncoders(const double *vals) override;
65 yarp::dev::ReturnValue getEncoder(int j, double *v) override;
66 yarp::dev::ReturnValue getEncodersTimed(double *encs, double *time) override;
67 yarp::dev::ReturnValue getEncoderTimed(int j, double *v, double *t) override;
68 yarp::dev::ReturnValue getEncoders(double *encs) override;
69 yarp::dev::ReturnValue getEncoderSpeed(int j, double *spds) override;
70 yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override;
71 yarp::dev::ReturnValue getEncoderAcceleration(int j, double *spds) override;
73};
74
75#endif // YARP_DEV_IMPLEMENTENCODERSTIMED_H
Control board, extend encoder raw interface adding timestamps.
Control board, extend encoder interface with timestamps.
yarp::dev::ReturnValue getEncoders(double *encs) override
Read the position 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 getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
yarp::dev::ReturnValue resetEncoder(int j) override
Reset encoder, single joint.
bool uninitialize()
Clean up internal data and memory.
yarp::dev::ReturnValue getEncoderAcceleration(int j, double *spds) override
Read the instantaneous acceleration of an axis.
yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getEncoderSpeed(int j, double *spds) override
Read the istantaneous speed of an axis.
yarp::dev::ReturnValue setEncoders(const double *vals) override
Set the value of all encoders.
yarp::dev::ReturnValue getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getEncoder(int j, double *v) override
Read the value of an encoder.
yarp::dev::ReturnValue resetEncoders() override
Reset encoders.
yarp::dev::ReturnValue setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
yarp::dev::ReturnValue getEncodersTimed(double *encs, double *time) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getAxes(size_t &ax) override
Get the number of controlled axes.
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