6#ifndef LASER_FROM_ROS_TOPIC_H
7#define LASER_FROM_ROS_TOPIC_H
25#include <yarp/rosmsg/sensor_msgs/LaserScan.h>
26#include <yarp/rosmsg/impl/yarpRosHelper.h>
34#if __has_include (<yarp/dev/LaserScan2D.h>)
66 std::mutex m_port_mutex;
74 m_lastScan(alt.m_lastScan),
75 m_lastStamp(alt.m_lastStamp),
76 m_contains_data(alt.m_contains_data)
82 virtual void onRead(yarp::rosmsg::sensor_msgs::LaserScan& v)
override;
124 bool close()
override;
define control board standard interfaces
contains the definition of a Vector type
laserFromRosTopic: Documentation to be added
void calculate(yarp::sig::LaserScan2D scan, yarp::sig::Matrix m)
bool close() override
Close the DeviceDriver.
std::vector< InputPortProcessor > m_input_ports
bool setDistanceRange(double min, double max) override
set the device detection range.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
std::vector< yarp::os::Stamp > m_last_stamp
std::vector< std::string > m_port_names
bool setHorizontalResolution(double step) override
get the angular step between two measurements (if available)
void run() override
Loop function.
yarp::os::Node * m_ros_node
yarp::dev::PolyDriver m_tc_driver
LaserFromRosTopic(double period=0.01)
bool setScanLimits(double min, double max) override
set the scan angular range.
bool threadInit() override
Initialization method.
yarp::sig::Vector m_empty_laser_data
bool acquireDataFromHW() override final
This method should be implemented by the user, and contain the logic to grab data from the hardware.
std::vector< yarp::sig::LaserScan2D > m_last_scan_data
void threadRelease() override
Release method.
std::vector< std::string > m_src_frame_id
yarp::dev::IFrameTransform * m_iTc
std::string m_dst_frame_id
bool m_option_override_limits
bool setScanRate(double rate) override
set the scan rate (scans per seconds)
Interface implemented by all device drivers.
The Lidar2DDeviceBase class.
A container for a device driver.
An abstraction for a periodic thread.
PeriodicThread(double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative)
Constructor.
void step()
Call this to "step" the thread rather than starting it.
A base class for nested structures that can be searched.
An abstraction for a time stamp and/or sequence number.
A port specialized for reading data of a constant type published on a topic.
Subscriber(const std::string &name="")
Constructor.
The main, catch-all namespace for YARP.