YARP
Yet Another Robot Platform

Map2DStorage: A device capable of read/save collections of maps from disk, and make them accessible to any Map2DClient device. More...

#include <map2DStorage/map2DStorage.h>

+ Inheritance diagram for Map2DStorage:

Public Member Functions

 Map2DStorage ()
 Map2DStorage. More...
 
 ~Map2DStorage ()
 
bool open (yarp::os::Searchable &params) override
 Open the DeviceDriver. More...
 
bool close () override
 Close the DeviceDriver. More...
 
bool clearAllMaps () override
 Removes all the registered maps from the server. More...
 
bool store_map (const yarp::dev::Nav2D::MapGrid2D &map) override
 Stores a map into the map server. More...
 
bool get_map (std::string map_name, yarp::dev::Nav2D::MapGrid2D &map) override
 Gets a map from the map server. More...
 
bool get_map_names (std::vector< std::string > &map_names) override
 Gets a list containing the names of all registered maps. More...
 
bool remove_map (std::string map_name) override
 Removes a map from the map server. More...
 
bool storeLocation (std::string location_name, yarp::dev::Nav2D::Map2DLocation loc) override
 Store a location specified by the user in the world reference frame. More...
 
bool storeArea (std::string area_name, yarp::dev::Nav2D::Map2DArea area) override
 Store an area. More...
 
bool storePath (std::string path_name, yarp::dev::Nav2D::Map2DPath path) override
 Store a path. More...
 
bool getLocation (std::string location_name, yarp::dev::Nav2D::Map2DLocation &loc) override
 Retrieves a location specified by the user in the world reference frame. More...
 
bool getArea (std::string area_name, yarp::dev::Nav2D::Map2DArea &area) override
 Retrieves an area. More...
 
bool getPath (std::string path_name, yarp::dev::Nav2D::Map2DPath &path) override
 Retrieves a path. More...
 
bool getLocationsList (std::vector< std::string > &locations) override
 Get a list of the names of all stored locations. More...
 
bool getAreasList (std::vector< std::string > &areas) override
 Get a list of the names of all stored areas. More...
 
bool getPathsList (std::vector< std::string > &paths) override
 Get a list of the names of all stored paths. More...
 
bool getAllLocations (std::vector< yarp::dev::Nav2D::Map2DLocation > &locations) override
 Get a list of all stored locations. More...
 
bool getAllAreas (std::vector< yarp::dev::Nav2D::Map2DArea > &areas) override
 Get a list of all stored areas. More...
 
bool getAllPaths (std::vector< yarp::dev::Nav2D::Map2DPath > &paths) override
 Get a list of all stored paths. More...
 
bool renameLocation (std::string original_name, std::string new_name) override
 Searches for a location and renames it. More...
 
bool deleteLocation (std::string location_name) override
 Delete a location. More...
 
bool deletePath (std::string path_name) override
 Delete a path. More...
 
bool renameArea (std::string original_name, std::string new_name) override
 Searches for an area and renames it. More...
 
bool renamePath (std::string original_name, std::string new_name) override
 Searches for a path and renames it. More...
 
bool deleteArea (std::string area_name) override
 Delete an area. More...
 
bool clearAllLocations () override
 Delete all stored locations. More...
 
bool clearAllAreas () override
 Delete all stored areas. More...
 
bool clearAllPaths () override
 Delete all stored paths. More...
 
bool clearAllMapsTemporaryFlags () override
 Clear all temporary flags from all stored maps. More...
 
bool clearMapTemporaryFlags (std::string map_name) override
 Clear all temporary flags from a specific map. More...
 
bool saveMapToDisk (std::string map_name, std::string file_name) override
 Save a map to disk. More...
 
bool loadMapFromDisk (std::string file_name) override
 Load a map from disk. More...
 
bool saveMapsCollection (std::string maps_collection_file) override
 Save a collection of maps to disk. More...
 
bool loadMapsCollection (std::string maps_collection_file) override
 Load a collection of maps from disk. More...
 
bool loadLocationsAndExtras (std::string locations_file) override
 Load a collection of locations/areas/paths etc from disk. More...
 
bool saveLocationsAndExtras (std::string locations_file) override
 Save a collection of locations/area/paths etc to disk. More...
 
bool enableMapsCompression (bool enable) override
 99999999999 More...
 
- 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
 
 ~DeviceDriver () override
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver. More...
 
bool close () override
 Close the DeviceDriver. More...
 
virtual std::string id () const
 Return the id assigned to the PolyDriver. More...
 
virtual void setId (const std::string &id)
 Set the id for this device. More...
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver. More...
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others. More...
 
