YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ImplementPWMControl.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_DEV_IMPLEMENTPWMCONTROL_H
8#define YARP_DEV_IMPLEMENTPWMCONTROL_H
9
11#include <yarp/dev/api.h>
12#include <yarp/conf/system.h>
13#include <vector>
14
15namespace yarp::dev {
16class ImplementPWMControl;
17}
18
19namespace yarp::dev::impl {
20
21template <typename T>
22class FixedSizeBuffersManager;
23
24} // namespace yarp::dev::impl
25
27{
28 yarp::dev::IPWMControlRaw* m_iraw=nullptr;
29 void* m_helper=nullptr;
30 std::vector<int> m_buffer_ints;
31 std::vector<double> m_buffer_doubles;
32 std::mutex m_imp_mutex;
33
34
35public:
36 bool initialize(int k, const int *amap, const double* dutyToPWM);
37 bool uninitialize();
41 yarp::dev::ReturnValue setRefDutyCycle(int j, double v) override;
42 yarp::dev::ReturnValue setRefDutyCycles(const double *v) override;
43 yarp::dev::ReturnValue getRefDutyCycle(int j, double *v) override;
44 yarp::dev::ReturnValue getRefDutyCycles(double *v) override;
45 yarp::dev::ReturnValue getDutyCycle(int j, double *v) override;
46 yarp::dev::ReturnValue getDutyCycles(double *v) override;
47
48};
49
50#endif // YARP_DEV_IMPLEMENTPWMCONTROL_H
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition IPWMControl.h:85
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition IPWMControl.h:24
bool initialize(int k, const int *amap, const double *dutyToPWM)
yarp::dev::ReturnValue getDutyCycle(int j, double *v) override
Gets the current dutycycle of the output of the amplifier (i.e.
yarp::dev::ReturnValue getRefDutyCycle(int j, double *v) override
Gets the last reference sent using the setRefDutyCycle function.
yarp::dev::ReturnValue setRefDutyCycles(const double *v) override
Sets the reference dutycycle for all the motors.
yarp::dev::ReturnValue getNumberOfMotors(int *ax) override
Retrieves the number of controlled motors from the current physical interface.
yarp::dev::ReturnValue getRefDutyCycles(double *v) override
Gets the last reference sent using the setRefDutyCycles function.
yarp::dev::ReturnValue setRefDutyCycle(int j, double v) override
Sets the reference dutycycle to a single motor.
yarp::dev::ReturnValue getDutyCycles(double *v) override
Gets the current dutycycle of the output of the amplifier (i.e.
For streams capable of holding different kinds of content, check what they actually have.
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18