18#define DEFAULT_THREAD_PERIOD 0.01
21#define M_PI 3.14159265358979323846
28#define CHECK_POINTER(xxx) {if (xxx==nullptr) {yCError(LOCALIZATION2DSERVER, "Invalid interface"); return false;}}
32 std::lock_guard <std::mutex> lg(m_mutex);
34 {
if (m_iLoc ==
nullptr) {
yCError(LOCALIZATION2DSERVER,
"Invalid interface");
return false; }}
38 yCError(LOCALIZATION2DSERVER,
"Unable to startLocalizationService");
46 std::lock_guard <std::mutex> lg(m_mutex);
48 {
if (m_iLoc ==
nullptr) {
yCError(LOCALIZATION2DSERVER,
"Invalid interface");
return false; }}
52 yCError(LOCALIZATION2DSERVER,
"Unable to stopLocalizationService");
60 std::lock_guard <std::mutex> lg(m_mutex);
70 {
if (m_iLoc ==
nullptr) {
yCError(LOCALIZATION2DSERVER,
"Invalid interface");
return ret; }}
75 yCError(LOCALIZATION2DSERVER,
"Unable to getLocalizationStatus");
89 std::lock_guard <std::mutex> lg(m_mutex);
92 {
if (m_iLoc ==
nullptr) {
yCError(LOCALIZATION2DSERVER,
"Invalid interface");
return ret; }}
93 std::vector<yarp::dev::Nav2D::Map2DLocation> poses;
96 yCError(LOCALIZATION2DSERVER,
"Unable to getEstimatedPoses");
109 std::lock_guard <std::mutex> lg(m_mutex);
119 {
if (m_iLoc ==
nullptr) {
yCError(LOCALIZATION2DSERVER,
"Invalid interface");
return ret; }}
124 yCError(LOCALIZATION2DSERVER,
"Unable to getCurrentPosition");
137 std::lock_guard <std::mutex> lg(m_mutex);
140 {
if (m_iLoc ==
nullptr) {
yCError(LOCALIZATION2DSERVER,
"Invalid interface");
return ret; }}
145 yCError(LOCALIZATION2DSERVER,
"Unable to getCurrentPosition");
159 std::lock_guard <std::mutex> lg(m_mutex);
169 {
if (m_iLoc ==
nullptr) {
yCError(LOCALIZATION2DSERVER,
"Invalid interface");
return ret; }}
174 yCError(LOCALIZATION2DSERVER,
"Unable to getEstimatedOdometry");
187 std::lock_guard <std::mutex> lg(m_mutex);
189 {
if (m_iLoc ==
nullptr) {
yCError(LOCALIZATION2DSERVER,
"Invalid interface");
return false; }}
192 yCError(LOCALIZATION2DSERVER,
"Unable to setInitialPose");
200 std::lock_guard <std::mutex> lg(m_mutex);
202 {
if (m_iLoc ==
nullptr) {
yCError(LOCALIZATION2DSERVER,
"Invalid interface");
return false; }}
206 yCError(LOCALIZATION2DSERVER,
"Unable to setInitialPose");
bool start_localization_service_RPC() override
yarp::dev::OdometryData m_current_odometry
return_get_current_position1 get_current_position1_RPC() override
return_get_current_position2 get_current_position2_RPC() override
yarp::dev::Nav2D::LocalizationStatusEnum m_current_status
bool set_initial_pose2_RPC(const yarp::dev::Nav2D::Map2DLocation &loc, const yarp::sig::Matrix &cov) override
bool stop_localization_service_RPC() override
return_get_estimated_odometry get_estimated_odometry_RPC() override
bool set_initial_pose1_RPC(const yarp::dev::Nav2D::Map2DLocation &loc) override
return_get_localization_status get_localization_status_RPC() override
bool m_getdata_using_periodic_thread
yarp::dev::Nav2D::Map2DLocation m_current_position
return_get_estimated_poses get_estimated_poses_RPC() override
virtual bool getEstimatedOdometry(yarp::dev::OdometryData &odom)=0
Gets the estimated odometry the robot, including its velocity expressed in the world and in the local...
virtual bool getCurrentPosition(yarp::dev::Nav2D::Map2DLocation &loc)=0
Gets the current position of the robot w.r.t world reference frame.
virtual bool getEstimatedPoses(std::vector< yarp::dev::Nav2D::Map2DLocation > &poses)=0
Gets a set of pose estimates computed by the localization algorithm.
virtual bool startLocalizationService()=0
Starts the localization service.
virtual bool stopLocalizationService()=0
Stops the localization service.
virtual bool setInitialPose(const yarp::dev::Nav2D::Map2DLocation &loc)=0
Sets the initial pose for the localization algorithm which estimates the current position of the robo...
virtual bool getLocalizationStatus(LocalizationStatusEnum &status)=0
Gets the current status of the localization task.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
@ localization_status_error
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.