YARP
Yet Another Robot Platform
IPWMControl.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_IPWMCONTROL_H
7#define YARP_DEV_IPWMCONTROL_H
8
9#include <yarp/dev/api.h>
10#include <yarp/os/Vocab.h>
11
12namespace yarp::dev {
13class IPWMControlRaw;
14class IPWMControl;
15}
16
23{
24public:
25 virtual ~IPWMControl(){}
26
32 virtual bool getNumberOfMotors(int *number) = 0;
33
40 virtual bool setRefDutyCycle(int m, double ref) = 0;
41
47 virtual bool setRefDutyCycles(const double *refs) = 0;
48
55 virtual bool getRefDutyCycle(int m, double *ref) = 0;
56
62 virtual bool getRefDutyCycles(double *refs) = 0;
63
69 virtual bool getDutyCycle(int m, double *val) = 0;
70
75 virtual bool getDutyCycles(double *vals) = 0;
76};
77
83{
84public:
85 virtual ~IPWMControlRaw(){}
86
92 virtual bool getNumberOfMotorsRaw(int *number) = 0;
93
100 virtual bool setRefDutyCycleRaw(int m, double ref) = 0;
101
107 virtual bool setRefDutyCyclesRaw(const double *refs) = 0;
108
115 virtual bool getRefDutyCycleRaw(int m, double *ref) = 0;
116
122 virtual bool getRefDutyCyclesRaw(double *refs) = 0;
123
129 virtual bool getDutyCycleRaw(int m, double *val) = 0;
130
135 virtual bool getDutyCyclesRaw(double *vals) = 0;
136};
137
138// Interface name
140// methods names
145
146#endif // YARP_DEV_IPWMCONTROL_H
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_INTERFACE
Definition: IPWMControl.h:139
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUTS
Definition: IPWMControl.h:144
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWMS
Definition: IPWMControl.h:142
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWM
Definition: IPWMControl.h:141
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUT
Definition: IPWMControl.h:143
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition: IPWMControl.h:83
virtual bool getDutyCycleRaw(int m, double *val)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual bool setRefDutyCycleRaw(int m, double ref)=0
Sets the reference dutycycle of a single motor.
virtual bool getDutyCyclesRaw(double *vals)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual bool getNumberOfMotorsRaw(int *number)=0
Retrieves the number of controlled motors from the current physical interface.
virtual bool setRefDutyCyclesRaw(const double *refs)=0
Sets the reference dutycycle for all motors.
virtual bool getRefDutyCyclesRaw(double *refs)=0
Gets the last reference sent using the setRefDutyCyclesRaw function.
virtual bool getRefDutyCycleRaw(int m, double *ref)=0
Gets the last reference sent using the setRefDutyCycleRaw function.
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition: IPWMControl.h:23
virtual bool getDutyCycle(int m, double *val)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual bool getNumberOfMotors(int *number)=0
Retrieves the number of controlled motors from the current physical interface.
virtual bool getRefDutyCycles(double *refs)=0
Gets the last reference sent using the setRefDutyCycles function.
virtual bool setRefDutyCycle(int m, double ref)=0
Sets the reference dutycycle to a single motor.
virtual bool setRefDutyCycles(const double *refs)=0
Sets the reference dutycycle for all the motors.
virtual bool getRefDutyCycle(int m, double *ref)=0
Gets the last reference sent using the setRefDutyCycle function.
virtual bool getDutyCycles(double *vals)=0
Gets the current dutycycle of the output of the amplifier (i.e.
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: Vocab.h:27
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18