YARP
Yet Another Robot Platform
Odometry2DServerImpl.cpp
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
7#include <yarp/os/LogStream.h>
9
12using namespace yarp::os;
13using namespace yarp::dev;
14using namespace yarp::dev::Nav2D;
15using namespace std;
16
17#define DEFAULT_THREAD_PERIOD 0.01
18
19#ifndef M_PI
20#define M_PI 3.14159265358979323846
21#endif
22
23namespace {
24YARP_LOG_COMPONENT(ODOM2D_RPC, "yarp.device.map2D_nws_yarp.IMap2DRPCd")
25}
26
27#define CHECK_POINTER(xxx) {if (xxx==nullptr) {yCError(ODOM2D_RPC, "Invalid interface"); return false;}}
28
30{
31 std::lock_guard <std::mutex> lg(m_mutex);
32
33 {if (m_iOdom == nullptr) { yCError(ODOM2D_RPC, "Invalid interface"); return false; }}
34
35 if (!m_iOdom->resetOdometry())
36 {
37 yCError(ODOM2D_RPC, "Unable to resetOdometry");
38 return false;
39 }
40 return true;
41}
bool reset_odometry_RPC() override
virtual bool resetOdometry()=0
Resets the odometry of the robot to zero.
#define yCError(component,...)
Definition: LogComponent.h:213
#define YARP_LOG_COMPONENT(name,...)
Definition: LogComponent.h:76
STL namespace.
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.