- Public Member Functions inherited from yarp::os::IConfig
virtual ~IConfig ()
 Destructor. More...
 
virtual bool open (Searchable &config)
 Initialize the object. More...
 
virtual bool close ()
 Shut the object down. More...
 
virtual bool configure (Searchable &config)
 Change online parameters. More...
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual bool read (ConnectionReader &reader)=0
 Read this object from a network connection. More...
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::dev::Nav2D::IMap2D
virtual ~IMap2D ()
 Destructor. More...
 
virtual bool clearAllMaps ()=0
 Removes all the registered maps from the server. More...
 
virtual bool store_map (const yarp::dev::Nav2D::MapGrid2D &map)=0
 Stores a map into the map server. More...
 
virtual bool get_map (std::string map_name, yarp::dev::Nav2D::MapGrid2D &map)=0
 Gets a map from the map server. More...
 
virtual bool get_map_names (std::vector< std::string > &map_names)=0
 Gets a list containing the names of all registered maps. More...
 
virtual bool remove_map (std::string map_name)=0
 Removes a map from the map server. More...
 
virtual bool storeLocation (std::string location_name, yarp::dev::Nav2D::Map2DLocation loc)=0
 Store a location specified by the user in the world reference frame. More...
 
virtual bool storeArea (std::string area_name, yarp::dev::Nav2D::Map2DArea area)=0
 Store an area. More...
 
virtual bool storePath (std::string path_name, yarp::dev::Nav2D::Map2DPath path)=0
 Store a path. More...
 
virtual bool getLocation (std::string location_name, yarp::dev::Nav2D::Map2DLocation &loc)=0
 Retrieves a location specified by the user in the world reference frame. More...
 
virtual bool getArea (std::string area_name, yarp::dev::Nav2D::Map2DArea &area)=0
 Retrieves an area. More...
 
virtual bool getPath (std::string path_name, yarp::dev::Nav2D::Map2DPath &path)=0
 Retrieves a path. More...
 
virtual bool getLocationsList (std::vector< std::string > &locations)=0
 Get a list of the names of all stored locations. More...
 
virtual bool getAreasList (std::vector< std::string > &areas)=0
 Get a list of the names of all stored areas. More...
 
virtual bool getPathsList (std::vector< std::string > &paths)=0
 Get a list of the names of all stored paths. More...
 
virtual bool getAllLocations (std::vector< yarp::dev::Nav2D::Map2DLocation > &locations)=0
 Get a list of all stored locations. More...
 
virtual bool getAllAreas (std::vector< yarp::dev::Nav2D::Map2DArea > &areas)=0
 Get a list of all stored areas. More...
 
virtual bool getAllPaths (std::vector< yarp::dev::Nav2D::Map2DPath > &paths)=0
 Get a list of all stored paths. More...
 
virtual bool renameLocation (std::string original_name, std::string new_name)=0
 Searches for a location and renames it. More...
 
virtual bool deleteLocation (std::string location_name)=0
 Delete a location. More...
 
virtual bool deletePath (std::string path_name)=0
 Delete a path. More...
 
virtual bool renameArea (std::string original_name, std::string new_name)=0
 Searches for an area and renames it. More...
 
virtual bool renamePath (std::string original_name, std::string new_name)=0
 Searches for a path and renames it. More...
 
virtual bool deleteArea (std::string area_name)=0
 Delete an area. More...
 
virtual bool clearAllLocations ()=0
 Delete all stored locations. More...
 
virtual bool clearAllAreas ()=0
 Delete all stored areas. More...
 
virtual bool clearAllPaths ()=0
 Delete all stored paths. More...
 
virtual bool clearAllMapsTemporaryFlags ()=0
 Clear all temporary flags from all stored maps. More...
 
virtual bool clearMapTemporaryFlags (std::string map_name)=0
 Clear all temporary flags from a specific map. More...
 
virtual bool saveMapToDisk (std::string map_name, std::string file_name)=0
 Save a map to disk. More...
 
virtual bool loadMapFromDisk (std::string file_name)=0
 Load a map from disk. More...
 
virtual bool saveMapsCollection (std::string file_name)=0
 Save a collection of maps to disk. More...
 
virtual bool loadMapsCollection (std::string file_name)=0
 Load a collection of maps from disk. More...
 
virtual bool saveLocationsAndExtras (std::string file_name)=0
 Save a collection of locations/area/paths etc to disk. More...
 
virtual bool loadLocationsAndExtras (std::string file_name)=0
 Load a collection of locations/areas/paths etc from disk. More...
 
virtual bool enableMapsCompression (bool enable)=0
 99999999999 More...
 

Detailed Description

