YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
laserFromDepth.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_DEPTH_H
7#define LASER_FROM_DEPTH_H
8
10#include <yarp/os/Semaphore.h>
13#include <yarp/dev/PolyDriver.h>
14#include <yarp/sig/Vector.h>
17
18#include <mutex>
19#include <string>
20#include <vector>
21
22using namespace yarp::os;
23using namespace yarp::dev;
24
25typedef unsigned char byte;
26
27//---------------------------------------------------------------------------------------------------------------
35{
36protected:
38 IRGBDSensor* iRGBD = nullptr;
39
40 size_t m_depth_width = 0;
41 size_t m_depth_height = 0;
43
44public:
45 LaserFromDepth(double period = 0.01) : PeriodicThread(period),
47 {}
48
50 {
51 }
52
53 bool open(yarp::os::Searchable& config) override;
54 bool close() override;
55 bool threadInit() override;
56 void threadRelease() override;
57 void run() override;
58
59public:
60 //IRangefinder2D interface
61 yarp::dev::ReturnValue setDistanceRange (double min, double max) override;
62 yarp::dev::ReturnValue setScanLimits (double min, double max) override;
64 yarp::dev::ReturnValue setScanRate (double rate) override;
65
66public:
67 //Lidar2DDeviceBase
69};
70
71#endif
define control board standard interfaces
contains the definition of a Vector type
laserFromDepth: This devices connects to an RGBDSensor_nws_yarp to receive depth data.
PolyDriver driver
yarp::dev::ReturnValue setScanRate(double rate) override
set the scan rate (scans per seconds)
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
void run() override
Loop function.
IRGBDSensor * iRGBD
bool acquireDataFromHW() override final
This method should be implemented by the user, and contain the logic to grab data from the hardware.
LaserFromDepth(double period=0.01)
yarp::dev::ReturnValue setHorizontalResolution(double step) override
get the angular step between two measurements (if available)
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue setScanLimits(double min, double max) override
set the scan angular range.
void threadRelease() override
Release method.
yarp::dev::ReturnValue setDistanceRange(double min, double max) override
set the device detection range.
bool threadInit() override
Initialization method.
yarp::sig::ImageOf< float > m_depth_image
Interface implemented by all device drivers.
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 base class for nested structures that can be searched.
Definition Searchable.h:31
Typed image class.
Definition Image.h:605
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.