YARP
Yet Another Robot Platform
Localization2DClient.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef YARP_DEV_LOCALIZATION2DCLIENT_H
20 #define YARP_DEV_LOCALIZATION2DCLIENT_H
21 
22 
23 #include <yarp/os/Network.h>
24 #include <yarp/os/BufferedPort.h>
28 #include <yarp/sig/Vector.h>
29 #include <yarp/os/Semaphore.h>
30 #include <yarp/os/Time.h>
31 #include <yarp/os/Port.h>
32 #include <mutex>
33 #include <string>
34 #include <yarp/dev/PolyDriver.h>
35 #include <yarp/dev/Map2DLocation.h>
37 
38 
55 {
56 protected:
57  std::mutex m_mutex;
59  std::string m_local_name;
60  std::string m_remote_name;
61 
62 public:
63  /* DeviceDriver methods */
64  bool open(yarp::os::Searchable& config) override;
65  bool close() override;
66 
67  /* The following methods belong to ILocalization2D interface */
69  bool getEstimatedOdometry(yarp::dev::OdometryData& odom) override;
70  bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation& loc) override;
72  bool getEstimatedPoses(std::vector<yarp::dev::Nav2D::Map2DLocation>& poses) override;
73  bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation& loc, const yarp::sig::Matrix& cov) override;
75  bool startLocalizationService() override;
76  bool stopLocalizationService() override;
77 };
78 
79 #endif // YARP_DEV_LOCALIZATION2DCLIENT_H
Network.h
Localization2DClient::startLocalizationService
bool startLocalizationService() override
Starts the localization service.
Definition: Localization2DClient.cpp:322
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
Localization2DClient::getEstimatedOdometry
bool getEstimatedOdometry(yarp::dev::OdometryData &odom) override
Gets the estimated odometry the robot, including its velocity expressed in the world and in the local...
Definition: Localization2DClient.cpp:162
Vector.h
contains the definition of a Vector type
Localization2DClient::getEstimatedPoses
bool getEstimatedPoses(std::vector< yarp::dev::Nav2D::Map2DLocation > &poses) override
Gets a set of pose estimates computed by the localization algorithm.
Definition: Localization2DClient.cpp:242
Port.h
Localization2DClient::getCurrentPosition
bool getCurrentPosition(yarp::dev::Nav2D::Map2DLocation &loc) override
Gets the current position of the robot w.r.t world reference frame.
Definition: Localization2DClient.cpp:168
Localization2DClient::m_mutex
std::mutex m_mutex
Definition: Localization2DClient.h:57
IPreciselyTimed.h
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
yarp::dev::Nav2D::ILocalization2D
ILocalization2D interface.
Definition: ILocalization2D.h:40
ControlBoardHelpers.h
yarp::dev::Nav2D::LocalizationStatusEnum
LocalizationStatusEnum
Definition: ILocalization2D.h:25
Localization2DClient
localization2DClient A device which allows a user application retrieve the current position of the ro...
Definition: Localization2DClient.h:55
ControlBoardInterfaces.h
define control board standard interfaces
yarp::dev::OdometryData
Definition: OdometryData.h:27
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
Localization2DClient::m_rpc_port_localization_server
yarp::os::Port m_rpc_port_localization_server
Definition: Localization2DClient.h:58
PolyDriver.h
Localization2DClient::stopLocalizationService
bool stopLocalizationService() override
Stops the localization service.
Definition: Localization2DClient.cpp:347
Localization2DClient::open
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Definition: Localization2DClient.cpp:39
Map2DLocation.h
contains the definition of a Map2DLocation type
Semaphore.h
BufferedPort.h
ILocalization2D.h
yarp::dev::Nav2D::Map2DLocation
Definition: Map2DLocation.h:30
Localization2DClient::getLocalizationStatus
bool getLocalizationStatus(yarp::dev::Nav2D::LocalizationStatusEnum &status) override
Gets the current status of the localization task.
Definition: Localization2DClient.cpp:292
Localization2DClient::close
bool close() override
Close the DeviceDriver.
Definition: Localization2DClient.cpp:372
Time.h
Localization2DClient::m_local_name
std::string m_local_name
Definition: Localization2DClient.h:59
Localization2DClient::m_remote_name
std::string m_remote_name
Definition: Localization2DClient.h:60
Localization2DClient::setInitialPose
bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation &loc) override
Sets the initial pose for the localization algorithm which estimates the current position of the robo...
Definition: Localization2DClient.cpp:97
yarp::sig::Matrix
A class for a Matrix.
Definition: Matrix.h:46