YARP
Yet Another Robot Platform
laserFromPointCloud.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#ifndef LASER_FROM_POINTCLOUDS_H
7#define LASER_FROM_POINTCLOUDS_H
8
10#include <yarp/os/Semaphore.h>
13#include <yarp/dev/PolyDriver.h>
14#include <yarp/sig/Vector.h>
16#include <yarp/sig/PointCloud.h>
18#include <yarp/sig/Vector.h>
22
23#include <mutex>
24#include <string>
25#include <vector>
26
27using namespace yarp::os;
28using namespace yarp::dev;
29
30typedef unsigned char byte;
31
32//---------------------------------------------------------------------------------------------------------------
39{
40protected:
42 IRGBDSensor* m_iRGBD = nullptr;
43
46
47 size_t m_depth_width = 0;
48 size_t m_depth_height = 0;
52
53 //point cloud
54 size_t m_pc_stepx = 0;
55 size_t m_pc_stepy = 0;
57
58 //frames and point cloud clipping planes
60 std::string m_ground_frame_id;
61 std::string m_camera_frame_id;
66
67public:
68 LaserFromPointCloud(double period = 0.01) : PeriodicThread(period),
70 {}
71
73 {
74 }
75
76 bool open(yarp::os::Searchable& config) override;
77 bool close() override;
78 bool threadInit() override;
79 void threadRelease() override;
80 void run() override;
81
82public:
83 //IRangefinder2D interface
84 bool setDistanceRange (double min, double max) override;
85 bool setScanLimits (double min, double max) override;
86 bool setHorizontalResolution (double step) override;
87 bool setScanRate (double rate) override;
88
89public:
90 //Lidar2DDeviceBase
91 bool acquireDataFromHW() override final;
92};
93
94#endif
define control board standard interfaces
contains the definition of a Vector type
laserFromPointCloud: Documentation to be added
void run() override
Loop function.
bool setScanRate(double rate) override
set the scan rate (scans per seconds)
yarp::sig::IntrinsicParams m_intrinsics
bool setDistanceRange(double min, double max) override
set the device detection range.
yarp::sig::utils::PCL_ROI m_pc_roi
yarp::sig::Matrix m_transform_mtrx
IFrameTransform * m_iTc
bool close() override
Close the DeviceDriver.
yarp::sig::ImageOf< float > m_depth_image
bool setHorizontalResolution(double step) override
get the angular step between two measurements (if available)
void threadRelease() override
Release method.
bool acquireDataFromHW() override final
This method should be implemented by the user, and contain the logic to grab data from the hardware.
yarp::os::Property m_propIntrinsics
LaserFromPointCloud(double period=0.01)
bool setScanLimits(double min, double max) override
set the scan angular range.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool threadInit() override
Initialization method.
Interface implemented by all device drivers.
Definition: DeviceDriver.h:30
Transform Interface.
A generic interface for cameras that have both color camera as well as depth camera sensor,...
Definition: IRGBDSensor.h:39
The Lidar2DDeviceBase class.
A container for a device driver.
Definition: PolyDriver.h:23
An abstraction for a periodic thread.
void step()
Call this to "step" the thread rather than starting it.
A class for storing options and configuration information.
Definition: Property.h:33
A base class for nested structures that can be searched.
Definition: Searchable.h:56
A class for a Matrix.
Definition: Matrix.h:39
unsigned char byte
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.
The IntrinsicParams struct to handle the intrinsic parameter of cameras(RGB and RGBD either).