YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

navigation2D_nwc_yarp: A device which allows a client application to perform navigation tasks, such as commanding the robot to reach a specific location in a map. More...

#include <networkWrappers/navigation2D_nwc_yarp/Navigation2D_nwc_yarp.h>

+ Inheritance diagram for Navigation2D_nwc_yarp:

Public Member Functions

bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
bool parse_respond_string (const yarp::os::Bottle &command, yarp::os::Bottle &reply)
 
virtual bool read (yarp::os::ConnectionReader &connection) override
 Read this object from a network connection.
 
yarp::dev::ReturnValue checkInsideArea (yarp::dev::Nav2D::Map2DArea area, bool &is_inside) override
 Check if the robot is currently inside the specified area.
 
yarp::dev::ReturnValue checkInsideArea (std::string area_name, bool &is_inside) override
 Check if the robot is currently inside the specified area.
 
yarp::dev::ReturnValue checkNearToLocation (yarp::dev::Nav2D::Map2DLocation loc, bool &is_near, double linear_tolerance, double angular_tolerance=std::numeric_limits< double >::infinity()) override
 Check if the robot is currently near to the specified area.
 
yarp::dev::ReturnValue checkNearToLocation (std::string location_name, bool &is_near, double linear_tolerance, double angular_tolerance=std::numeric_limits< double >::infinity()) override
 Check if the robot is currently near to the specified area.
 
yarp::dev::ReturnValue storeCurrentPosition (std::string location_name) override
 Store the current location of the robot.
 
yarp::dev::ReturnValue getNavigationStatus (yarp::dev::Nav2D::NavigationStatusEnum &status) override
 Gets the current status of the navigation task.
 
yarp::dev::ReturnValue recomputeCurrentNavigationPath () override
 Forces the navigation system to recompute the path from the current robot position to the current goal.
 
yarp::dev::ReturnValue stopNavigation () override
 Terminates the current navigation task.
 
yarp::dev::ReturnValue suspendNavigation (const double time_s) override
 Ask to the robot to suspend the current navigation task for a defined amount of time.
 
yarp::dev::ReturnValue resumeNavigation () override
 Resume a previously suspended navigation task.
 
yarp::dev::ReturnValue getAllNavigationWaypoints (yarp::dev::Nav2D::TrajectoryTypeEnum trajectory_type, yarp::dev::Nav2D::Map2DPath &waypoints) override
 Returns the list of waypoints generated by the navigation algorithm.
 
yarp::dev::ReturnValue getCurrentNavigationWaypoint (yarp::dev::Nav2D::Map2DLocation &curr_waypoint) override
 Returns the current waypoint pursued by the navigation algorithm.
 
yarp::dev::ReturnValue getCurrentNavigationMap (yarp::dev::Nav2D::NavigationMapTypeEnum map_type, yarp::dev::Nav2D::MapGrid2D &map) override
 Returns the current navigation map processed by the navigation algorithm.
 
yarp::dev::ReturnValue gotoTargetByAbsoluteLocation (yarp::dev::Nav2D::Map2DLocation loc) override
 Ask the robot to reach a position defined in the world reference frame.
 
yarp::dev::ReturnValue gotoTargetByLocationName (std::string location_name) override
 Ask the robot to reach a previously stored location/area.
 
yarp::dev::ReturnValue gotoTargetByRelativeLocation (double x, double y, double theta) override
 Ask the robot to reach a position defined in the robot reference frame.
 
yarp::dev::ReturnValue gotoTargetByRelativeLocation (double x, double y) override
 Ask the robot to reach a position defined in the robot reference frame.
 
yarp::dev::ReturnValue followPath (const yarp::dev::Nav2D::Map2DPath &locs) override
 Ask the robot to navigate through a set of locations defined in the world reference frame.
 
yarp::dev::ReturnValue getAbsoluteLocationOfCurrentTarget (yarp::dev::Nav2D::Map2DLocation &loc) override
 Gets the last navigation target in the world reference frame.
 
yarp::dev::ReturnValue getNameOfCurrentTarget (std::string &location_name) override
 Gets the name of the current target, if available (set by gotoTargetByLocationName)
 
yarp::dev::ReturnValue getRelativeLocationOfCurrentTarget (double &x, double &y, double &theta) override
 Gets the last navigation target in the robot reference frame.
 
yarp::dev::ReturnValue applyVelocityCommand (double x_vel, double y_vel, double theta_vel, double timeout=0.1) override
 Apply a velocity command.
 
yarp::dev::ReturnValue getLastVelocityCommand (double &x_vel, double &y_vel, double &theta_vel) override
 Returns the last applied velocity command.
 
