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)
93 for (
size_t i = 0; i < size; i++)
98 if (timestamp!=
nullptr)
112 m_max_distance(30.0),
114 m_clip_max_enable(
false),
115 m_clip_min_enable(
false),
116 m_do_not_clip_and_allow_infinity_enable(
true)
125 bool br = config.
check(
"SENSOR");
147 bool bs = config.
check(
"SKIP");
157 for (
size_t s = 1; s <
s_maxs; s++)
225bool Lidar2DDeviceBase::checkSkipAngle(
const double&
angle,
double&
distance)
256 distance = std::numeric_limits<double>::infinity();
268 distance = std::numeric_limits<double>::infinity();
const yarp::os::LogComponent & LASER_BASE()
A generic interface for planar laser range finders.
The Lidar2DDeviceBase class.
yarp::os::Stamp m_timestamp
yarp::dev::ReturnValue getLaserMeasurement(std::vector< yarp::sig::LaserMeasurementData > &data, double *timestamp=nullptr) override
Get the device measurements.
yarp::dev::ReturnValue getHorizontalResolution(double &step) override
get the angular step between two measurements.
yarp::dev::ReturnValue getDeviceStatus(Device_status &status) override
get the device status
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.
yarp::dev::ReturnValue getScanRate(double &rate) override
get the scan rate (scans per seconds)
std::vector< Range_t > m_range_skip_vector
yarp::dev::ReturnValue getDeviceInfo(std::string &device_info) override
get the device hardware characteristics
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 parseConfiguration(yarp::os::Searchable &config)
yarp::sig::Vector m_laser_data
yarp::dev::ReturnValue getDistanceRange(double &min, double &max) override
get the device detection range
yarp::dev::ReturnValue getRawData(yarp::sig::Vector &data, double *timestamp=nullptr) override
Get the device measurements.
@ return_value_error_method_failed
Method is deprecated.
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.