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 //---------------------------------------------------------------------------------------------------------------
47 {
48 protected:
50  IRGBDSensor* iRGBD = nullptr;
51 
52  size_t m_depth_width = 0;
53  size_t m_depth_height = 0;
55 
56 public:
57  LaserFromDepth(double period = 0.01) : PeriodicThread(period),
59  {}
60 
62  {
63  }
64 
65  bool open(yarp::os::Searchable& config) override;
66  bool close() override;
67  bool threadInit() override;
68  void threadRelease() override;
69  void run() override;
70 
71 public:
72  //IRangefinder2D interface
73  bool setDistanceRange (double min, double max) override;
74  bool setScanLimits (double min, double max) override;
75  bool setHorizontalResolution (double step) override;
76  bool setScanRate (double rate) override;
77 };
78 
79 #endif
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
IRangefinder2D.h
Vector.h
contains the definition of a Vector type
LaserFromDepth::~LaserFromDepth
~LaserFromDepth()
Definition: laserFromDepth.h:61
Lidar2DDeviceBase.h
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
LaserFromDepth::driver
PolyDriver driver
Definition: laserFromDepth.h:49
ControlBoardInterfaces.h
define control board standard interfaces
yarp::dev
An interface for the device drivers.
Definition: audioBufferSizeData.cpp:17
yarp::dev::Lidar2DDeviceBase
The DLidarDeviceTemplate class.
Definition: Lidar2DDeviceBase.h:33
yarp::sig::ImageOf< float >
PolyDriver.h
LaserFromDepth::m_depth_image
yarp::sig::ImageOf< float > m_depth_image
Definition: laserFromDepth.h:54
yarp::dev::PolyDriver
A container for a device driver.
Definition: PolyDriver.h:27
yarp::dev::IRGBDSensor
A generic interface for cameras that have both color camera as well as depth camera sensor,...
Definition: IRGBDSensor.h:56
Semaphore.h
yarp::os::PeriodicThread
An abstraction for a periodic thread.
Definition: PeriodicThread.h:25
LaserFromDepth::LaserFromDepth
LaserFromDepth(double period=0.01)
Definition: laserFromDepth.h:57
PeriodicThread.h
IRGBDSensor.h
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
LaserFromDepth
laserFromDepth: Documentation to be added
Definition: laserFromDepth.h:47
byte
unsigned char byte
Definition: laserFromDepth.h:38