YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
84{
85public:
86 virtual ~IPWMControlRaw(){}
87
93 virtual bool getNumberOfMotorsRaw(int *number) = 0;
94
101 virtual bool setRefDutyCycleRaw(int m, double ref) = 0;
102
108 virtual bool setRefDutyCyclesRaw(const double *refs) = 0;
109
116 virtual bool getRefDutyCycleRaw(int m, double *ref) = 0;
117
123 virtual bool getRefDutyCyclesRaw(double *refs) = 0;
124
130 virtual bool getDutyCycleRaw(int m, double *val) = 0;
131
136 virtual bool getDutyCyclesRaw(double *vals) = 0;
137};
138
139// Interface name
141// methods names
146
147#endif // YARP_DEV_IPWMCONTROL_H
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUTS
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWMS
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWM
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUT
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition IPWMControl.h:84
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.
Definition jointData.cpp:13
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