YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Map2D_nwc_yarp.h
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
6#ifndef YARP_DEV_MAP2D_NWC_YARP_H
7#define YARP_DEV_MAP2D_NWC_YARP_H
8
9
10#include <yarp/os/Network.h>
12#include <yarp/dev/IMap2D.h>
13#include <yarp/sig/Vector.h>
14#include <yarp/dev/MapGrid2D.h>
16#include <yarp/dev/Map2DArea.h>
17#include <yarp/os/Semaphore.h>
18#include <yarp/os/Time.h>
19#include <yarp/dev/PolyDriver.h>
20#include "IMap2DMsgs.h"
21
23
39{
40protected:
43 std::mutex m_mutex;
44
45public:
46
47 /* DeviceDriver methods */
48 bool open(yarp::os::Searchable& config) override;
49 bool close() override;
50
51 /* The following methods belong to IMap2D interface */
52 bool clearAllMaps () override;
53 bool remove_map (std::string map_name) override;
54 bool store_map (const yarp::dev::Nav2D::MapGrid2D& map) override;
55 bool get_map (std::string map_name, yarp::dev::Nav2D::MapGrid2D& map) override;
56 bool get_map_names(std::vector<std::string>& map_names) override;
57
58 bool storeLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation loc) override;
59 bool storeArea(std::string area_name, yarp::dev::Nav2D::Map2DArea area) override;
60 bool storePath(std::string path_name, yarp::dev::Nav2D::Map2DPath path) override;
61
62 bool getLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation& loc) override;
63 bool getArea(std::string location_name, yarp::dev::Nav2D::Map2DArea& area) override;
64 bool getPath(std::string path_name, yarp::dev::Nav2D::Map2DPath& path) override;
65
66 bool renameLocation(std::string original_name, std::string new_name) override;
67 bool renameArea(std::string original_name, std::string new_name) override;
68 bool renamePath(std::string original_name, std::string new_name) override;
69
70 bool deleteLocation(std::string location_name) override;
71 bool deleteArea(std::string location_name) override;
72 bool deletePath(std::string path_name) override;
73
74 bool getLocationsList(std::vector<std::string>& locations) override;
75 bool getAreasList(std::vector<std::string>& locations) override;
76 bool getPathsList(std::vector<std::string>& paths) override;
77
78 bool getAllLocations(std::vector<yarp::dev::Nav2D::Map2DLocation>& locations) override;
79 bool getAllAreas(std::vector<yarp::dev::Nav2D::Map2DArea>& areas) override;
80 bool getAllPaths(std::vector<yarp::dev::Nav2D::Map2DPath>& paths) override;
81
82 bool clearAllLocations() override;
83 bool clearAllAreas() override;
84 bool clearAllPaths() override;
85
86 bool clearAllMapsTemporaryFlags() override;
87 bool clearMapTemporaryFlags(std::string map_name) override;
88
89 bool saveMapsCollection(std::string maps_collection_file) override;
90 bool loadMapsCollection(std::string maps_collection_file) override;
91 bool saveLocationsAndExtras(std::string locations_collection_file) override;
92 bool loadLocationsAndExtras(std::string locations_collection_file) override;
93 bool saveMapToDisk(std::string map_name, std::string file_name) override;
94 bool loadMapFromDisk(std::string file_name) override;
95 bool enableMapsCompression(bool enable) override;
96};
97
98#endif // YARP_DEV_MAP2D_NWC_YARP_H
contains the definition of a Map2DArea type
contains the definition of a Map2DLocation type
contains the definition of a map type
contains the definition of a Vector type
This class is the parameters parser for class Map2D_nwc_yarp.
Map2D_nwc_yarp: A device which allows a client application to store/retrieve user maps device in a ma...
bool getAllLocations(std::vector< yarp::dev::Nav2D::Map2DLocation > &locations) override
Get a list of all stored locations.
bool clearAllLocations() override
Delete all stored locations.
bool saveMapToDisk(std::string map_name, std::string file_name) override
Save a map to disk.
bool get_map(std::string map_name, yarp::dev::Nav2D::MapGrid2D &map) override
Gets a map from the map server.
bool renameArea(std::string original_name, std::string new_name) override
Searches for an area and renames it.
bool store_map(const yarp::dev::Nav2D::MapGrid2D &map) override
Stores a map into the map server.
bool getArea(std::string location_name, yarp::dev::Nav2D::Map2DArea &area) override
Retrieves an area.
bool storePath(std::string path_name, yarp::dev::Nav2D::Map2DPath path) override
Store a path.
bool loadMapFromDisk(std::string file_name) override
Load a map from disk.
bool getLocationsList(std::vector< std::string > &locations) override
Get a list of the names of all stored locations.
bool saveMapsCollection(std::string maps_collection_file) override
Save a collection of maps to disk.
bool renameLocation(std::string original_name, std::string new_name) override
Searches for a location and renames it.
bool getAllPaths(std::vector< yarp::dev::Nav2D::Map2DPath > &paths) override
Get a list of all stored paths.
bool getAllAreas(std::vector< yarp::dev::Nav2D::Map2DArea > &areas) override
Get a list of all stored areas.
bool remove_map(std::string map_name) override
Removes a map from the map server.
bool getLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation &loc) override
Retrieves a location specified by the user in the world reference frame.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::os::Port m_rpcPort_to_Map2D_nws
bool saveLocationsAndExtras(std::string locations_collection_file) override
Save a collection of locations/area/paths etc to disk.
bool clearAllPaths() override
Delete all stored paths.
bool deleteArea(std::string location_name) override
Delete an area.
bool loadLocationsAndExtras(std::string locations_collection_file) override
Load a collection of locations/areas/paths etc from disk.
bool storeArea(std::string area_name, yarp::dev::Nav2D::Map2DArea area) override
Store an area.
bool clearAllMapsTemporaryFlags() override
Clear all temporary flags from all stored maps.
bool clearAllAreas() override
Delete all stored areas.
IMap2DMsgs m_map_RPC
bool storeLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation loc) override
Store a location specified by the user in the world reference frame.
bool clearAllMaps() override
Removes all the registered maps from the server.
bool getPathsList(std::vector< std::string > &paths) override
Get a list of the names of all stored paths.
bool deletePath(std::string path_name) override
Delete a path.
bool clearMapTemporaryFlags(std::string map_name) override
Clear all temporary flags from a specific map.
bool loadMapsCollection(std::string maps_collection_file) override
Load a collection of maps from disk.
bool deleteLocation(std::string location_name) override
Delete a location.
std::mutex m_mutex
bool renamePath(std::string original_name, std::string new_name) override
Searches for a path and renames it.
bool getPath(std::string path_name, yarp::dev::Nav2D::Map2DPath &path) override
Retrieves a path.
bool close() override
Close the DeviceDriver.
bool get_map_names(std::vector< std::string > &map_names) override
Gets a list containing the names of all registered maps.
bool getAreasList(std::vector< std::string > &locations) override
Get a list of the names of all stored areas.
bool enableMapsCompression(bool enable) override
99999999999
Interface implemented by all device drivers.
IMap2D Interface.
Definition IMap2D.h:29
A mini-server for network communication.
Definition Port.h:46
A base class for nested structures that can be searched.
Definition Searchable.h:31