YARP
Yet Another Robot Platform
laserFromPointCloud.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_POINTCLOUDS_H
20 #define LASER_FROM_POINTCLOUDS_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>
29 #include <yarp/sig/PointCloud.h>
31 #include <yarp/sig/Vector.h>
32 #include <yarp/dev/IRGBDSensor.h>
35 
36 #include <mutex>
37 #include <string>
38 #include <vector>
39 
40 using namespace yarp::os;
41 using namespace yarp::dev;
42 
43 typedef unsigned char byte;
44 
45 //---------------------------------------------------------------------------------------------------------------
46 
48 {
49 protected:
51  IRGBDSensor* m_iRGBD = nullptr;
52 
54  IFrameTransform* m_iTc = nullptr;
55 
56  size_t m_depth_width = 0;
57  size_t m_depth_height = 0;
61 
62  //point cloud
63  size_t m_pc_stepx = 0;
64  size_t m_pc_stepy = 0;
66 
67  //frames and point cloud clipping planes
69  std::string m_ground_frame_id;
70  std::string m_camera_frame_id;
75 
76 public:
77  LaserFromPointCloud(double period = 0.01) : PeriodicThread(period),
79  {}
80 
82  {
83  }
84 
85  bool open(yarp::os::Searchable& config) override;
86  bool close() override;
87  bool threadInit() override;
88  void threadRelease() override;
89  void run() override;
90 
91 public:
92  //IRangefinder2D interface
93  bool setDistanceRange (double min, double max) override;
94  bool setScanLimits (double min, double max) override;
95  bool setHorizontalResolution (double step) override;
96  bool setScanRate (double rate) override;
97 };
98 
99 #endif
define control board standard interfaces
contains the definition of a Vector type
yarp::sig::IntrinsicParams m_intrinsics
yarp::sig::utils::PCL_ROI m_pc_roi
yarp::sig::Matrix m_transform_mtrx
yarp::sig::ImageOf< float > m_depth_image
yarp::os::Property m_propIntrinsics
LaserFromPointCloud(double period=0.01)
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
Transform Interface.
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 class for storing options and configuration information.
Definition: Property.h:37
A base class for nested structures that can be searched.
Definition: Searchable.h:69
A class for a Matrix.
Definition: Matrix.h:46
unsigned char byte
An interface for the device drivers.
An interface to the operating system, including Port based communication.
The IntrinsicParams struct to handle the intrinsic parameter of cameras(RGB and RGBD either).