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>
12
13namespace yarp::dev {
14class IPWMControlRaw;
15class IPWMControl;
16}
17
24{
25public:
26 virtual ~IPWMControl(){}
27
33 virtual yarp::dev::ReturnValue getNumberOfMotors(int *number) = 0;
34
41 virtual yarp::dev::ReturnValue setRefDutyCycle(int m, double ref) = 0;
42
48 virtual yarp::dev::ReturnValue setRefDutyCycles(const double *refs) = 0;
49
56 virtual yarp::dev::ReturnValue getRefDutyCycle(int m, double *ref) = 0;
57
63 virtual yarp::dev::ReturnValue getRefDutyCycles(double *refs) = 0;
64
70 virtual yarp::dev::ReturnValue getDutyCycle(int m, double *val) = 0;
71
76 virtual yarp::dev::ReturnValue getDutyCycles(double *vals) = 0;
77};
78
85{
86public:
87 virtual ~IPWMControlRaw(){}
88
95
102 virtual yarp::dev::ReturnValue setRefDutyCycleRaw(int m, double ref) = 0;
103
109 virtual yarp::dev::ReturnValue setRefDutyCyclesRaw(const double *refs) = 0;
110
117 virtual yarp::dev::ReturnValue getRefDutyCycleRaw(int m, double *ref) = 0;
118
125
131 virtual yarp::dev::ReturnValue getDutyCycleRaw(int m, double *val) = 0;
132
137 virtual yarp::dev::ReturnValue 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
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:85
virtual yarp::dev::ReturnValue setRefDutyCycleRaw(int m, double ref)=0
Sets the reference dutycycle of a single motor.
virtual yarp::dev::ReturnValue getDutyCycleRaw(int m, double *val)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual yarp::dev::ReturnValue getRefDutyCyclesRaw(double *refs)=0
Gets the last reference sent using the setRefDutyCyclesRaw function.
virtual yarp::dev::ReturnValue getNumberOfMotorsRaw(int *number)=0
Retrieves the number of controlled motors from the current physical interface.
virtual yarp::dev::ReturnValue getRefDutyCycleRaw(int m, double *ref)=0
Gets the last reference sent using the setRefDutyCycleRaw function.
virtual yarp::dev::ReturnValue getDutyCyclesRaw(double *vals)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual yarp::dev::ReturnValue setRefDutyCyclesRaw(const double *refs)=0
Sets the reference dutycycle for all motors.
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition IPWMControl.h:24
virtual yarp::dev::ReturnValue getNumberOfMotors(int *number)=0
Retrieves the number of controlled motors from the current physical interface.
virtual yarp::dev::ReturnValue getRefDutyCycles(double *refs)=0
Gets the last reference sent using the setRefDutyCycles function.
virtual yarp::dev::ReturnValue getDutyCycle(int m, double *val)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual yarp::dev::ReturnValue setRefDutyCycles(const double *refs)=0
Sets the reference dutycycle for all the motors.
virtual yarp::dev::ReturnValue setRefDutyCycle(int m, double ref)=0
Sets the reference dutycycle to a single motor.
virtual yarp::dev::ReturnValue getDutyCycles(double *vals)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual yarp::dev::ReturnValue getRefDutyCycle(int m, double *ref)=0
Gets the last reference sent using the setRefDutyCycle function.
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