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 //---------------------------------------------------------------------------------------------------------------
52 {
53 protected:
55  IRGBDSensor* m_iRGBD = nullptr;
56 
58  IFrameTransform* m_iTc = nullptr;
59 
60  size_t m_depth_width = 0;
61  size_t m_depth_height = 0;
65 
66  //point cloud
67  size_t m_pc_stepx = 0;
68  size_t m_pc_stepy = 0;
70 
71  //frames and point cloud clipping planes
73  std::string m_ground_frame_id;
74  std::string m_camera_frame_id;
79 
80 public:
81  LaserFromPointCloud(double period = 0.01) : PeriodicThread(period),
83  {}
84 
86  {
87  }
88 
89  bool open(yarp::os::Searchable& config) override;
90  bool close() override;
91  bool threadInit() override;
92  void threadRelease() override;
93  void run() override;
94 
95 public:
96  //IRangefinder2D interface
97  bool setDistanceRange (double min, double max) override;
98  bool setScanLimits (double min, double max) override;
99  bool setHorizontalResolution (double step) override;
100  bool setScanRate (double rate) override;
101 };
102 
103 #endif
LaserFromPointCloud::m_camera_frame_id
std::string m_camera_frame_id
Definition: laserFromPointCloud.h:74
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
IRangefinder2D.h
LaserFromPointCloud::m_intrinsics
yarp::sig::IntrinsicParams m_intrinsics
Definition: laserFromPointCloud.h:63
Vector.h
contains the definition of a Vector type
LaserFromPointCloud::m_pc_roi
yarp::sig::utils::PCL_ROI m_pc_roi
Definition: laserFromPointCloud.h:69
Lidar2DDeviceBase.h
LaserFromPointCloud::m_ground_frame_id
std::string m_ground_frame_id
Definition: laserFromPointCloud.h:73
IntrinsicParams.h
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
PointCloud.h
yarp::sig::utils::PCL_ROI
Definition: PointCloudUtils.h:27
LaserFromPointCloud::LaserFromPointCloud
LaserFromPointCloud(double period=0.01)
Definition: laserFromPointCloud.h:81
LaserFromPointCloud::m_tc_driver
PolyDriver m_tc_driver
Definition: laserFromPointCloud.h:57
ControlBoardInterfaces.h
define control board standard interfaces
yarp::dev::IFrameTransform
Transform Interface.
Definition: IFrameTransform.h:33
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 >
LaserFromPointCloud::m_floor_height
double m_floor_height
Definition: laserFromPointCloud.h:75
LaserFromPointCloud::m_pointcloud_max_distance
double m_pointcloud_max_distance
Definition: laserFromPointCloud.h:77
PolyDriver.h
yarp::dev::PolyDriver
A container for a device driver.
Definition: PolyDriver.h:27
LaserFromPointCloud
laserFromPointCloud: Documentation to be added
Definition: laserFromPointCloud.h:52
LaserFromPointCloud::m_rgbd_driver
PolyDriver m_rgbd_driver
Definition: laserFromPointCloud.h:54
LaserFromPointCloud::m_transform_mtrx
yarp::sig::Matrix m_transform_mtrx
Definition: laserFromPointCloud.h:78
LaserFromPointCloud::m_ceiling_height
double m_ceiling_height
Definition: laserFromPointCloud.h:76
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
LaserFromPointCloud::m_depth_image
yarp::sig::ImageOf< float > m_depth_image
Definition: laserFromPointCloud.h:64
yarp::os::PeriodicThread
An abstraction for a periodic thread.
Definition: PeriodicThread.h:25
PeriodicThread.h
IRGBDSensor.h
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
LaserFromPointCloud::m_publish_ros_pc
bool m_publish_ros_pc
Definition: laserFromPointCloud.h:72
LaserFromPointCloud::m_propIntrinsics
yarp::os::Property m_propIntrinsics
Definition: laserFromPointCloud.h:62
yarp::sig::IntrinsicParams
The IntrinsicParams struct to handle the intrinsic parameter of cameras(RGB and RGBD either).
Definition: IntrinsicParams.h:44
byte
unsigned char byte
Definition: laserFromPointCloud.h:43
LaserFromPointCloud::~LaserFromPointCloud
~LaserFromPointCloud()
Definition: laserFromPointCloud.h:85
PointCloudUtils.h
IFrameTransform.h
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37
yarp::sig::Matrix
A class for a Matrix.
Definition: Matrix.h:46