YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
INavigation2D.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_DEV_INAVIGATION2D_H
7#define YARP_DEV_INAVIGATION2D_H
8
9#include <yarp/os/Vocab.h>
10#include <yarp/dev/api.h>
12#include <yarp/dev/IMap2D.h>
15#include <yarp/dev/Map2DPath.h>
16#include <yarp/dev/Map2DArea.h>
17#include <yarp/dev/MapGrid2D.h>
18#include <vector>
19#include <limits>
20#include <string>
21
22namespace yarp::dev::Nav2D {
23class INavigation2DVelocityActions;
24class INavigation2DTargetActions;
25class INavigation2DControlActions;
26class INavigation2DExtraActions;
27class INavigation2D;
28
42
44{
45 global_map = yarp::os::createVocab32('g', 'l', 'o', 'b'),
46 local_map = yarp::os::createVocab32('l', 'o', 'c', 'a')
47};
48
54
55namespace INavigation2DHelpers
56{
57 //converts a string to a NavigationStatusEnum.
58 //navigation_status_error is returned if the string is not recognized.
60
61 //converts a NavigationStatusEnum to a string.
63} // namespace INavigation2DHelpers
64} // namespace yarp::dev::Nav2D
65
67{
68public:
73
82 virtual yarp::dev::ReturnValue applyVelocityCommand(double x_vel, double y_vel, double theta_vel, double timeout = 0.1) = 0;
83
91 virtual yarp::dev::ReturnValue getLastVelocityCommand(double& x_vel, double& y_vel, double& theta_vel) = 0;
92};
93
149
213
215{
216public:
222 virtual yarp::dev::ReturnValue gotoTargetByLocationName(std::string location_or_area_name) = 0;
223
230 virtual yarp::dev::ReturnValue checkInsideArea(std::string area_name, bool& is_inside) = 0;
231
238 virtual yarp::dev::ReturnValue checkInsideArea(Nav2D::Map2DArea area, bool& is_inside) = 0;
239
248 virtual yarp::dev::ReturnValue checkNearToLocation(Nav2D::Map2DLocation loc, bool& is_near, double linear_tolerance, double angular_tolerance = std::numeric_limits<double>::infinity()) = 0;
249
258 virtual yarp::dev::ReturnValue checkNearToLocation(std::string location_name, bool& is_near, double linear_tolerance, double angular_tolerance = std::numeric_limits<double>::infinity()) = 0;
259
265 virtual yarp::dev::ReturnValue getNameOfCurrentTarget(std::string& location_name) = 0;
266
272 virtual yarp::dev::ReturnValue storeCurrentPosition(std::string location_name) = 0;
273
278};
279
298
305
306#endif // YARP_DEV_INAVIGATION2D_H
constexpr yarp::conf::vocab32_t VOCAB_NAV_RESUME
constexpr yarp::conf::vocab32_t VOCAB_NAV_GET_CURRENT_WAYPOINT
constexpr yarp::conf::vocab32_t VOCAB_NAV_GET_NAVIGATION_WAYPOINTS
constexpr yarp::conf::vocab32_t VOCAB_NAV_GET_NAV_MAP
constexpr yarp::conf::vocab32_t VOCAB_NAV_STOP
constexpr yarp::conf::vocab32_t VOCAB_NAV_SUSPEND
contains the definition of a Map2DArea type
contains the definition of a Map2DLocation type
contains the definition of a Map2DPath type
contains the definition of a map type
ILocalization2D interface.
IMap2D Interface.
Definition IMap2D.h:30
virtual yarp::dev::ReturnValue suspendNavigation(const double time_s=std::numeric_limits< double >::infinity())=0
Ask to the robot to suspend the current navigation task for a defined amount of time.
virtual yarp::dev::ReturnValue getCurrentNavigationWaypoint(yarp::dev::Nav2D::Map2DLocation &curr_waypoint)=0
Returns the current waypoint pursued by the navigation algorithm.
virtual yarp::dev::ReturnValue getAllNavigationWaypoints(yarp::dev::Nav2D::TrajectoryTypeEnum trajectory_type, yarp::dev::Nav2D::Map2DPath &waypoints)=0
Returns the list of waypoints generated by the navigation algorithm.
virtual yarp::dev::ReturnValue resumeNavigation()=0
Resume a previously suspended navigation task.
virtual yarp::dev::ReturnValue recomputeCurrentNavigationPath()=0
Forces the navigation system to recompute the path from the current robot position to the current goa...
virtual yarp::dev::ReturnValue getNavigationStatus(NavigationStatusEnum &status)=0
Gets the current status of the navigation task.
virtual yarp::dev::ReturnValue stopNavigation()=0
Terminates the current navigation task.
virtual yarp::dev::ReturnValue getCurrentNavigationMap(yarp::dev::Nav2D::NavigationMapTypeEnum map_type, yarp::dev::Nav2D::MapGrid2D &map)=0
Returns the current navigation map processed by the navigation algorithm.
virtual yarp::dev::ReturnValue checkNearToLocation(std::string location_name, bool &is_near, double linear_tolerance, double angular_tolerance=std::numeric_limits< double >::infinity())=0
Check if the robot is currently near to the specified area.
virtual yarp::dev::ReturnValue checkInsideArea(std::string area_name, bool &is_inside)=0
Check if the robot is currently inside the specified area.
virtual yarp::dev::ReturnValue checkInsideArea(Nav2D::Map2DArea area, bool &is_inside)=0
Check if the robot is currently inside the specified area.
virtual yarp::dev::ReturnValue getNameOfCurrentTarget(std::string &location_name)=0
Gets the name of the current target, if available (set by gotoTargetByLocationName)
virtual yarp::dev::ReturnValue storeCurrentPosition(std::string location_name)=0
Store the current location of the robot.
virtual yarp::dev::ReturnValue gotoTargetByLocationName(std::string location_or_area_name)=0
Ask the robot to reach a previously stored location/area.
virtual yarp::dev::ReturnValue checkNearToLocation(Nav2D::Map2DLocation loc, bool &is_near, double linear_tolerance, double angular_tolerance=std::numeric_limits< double >::infinity())=0
Check if the robot is currently near to the specified area.
virtual yarp::dev::ReturnValue getAbsoluteLocationOfCurrentTarget(yarp::dev::Nav2D::Map2DLocation &loc)=0
Gets the last navigation target in the world reference frame.
virtual yarp::dev::ReturnValue getRelativeLocationOfCurrentTarget(double &x, double &y, double &theta)=0
Gets the last navigation target in the robot reference frame.
virtual yarp::dev::ReturnValue gotoTargetByRelativeLocation(double x, double y, double theta)=0
Ask the robot to reach a position defined in the robot reference frame.
virtual yarp::dev::ReturnValue gotoTargetByRelativeLocation(double x, double y)=0
Ask the robot to reach a position defined in the robot reference frame.
virtual yarp::dev::ReturnValue followPath(const yarp::dev::Nav2D::Map2DPath &path)=0
Ask the robot to navigate through a set of locations defined in the world reference frame.
virtual yarp::dev::ReturnValue gotoTargetByAbsoluteLocation(yarp::dev::Nav2D::Map2DLocation loc)=0
Ask the robot to reach a position defined in the world reference frame.
virtual yarp::dev::ReturnValue getLastVelocityCommand(double &x_vel, double &y_vel, double &theta_vel)=0
Returns the last applied velocity command.
virtual yarp::dev::ReturnValue applyVelocityCommand(double x_vel, double y_vel, double theta_vel, double timeout=0.1)=0
Apply a velocity command.
An interface to control the navigation of a mobile robot in a 2D environment.
virtual ~INavigation2D()
Destructor.
std::int32_t vocab32_t
Definition numeric.h:78
std::string statusToString(NavigationStatusEnum status)
NavigationStatusEnum stringToStatus(std::string s)
@ navigation_status_preparing_before_move
@ navigation_status_waiting_obstacle
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition Vocab.h:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18