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>
18#include <math.h>
19#include <mutex>
20
21using namespace yarp::os;
22
25{
26protected:
27 //general
34 std::mutex m_mutex;
36 std::string m_local_name;
37
38public:
39 fakeLocalizerThread(double _period, yarp::os::Searchable& _cfg);
40 virtual bool threadInit() override;
41 virtual void threadRelease() override;
42 virtual void run() override;
43
44public:
48};
49
58{
59public:
61 virtual bool open(yarp::os::Searchable& config) override;
62
64 virtual ~fakeLocalizer();
65
66 virtual bool close() override;
67
68public:
74
79 bool getEstimatedPoses(std::vector<yarp::dev::Nav2D::Map2DLocation>& poses) override;
80
87
93 bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation& loc) override;
94
101 virtual bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation& loc, const yarp::sig::Matrix& cov) override;
102
110
116 virtual bool getEstimatedOdometry(yarp::dev::OdometryData& odom) override;
117
122 virtual bool startLocalizationService() override;
123
128 virtual bool stopLocalizationService() override;
129};
define control board standard interfaces
contains the definition of a Vector type
virtual void run() override
Loop function.
yarp::dev::Nav2D::Map2DLocation m_current_loc
virtual bool threadInit() override
Initialization method.
yarp::dev::Nav2D::Map2DLocation m_current_odom
bool getCurrentLoc(yarp::dev::Nav2D::Map2DLocation &loc)
yarp::dev::Nav2D::Map2DLocation m_initial_loc
std::string m_local_name
virtual void threadRelease() override
Release method.
yarp::os::Searchable & m_cfg
fakeLocalizerThread(double _period, yarp::os::Searchable &_cfg)
bool initializeLocalization(const yarp::dev::Nav2D::Map2DLocation &loc)
yarp::dev::Nav2D::Map2DLocation m_initial_odom
fakeLocalizer Documentation to be added
virtual bool startLocalizationService() override
Starts the localization service.
virtual bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool getCurrentPosition(yarp::dev::Nav2D::Map2DLocation &loc) override
Gets the current position of the robot w.r.t world reference frame.
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...
virtual bool getEstimatedOdometry(yarp::dev::OdometryData &odom) override
Gets the estimated odometry the robot, including its velocity expressed in the world and in the local...
virtual ~fakeLocalizer()
virtual bool close() override
Close the DeviceDriver.
virtual bool stopLocalizationService() override
Stops the localization service.
bool getEstimatedPoses(std::vector< yarp::dev::Nav2D::Map2DLocation > &poses) override
Gets a set of pose estimates computed by the localization algorithm.
bool getLocalizationStatus(yarp::dev::Nav2D::LocalizationStatusEnum &status) override
Gets the current status of the localization task.
fakeLocalizerThread * locThread
Interface implemented by all device drivers.
Definition: DeviceDriver.h:30
ILocalization2D interface.
An abstraction for a periodic thread.
A base class for nested structures that can be searched.
Definition: Searchable.h:63
A class for a Matrix.
Definition: Matrix.h:39
An interface to the operating system, including Port based communication.