6#define _USE_MATH_DEFINES
27#define DEG2RAD M_PI/180.0
31#define RAD2DEG 180/M_PI
47 m_contains_data=
false;
56 m_port_mutex.unlock();
63 while (m_contains_data==
false)
72 m_port_mutex.unlock();
80 m_info =
"LaserFromExternalPort device";
167 if (config.
check(
"TRANSFORMS") && config.
check(
"TRANSFORM_CLIENT"))
205 tcprop.put(
"device",
"transformClient");
280 return ReturnValue::return_code::return_value_error_not_implemented_by_device;
303#ifdef DO_NOTHING_DEBUG
315 if (
distance == std::numeric_limits<double>::infinity())
395 if (
m_iTc ==
nullptr)
std::vector< InputPortProcessor > m_input_ports
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue setHorizontalResolution(double step) override
get the angular step between two measurements (if available)
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool threadInit() override
Initialization method.
std::vector< std::string > m_src_frame_id
std::vector< yarp::os::Stamp > m_last_stamp
std::string m_dst_frame_id
yarp::dev::ReturnValue setScanLimits(double min, double max) override
set the scan angular range.
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
yarp::sig::Vector m_empty_laser_data
bool m_option_override_limits
yarp::dev::IFrameTransform * m_iTc
void run() override
Loop function.
std::vector< std::string > m_port_names
void threadRelease() override
Release method.
yarp::dev::ReturnValue setScanRate(double rate) override
set the scan rate (scans per seconds)
yarp::dev::ReturnValue setDistanceRange(double min, double max) override
set the device detection range.
yarp::dev::PolyDriver m_tc_driver
void calculate(yarp::sig::LaserScan2D scan, yarp::sig::Matrix m)
bool view(T *&x)
Get an interface to the device driver.
virtual bool updateLidarData()
This utility method calls in sequence: grabDataFromHW(), updateTimestamp and applyLimitsOnLaserData()...
bool parseConfiguration(yarp::os::Searchable &config)
yarp::sig::Vector m_laser_data
bool isValid() const
Check if device is valid.
bool open(const std::string &txt)
Construct and configure a device by its common name.
A simple collection of objects that can be described and transmitted in a portable way.
A mini-server for performing network communication in the background.
bool getEnvelope(PortReader &envelope) override
void close() override
Stop port activity.
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.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
An abstraction for a time stamp and/or sequence number.
void resize(size_t size) override
Resize the vector.
double constrainAngle(double x)
const yarp::os::LogComponent & LASER_FROM_EXTERNAL_PORT()
#define yCInfo(component,...)
#define yCError(component,...)
#define yCAssert(component, x)
#define yCWarning(component,...)
#define yCDebug(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
yarp::sig::Vector dcm2rpy(const yarp::sig::Matrix &R)
Converts a dcm (direction cosine matrix) rotation matrix to roll-pitch-yaw angles (defined in Math....
double now()
Return the current time in seconds, relative to an arbitrary starting point.
void delay(double seconds)
Wait for a certain number of seconds.
An interface to the operating system, including Port based communication.