YARP
Yet Another Robot Platform
FakeOdometry.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_FAKEODOMETRY_H
7#define YARP_FAKEODOMETRY_H
8
10#include <yarp/sig/Vector.h>
13
14constexpr double default_period = 0.02;
15
59{
60public:
62
63 // PeriodicThread
64 virtual bool threadInit() override;
65 virtual void threadRelease() override;
66 virtual void run() override;
67
68 // DeviceDriver
69 bool open(yarp::os::Searchable& config) override;
70 bool close() override;
71
72 // IOdometry2D
73 bool getOdometry(yarp::dev::OdometryData& odom, double* timestamp=nullptr) override;
74 bool resetOdometry() override;
75
76private:
77 yarp::dev::OdometryData m_odometryData;
78
79 std::mutex m_odometry_mutex;
80 double m_period;
81 double m_timestamp=0;
82};
83
84#endif // YARP_FAKEODOMETRY_H
constexpr double default_period
Definition: FakeOdometry.h:14
contains the definition of a Vector type
FakeOdometry: A device for generating a fake odometry. This device will generate the odometry and the...
Definition: FakeOdometry.h:59
virtual void threadRelease() override
Release method.
virtual void run() override
Loop function.
virtual bool threadInit() override
Initialization method.
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool resetOdometry() override
Resets the odometry of the robot to zero.
bool getOdometry(yarp::dev::OdometryData &odom, double *timestamp=nullptr) override
Gets the odometry of the robot, including its velocity expressed in the world and in the local refere...
Interface implemented by all device drivers.
Definition: DeviceDriver.h:30
IOdometry2D interface.
Definition: IOdometry2D.h:22
An abstraction for a periodic thread.
A base class for nested structures that can be searched.
Definition: Searchable.h:63