YARP
Yet Another Robot Platform
ImplementPWMControl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_DEV_IMPLEMENTPWMCONTROL_H
11 #define YARP_DEV_IMPLEMENTPWMCONTROL_H
12 
13 #include <yarp/dev/IPWMControl.h>
14 #include <yarp/dev/api.h>
15 #include <yarp/conf/system.h>
16 
17 namespace yarp {
18  namespace dev {
19  class ImplementPWMControl;
20  }
21 }
22 
23 namespace yarp {
24 namespace dev {
25 namespace impl {
26 
27 template <typename T>
28 class FixedSizeBuffersManager;
29 
30 } // namespace impl
31 } // namespace dev
32 } // namespace yarp
33 
35 {
36  void *helper;
39 public:
40  bool initialize(int k, const int *amap, const double* dutyToPWM);
41  bool uninitialize();
44  bool getNumberOfMotors(int *ax) override;
45  bool setRefDutyCycle(int j, double v) override;
46  bool setRefDutyCycles(const double *v) override;
47  bool getRefDutyCycle(int j, double *v) override;
48  bool getRefDutyCycles(double *v) override;
49  bool getDutyCycle(int j, double *v) override;
50  bool getDutyCycles(double *v) override;
51 
52 };
53 
54 #endif // YARP_DEV_IMPLEMENTPWMCONTROL_H
yarp::dev::IPWMControl::getNumberOfMotors
virtual bool getNumberOfMotors(int *number)=0
Retrieves the number of controlled motors from the current physical interface.
yarp::dev::ImplementPWMControl::initialize
bool initialize(int k, const int *amap, const double *dutyToPWM)
Definition: ImplementPWMControl.cpp:27
yarp::dev::IPWMControlRaw
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition: IPWMControl.h:88
yarp::dev::IPWMControl::getDutyCycle
virtual bool getDutyCycle(int m, double *val)=0
Gets the current dutycycle of the output of the amplifier (i.e.
yarp::dev::ImplementPWMControl::uninitialize
bool uninitialize()
Definition: ImplementPWMControl.cpp:46
yarp::dev::impl::FixedSizeBuffersManager< double >
yarp::dev::IPWMControl::getRefDutyCycle
virtual bool getRefDutyCycle(int m, double *ref)=0
Gets the last reference sent using the setRefDutyCycle function.
yarp::dev::IPWMControl::getDutyCycles
virtual bool getDutyCycles(double *vals)=0
Gets the current dutycycle of the output of the amplifier (i.e.
yarp::dev::IPWMControl::setRefDutyCycles
virtual bool setRefDutyCycles(const double *refs)=0
Sets the reference dutycycle for all the motors.
yarp::dev::ImplementPWMControl
Definition: ImplementPWMControl.h:35
yarp::dev::IPWMControl
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition: IPWMControl.h:28
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
system.h
yarp::dev::ImplementPWMControl::ImplementPWMControl
ImplementPWMControl(IPWMControlRaw *v)
Definition: ImplementPWMControl.cpp:21
yarp::dev::IPWMControl::getRefDutyCycles
virtual bool getRefDutyCycles(double *refs)=0
Gets the last reference sent using the setRefDutyCycles function.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::IPWMControl::setRefDutyCycle
virtual bool setRefDutyCycle(int m, double ref)=0
Sets the reference dutycycle to a single motor.
api.h
IPWMControl.h
yarp::dev::ImplementPWMControl::~ImplementPWMControl
~ImplementPWMControl()
Definition: ImplementPWMControl.cpp:41