YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
UltraPythonDriver.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#pragma once
20
22#include <yarp/dev/FrameGrabberInterfaces.h>
24#include <yarp/os/Semaphore.h>
25#include <yarp/os/Stamp.h>
26
28
30
31class UltraPythonDriver : public yarp::dev::DeviceDriver,
32 public yarp::dev::IPreciselyTimed,
33 public yarp::dev::IFrameGrabberControls,
34 public yarp::dev::IFrameGrabberImage
35 //public yarp::dev::IRgbVisualParams
36{
37 UltraPythonDriver(const UltraPythonDriver &) = delete;
38 void operator=(const UltraPythonDriver &) = delete;
39
40 public:
42 ~UltraPythonDriver() override;
43
44 // Implements DeviceDriver
45 bool open(yarp::os::Searchable &config) override;
46 bool close() override;
47
48 // Implements IFrameGrabberImage basic interface.
49 int height() const override;
50 int width() const override;
51 bool getImage(yarp::sig::ImageOf<yarp::sig::PixelRgb> &image) override;
52
53 // Implements the IPreciselyTimed interface.
54 yarp::os::Stamp getLastInputStamp() override;
55
56 // Implementation of IFrameGrabberControls interface
57 bool getCameraDescription(CameraDescriptor *camera) override;
58 bool hasFeature(int feature, bool *hasFeature) override;
59 bool setFeature(int feature, double value) override;
60 bool getFeature(int feature, double *value) override;
61 bool setFeature(int feature, double value1, double value2) override;
62 bool getFeature(int feature, double *value1, double *value2) override;
63 bool hasOnOff(int feature, bool *HasOnOff) override;
64 bool setActive(int feature, bool onoff) override;
65 bool getActive(int feature, bool *isActive) override;
66 bool hasAuto(int feature, bool *hasAuto) override;
67 bool hasManual(int feature, bool *hasManual) override;
68 bool hasOnePush(int feature, bool *hasOnePush) override;
69 bool setMode(int feature, FeatureMode mode) override;
70 bool getMode(int feature, FeatureMode *mode) override;
71 bool setOnePush(int feature) override;
72
73 private:
75 bool configured_{false};
76
77 bool fromConfig(yarp::os::Searchable &config);
78
79 UltraPythonCameraHelper pythonCameraHelper_;
80 void pythonPreprocess(const void *pythonbuffer, size_t size);
81
82 int remapControlYARPtoXilinx(int feature) const;
83};
const yarp::os::LogComponent & ULTRAPYTHON()
A base class for nested structures that can be searched.
Definition Searchable.h:31
A class for thread synchronization and mutual exclusion.
Definition Semaphore.h:25
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21
Typed image class.
Definition Image.h:605
#define YARP_DECLARE_LOG_COMPONENT(name)
The main, catch-all namespace for YARP.
Definition dirs.h:16