YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
59 std::string m_ground_frame_id;
60 std::string m_camera_frame_id;
65
66public:
67 LaserFromPointCloud(double period = 0.01) : PeriodicThread(period),
69 {}
70
74
75 bool open(yarp::os::Searchable& config) override;
76 bool close() override;
77 bool threadInit() override;
78 void threadRelease() override;
79 void run() override;
80
81public:
82 //IRangefinder2D interface
83 yarp::dev::ReturnValue setDistanceRange (double min, double max) override;
84 yarp::dev::ReturnValue setScanLimits (double min, double max) override;
86 yarp::dev::ReturnValue setScanRate (double rate) override;
87
88public:
89 //Lidar2DDeviceBase
91
93 bool utility_insideCameraFov (size_t i, double left_elem, double right_elem);
94};
95
96#endif
define control board standard interfaces
contains the definition of a Vector type
laserFromPointCloud: Documentation to be added
yarp::dev::ReturnValue setScanLimits(double min, double max) override
set the scan angular range.
void run() override
Loop function.
yarp::dev::ReturnValue setScanRate(double rate) override
set the scan rate (scans per seconds)
yarp::sig::IntrinsicParams m_intrinsics
yarp::sig::utils::PCL_ROI m_pc_roi
yarp::sig::Matrix m_transform_mtrx
IFrameTransform * m_iTc
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue setDistanceRange(double min, double max) override
set the device detection range.
yarp::sig::ImageOf< float > m_depth_image
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::dev::ReturnValue setHorizontalResolution(double step) override
get the angular step between two measurements (if available)
yarp::os::Property m_propIntrinsics
LaserFromPointCloud(double period=0.01)
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool threadInit() override
Initialization method.
Interface implemented by all device drivers.
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
A mini-server for performing network communication in the background.
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:31
Typed image class.
Definition Image.h:603
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.
Definition OSTestMsg.cpp:13
The IntrinsicParams struct to handle the intrinsic parameter of cameras(RGB and RGBD either).