YARP
Yet Another Robot Platform
fakeLocalizerDev.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>
10 #include <yarp/os/LogStream.h>
11 #include <yarp/os/Node.h>
12 #include <yarp/dev/PolyDriver.h>
13 #include <yarp/os/Bottle.h>
14 #include <yarp/sig/Vector.h>
15 #include <yarp/dev/INavigation2D.h>
17 #include <yarp/os/PeriodicThread.h>
18 #include <math.h>
19 #include <mutex>
20 
21 using namespace yarp::os;
22 
25 {
26 protected:
27  //general
34  std::mutex m_mutex;
36  std::string m_local_name;
37 
38 public:
39  fakeLocalizerThread(double _period, yarp::os::Searchable& _cfg);
40  virtual bool threadInit() override;
41  virtual void threadRelease() override;
42  virtual void run() override;
43 
44 public:
45  bool initializeLocalization(const yarp::dev::Nav2D::Map2DLocation& loc);
46  bool getCurrentLoc(yarp::dev::Nav2D::Map2DLocation& loc);
47 };
48 
57 {
58 public:
60  virtual bool open(yarp::os::Searchable& config) override;
61 
62  fakeLocalizer();
63  virtual ~fakeLocalizer();
64 
65  virtual bool close() override;
66 
67 public:
72  bool getLocalizationStatus(yarp::dev::Nav2D::LocalizationStatusEnum& status) override;
73 
78  bool getEstimatedPoses(std::vector<yarp::dev::Nav2D::Map2DLocation>& poses) override;
79 
85  bool getCurrentPosition(yarp::dev::Nav2D::Map2DLocation& loc) override;
86 
92  bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation& loc) override;
93 
100  virtual bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation& loc, const yarp::sig::Matrix& cov) override;
101 
108  virtual bool getCurrentPosition(yarp::dev::Nav2D::Map2DLocation& loc, yarp::sig::Matrix& cov) override;
109 
115  virtual bool getEstimatedOdometry(yarp::dev::OdometryData& odom) override;
116 
121  virtual bool startLocalizationService() override;
122 
127  virtual bool stopLocalizationService() override;
128 };
define control board standard interfaces
contains the definition of a Vector type
yarp::dev::Nav2D::Map2DLocation m_current_loc
yarp::dev::Nav2D::Map2DLocation m_current_odom
yarp::dev::Nav2D::Map2DLocation m_initial_loc
std::string m_local_name
yarp::os::Searchable & m_cfg
yarp::dev::Nav2D::Map2DLocation m_initial_odom
fakeLocalizer Documentation to be added
fakeLocalizerThread * locThread
Interface implemented by all device drivers.
Definition: DeviceDriver.h:35
ILocalization2D interface.
An abstraction for a periodic thread.
A base class for nested structures that can be searched.
Definition: Searchable.h:66
A class for a Matrix.
Definition: Matrix.h:43
An interface to the operating system, including Port based communication.