YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IMotorEncoders.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_IMOTORENCODERS_H
7#define YARP_DEV_IMOTORENCODERS_H
8
9#include <yarp/os/Vocab.h>
10#include <yarp/dev/api.h>
12
13namespace yarp::dev {
14class IMotorEncodersRaw;
15class IMotorEncoders;
16}
17
24{
25public:
29 virtual ~IMotorEncodersRaw() {}
30
37
44
50
58
66
73 virtual yarp::dev::ReturnValue setMotorEncoderRaw(int m, const double val)=0;
74
80 virtual yarp::dev::ReturnValue setMotorEncodersRaw(const double *vals)=0;
81
88 virtual yarp::dev::ReturnValue getMotorEncoderRaw(int m, double *v)=0;
89
96
103 virtual yarp::dev::ReturnValue getMotorEncodersTimedRaw(double *encs, double *stamps)=0;
104
112 virtual yarp::dev::ReturnValue getMotorEncoderTimedRaw(int m, double *encs, double *stamp)=0;
113
121
128
136
143};
144
151{
152public:
156 virtual ~IMotorEncoders() {}
157
164
171
177
185
193
200 virtual yarp::dev::ReturnValue setMotorEncoder(int m, const double val)=0;
201
207 virtual yarp::dev::ReturnValue setMotorEncoders(const double *vals)=0;
208
215 virtual yarp::dev::ReturnValue getMotorEncoder(int m, double *v)=0;
216
223
230 virtual yarp::dev::ReturnValue getMotorEncodersTimed(double *encs, double *time)=0;
231
239 virtual yarp::dev::ReturnValue getMotorEncoderTimed(int m, double *encs, double *time)=0;
240
247 virtual yarp::dev::ReturnValue getMotorEncoderSpeed(int m, double *sp)=0;
248
255
263
270};
271
272// interface IMotorEncoders gets
280
281#endif // YARP_DEV_IMOTORENCODERS_H
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_SPEED
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_ACCELERATIONS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_ACCELERATION
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_SPEEDS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_NUMBER
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODERS
Control board, encoder interface.
virtual yarp::dev::ReturnValue setMotorEncoderRaw(int m, const double val)=0
Set the value of the motor encoder for a given motor.
virtual yarp::dev::ReturnValue resetMotorEncoderRaw(int m)=0
Reset motor encoder, single motor.
virtual yarp::dev::ReturnValue getMotorEncoderTimedRaw(int m, double *encs, double *stamp)=0
Read the instantaneous position of a motor encoder.
virtual yarp::dev::ReturnValue getMotorEncodersRaw(double *encs)=0
Read the position of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderRaw(int m, double *v)=0
Read the value of a motor encoder.
virtual yarp::dev::ReturnValue setMotorEncodersRaw(const double *vals)=0
Set the value of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderSpeedRaw(int m, double *sp)=0
Read the instantaneous speed of a motor encoder.
virtual yarp::dev::ReturnValue setMotorEncoderCountsPerRevolutionRaw(int m, const double cpr)=0
Sets number of counts per revolution for motor encoder m.
virtual yarp::dev::ReturnValue resetMotorEncodersRaw()=0
Reset motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderAccelerationsRaw(double *accs)=0
Read the instantaneous acceleration of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderSpeedsRaw(double *spds)=0
Read the instantaneous speed of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderCountsPerRevolutionRaw(int m, double *cpr)=0
Gets number of counts per revolution for motor encoder m.
virtual yarp::dev::ReturnValue getMotorEncodersTimedRaw(double *encs, double *stamps)=0
Read the instantaneous position of all motor encoders.
virtual ~IMotorEncodersRaw()
Destructor.
virtual yarp::dev::ReturnValue getMotorEncoderAccelerationRaw(int m, double *spds)=0
Read the instantaneous acceleration of a motor encoder.
virtual yarp::dev::ReturnValue getNumberOfMotorEncodersRaw(int *num)=0
Get the number of available motor encoders.
Control board, encoder interface.
virtual yarp::dev::ReturnValue getMotorEncoderSpeed(int m, double *sp)=0
Read the instantaneous speed of a motor encoder.
virtual yarp::dev::ReturnValue getNumberOfMotorEncoders(int *num)=0
Get the number of available motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoders(double *encs)=0
Read the position of all motor encoders.
virtual yarp::dev::ReturnValue resetMotorEncoders()=0
Reset motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderAcceleration(int m, double *acc)=0
Read the instantaneous acceleration of a motor encoder.
virtual yarp::dev::ReturnValue setMotorEncoder(int m, const double val)=0
Set the value of the motor encoder for a given motor.
virtual yarp::dev::ReturnValue getMotorEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderCountsPerRevolution(int m, double *cpr)=0
Gets number of counts per revolution for motor encoder m.
virtual yarp::dev::ReturnValue resetMotorEncoder(int m)=0
Reset motor encoder, single motor.
virtual yarp::dev::ReturnValue setMotorEncoderCountsPerRevolution(int m, const double cpr)=0
Sets number of counts per revolution for motor encoder m.
virtual yarp::dev::ReturnValue getMotorEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all motor encoders.
virtual yarp::dev::ReturnValue setMotorEncoders(const double *vals)=0
Set the value of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncodersTimed(double *encs, double *time)=0
Read the instantaneous position of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoder(int m, double *v)=0
Read the value of a motor encoder.
virtual ~IMotorEncoders()
Destructor.
virtual yarp::dev::ReturnValue getMotorEncoderTimed(int m, double *encs, double *time)=0
Read the instantaneous position of a motor encoder.
std::int32_t vocab32_t
Definition numeric.h:78
For streams capable of holding different kinds of content, check what they actually have.
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition Vocab32.h:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18