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
51 std::string m_rpcPortName;
52 std::string m_statusPortName;
55
56 //drivers and interfaces
61
63
64public:
69
70public:
71 virtual bool open(yarp::os::Searchable& prop) override;
72 virtual bool close() override;
73 virtual bool detach() override;
74 virtual bool attach(yarp::dev::PolyDriver* drv) override;
75 virtual void run() override;
76
78 virtual bool read(yarp::os::ConnectionReader& connection) override;
79
80private:
81 std::string getStatusAsString(yarp::dev::Nav2D::NavigationStatusEnum status);
82 void updateStatusPort(std::string& status);
83};
84
85#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.
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