6#define _USE_MATH_DEFINES
24#define DEG2RAD M_PI/180.0
27#define DEFAULT_THREAD_PERIOD 20
59 double tmpDT=now-prev;
61 if (
tmpDT > deltaTMax) {
64 if (
tmpDT < deltaTMin) {
221 if (timestamp !=
nullptr)
238 for (
size_t i = 0;
i < size;
i++)
241 double value = scan.
scans[
i];
242 data[
i].set_polar(value,
angle);
244 if (timestamp!=
nullptr)
347 std::lock_guard <std::mutex>
lg(
m_mutex);
360 device_info =
ret.device_info;
virtual bool setScanRate_RPC(const double rate)
virtual return_getScanRate getScanRate_RPC()
virtual bool setDistanceRange_RPC(const double min, const double max)
virtual bool setScanLimits_RPC(const double min, const double max)
virtual return_getHorizontalResolution getHorizontalResolution_RPC()
virtual return_getScanLimits getScanLimits_RPC()
virtual return_getDeviceInfo getDeviceInfo_RPC()
virtual return_getDistanceRange getDistanceRange_RPC()
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
bool getDeviceStatus(Device_status &status) override
get the device status
bool close() override
Close the DeviceDriver.
bool getDistanceRange(double &min, double &max) override
get the device detection range
bool getDeviceInfo(std::string &device_info) override
get the device hardware characteristics
bool setScanRate(double rate) override
set the scan rate (scans per seconds)
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool setDistanceRange(double min, double max) override
set the device detection range.
bool getRawData(yarp::sig::Vector &data, double *timestamp=nullptr) override
Get the device measurements.
bool getScanLimits(double &min, double &max) override
get the scan angular range.
bool setScanLimits(double min, double max) override
set the scan angular range.
bool setHorizontalResolution(double step) override
get the angular step between two measurements (if available)
bool getScanRate(double &rate) override
get the scan rate (scans per seconds)
Rangefinder2DInputPortProcessor m_inputPort
bool getHorizontalResolution(double &step) override
get the angular step between two measurements.
bool getLaserMeasurement(std::vector< yarp::sig::LaserMeasurementData > &data, double *timestamp=nullptr) override
Get the device measurements.
A mini-server for performing network communication in the background.
bool getEnvelope(PortReader &envelope) override
void close() override
Stop port activity.
void disableCallback() override
Remove a callback set up with useCallback()
BufferedPort()
Constructor.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
void useCallback(TypedReaderCallback< T > &callback) override
Set an object whose onRead method will be called when data is available.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A base class for nested structures that can be searched.
An abstraction for a time stamp and/or sequence number.
double getTime() const
Get the time stamp.
bool isValid() const
Check if this Stamp is valid.
static double nowSystem()
bool attachAsClient(yarp::os::UnbufferedContactable &port)
Tag this WireLink as a client, sending data via the specified port.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
yarp::sig::Vector scans
the scan data, measured in [m].
std::int32_t status
the status of the device.
#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.