6#define _USE_MATH_DEFINES
19#define DEG2RAD M_PI/180.0
26 std::lock_guard<std::mutex>
guard(m_mutex);
58 if (timestamp !=
nullptr)
89 for (
size_t i = 0;
i < size;
i++)
94 if (timestamp!=
nullptr)
108 m_max_distance(30.0),
110 m_clip_max_enable(
false),
111 m_clip_min_enable(
false),
112 m_do_not_clip_and_allow_infinity_enable(
true)
121 bool br = config.
check(
"SENSOR");
143 bool bs = config.
check(
"SKIP");
153 for (
size_t s = 1; s <
s_maxs; s++)
221bool Lidar2DDeviceBase::checkSkipAngle(
const double&
angle,
double&
distance)
252 distance = std::numeric_limits<double>::infinity();
264 distance = std::numeric_limits<double>::infinity();
const yarp::os::LogComponent & LASER_BASE()
A generic interface for planar laser range finders.
The Lidar2DDeviceBase class.
bool getDeviceStatus(Device_status &status) override
get the device status
yarp::os::Stamp m_timestamp
bool getScanRate(double &rate) override
get the scan rate (scans per seconds)
bool getRawData(yarp::sig::Vector &data, double *timestamp=nullptr) override
Get the device measurements.
virtual bool updateLidarData()
This utility method calls in sequence: grabDataFromHW(), updateTimestamp and applyLimitsOnLaserData()...
virtual bool acquireDataFromHW()=0
This method should be implemented by the user, and contain the logic to grab data from the hardware.
virtual bool applyLimitsOnLaserData()
Apply the limits on the internally stored lidar measurements.
bool getLaserMeasurement(std::vector< yarp::sig::LaserMeasurementData > &data, double *timestamp=nullptr) override
Get the device measurements.
bool getDeviceInfo(std::string &device_info) override
get the device hardware characteristics
std::vector< Range_t > m_range_skip_vector
bool m_do_not_clip_and_allow_infinity_enable
yarp::dev::IRangefinder2D::Device_status m_device_status
virtual bool updateTimestamp()
By default, it automatically updates the internal timestamp with the yarp time.
bool getHorizontalResolution(double &step) override
get the angular step between two measurements.
bool parseConfiguration(yarp::os::Searchable &config)
yarp::sig::Vector m_laser_data
bool getDistanceRange(double &min, double &max) override
get the device detection range
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.
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.
void update()
Set the timestamp to the current time, and increment the sequence number (wrapping to 0 if the sequen...
double getTime() const
Get the time stamp.
void resize(size_t size) override
Resize the vector.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.
The main, catch-all namespace for YARP.