yarp::dev::ReturnValue getCurrentPosition (yarp::dev::Nav2D::Map2DLocation &loc) override
 Gets the current position of the robot w.r.t world reference frame.
 
yarp::dev::ReturnValue getEstimatedOdometry (yarp::dev::OdometryData &odom) override
 Gets the estimated odometry the robot, including its velocity expressed in the world and in the local reference frame.
 
yarp::dev::ReturnValue setInitialPose (const yarp::dev::Nav2D::Map2DLocation &loc) override
 Sets the initial pose for the localization algorithm which estimates the current position of the robot w.r.t world reference frame.
 
yarp::dev::ReturnValue getLocalizationStatus (yarp::dev::Nav2D::LocalizationStatusEnum &status) override
 Gets the current status of the localization task.
 
yarp::dev::ReturnValue getEstimatedPoses (std::vector< yarp::dev::Nav2D::Map2DLocation > &poses) override
 Gets a set of pose estimates computed by the localization algorithm.
 
yarp::dev::ReturnValue setInitialPose (const yarp::dev::Nav2D::Map2DLocation &loc, const yarp::sig::Matrix &cov) override
 Sets the initial pose for the localization algorithm which estimates the current position of the robot w.r.t world reference frame.
 
yarp::dev::ReturnValue getCurrentPosition (yarp::dev::Nav2D::Map2DLocation &loc, yarp::sig::Matrix &cov) override
 Gets the current position of the robot w.r.t world reference frame, plus the covariance.
 
yarp::dev::ReturnValue startLocalizationService () override
 Starts the localization service.
 
yarp::dev::ReturnValue stopLocalizationService () override
 Stops the localization service.
 
yarp::dev::ReturnValue storeLocation (std::string location_name, yarp::dev::Nav2D::Map2DLocation loc) override
 Store a location specified by the user in the world reference frame.
 
yarp::dev::ReturnValue storeArea (std::string location_name, yarp::dev::Nav2D::Map2DArea area) override
 Store an area.
 
yarp::dev::ReturnValue storePath (std::string path_name, yarp::dev::Nav2D::Map2DPath path) override
 Store a path.
 
yarp::dev::ReturnValue getLocation (std::string location_name, yarp::dev::Nav2D::Map2DLocation &loc) override
 Retrieves a location specified by the user in the world reference frame.
 
yarp::dev::ReturnValue getArea (std::string location_name, yarp::dev::Nav2D::Map2DArea &area) override
 Retrieves an area.
 
yarp::dev::ReturnValue getPath (std::string path_name, yarp::dev::Nav2D::Map2DPath &path) override
 Retrieves a path.
 
yarp::dev::ReturnValue renameLocation (std::string original_name, std::string new_name) override
 Searches for a location and renames it.
 
yarp::dev::ReturnValue renameArea (std::string original_name, std::string new_name) override
 Searches for an area and renames it.
 
yarp::dev::ReturnValue renamePath (std::string original_name, std::string new_name) override
 Searches for a path and renames it.
 
yarp::dev::ReturnValue deleteLocation (std::string location_name) override
 Delete a location.
 
yarp::dev::ReturnValue deleteArea (std::string location_name) override
 Delete an area.
 
yarp::dev::ReturnValue deletePath (std::string path_name) override
 Delete a path.
 
yarp::dev::ReturnValue getLocationsList (std::vector< std::string > &locations) override
 Get a list of the names of all stored locations.
 
yarp::dev::ReturnValue getAreasList (std::vector< std::string > &locations) override
 Get a list of the names of all stored areas.
 
yarp::dev::ReturnValue getPathsList (std::vector< std::string > &paths) override
 Get a list of the names of all stored paths.
 
yarp::dev::ReturnValue getAllLocations (std::vector< yarp::dev::Nav2D::Map2DLocation > &locations) override
 Get a list of all stored locations.
 
yarp::dev::ReturnValue getAllAreas (std::vector< yarp::dev::Nav2D::Map2DArea > &areas) override
 Get a list of all stored areas.
 
yarp::dev::ReturnValue getAllPaths (std::vector< yarp::dev::Nav2D::Map2DPath > &paths) override
 Get a list of all stored paths.
 
yarp::dev::ReturnValue clearAllLocations () override
 Delete all stored locations.
 
yarp::dev::ReturnValue clearAllAreas () override
 Delete all stored areas.
 
yarp::dev::ReturnValue clearAllPaths () override
 Delete all stored paths.
 
yarp::dev::ReturnValue clearAllMaps () override
 Removes all the registered maps from the server.
 
yarp::dev::ReturnValue remove_map (std::string map_name) override
 Removes a map from the map server.
 
yarp::dev::ReturnValue store_map (const yarp::dev::Nav2D::MapGrid2D &map) override
 Stores a map into the map server.
 