Map2DStorage: A device capable of read/save collections of maps from disk, and make them accessible to any Map2DClient device.

Map2DStorage

Parameters required by this device are:

Parameter name SubParameter Type Units Default Value Required Description Notes
name - string - /mapServer/rpc No Full name of the rpc port opened by the Map2DServer device.
mapCollection - string - - No The name of .ini file containing a map collection.

Definition at line 55 of file map2DStorage.h.

Constructor & Destructor Documentation

◆ Map2DStorage()

Map2DStorage::Map2DStorage ( )

Map2DStorage.

Definition at line 33 of file map2DStorage.cpp.

◆ ~Map2DStorage()

Map2DStorage::~Map2DStorage ( )
default

Member Function Documentation

◆ clearAllAreas()

bool Map2DStorage::clearAllAreas ( )
overridevirtual

Delete all stored areas.

Returns
true/false

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

Definition at line 984 of file map2DStorage.cpp.

◆ clearAllLocations()

bool Map2DStorage::clearAllLocations ( )
overridevirtual

Delete all stored locations.

Returns
true/false

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

Definition at line 978 of file map2DStorage.cpp.

◆ clearAllMaps()

bool Map2DStorage::clearAllMaps ( )
overridevirtual

Removes all the registered maps from the server.

Returns
true/false

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

Definition at line 717 of file map2DStorage.cpp.

◆ clearAllMapsTemporaryFlags()

bool Map2DStorage::clearAllMapsTemporaryFlags ( )
overridevirtual

Clear all temporary flags from all stored maps.

Returns
true/false

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

Definition at line 996 of file map2DStorage.cpp.

◆ clearAllPaths()

bool Map2DStorage::clearAllPaths ( )
overridevirtual

Delete all stored paths.

Returns
true/false

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

Definition at line 990 of file map2DStorage.cpp.

◆ clearMapTemporaryFlags()

bool Map2DStorage::clearMapTemporaryFlags ( std::string  map_name)
overridevirtual

Clear all temporary flags from a specific map.

Returns
true/false

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

Definition at line 1005 of file map2DStorage.cpp.

◆ close()

bool Map2DStorage::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 242 of file map2DStorage.cpp.

◆ deleteArea()

bool Map2DStorage::deleteArea ( std::string  area_name)
overridevirtual

Delete an area.

Parameters
area_namethe name of the area
Returns
true/false

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

Definition at line 914 of file map2DStorage.cpp.

◆ deleteLocation()

bool Map2DStorage::deleteLocation ( std::string  location_name)
overridevirtual

Delete a location.

Parameters
location_namethe name of the location
Returns
true/false

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

Definition at line 902 of file map2DStorage.cpp.

◆ deletePath()

bool Map2DStorage::deletePath ( std::string  path_name)
overridevirtual

Delete a path.

Parameters
path_namethe name of the path
Returns
true/false

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

Definition at line 926 of file map2DStorage.cpp.

◆ enableMapsCompression()

bool Map2DStorage::enableMapsCompression ( bool  enable)
overridevirtual

99999999999

Parameters
enable
Returns
true/false

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

Definition at line 1107 of file map2DStorage.cpp.

◆ get_map()

bool Map2DStorage::get_map ( std::string  map_name,
yarp::dev::Nav2D::MapGrid2D map 
)
overridevirtual

Gets a map from the map server.

Returns
true/false

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

Definition at line 740 of file map2DStorage.cpp.

◆ get_map_names()

bool Map2DStorage::get_map_names ( std::vector< std::string > &  map_names)
overridevirtual

Gets a list containing the names of all registered maps.

Returns
true/false

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

Definition at line 751 of file map2DStorage.cpp.

◆ getAllAreas()

bool Map2DStorage::getAllAreas ( std::vector< yarp::dev::Nav2D::Map2DArea > &  areas)
overridevirtual

Get a list of all stored areas.

Parameters
thereturned list of areas
Returns
true/false

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

Definition at line 865 of file map2DStorage.cpp.

◆ getAllLocations()

bool Map2DStorage::getAllLocations ( std::vector< yarp::dev::Nav2D::Map2DLocation > &  locations)
overridevirtual

Get a list of all stored locations.

Parameters
thereturned list of locations
Returns
true/false

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

Definition at line 855 of file map2DStorage.cpp.

◆ getAllPaths()

bool Map2DStorage::getAllPaths ( std::vector< yarp::dev::Nav2D::Map2DPath > &  paths)
overridevirtual

Get a list of all stored paths.

Parameters
thereturned list of paths
Returns
true/false

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

Definition at line 874 of file map2DStorage.cpp.

◆ getArea()

