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 
12 namespace yarp {
13  namespace dev {
14  class IPWMControlRaw;
15  class IPWMControl;
16  }
17 }
18 
25 {
26 public:
27  virtual ~IPWMControl(){}
28 
34  virtual bool getNumberOfMotors(int *number) = 0;
35 
42  virtual bool setRefDutyCycle(int m, double ref) = 0;
43 
49  virtual bool setRefDutyCycles(const double *refs) = 0;
50 
57  virtual bool getRefDutyCycle(int m, double *ref) = 0;
58 
64  virtual bool getRefDutyCycles(double *refs) = 0;
65 
71  virtual bool getDutyCycle(int m, double *val) = 0;
72 
77  virtual bool getDutyCycles(double *vals) = 0;
78 };
79 
85 {
86 public:
87  virtual ~IPWMControlRaw(){}
88 
94  virtual bool getNumberOfMotorsRaw(int *number) = 0;
95 
102  virtual bool setRefDutyCycleRaw(int m, double ref) = 0;
103 
109  virtual bool setRefDutyCyclesRaw(const double *refs) = 0;
110 
117  virtual bool getRefDutyCycleRaw(int m, double *ref) = 0;
118 
124  virtual bool getRefDutyCyclesRaw(double *refs) = 0;
125 
131  virtual bool getDutyCycleRaw(int m, double *val) = 0;
132 
137  virtual bool getDutyCyclesRaw(double *vals) = 0;
138 };
139 
140 // Interface name
142 // methods names
147 
148 #endif // YARP_DEV_IPWMCONTROL_H
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_INTERFACE
Definition: IPWMControl.h:141
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUTS
Definition: IPWMControl.h:146
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWMS
Definition: IPWMControl.h:144
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWM
Definition: IPWMControl.h:143
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUT
Definition: IPWMControl.h:145
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition: IPWMControl.h:85
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:25
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
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:28
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18