6#define _USE_MATH_DEFINES
24#define DEG2RAD M_PI/180.0
34 m_info =
"LaserFromDepth device";
35 m_device_status = DEVICE_OK_STANDBY;
47 if (this->parseConfiguration(config) ==
false)
54 if(!config.check(
"RGBD_SENSOR_CLIENT"))
59 prop.
fromString(config.findGroup(
"RGBD_SENSOR_CLIENT").toString());
60 prop.
put(
"device",
"RGBDSensorClient");
63 if (!driver.isValid())
75 m_depth_width = iRGBD->getDepthWidth();
76 m_depth_height = iRGBD->getDepthHeight();
80 m_sensorsNum = m_depth_width;
81 m_resolution =
hfov / m_depth_width;
82 m_laser_data.resize(m_sensorsNum, 0.0);
83 m_max_angle = +
hfov / 2;
84 m_min_angle = -
hfov / 2;
129 return ReturnValue::return_code::return_value_error_not_implemented_by_device;
laserFromDepth: This devices connects to an RGBDSensor_nws_yarp to receive depth data.
yarp::dev::ReturnValue setScanRate(double rate) override
set the scan rate (scans per seconds)
void run() override
Loop function.
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)
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
virtual bool getDepthImage(yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthImage, yarp::os::Stamp *timeStamp=nullptr)=0
Get the depth frame from the device.
virtual bool updateLidarData()
This utility method calls in sequence: grabDataFromHW(), updateTimestamp and applyLimitsOnLaserData()...
yarp::sig::Vector m_laser_data
bool close() override
Close the DeviceDriver.
bool isValid() const
Check if device is valid.
A mini-server for performing network communication in the background.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
bool start()
Call this to start the thread.
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
A class for storing options and configuration information.
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
A base class for nested structures that can be searched.
size_t width() const
Gets width of image in pixels.
unsigned char * getRawImage() const
Access to the internal image buffer.
size_t height() const
Gets height of image in pixels.
unsigned char * getPixelAddress(size_t x, size_t y) const
Get address of a pixel in memory.
const yarp::os::LogComponent & LASER_FROM_DEPTH()
#define yCInfo(component,...)
#define yCError(component,...)
#define yCWarning(component,...)
#define yCDebug(component,...)
#define YARP_LOG_COMPONENT(name,...)
double now()
Return the current time in seconds, relative to an arbitrary starting point.
The main, catch-all namespace for YARP.