|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
44 #define M_PI 3.14159265358979323846
47 #define RAD2DEG 180/M_PI
48 #define DEG2RAD M_PI/180
64 locThread->getCurrentLoc(loc);
69 for (
int i = 0; i < 10; i++)
71 yarp::dev::Map2DLocation newloc=loc;
73 std::default_random_engine generator(seed);
74 std::uniform_real_distribution<double> dist(-1, 1);
75 std::uniform_real_distribution<double> dist_t(-180, 180);
76 double numberx = dist(generator);
77 double numbery = dist(generator);
78 double numbert = dist_t(generator);
81 newloc.theta += numbert;
82 poses.push_back(newloc);
90 locThread->getCurrentLoc(loc);
96 locThread->initializeLocalization(loc);
102 locThread->getCurrentLoc(loc);
108 locThread->initializeLocalization(loc);
115 locThread->getCurrentLoc(loc);
145 std::lock_guard<std::mutex> lock(
m_mutex);
171 yCWarning(FAKELOCALIZER) <<
"No localization data received for more than 0.1s!";
177 yCInfo(FAKELOCALIZER) <<
"Localization init request: (" << loc.
map_id <<
")";
178 std::lock_guard<std::mutex> lock(
m_mutex);
201 std::lock_guard<std::mutex> lock(
m_mutex);
yarp::dev::Nav2D::Map2DLocation m_current_odom
A base class for nested structures that can be searched.
double m_last_locdata_received
contains the definition of a Vector type
#define yCWarning(component,...)
virtual bool stopLocalizationService() override
Stops the localization service.
virtual void threadRelease() override
Release method.
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...
#define YARP_LOG_COMPONENT(name,...)
yarp::dev::Nav2D::Map2DLocation m_initial_loc
virtual bool close() override
Close the DeviceDriver.
bool getEstimatedPoses(std::vector< yarp::dev::Nav2D::Map2DLocation > &poses) override
Gets a set of pose estimates computed by the localization algorithm.
define control board standard interfaces
double now()
Return the current time in seconds, relative to an arbitrary starting point.
An interface for the device drivers.
yarp::dev::Nav2D::Map2DLocation m_current_loc
virtual bool startLocalizationService() override
Starts the localization service.
virtual bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
double m_last_statistics_printed
@ localization_status_localized_ok
yarp::dev::Nav2D::Map2DLocation m_initial_odom
double odom_theta
orientation the robot [deg], expressed in the world reference frame
bool initializeLocalization(const yarp::dev::Nav2D::Map2DLocation &loc)
virtual bool threadInit() override
Initialization method.
bool start()
Call this to start the thread.
fakeLocalizerThread * locThread
bool getLocalizationStatus(yarp::dev::Nav2D::LocalizationStatusEnum &status) override
Gets the current status of the localization task.
An abstraction for a periodic thread.
T * data()
Return a pointer to the first element of the vector.
virtual void run() override
Loop function.
#define yCInfo(component,...)
An interface to the operating system, including Port based communication.
bool getCurrentPosition(yarp::dev::Nav2D::Map2DLocation &loc) override
Gets the current position of the robot w.r.t world reference frame.
double odom_y
position of the robot [m], expressed in the world reference frame
double odom_x
position of the robot [m], expressed in the world reference frame
fakeLocalizerThread(double _period, yarp::os::Searchable &_cfg)
bool getCurrentLoc(yarp::dev::Nav2D::Map2DLocation &loc)
A class for storing options and configuration information.
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...