YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Rangefinder2D_nws_yarp.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#ifndef YARP_DEV_RANGEFINDER2D_NWS_YARP_H
7#define YARP_DEV_RANGEFINDER2D_NWS_YARP_H
8
9 //#include <list>
10#include <vector>
11#include <iostream>
12#include <string>
13#include <sstream>
14
15#include <yarp/os/Network.h>
16#include <yarp/os/Port.h>
18#include <yarp/os/Bottle.h>
19#include <yarp/os/Time.h>
20#include <yarp/os/Property.h>
21
24#include <yarp/os/Stamp.h>
25
26#include <yarp/sig/Vector.h>
27
30#include <yarp/dev/PolyDriver.h>
33#include <yarp/dev/api.h>
35
36#define DEFAULT_THREAD_PERIOD 0.02 //s
37
54{
55public:
58
59 bool open(yarp::os::Searchable &params) override;
60 bool close() override;
61
63 bool attach(yarp::dev::PolyDriver* driver) override;
64 bool detach() override;
65
66 bool threadInit() override;
67 void threadRelease() override;
68 void run() override;
69 bool read(yarp::os::ConnectionReader& connection) override;
70
71private:
72 yarp::os::Port rpcPort;
74
75 //interfaces
77
78 //device data
79 yarp::os::Stamp lastStateStamp;
80 double minAngle, maxAngle;
81 double minDistance, maxDistance;
82 double resolution;
83};
84
85#endif //YARP_DEV_RANGEFINDER2D_NWS_YARP_H
contains the definition of a Vector type
This class is the parameters parser for class Rangefinder2D_nws_yarp.
rangefinder2D_nws_yarp: A Network grabber for 2D Rangefinder devices.
void run() override
Loop function.
void threadRelease() override
Release method.
bool open(yarp::os::Searchable &params) override
Open the DeviceDriver.
Rangefinder2D_nws_yarp()
It reads the data from a rangefinder sensor and sends them on one port.
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.
Interface implemented by all device drivers.
A generic interface for planar laser range finders.
A container for a device driver.
Definition PolyDriver.h:23
Helper interface for an object that can wrap/or "attach" to a single other device.
A mini-server for performing network communication in the background.
An interface for reading from a network connection.
An abstraction for a periodic thread.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition PortReader.h:24
A mini-server for network communication.
Definition Port.h:46
A base class for nested structures that can be searched.
Definition Searchable.h:31
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21