35 std::lock_guard lock(m_odometry_mutex);
57 if (!config.
check(
"period",
"refresh period of the broadcasted values in s")) {
58 yCInfo(FAKEODOMETRY) <<
"Using default 'period' parameter";
62 yCInfo(FAKEODOMETRY) <<
"thread period set to " << m_period <<
"s";
63 PeriodicThread::setPeriod(m_period);
64 return PeriodicThread::start();
70 if (PeriodicThread::isRunning())
72 PeriodicThread::stop();
80 std::lock_guard lock(m_odometry_mutex);
90 if (timestamp!=
nullptr)
92 *timestamp = m_timestamp;
100 std::lock_guard lock(m_odometry_mutex);
101 m_odometryData.
odom_x = 0;
102 m_odometryData.
odom_y = 0;
constexpr double default_period
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...
double base_vel_x
velocity of the robot [m/s] expressed in the robot reference frame
double odom_vel_y
velocity of the robot [m/s] expressed in the world reference frame
double base_vel_theta
angular velocity of the robot [deg/s] expressed in the robot reference frame
double odom_vel_theta
angular velocity of the robot [deg/s] expressed in the world reference frame
double base_vel_y
velocity of the robot [m/s] expressed in the robot 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
double odom_vel_x
velocity of the robot [m/s] expressed in the world reference frame
static double scalar()
Get a random number from a uniform distribution in the range [0,1].
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
#define yCInfo(component,...)
#define yCTrace(component,...)
#define YARP_LOG_COMPONENT(name,...)
double now()
Return the current time in seconds, relative to an arbitrary starting point.