30#define M_PI 3.14159265358979323846
33#define RAD2DEG 180/M_PI
34#define DEG2RAD M_PI/180
42 std::lock_guard<std::mutex> lock(
m_mutex);
46 return yarp::dev::ReturnValue_ok;
51 std::lock_guard<std::mutex> lock(
m_mutex);
61 for (
int i = 0;
i < 10;
i++)
63 yarp::dev::Map2DLocation
newloc=loc;
64 unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
65 std::default_random_engine
generator(seed);
66 std::uniform_real_distribution<double>
dist(-1, 1);
67 std::uniform_real_distribution<double>
dist_t(-180, 180);
77 return yarp::dev::ReturnValue_ok;
82 std::lock_guard<std::mutex> lock(
m_mutex);
86 return yarp::dev::ReturnValue_ok;
91 std::lock_guard<std::mutex> lock(
m_mutex);
95 return yarp::dev::ReturnValue_ok;
100 std::lock_guard<std::mutex> lock(
m_mutex);
104 return yarp::dev::ReturnValue_ok;
109 std::lock_guard<std::mutex> lock(
m_mutex);
113 return yarp::dev::ReturnValue_ok;
118 std::lock_guard<std::mutex> lock(
m_mutex);
126 return yarp::dev::ReturnValue_ok;
156 std::lock_guard<std::mutex> lock(
m_mutex);
159 return yarp::dev::ReturnValue_ok;
164 std::lock_guard<std::mutex> lock(
m_mutex);
167 return yarp::dev::ReturnValue_ok;
172 std::lock_guard<std::mutex> lock(
m_mutex);
define control board standard interfaces
contains the definition of a Vector type
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
virtual bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
fakeLocalizerThread * locThread
virtual bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue getLocalizationStatus(yarp::dev::Nav2D::LocalizationStatusEnum &status) override
Gets the current status of the localization task.
yarp::dev::ReturnValue startLocalizationService() override
Starts the localization service.
yarp::dev::ReturnValue stopLocalizationService() override
Stops the localization service.
yarp::dev::ReturnValue setInitialPose(const yarp::dev::Nav2D::Map2DLocation &loc) override
Sets the initial pose for the localization algorithm which estimates the current position of the robo...
yarp::dev::ReturnValue getEstimatedPoses(std::vector< yarp::dev::Nav2D::Map2DLocation > &poses) override
Gets a set of pose estimates computed by the localization algorithm.
yarp::dev::ReturnValue getEstimatedOdometry(yarp::dev::OdometryData &odom) override
Gets the estimated odometry the robot, including its velocity expressed in the world and in the local...
yarp::dev::ReturnValue getCurrentPosition(yarp::dev::Nav2D::Map2DLocation &loc) override
Gets the current position of the robot w.r.t world reference frame.
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
virtual void threadRelease() override
Release method.
fakeLocalizerThread(double _period)
double m_last_statistics_printed
bool initializeLocalization(const yarp::dev::Nav2D::Map2DLocation &loc)
yarp::dev::Nav2D::Map2DLocation m_initial_odom
std::mutex m_mutex_thread
double m_last_locdata_received
std::string map_id
name of the map
double theta
orientation [deg] in the map reference frame
double y
y position of the location [m], expressed in the map reference frame
double x
x position of the location [m], expressed in the map reference frame
double odom_x
position of the robot [m], expressed in the world reference frame
double odom_y
position of the robot [m], expressed in the world reference frame
double odom_theta
orientation the robot [deg], expressed in the world reference frame
@ return_value_error_method_failed
Method is deprecated.
A mini-server for performing network communication in the background.
An abstraction for a periodic thread.
bool start()
Call this to start the thread.
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
A class for storing options and configuration information.
A base class for nested structures that can be searched.
void resize(size_t r, size_t c)
Resize the matrix, if matrix is not empty preserve old content.
const Matrix & eye()
Build an identity matrix, don't resize.
T * data()
Return a pointer to the first element of the vector.
#define yCInfo(component,...)
#define yCError(component,...)
#define yCWarning(component,...)
#define YARP_LOG_COMPONENT(name,...)
@ localization_status_localized_ok
For streams capable of holding different kinds of content, check what they actually have.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
An interface to the operating system, including Port based communication.