YARP
Yet Another Robot Platform
laserFromDepth.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 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 #ifndef LASER_FROM_DEPTH_H
20 #define LASER_FROM_DEPTH_H
21 
22 #include <yarp/os/PeriodicThread.h>
23 #include <yarp/os/Semaphore.h>
26 #include <yarp/dev/PolyDriver.h>
27 #include <yarp/sig/Vector.h>
28 #include <yarp/dev/IRGBDSensor.h>
30 
31 #include <mutex>
32 #include <string>
33 #include <vector>
34 
35 using namespace yarp::os;
36 using namespace yarp::dev;
37 
38 typedef unsigned char byte;
39 
40 //---------------------------------------------------------------------------------------------------------------
41 
43 {
44 protected:
46  IRGBDSensor* iRGBD = nullptr;
47 
48  size_t m_depth_width = 0;
49  size_t m_depth_height = 0;
51 
52 public:
53  LaserFromDepth(double period = 0.01) : PeriodicThread(period),
55  {}
56 
58  {
59  }
60 
61  bool open(yarp::os::Searchable& config) override;
62  bool close() override;
63  bool threadInit() override;
64  void threadRelease() override;
65  void run() override;
66 
67 public:
68  //IRangefinder2D interface
69  bool setDistanceRange (double min, double max) override;
70  bool setScanLimits (double min, double max) override;
71  bool setHorizontalResolution (double step) override;
72  bool setScanRate (double rate) override;
73 };
74 
75 #endif
define control board standard interfaces
contains the definition of a Vector type
PolyDriver driver
LaserFromDepth(double period=0.01)
yarp::sig::ImageOf< float > m_depth_image
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
A generic interface for cameras that have both color camera as well as depth camera sensor,...
Definition: IRGBDSensor.h:56
The DLidarDeviceTemplate class.
A container for a device driver.
Definition: PolyDriver.h:27
An abstraction for a periodic thread.
A base class for nested structures that can be searched.
Definition: Searchable.h:69
unsigned char byte
An interface for the device drivers.
An interface to the operating system, including Port based communication.