6#define _USE_MATH_DEFINES
55 if (
nullptr == sens_p)
101 bool b = m_RPC.
read(connection);
137 streamingPort.
close();
176 streamingPort.
write();
define control board standard interfaces
const yarp::os::LogComponent & RANGEFINDER2D_NWS_YARP()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
void setInterface(yarp::dev::IRangefinder2D *_irf)
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
rangefinder2D_nws_yarp: A Network grabber for 2D Rangefinder devices.
void run() override
Loop function.
void threadRelease() override
Release method.
~Rangefinder2D_nws_yarp()
bool open(yarp::os::Searchable ¶ms) override
Open the DeviceDriver.
bool detach() override
Detach the object (you must have first called attach).
void attach(yarp::dev::IRangefinder2D *s)
bool threadInit() override
Initialization method.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool close() override
Close the DeviceDriver.
bool view(T *&x)
Get an interface to the device driver.
A generic interface for planar laser range finders.
virtual ReturnValue getRawData(yarp::sig::Vector &data, double *timestamp=nullptr)=0
Get the device measurements.
virtual ReturnValue getDistanceRange(double &min, double &max)=0
get the device detection range
virtual ReturnValue getScanLimits(double &min, double &max)=0
get the scan angular range.
virtual ReturnValue getHorizontalResolution(double &step)=0
get the angular step between two measurements.
virtual ReturnValue getDeviceStatus(Device_status &status)=0
get the device status
A container for a device driver.
bool isValid() const
Check if device is valid.
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
bool setEnvelope(PortWriter &envelope) override
Set an envelope (e.g., a timestamp) to the next message which will be sent.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
void interrupt() override
Interrupt any current reads or writes attached to the port.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
T & prepare()
Access the object which will be transmitted by the next call to yarp::os::BufferedPort::write.
An interface for reading from a network connection.
An abstraction for a periodic thread.
bool setPeriod(double period)
Set the (new) period of the thread.
bool isRunning() const
Returns true when the thread is started, false otherwise.
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...
void setReader(PortReader &reader) override
Set an external reader for port data.
void interrupt() override
Interrupt any current reads or writes attached to the port.
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.
void update()
Set the timestamp to the current time, and increment the sequence number (wrapping to 0 if the sequen...
double angle_min
first angle of the scan [deg]
yarp::sig::Vector scans
the scan data, measured in [m].
double angle_max
last angle of the scan [deg]
std::int32_t status
the status of the device.
double range_max
the maximum distance of the scan [m]
double range_min
the minimum distance of the scan [m]
#define yCError(component,...)
#define yCTrace(component,...)
#define yCDebug(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
An interface to the operating system, including Port based communication.