YARP
Yet Another Robot Platform
fakeLocalizerDev.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 #include <yarp/os/Network.h>
20 #include <yarp/os/RFModule.h>
21 #include <yarp/os/Time.h>
22 #include <yarp/os/Port.h>
23 #include <yarp/os/LogStream.h>
24 #include <yarp/os/Node.h>
25 #include <yarp/dev/PolyDriver.h>
26 #include <yarp/os/Bottle.h>
27 #include <yarp/sig/Vector.h>
28 #include <yarp/dev/INavigation2D.h>
30 #include <yarp/os/PeriodicThread.h>
31 #include <math.h>
32 #include <mutex>
33 
34 using namespace yarp::os;
35 
38 {
39 protected:
40  //general
47  std::mutex m_mutex;
49  std::string m_local_name;
50 
51 public:
52  fakeLocalizerThread(double _period, yarp::os::Searchable& _cfg);
53  virtual bool threadInit() override;
54  virtual void threadRelease() override;
55  virtual void run() override;
56 
57 public:
58  bool initializeLocalization(const yarp::dev::Nav2D::Map2DLocation& loc);
59  bool getCurrentLoc(yarp::dev::Nav2D::Map2DLocation& loc);
60 };
61 
70 {
71 public:
73  virtual bool open(yarp::os::Searchable& config) override;
74 
75  fakeLocalizer();
76  virtual ~fakeLocalizer();
77 
78  virtual bool close() override;
79 
80 public:
85  bool getLocalizationStatus(yarp::dev::Nav2D::LocalizationStatusEnum& status) override;
86 
91  bool getEstimatedPoses(std::vector<yarp::dev::Nav2D::Map2DLocation>& poses) override;
92 
98  bool getCurrentPosition(yarp::dev::Nav2D::Map2DLocation& loc) override;
99 
105  bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation& loc) override;
106 
113  virtual bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation& loc, const yarp::sig::Matrix& cov) override;
114 
121  virtual bool getCurrentPosition(yarp::dev::Nav2D::Map2DLocation& loc, yarp::sig::Matrix& cov) override;
122 
128  virtual bool getEstimatedOdometry(yarp::dev::OdometryData& odom) override;
129 
134  virtual bool startLocalizationService() override;
135 
140  virtual bool stopLocalizationService() override;
141 };
LogStream.h
INavigation2D.h
Network.h
fakeLocalizerThread::m_current_odom
yarp::dev::Nav2D::Map2DLocation m_current_odom
Definition: fakeLocalizerDev.h:46
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
fakeLocalizerThread::m_last_locdata_received
double m_last_locdata_received
Definition: fakeLocalizerDev.h:42
Vector.h
contains the definition of a Vector type
fakeLocalizerThread::m_cfg
yarp::os::Searchable & m_cfg
Definition: fakeLocalizerDev.h:48
Port.h
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
yarp::dev::Nav2D::ILocalization2D
ILocalization2D interface.
Definition: ILocalization2D.h:40
fakeLocalizerThread::m_initial_loc
yarp::dev::Nav2D::Map2DLocation m_initial_loc
Definition: fakeLocalizerDev.h:43
yarp::dev::Nav2D::LocalizationStatusEnum
LocalizationStatusEnum
Definition: ILocalization2D.h:25
ControlBoardInterfaces.h
define control board standard interfaces
yarp::dev::OdometryData
Definition: OdometryData.h:27
fakeLocalizerThread::m_current_loc
yarp::dev::Nav2D::Map2DLocation m_current_loc
Definition: fakeLocalizerDev.h:45
fakeLocalizerThread
Definition: fakeLocalizerDev.h:38
fakeLocalizerThread::m_last_statistics_printed
double m_last_statistics_printed
Definition: fakeLocalizerDev.h:41
fakeLocalizerThread::m_initial_odom
yarp::dev::Nav2D::Map2DLocation m_initial_odom
Definition: fakeLocalizerDev.h:44
PolyDriver.h
Node.h
fakeLocalizer::locThread
fakeLocalizerThread * locThread
Definition: fakeLocalizerDev.h:72
RFModule.h
yarp::os::PeriodicThread
An abstraction for a periodic thread.
Definition: PeriodicThread.h:25
PeriodicThread.h
yarp::dev::Nav2D::Map2DLocation
Definition: Map2DLocation.h:30
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
fakeLocalizerThread::m_local_name
std::string m_local_name
Definition: fakeLocalizerDev.h:49
fakeLocalizer
fakeLocalizer Documentation to be added
Definition: fakeLocalizerDev.h:70
Time.h
fakeLocalizerThread::m_mutex
std::mutex m_mutex
Definition: fakeLocalizerDev.h:47
Bottle.h
yarp::sig::Matrix
A class for a Matrix.
Definition: Matrix.h:46