bool Map2DStorage::getArea ( std::string  area_name,
yarp::dev::Nav2D::Map2DArea area 
)
overridevirtual

Retrieves an area.

Parameters
area_namethe name of the area
areathe area
Returns
true/false

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

Definition at line 803 of file map2DStorage.cpp.

◆ getAreasList()

bool Map2DStorage::getAreasList ( std::vector< std::string > &  areas)
overridevirtual

Get a list of the names of all stored areas.

Parameters
thereturned list of areas names
Returns
true/false

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

Definition at line 835 of file map2DStorage.cpp.

◆ getLocation()

bool Map2DStorage::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
true/false

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

Definition at line 792 of file map2DStorage.cpp.

◆ getLocationsList()

bool Map2DStorage::getLocationsList ( std::vector< std::string > &  locations)
overridevirtual

Get a list of the names of all stored locations.

Parameters
thereturned list of locations names
Returns
true/false

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

Definition at line 825 of file map2DStorage.cpp.

◆ getPath()

bool Map2DStorage::getPath ( std::string  path_name,
yarp::dev::Nav2D::Map2DPath path 
)
overridevirtual

Retrieves a path.

Parameters
path_namethe name of the path
paththe path
Returns
true/false

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

Definition at line 814 of file map2DStorage.cpp.

◆ getPathsList()

bool Map2DStorage::getPathsList ( std::vector< std::string > &  paths)
overridevirtual

Get a list of the names of all stored paths.

Parameters
thereturned list of paths names
Returns
true/false

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

Definition at line 845 of file map2DStorage.cpp.

◆ loadLocationsAndExtras()

bool Map2DStorage::loadLocationsAndExtras ( std::string  file_name)
overridevirtual

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

Parameters
file_namefile name with full path
Returns
true/false

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

Definition at line 579 of file map2DStorage.cpp.

◆ loadMapFromDisk()

bool Map2DStorage::loadMapFromDisk ( std::string  file_name)
overridevirtual

Load a map from disk.

Parameters
file_namefile name with full path
Returns
true/false

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

Definition at line 1079 of file map2DStorage.cpp.

◆ loadMapsCollection()

bool Map2DStorage::loadMapsCollection ( std::string  file_name)
overridevirtual

Load a collection of maps from disk.

Parameters
file_namefile name with full path
Returns
true/false

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

Definition at line 75 of file map2DStorage.cpp.

◆ open()

bool Map2DStorage::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 139 of file map2DStorage.cpp.

◆ remove_map()

bool Map2DStorage::remove_map ( std::string  map_name)
overridevirtual

Removes a map from the map server.

Returns
true/false

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

Definition at line 761 of file map2DStorage.cpp.

◆ renameArea()

bool Map2DStorage::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
true/false

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

Definition at line 938 of file map2DStorage.cpp.

◆ renameLocation()

bool Map2DStorage::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
true/false

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

Definition at line 884 of file map2DStorage.cpp.

◆ renamePath()

bool Map2DStorage::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
true/false

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

Definition at line 957 of file map2DStorage.cpp.

◆ saveLocationsAndExtras()

bool Map2DStorage::saveLocationsAndExtras ( std::string  file_name)
overridevirtual

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

Parameters
file_namefile name with full path
Returns
true/false

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

Definition at line 645 of file map2DStorage.cpp.

◆ saveMapsCollection()

bool Map2DStorage::saveMapsCollection ( std::string  file_name)
overridevirtual

Save a collection of maps to disk.

Parameters
file_namefile name with full path
Returns
true/false

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

Definition at line 39 of file map2DStorage.cpp.

◆ saveMapToDisk()

bool Map2DStorage::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
true/false

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

Definition at line 1054 of file map2DStorage.cpp.

◆ store_map()

bool Map2DStorage::store_map ( const yarp::dev::Nav2D::MapGrid2D map)
overridevirtual

Stores a map into the map server.

Returns
true/false

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

Definition at line 723 of file map2DStorage.cpp.

◆ storeArea()

bool Map2DStorage::storeArea ( std::string  area_name,
yarp::dev::Nav2D::Map2DArea  area 
)
overridevirtual

Store an area.

Parameters
area_namethe name of the area
areathe area
Returns
true/false

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

Definition at line 780 of file map2DStorage.cpp.

◆ storeLocation()

bool Map2DStorage::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
true/false

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

Definition at line 774 of file map2DStorage.cpp.

◆ storePath()

bool Map2DStorage::storePath ( std::string  path_name,
yarp::dev::Nav2D::Map2DPath  path 
)
overridevirtual

Store a path.

Parameters
path_namethe name of the path
paththe path
Returns
true/false

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

Definition at line 786 of file map2DStorage.cpp.


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