yarp::dev::ReturnValue get_map (std::string map_name, yarp::dev::Nav2D::MapGrid2D &map) override
 Gets a map from the map server.
 
yarp::dev::ReturnValue get_map_names (std::vector< std::string > &map_names) override
 Gets a list containing the names of all registered maps.
 
yarp::dev::ReturnValue clearAllMapsTemporaryFlags () override
 Clear all temporary flags from all stored maps.
 
yarp::dev::ReturnValue clearMapTemporaryFlags (std::string map_name) override
 Clear all temporary flags from a specific map.
 
yarp::dev::ReturnValue saveMapsCollection (std::string maps_collection_file) override
 Save a collection of maps to disk.
 
yarp::dev::ReturnValue loadMapsCollection (std::string maps_collection_file) override
 Load a collection of maps from disk.
 
yarp::dev::ReturnValue saveLocationsAndExtras (std::string locations_collection_file) override
 Save a collection of locations/area/paths etc to disk.
 
yarp::dev::ReturnValue loadLocationsAndExtras (std::string locations_collection_file) override
 Load a collection of locations/areas/paths etc from disk.
 
yarp::dev::ReturnValue saveMapToDisk (std::string map_name, std::string file_name) override
 Save a map to disk.
 
yarp::dev::ReturnValue loadMapFromDisk (std::string file_name) override
 Load a map from disk.
 
yarp::dev::ReturnValue enableMapsCompression (bool enable) override
 Enable/disables maps compression over the network.
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from yarp::dev::Nav2D::INavigation2D
virtual ~INavigation2D ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::Nav2D::INavigation2DTargetActions
virtual ~INavigation2DTargetActions ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::Nav2D::INavigation2DControlActions
virtual ~INavigation2DControlActions ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::Nav2D::INavigation2DVelocityActions
virtual ~INavigation2DVelocityActions ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::Nav2D::INavigation2DExtraActions
virtual ~INavigation2DExtraActions ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::Nav2D::IMap2D
virtual ~IMap2D ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::Nav2D::ILocalization2D
virtual ~ILocalization2D ()
 Destructor.
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor.
 
virtual Type getReadType () const
 
- Public Member Functions inherited from Navigation2D_nwc_yarp_ParamsParser
 Navigation2D_nwc_yarp_ParamsParser ()
 
 ~Navigation2D_nwc_yarp_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
 Return the value (represented as a string) of the requested parameter.
 
std::string getConfiguration () const override
 Return the configuration of the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Protected Attributes

IMap2DMsgs m_map_RPC
 
ILocalization2DMsgs m_loc_RPC
 
INavigation2DMsgs m_nav_RPC
 
std::mutex m_mutex
 
yarp::os::Port m_rpc_port_to_navigation_server
 
yarp::os::Port m_rpc_port_to_Map2DServer
 
yarp::os::Port m_rpc_port_to_localization_server
 
yarp::os::Port m_rpc_port_user_commands
 

Additional Inherited Members

- Public Attributes inherited from Navigation2D_nwc_yarp_ParamsParser
const std::string m_device_classname = {"Navigation2D_nwc_yarp"}
 
