YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Navigation2D_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#include <yarp/os/Network.h>
7#include <yarp/os/RFModule.h>
8#include <yarp/os/Time.h>
9#include <yarp/os/Port.h>
12#include <yarp/dev/PolyDriver.h>
17#include <math.h>
18
20
21#ifndef NAV_SERVER_H
22#define NAV_SERVER_H
23
24#define DEFAULT_THREAD_PERIOD 0.02 //s
25
37#define DEF_m_RPC 1
38
44{
45protected:
46 //thrift
48 std::mutex m_mutex;
49
52 std::string m_rpcPortName;
53 std::string m_statusPortName;
56
57 //drivers and interfaces
62
64
65public:
70
71public:
72 virtual bool open(yarp::os::Searchable& prop) override;
73 virtual bool close() override;
74 virtual bool detach() override;
75 virtual bool attach(yarp::dev::PolyDriver* drv) override;
76 virtual void run() override;
77
79 virtual bool read(yarp::os::ConnectionReader& connection) override;
80
81private:
82 std::string getStatusAsString(yarp::dev::Nav2D::NavigationStatusEnum status);
83 void updateStatusPort(std::string& status);
84};
85
86#endif
define control board standard interfaces
This class is the parameters parser for class Navigation2D_nws_yarp.
virtual void run() override
Loop function.
virtual bool detach() override
Detach the object (you must have first called attach).
virtual bool open(yarp::os::Searchable &prop) override
Open the DeviceDriver.
INavigation2DRPCd * m_RPC
yarp::dev::Nav2D::INavigation2DControlActions * iNav_ctrl
bool initialize_YARP(yarp::os::Searchable &config)
yarp::dev::PolyDriver pNav
virtual bool close() override
Close the DeviceDriver.
yarp::dev::Nav2D::NavigationStatusEnum m_navigation_status
virtual bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Navigation2D_nws_yarp()
Default module constructor.
virtual bool attach(yarp::dev::PolyDriver *drv) override
Attach to another object.
yarp::dev::Nav2D::INavigation2DVelocityActions * iNav_vel
yarp::dev::Nav2D::INavigation2DTargetActions * iNav_target
Interface implemented by all device drivers.
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.
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