const std::string m_device_name = {"navigation2D_nwc_yarp"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
std::string m_provided_configuration
 
const std::string m_local_defaultValue = {""}
 
const std::string m_navigation_server_defaultValue = {""}
 
const std::string m_map_locations_server_defaultValue = {""}
 
const std::string m_localization_server_defaultValue = {""}
 
std::string m_local = {}
 
std::string m_navigation_server = {}
 
std::string m_map_locations_server = {}
 
std::string m_localization_server = {}
 

Detailed Description

navigation2D_nwc_yarp: A device which allows a client application to perform navigation tasks, such as commanding the robot to reach a specific location in a map.

Navigation2D_nwc_yarp

Parameters required by this device are shown in class: Navigation2D_nwc_yarp_ParamsParser

Definition at line 38 of file Navigation2D_nwc_yarp.h.

Member Function Documentation

◆ applyVelocityCommand()

ReturnValue Navigation2D_nwc_yarp::applyVelocityCommand ( double  x_vel,
double  y_vel,
double  theta_vel,
double  timeout = 0.1 
)
overridevirtual

Apply a velocity command.

Velocities are expressed in the robot reference frame.

Parameters
x[m/s]
y[m/s]
theta[deg/s]
timeoutThe velocity command expires after the specified amount of time (by default 0.1 seconds)
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DVelocityActions.

Definition at line 42 of file Navigation2D_nwc_yarp_iVelActs.cpp.

◆ checkInsideArea() [1/2]

ReturnValue Navigation2D_nwc_yarp::checkInsideArea ( std::string  area_name,
bool is_inside 
)
overridevirtual

Check if the robot is currently inside the specified area.

Parameters
area_namethe name of an area previously saved
Returns
is_inside true if the robot is inside the area.
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DExtraActions.

Definition at line 236 of file Navigation2D_nwc_yarp.cpp.

◆ checkInsideArea() [2/2]

ReturnValue Navigation2D_nwc_yarp::checkInsideArea ( yarp::dev::Nav2D::Map2DArea  area,
bool is_inside 
)
overridevirtual

Check if the robot is currently inside the specified area.

Parameters
areathe area to be checked
Returns
is_inside true if the robot is inside the area.
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DExtraActions.

Definition at line 221 of file Navigation2D_nwc_yarp.cpp.

◆ checkNearToLocation() [1/2]

ReturnValue Navigation2D_nwc_yarp::checkNearToLocation ( std::string  location_name,
bool is_near,
double  linear_tolerance,
double  angular_tolerance = std::numeric_limits< double >::infinity() 
)
overridevirtual

Check if the robot is currently near to the specified area.

Parameters
location_namethe name of the location: it will be searched in the server
Returns
is_near true if the robot is near to the area.
Parameters
linear_tolerancelinear tolerance [m]
angular_tolerance[deg]
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DExtraActions.

Definition at line 198 of file Navigation2D_nwc_yarp.cpp.

◆ checkNearToLocation() [2/2]

ReturnValue Navigation2D_nwc_yarp::checkNearToLocation ( yarp::dev::Nav2D::Map2DLocation  loc,
bool is_near,
double  linear_tolerance,
double  angular_tolerance = std::numeric_limits< double >::infinity() 
)
overridevirtual

Check if the robot is currently near to the specified area.

Parameters
locthe location to be checked
Returns
is_near true if the robot is near to the area.
Parameters
linear_tolerancelinear tolerance [m]
angular_tolerance[deg 0-360]
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DExtraActions.

Definition at line 183 of file Navigation2D_nwc_yarp.cpp.

◆ clearAllAreas()

ReturnValue Navigation2D_nwc_yarp::clearAllAreas ( )
overridevirtual

Delete all stored areas.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 248 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ clearAllLocations()

ReturnValue Navigation2D_nwc_yarp::clearAllLocations ( )
overridevirtual

Delete all stored locations.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 242 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ clearAllMaps()

ReturnValue Navigation2D_nwc_yarp::clearAllMaps ( )
overridevirtual

Removes all the registered maps from the server.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 46 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ clearAllMapsTemporaryFlags()

ReturnValue Navigation2D_nwc_yarp::clearAllMapsTemporaryFlags ( )
overridevirtual

Clear all temporary flags from all stored maps.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 254 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ clearAllPaths()

ReturnValue Navigation2D_nwc_yarp::clearAllPaths ( )
overridevirtual

Delete all stored paths.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 266 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ clearMapTemporaryFlags()

ReturnValue Navigation2D_nwc_yarp::clearMapTemporaryFlags ( std::string  map_name)
overridevirtual

Clear all temporary flags from a specific map.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 260 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ close()

bool Navigation2D_nwc_yarp::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 127 of file Navigation2D_nwc_yarp.cpp.

◆ deleteArea()

ReturnValue Navigation2D_nwc_yarp::deleteArea ( std::string  area_name)
overridevirtual

Delete an area.

Parameters
area_namethe name of the area
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 218 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ deleteLocation()

ReturnValue Navigation2D_nwc_yarp::deleteLocation ( std::string  location_name)
overridevirtual

Delete a location.

Parameters
location_namethe name of the location
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 206 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ deletePath()

ReturnValue Navigation2D_nwc_yarp::deletePath ( std::string  path_name)
overridevirtual

Delete a path.

Parameters
path_namethe name of the path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 224 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ enableMapsCompression()

ReturnValue Navigation2D_nwc_yarp::enableMapsCompression ( bool  enable)
overridevirtual

Enable/disables maps compression over the network.

Parameters
enable
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 308 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ followPath()

ReturnValue Navigation2D_nwc_yarp::followPath ( const yarp::dev::Nav2D::Map2DPath path)
overridevirtual

Ask the robot to navigate through a set of locations defined in the world reference frame.

Parameters
paththe locations to be reached
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 73 of file Navigation2D_nwc_yarp_iNav2DTarget.cpp.

◆ get_map()

ReturnValue Navigation2D_nwc_yarp::get_map ( std::string  map_name,
yarp::dev::Nav2D::MapGrid2D map 
)
overridevirtual

Gets a map from the map server.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 33 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ get_map_names()

ReturnValue Navigation2D_nwc_yarp::get_map_names ( std::vector< std::string > &  map_names)
overridevirtual

Gets a list containing the names of all registered maps.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 52 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getAbsoluteLocationOfCurrentTarget()

ReturnValue Navigation2D_nwc_yarp::getAbsoluteLocationOfCurrentTarget ( yarp::dev::Nav2D::Map2DLocation loc)
overridevirtual

Gets the last navigation target in the world reference frame.

Parameters
locthe location of the robot
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 45 of file Navigation2D_nwc_yarp_iNav2DTarget.cpp.

◆ getAllAreas()

ReturnValue Navigation2D_nwc_yarp::getAllAreas ( std::vector< yarp::dev::Nav2D::Map2DArea > &  areas)
overridevirtual

Get a list of all stored areas.

Parameters
thereturned list of areas
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 141 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getAllLocations()

ReturnValue Navigation2D_nwc_yarp::getAllLocations ( std::vector< yarp::dev::Nav2D::Map2DLocation > &  locations)
overridevirtual

Get a list of all stored locations.

Parameters
thereturned list of locations
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 128 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getAllNavigationWaypoints()

ReturnValue Navigation2D_nwc_yarp::getAllNavigationWaypoints ( yarp::dev::Nav2D::TrajectoryTypeEnum  trajectory_type,
yarp::dev::Nav2D::Map2DPath waypoints 
)
overridevirtual

Returns the list of waypoints generated by the navigation algorithm.

Parameters
trajectory_typespecifies if we are requesting the waypoints of the global trajectory or the waypoints of the local trajectory
waypointsthe list of waypoints generated by the navigation algorithm
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 64 of file Navigation2D_nwc_yarp_iNav2DCtrl.cpp.

◆ getAllPaths()

ReturnValue Navigation2D_nwc_yarp::getAllPaths ( std::vector< yarp::dev::Nav2D::Map2DPath > &  paths)
overridevirtual

Get a list of all stored paths.

Parameters
thereturned list of paths
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 154 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getArea()

ReturnValue Navigation2D_nwc_yarp::getArea ( std::string  area_name,
yarp::dev::Nav2D::Map2DArea area 
)
overridevirtual

Retrieves an area.

Parameters
area_namethe name of the area
areathe area
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 180 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getAreasList()

ReturnValue Navigation2D_nwc_yarp::getAreasList ( std::vector< std::string > &  areas)
overridevirtual

Get a list of the names of all stored areas.

Parameters
thereturned list of areas names
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 102 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getCurrentNavigationMap()

ReturnValue Navigation2D_nwc_yarp::getCurrentNavigationMap ( yarp::dev::Nav2D::NavigationMapTypeEnum  map_type,
yarp::dev::Nav2D::MapGrid2D map 
)
overridevirtual

Returns the current navigation map processed by the navigation algorithm.

Parameters
map_typethe map to be requested (e.g. global, local, etc.)
mapthe map, currently used by the navigation algorithm
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 90 of file Navigation2D_nwc_yarp_iNav2DCtrl.cpp.

◆ getCurrentNavigationWaypoint()

ReturnValue Navigation2D_nwc_yarp::getCurrentNavigationWaypoint ( yarp::dev::Nav2D::Map2DLocation curr_waypoint)
overridevirtual

Returns the current waypoint pursued by the navigation algorithm.

Parameters
curr_waypointthe current waypoint pursued by the navigation algorithm
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 77 of file Navigation2D_nwc_yarp_iNav2DCtrl.cpp.

◆ getCurrentPosition() [1/2]

ReturnValue Navigation2D_nwc_yarp::getCurrentPosition ( yarp::dev::Nav2D::Map2DLocation loc)
overridevirtual

Gets the current position of the robot w.r.t world reference frame.

Parameters
locthe location of the robot
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::ILocalization2D.

Definition at line 72 of file Navigation2D_nwc_yarp_iLocalization2D.cpp.

◆ getCurrentPosition() [2/2]

ReturnValue Navigation2D_nwc_yarp::getCurrentPosition ( yarp::dev::Nav2D::Map2DLocation loc,
yarp::sig::Matrix cov 
)
overridevirtual

Gets the current position of the robot w.r.t world reference frame, plus the covariance.

Parameters
locthe location of the robot
covthe 3x3 covariance matrix
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::ILocalization2D.

Definition at line 45 of file Navigation2D_nwc_yarp_iLocalization2D.cpp.

◆ getEstimatedOdometry()

ReturnValue Navigation2D_nwc_yarp::getEstimatedOdometry ( yarp::dev::OdometryData odom)
overridevirtual

Gets the estimated odometry the robot, including its velocity expressed in the world and in the local reference frame.

Parameters
locthe estimated odometry.
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::ILocalization2D.

Definition at line 59 of file Navigation2D_nwc_yarp_iLocalization2D.cpp.

◆ getEstimatedPoses()

ReturnValue Navigation2D_nwc_yarp::getEstimatedPoses ( std::vector< yarp::dev::Nav2D::Map2DLocation > &  poses)
overridevirtual

Gets a set of pose estimates computed by the localization algorithm.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::ILocalization2D.

Definition at line 98 of file Navigation2D_nwc_yarp_iLocalization2D.cpp.

◆ getLastVelocityCommand()

ReturnValue Navigation2D_nwc_yarp::getLastVelocityCommand ( double x_vel,
double y_vel,
double theta_vel 
)
overridevirtual

Returns the last applied velocity command.

Parameters
x[m/s]
y[m/s]
theta[deg/s]
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DVelocityActions.

Definition at line 27 of file Navigation2D_nwc_yarp_iVelActs.cpp.

◆ getLocalizationStatus()

ReturnValue Navigation2D_nwc_yarp::getLocalizationStatus ( yarp::dev::Nav2D::LocalizationStatusEnum status)
overridevirtual

Gets the current status of the localization task.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::ILocalization2D.

Definition at line 85 of file Navigation2D_nwc_yarp_iLocalization2D.cpp.

◆ getLocation()

ReturnValue Navigation2D_nwc_yarp::getLocation ( std::string  location_name,
yarp::dev::Nav2D::Map2DLocation loc 
)
overridevirtual

Retrieves a location specified by the user in the world reference frame.

Parameters
location_namethe name of the location
locthe location
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 167 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getLocationsList()

ReturnValue Navigation2D_nwc_yarp::getLocationsList ( std::vector< std::string > &  locations)
overridevirtual

Get a list of the names of all stored locations.

Parameters
thereturned list of locations names
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 89 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getNameOfCurrentTarget()

ReturnValue Navigation2D_nwc_yarp::getNameOfCurrentTarget ( std::string &  location_name)
overridevirtual

Gets the name of the current target, if available (set by gotoTargetByLocationName)

Parameters
location_namethe name of the current target
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DExtraActions.

Definition at line 303 of file Navigation2D_nwc_yarp.cpp.

◆ getNavigationStatus()

ReturnValue Navigation2D_nwc_yarp::getNavigationStatus ( yarp::dev::Nav2D::NavigationStatusEnum status)
overridevirtual

Gets the current status of the navigation task.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 27 of file Navigation2D_nwc_yarp_iNav2DCtrl.cpp.

◆ getPath()

ReturnValue Navigation2D_nwc_yarp::getPath ( std::string  path_name,
yarp::dev::Nav2D::Map2DPath path 
)
overridevirtual

Retrieves a path.

Parameters
path_namethe name of the path
paththe path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 193 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getPathsList()

ReturnValue Navigation2D_nwc_yarp::getPathsList ( std::vector< std::string > &  paths)
overridevirtual

Get a list of the names of all stored paths.

Parameters
thereturned list of paths names
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 115 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ getRelativeLocationOfCurrentTarget()

ReturnValue Navigation2D_nwc_yarp::getRelativeLocationOfCurrentTarget ( double x,
double y,
double theta 
)
overridevirtual

Gets the last navigation target in the robot reference frame.

Parameters
x
y
theta
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 58 of file Navigation2D_nwc_yarp_iNav2DTarget.cpp.

◆ gotoTargetByAbsoluteLocation()

ReturnValue Navigation2D_nwc_yarp::gotoTargetByAbsoluteLocation ( yarp::dev::Nav2D::Map2DLocation  loc)
overridevirtual

Ask the robot to reach a position defined in the world reference frame.

Parameters
locthe location to be reached
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 27 of file Navigation2D_nwc_yarp_iNav2DTarget.cpp.

◆ gotoTargetByLocationName()

ReturnValue Navigation2D_nwc_yarp::gotoTargetByLocationName ( std::string  location_or_area_name)
overridevirtual

Ask the robot to reach a previously stored location/area.

Parameters
location_namethe name of a location/area previously saved
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DExtraActions.

Definition at line 259 of file Navigation2D_nwc_yarp.cpp.

◆ gotoTargetByRelativeLocation() [1/2]

ReturnValue Navigation2D_nwc_yarp::gotoTargetByRelativeLocation ( double  x,
double  y 
)
overridevirtual

Ask the robot to reach a position defined in the robot reference frame.

The final orientation of the goal is unspecified.

Parameters
x
y
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 33 of file Navigation2D_nwc_yarp_iNav2DTarget.cpp.

◆ gotoTargetByRelativeLocation() [2/2]

ReturnValue Navigation2D_nwc_yarp::gotoTargetByRelativeLocation ( double  x,
double  y,
double  theta 
)
overridevirtual

Ask the robot to reach a position defined in the robot reference frame.

Parameters
x
y
theta
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 39 of file Navigation2D_nwc_yarp_iNav2DTarget.cpp.

◆ loadLocationsAndExtras()

ReturnValue Navigation2D_nwc_yarp::loadLocationsAndExtras ( std::string  file_name)
overridevirtual

Load a collection of locations/areas/paths etc from disk.

Parameters
file_namefile name with full path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 290 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ loadMapFromDisk()

ReturnValue Navigation2D_nwc_yarp::loadMapFromDisk ( std::string  file_name)
overridevirtual

Load a map from disk.

Parameters
file_namefile name with full path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 302 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ loadMapsCollection()

ReturnValue Navigation2D_nwc_yarp::loadMapsCollection ( std::string  file_name)
overridevirtual

Load a collection of maps from disk.

Parameters
file_namefile name with full path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 278 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ open()

bool Navigation2D_nwc_yarp::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 28 of file Navigation2D_nwc_yarp.cpp.

◆ parse_respond_string()

bool Navigation2D_nwc_yarp::parse_respond_string ( const yarp::os::Bottle command,
yarp::os::Bottle reply 
)

◆ read()

bool Navigation2D_nwc_yarp::read ( yarp::os::ConnectionReader reader)
overridevirtual

Read this object from a network connection.

Override this for your particular class.

Parameters
readeran interface to the network connection for reading
Returns
true iff the object is successfully read

Implements yarp::os::PortReader.

Definition at line 136 of file Navigation2D_nwc_yarp.cpp.

◆ recomputeCurrentNavigationPath()

ReturnValue Navigation2D_nwc_yarp::recomputeCurrentNavigationPath ( )
overridevirtual

Forces the navigation system to recompute the path from the current robot position to the current goal.

If no goal has been set, the command has no effect.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 40 of file Navigation2D_nwc_yarp_iNav2DCtrl.cpp.

◆ remove_map()

ReturnValue Navigation2D_nwc_yarp::remove_map ( std::string  map_name)
overridevirtual

Removes a map from the map server.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 65 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ renameArea()

ReturnValue Navigation2D_nwc_yarp::renameArea ( std::string  original_name,
std::string  new_name 
)
overridevirtual

Searches for an area and renames it.

Parameters
original_namethe name of the area
new_namethe new name of the area
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 230 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ renameLocation()

ReturnValue Navigation2D_nwc_yarp::renameLocation ( std::string  original_name,
std::string  new_name 
)
overridevirtual

Searches for a location and renames it.

Parameters
original_namethe name of the area
new_namethe new name of the area
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 212 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ renamePath()

ReturnValue Navigation2D_nwc_yarp::renamePath ( std::string  original_name,
std::string  new_name 
)
overridevirtual

Searches for a path and renames it.

Parameters
original_namethe name of the path
new_namethe new name of the path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 236 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ resumeNavigation()

ReturnValue Navigation2D_nwc_yarp::resumeNavigation ( )
overridevirtual

Resume a previously suspended navigation task.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 58 of file Navigation2D_nwc_yarp_iNav2DCtrl.cpp.

◆ saveLocationsAndExtras()

ReturnValue Navigation2D_nwc_yarp::saveLocationsAndExtras ( std::string  file_name)
overridevirtual

Save a collection of locations/area/paths etc to disk.

Parameters
file_namefile name with full path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 284 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ saveMapsCollection()

ReturnValue Navigation2D_nwc_yarp::saveMapsCollection ( std::string  file_name)
overridevirtual

Save a collection of maps to disk.

Parameters
file_namefile name with full path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 272 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ saveMapToDisk()

ReturnValue Navigation2D_nwc_yarp::saveMapToDisk ( std::string  map_name,
std::string  file_name 
)
overridevirtual

Save a map to disk.

Parameters
map_namethe name of the area
file_namefile name with full path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 296 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ setInitialPose() [1/2]

ReturnValue Navigation2D_nwc_yarp::setInitialPose ( const yarp::dev::Nav2D::Map2DLocation loc)
overridevirtual

Sets the initial pose for the localization algorithm which estimates the current position of the robot w.r.t world reference frame.

Parameters
locthe location of the robot
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::ILocalization2D.

Definition at line 27 of file Navigation2D_nwc_yarp_iLocalization2D.cpp.

◆ setInitialPose() [2/2]

ReturnValue Navigation2D_nwc_yarp::setInitialPose ( const yarp::dev::Nav2D::Map2DLocation loc,
const yarp::sig::Matrix cov 
)
overridevirtual

Sets the initial pose for the localization algorithm which estimates the current position of the robot w.r.t world reference frame.

Parameters
locthe location of the robot
covthe 3x3 covariance matrix
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::ILocalization2D.

Definition at line 33 of file Navigation2D_nwc_yarp_iLocalization2D.cpp.

◆ startLocalizationService()

ReturnValue Navigation2D_nwc_yarp::startLocalizationService ( )
overridevirtual

Starts the localization service.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::ILocalization2D.

Definition at line 111 of file Navigation2D_nwc_yarp_iLocalization2D.cpp.

◆ stopLocalizationService()

ReturnValue Navigation2D_nwc_yarp::stopLocalizationService ( )
overridevirtual

Stops the localization service.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::ILocalization2D.

Definition at line 117 of file Navigation2D_nwc_yarp_iLocalization2D.cpp.

◆ stopNavigation()

ReturnValue Navigation2D_nwc_yarp::stopNavigation ( )
overridevirtual

Terminates the current navigation task.

Cannot be resumed.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 52 of file Navigation2D_nwc_yarp_iNav2DCtrl.cpp.

◆ store_map()

ReturnValue Navigation2D_nwc_yarp::store_map ( const yarp::dev::Nav2D::MapGrid2D map)
overridevirtual

Stores a map into the map server.

Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 27 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ storeArea()

ReturnValue Navigation2D_nwc_yarp::storeArea ( std::string  area_name,
yarp::dev::Nav2D::Map2DArea  area 
)
overridevirtual

Store an area.

Parameters
area_namethe name of the area
areathe area
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 77 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ storeCurrentPosition()

ReturnValue Navigation2D_nwc_yarp::storeCurrentPosition ( std::string  location_name)
overridevirtual

Store the current location of the robot.

Parameters
location_namethe name of the location
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DExtraActions.

Definition at line 316 of file Navigation2D_nwc_yarp.cpp.

◆ storeLocation()

ReturnValue Navigation2D_nwc_yarp::storeLocation ( std::string  location_name,
yarp::dev::Nav2D::Map2DLocation  loc 
)
overridevirtual

Store a location specified by the user in the world reference frame.

Parameters
location_namethe name of the location
locthe location of the robot
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 71 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ storePath()

ReturnValue Navigation2D_nwc_yarp::storePath ( std::string  path_name,
yarp::dev::Nav2D::Map2DPath  path 
)
overridevirtual

Store a path.

Parameters
path_namethe name of the path
paththe path
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::IMap2D.

Definition at line 83 of file Navigation2D_nwc_yarp_iMap2D.cpp.

◆ suspendNavigation()

ReturnValue Navigation2D_nwc_yarp::suspendNavigation ( const double  time_s)
overridevirtual

Ask to the robot to suspend the current navigation task for a defined amount of time.

Can be resumed by resume().

Parameters
time_s
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 46 of file Navigation2D_nwc_yarp_iNav2DCtrl.cpp.

Member Data Documentation

◆ m_loc_RPC

ILocalization2DMsgs Navigation2D_nwc_yarp::m_loc_RPC
protected

Definition at line 47 of file Navigation2D_nwc_yarp.h.

◆ m_map_RPC

IMap2DMsgs Navigation2D_nwc_yarp::m_map_RPC
protected

Definition at line 46 of file Navigation2D_nwc_yarp.h.

◆ m_mutex

std::mutex Navigation2D_nwc_yarp::m_mutex
protected

Definition at line 51 of file Navigation2D_nwc_yarp.h.

◆ m_nav_RPC

INavigation2DMsgs Navigation2D_nwc_yarp::m_nav_RPC
protected

Definition at line 48 of file Navigation2D_nwc_yarp.h.

◆ m_rpc_port_to_localization_server

yarp::os::Port Navigation2D_nwc_yarp::m_rpc_port_to_localization_server
protected

Definition at line 54 of file Navigation2D_nwc_yarp.h.

◆ m_rpc_port_to_Map2DServer

yarp::os::Port Navigation2D_nwc_yarp::m_rpc_port_to_Map2DServer
protected

Definition at line 53 of file Navigation2D_nwc_yarp.h.

◆ m_rpc_port_to_navigation_server

yarp::os::Port Navigation2D_nwc_yarp::m_rpc_port_to_navigation_server
protected

Definition at line 52 of file Navigation2D_nwc_yarp.h.

◆ m_rpc_port_user_commands

yarp::os::Port Navigation2D_nwc_yarp::m_rpc_port_user_commands
protected

Definition at line 55 of file Navigation2D_nwc_yarp.h.


The documentation for this class was generated from the following files: