YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Map2DServerImpl.cpp
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
7#include <yarp/os/LogStream.h>
9#include "Map2DServerImpl.h"
10
13using namespace yarp::os;
14using namespace yarp::dev;
15using namespace yarp::dev::Nav2D;
16using namespace std;
17
18#define DEFAULT_THREAD_PERIOD 0.01
19
20#ifndef M_PI
21#define M_PI 3.14159265358979323846
22#endif
23
24namespace {
25YARP_LOG_COMPONENT(MAP2D_RPC, "yarp.device.map2D_nws_yarp.IMap2DRPCd")
26}
27
28#define CHECK_POINTER(xxx) {if (xxx==nullptr) {yCError(MAP2D_RPC, "Invalid interface"); return false;}}
29
31{
32 std::lock_guard <std::mutex> lg(m_mutex);
33
34 auto ret = m_iMap->clearAllMaps();
35 if (!ret)
36 {
37 yCError(MAP2D_RPC, "Unable to clearAllMaps");
38 }
39 return ret;
40}
41
43{
44 std::lock_guard <std::mutex> lg(m_mutex);
45
46 auto ret = m_iMap->store_map(themap);
47 if (!ret)
48 {
49 yCError(MAP2D_RPC, "Unable to store_map");
50 }
51 return ret;
52}
53
54return_get_map IMap2DRPCd::get_map_RPC(const std::string& map_name)
55{
56 std::lock_guard <std::mutex> lg(m_mutex);
57
60 ret.retval = m_iMap->get_map(map_name, map);
61 if (!ret.retval)
62 {
63 yCError(MAP2D_RPC, "Unable to getEstimatedPoses");
64 }
65 else
66 {
67 ret.themap = map;
68 }
69 return ret;
70}
71
73{
74 std::lock_guard <std::mutex> lg(m_mutex);
75
77 std::vector<string> map_names;
78 ret.retval = m_iMap->get_map_names(map_names);
79 if (!ret.retval)
80 {
81 yCError(MAP2D_RPC, "Unable to getEstimatedPoses");
82 }
83 else
84 {
85 ret.map_names = map_names;
86 }
87 return ret;
88}
89
90ReturnValue IMap2DRPCd::remove_map_RPC(const std::string& map_name)
91{
92 std::lock_guard <std::mutex> lg(m_mutex);
93
94 auto ret = m_iMap->remove_map(map_name);
95 if (!ret)
96 {
97 yCError(MAP2D_RPC, "Unable to remove_map");
98 }
99 return ret;
100}
101
103{
104 std::lock_guard <std::mutex> lg(m_mutex);
105
106 auto ret = m_iMap->storeLocation(location_name, loc);
107 if (!ret)
108 {
109 yCError(MAP2D_RPC, "Unable to storeLocation");
110 }
111 return ret;
112}
113
115{
116 std::lock_guard <std::mutex> lg(m_mutex);
117
118 auto ret = m_iMap->storeArea(area_name, area);
119 if (!ret)
120 {
121 yCError(MAP2D_RPC, "Unable to storeArea");
122 }
123 return ret;
124}
125
127{
128 std::lock_guard <std::mutex> lg(m_mutex);
129
130 auto ret = m_iMap->storePath(path_name, path);
131 if (!ret)
132 {
133 yCError(MAP2D_RPC, "Unable to storePath");
134 }
135 return ret;
136}
137
138ReturnValue IMap2DRPCd::rename_location_RPC(const std::string& original_name, const std::string& new_name)
139{
140 std::lock_guard <std::mutex> lg(m_mutex);
141
142 auto ret = m_iMap->renameLocation(original_name, new_name);
143 if (!ret)
144 {
145 yCError(MAP2D_RPC, "Unable to renameLocation");
146 }
147 return ret;
148}
149
150ReturnValue IMap2DRPCd::delete_location_RPC(const std::string& location_name)
151{
152 std::lock_guard <std::mutex> lg(m_mutex);
153
154 auto ret = m_iMap->deleteLocation(location_name);
155 if (!ret)
156 {
157 yCError(MAP2D_RPC, "Unable to deleteLocation");
158 }
159 return ret;
160}
161
162ReturnValue IMap2DRPCd::delete_path_RPC(const std::string& path_name)
163{
164 std::lock_guard <std::mutex> lg(m_mutex);
165
166 auto ret = m_iMap->deletePath(path_name);
167 if (!ret)
168 {
169 yCError(MAP2D_RPC, "Unable to deletePath");
170 }
171 return ret;
172}
173
174ReturnValue IMap2DRPCd::rename_area_RPC(const std::string& original_name, const std::string& new_name)
175{
176 std::lock_guard <std::mutex> lg(m_mutex);
177
178 auto ret = m_iMap->renameArea(original_name, new_name);
179 if (!ret)
180 {
181 yCError(MAP2D_RPC, "Unable to renameArea");
182 }
183 return ret;
184}
185
186ReturnValue IMap2DRPCd::rename_path_RPC(const std::string& original_name, const std::string& new_name)
187{
188 std::lock_guard <std::mutex> lg(m_mutex);
189
190 auto ret = m_iMap->renamePath(original_name, new_name);
191 if (!ret)
192 {
193 yCError(MAP2D_RPC, "Unable to renamePath");
194 }
195 return ret;
196}
197
198ReturnValue IMap2DRPCd::delete_area_RPC(const std::string& area_name)
199{
200 std::lock_guard <std::mutex> lg(m_mutex);
201
202 auto ret = m_iMap->deleteArea(area_name);
203 if (!ret)
204 {
205 yCError(MAP2D_RPC, "Unable to deleteArea");
206 }
207 return ret;
208}
209
211{
212 std::lock_guard <std::mutex> lg(m_mutex);
213
214 auto ret = m_iMap->clearAllLocations();
215 if (!ret)
216 {
217 yCError(MAP2D_RPC, "Unable to clearAllLocations");
218 }
219 return ret;
220}
221
223{
224 std::lock_guard <std::mutex> lg(m_mutex);
225
226 auto ret = m_iMap->clearAllAreas();
227 if (!ret)
228 {
229 yCError(MAP2D_RPC, "Unable to storePath");
230 }
231 return ret;
232}
233
235{
236 std::lock_guard <std::mutex> lg(m_mutex);
237
238 auto ret = m_iMap->clearAllPaths();
239 if (!ret)
240 {
241 yCError(MAP2D_RPC, "Unable to clearAllPaths");
242 }
243 return ret;
244}
245
247{
248 std::lock_guard <std::mutex> lg(m_mutex);
249
250 auto ret = m_iMap->clearAllMapsTemporaryFlags();
251 if (!ret)
252 {
253 yCError(MAP2D_RPC, "Unable to clearAllMapsTemporaryFlags");
254 }
255 return ret;
256}
257
259{
260 std::lock_guard <std::mutex> lg(m_mutex);
261
262 auto ret = m_iMap->clearMapTemporaryFlags(map_name);
263 if (!ret)
264 {
265 yCError(MAP2D_RPC, "Unable to clearMapTemporaryFlags");
266 }
267 return ret;
268}
269
270ReturnValue IMap2DRPCd::save_maps_collection_RPC(const std::string& maps_collection_file)
271{
272 std::lock_guard <std::mutex> lg(m_mutex);
273
274 auto ret = m_iMap->saveMapsCollection(maps_collection_file);
275 if (!ret)
276 {
277 yCError(MAP2D_RPC, "Unable to saveMapsCollection");
278 }
279 return ret;
280}
281
282ReturnValue IMap2DRPCd::load_maps_collection_RPC(const std::string& maps_collection_file)
283{
284 std::lock_guard <std::mutex> lg(m_mutex);
285
286 auto ret = m_iMap->loadMapsCollection(maps_collection_file);
287 if (!ret)
288 {
289 yCError(MAP2D_RPC, "Unable to loadMapsCollection");
290 }
291 return ret;
292}
293
294ReturnValue IMap2DRPCd::save_locations_and_extras_RPC(const std::string& locations_collection_file)
295{
296 std::lock_guard <std::mutex> lg(m_mutex);
297
298 auto ret = m_iMap->saveLocationsAndExtras(locations_collection_file);
299 if (!ret)
300 {
301 yCError(MAP2D_RPC, "Unable to saveLocationsAndExtras");
302 }
303 return ret;
304}
305
306ReturnValue IMap2DRPCd::load_locations_and_extras_RPC(const std::string& locations_collection_file)
307{
308 std::lock_guard <std::mutex> lg(m_mutex);
309
310 auto ret = m_iMap->loadLocationsAndExtras(locations_collection_file);
311 if (!ret)
312 {
313 yCError(MAP2D_RPC, "Unable to loadLocationsAndExtras");
314 }
315 return ret;
316}
317
318// --- Object related APIs ---
320{
321 std::lock_guard<std::mutex> lg(m_mutex);
322 auto ret = m_iMap->storeObject(object_name, obj);
323 if (!ret)
324 {
325 yCError(MAP2D_RPC, "Unable to storeObject");
326 }
327 return ret;
328}
329
330return_get_object IMap2DRPCd::get_object_RPC(const std::string& object_name)
331{
332 std::lock_guard<std::mutex> lg(m_mutex);
334 if (m_iMap == nullptr)
335 {
336 yCError(MAP2D_RPC, "Invalid interface");
337 return ret;
338 }
340 ret.retval = m_iMap->getObject(object_name, obj);
341 if (!ret.retval)
342 {
343 yCError(MAP2D_RPC, "Unable to getObject");
344 }
345 else
346 {
347 ret.obj = obj;
348 }
349 return ret;
350}
351
353{
354 std::lock_guard<std::mutex> lg(m_mutex);
356 std::vector<std::string> obj_names;
357 ret.retval = m_iMap->getObjectsList(obj_names);
358 if (!ret.retval)
359 {
360 yCError(MAP2D_RPC, "Unable to getObjectsList");
361 }
362 else
363 {
364 ret.objects = obj_names;
365 }
366 return ret;
367}
368
370{
371 std::lock_guard<std::mutex> lg(m_mutex);
373 std::vector<yarp::dev::Nav2D::Map2DObject> objs;
374 ret.retval = m_iMap->getAllObjects(objs);
375 if (!ret.retval)
376 {
377 yCError(MAP2D_RPC, "Unable to getAllObjects");
378 }
379 else
380 {
381 ret.objects = objs;
382 }
383 return ret;
384}
385
387{
388 std::lock_guard<std::mutex> lg(m_mutex);
390 std::vector<yarp::dev::Nav2D::Map2DLocation> locs;
391 ret.retval = m_iMap->getAllLocations(locs);
392 if (!ret.retval)
393 {
394 yCError(MAP2D_RPC, "Unable to getAllLocations");
395 }
396 else
397 {
398 ret.locations = locs;
399 }
400 return ret;
401}
402
404{
405 std::lock_guard<std::mutex> lg(m_mutex);
407 std::vector<yarp::dev::Nav2D::Map2DArea> areas;
408 ret.retval = m_iMap->getAllAreas(areas);
409 if (!ret.retval)
410 {
411 yCError(MAP2D_RPC, "Unable to getAllAreas");
412 }
413 else
414 {
415 ret.areas = areas;
416 }
417 return ret;
418}
419
421{
422 std::lock_guard<std::mutex> lg(m_mutex);
424 std::vector<yarp::dev::Nav2D::Map2DPath> paths;
425 ret.retval = m_iMap->getAllPaths(paths);
426 if (!ret.retval)
427 {
428 yCError(MAP2D_RPC, "Unable to getAllPaths");
429 }
430 else
431 {
432 ret.paths = paths;
433 }
434 return ret;
435}
436
437ReturnValue IMap2DRPCd::rename_object_RPC(const std::string& original_name, const std::string& new_name)
438{
439 std::lock_guard<std::mutex> lg(m_mutex);
440 auto ret = m_iMap->renameObject(original_name, new_name);
441 if (!ret)
442 {
443 yCError(MAP2D_RPC, "Unable to renameObject");
444 }
445 return ret;
446}
447
448ReturnValue IMap2DRPCd::delete_object_RPC(const std::string& object_name)
449{
450 std::lock_guard<std::mutex> lg(m_mutex);
451 auto ret = m_iMap->deleteObject(object_name);
452 if (!ret)
453 {
454 yCError(MAP2D_RPC, "Unable to deleteObject");
455 }
456 return ret;
457}
458
460{
461 std::lock_guard<std::mutex> lg(m_mutex);
462 auto ret = m_iMap->clearAllObjects();
463 if (!ret)
464 {
465 yCError(MAP2D_RPC, "Unable to clearAllObjects");
466 }
467 return ret;
468}
469
470ReturnValue IMap2DRPCd::save_map_to_disk_RPC(const std::string& map_name, const std::string& file_name)
471{
472 std::lock_guard<std::mutex> lg(m_mutex);
473 auto ret = m_iMap->saveMapToDisk(map_name, file_name);
474 if (!ret)
475 {
476 yCError(MAP2D_RPC, "Unable to saveMapToDisk");
477 }
478 return ret;
479}
480
482{
483 std::lock_guard<std::mutex> lg(m_mutex);
484 auto ret = m_iMap->loadMapFromDisk(file_name);
485 if (!ret)
486 {
487 yCError(MAP2D_RPC, "Unable to loadMapFromDisk");
488 }
489 return ret;
490}
491
493{
494 std::lock_guard<std::mutex> lg(m_mutex);
495 auto ret = m_iMap->enableMapsCompression(enable_compression);
496 if (!ret)
497 {
498 yCError(MAP2D_RPC, "Unable to enableMapsCompression");
499 }
500 return ret;
501}
502
503return_get_location IMap2DRPCd::get_location_RPC(const std::string& location_name)
504{
505 std::lock_guard <std::mutex> lg(m_mutex);
506
508 {if (m_iMap == nullptr) { yCError(MAP2D_RPC, "Invalid interface"); return ret; }}
510 ret.retval = m_iMap->getLocation(location_name, loc);
511 if (!ret.retval)
512 {
513 yCError(MAP2D_RPC, "Unable to getLocation");
514 }
515 else
516 {
517 ret.loc = loc;
518 }
519 return ret;
520}
521
522return_get_area IMap2DRPCd::get_area_RPC(const std::string& area_name)
523{
524 std::lock_guard <std::mutex> lg(m_mutex);
525
526 return_get_area ret;
527 {if (m_iMap == nullptr) { yCError(MAP2D_RPC, "Invalid interface"); return ret; }}
529 ret.retval = m_iMap->getArea(area_name, area);
530 if (!ret.retval)
531 {
532 yCError(MAP2D_RPC, "Unable to getArea");
533 }
534 else
535 {
536 ret.area = area;
537 }
538 return ret;
539}
540
541return_get_path IMap2DRPCd::get_path_RPC(const std::string& path_name)
542{
543 std::lock_guard <std::mutex> lg(m_mutex);
544
545 return_get_path ret;
547 ret.retval = m_iMap->getPath(path_name, path);
548 if (!ret.retval)
549 {
550 yCError(MAP2D_RPC, "Unable to getPath");
551 }
552 else
553 {
554 ret.path = path;
555 }
556 return ret;
557}
558
560{
561 std::lock_guard <std::mutex> lg(m_mutex);
562
564 std::vector<string> loc_names;
565 ret.retval = m_iMap->getLocationsList(loc_names);
566 if (!ret.retval)
567 {
568 yCError(MAP2D_RPC, "Unable to getLocationsList");
569 }
570 else
571 {
572 ret.locations = loc_names;
573 }
574 return ret;
575}
576
578{
579 std::lock_guard <std::mutex> lg(m_mutex);
580
582 std::vector<string> area_names;
583 ret.retval = m_iMap->getAreasList(area_names);
584 if (!ret.retval)
585 {
586 yCError(MAP2D_RPC, "Unable to getAreasList");
587 }
588 else
589 {
590 ret.areas = area_names;
591 }
592 return ret;
593}
594
596{
597 std::lock_guard <std::mutex> lg(m_mutex);
598
600 std::vector<string> path_names;
601 ret.retval = m_iMap->getPathsList(path_names);
602 if (!ret.retval)
603 {
604 yCError(MAP2D_RPC, "Unable to getPathsList");
605 }
606 else
607 {
608 ret.paths = path_names;
609 }
610 return ret;
611}
612
614{
615 std::lock_guard <std::mutex> lg(m_mutex);
616
617 auto ret = m_iMap->reloadMapsCollection();
618 if (!ret)
619 {
620 yCError(MAP2D_RPC, "Unable to reloadMapsCollection");
621 }
622 return ret;
623}
624
626{
627 std::lock_guard <std::mutex> lg(m_mutex);
628
629 auto ret = m_iMap->reloadLocationsAndExtras();
630 if (!ret)
631 {
632 yCError(MAP2D_RPC, "Unable to reloadLocationsAndExtras");
633 }
634 return ret;
635}
return_get_map_names get_map_names_RPC() override
yarp::dev::ReturnValue clear_all_areas_RPC() override
yarp::dev::ReturnValue rename_path_RPC(const std::string &original_name, const std::string &new_name) override
yarp::dev::ReturnValue clear_all_objects_RPC() override
return_get_path get_path_RPC(const std::string &path_name) override
return_get_all_paths get_all_paths_RPC() override
yarp::dev::ReturnValue store_area_RPC(const std::string &area_name, const yarp::dev::Nav2D::Map2DArea &area) override
yarp::dev::ReturnValue load_locations_and_extras_RPC(const std::string &locations_collection_file) override
yarp::dev::ReturnValue store_map_RPC(const yarp::dev::Nav2D::MapGrid2D &themap) override
yarp::dev::ReturnValue delete_object_RPC(const std::string &object_name) override
return_get_all_locations get_all_locations_RPC() override
yarp::dev::ReturnValue save_locations_and_extras_RPC(const std::string &locations_collection_file) override
yarp::dev::ReturnValue rename_area_RPC(const std::string &original_name, const std::string &new_name) override
return_get_all_areas get_all_areas_RPC() override
return_get_object get_object_RPC(const std::string &object_name) override
yarp::dev::ReturnValue rename_location_RPC(const std::string &original_name, const std::string &new_name) override
yarp::dev::ReturnValue store_object_RPC(const std::string &object_name, const yarp::dev::Nav2D::Map2DObject &obj) override
yarp::dev::ReturnValue save_map_to_disk_RPC(const std::string &map_name, const std::string &file_name) override
yarp::dev::ReturnValue save_maps_collection_RPC(const std::string &maps_collection_file) override
yarp::dev::ReturnValue delete_area_RPC(const std::string &area_name) override
yarp::dev::ReturnValue load_map_from_disk_RPC(const std::string &file_name) override
yarp::dev::ReturnValue rename_object_RPC(const std::string &original_name, const std::string &new_name) override
yarp::dev::ReturnValue enable_maps_compression_RPC(const bool enable_compression) override
return_get_location get_location_RPC(const std::string &location_name) override
return_get_all_objects get_all_objects_RPC() override
yarp::dev::ReturnValue reload_maps_collection_RPC() override
yarp::dev::ReturnValue delete_path_RPC(const std::string &path_name) override
return_get_areas_list get_areas_list_RPC() override
return_get_objects_list get_objects_list_RPC() override
yarp::dev::ReturnValue clear_map_temporary_flags_RPC(const std::string &map_name) override
yarp::dev::ReturnValue store_path_RPC(const std::string &path_name, const yarp::dev::Nav2D::Map2DPath &path) override
yarp::dev::ReturnValue reload_locations_and_extras_RPC() override
yarp::dev::ReturnValue clear_all_maps_temporary_flags_RPC() override
return_get_paths_list get_paths_list_RPC() override
return_get_locations_list get_locations_list_RPC() override
return_get_area get_area_RPC(const std::string &area_name) override
yarp::dev::ReturnValue clear_all_locations_RPC() override
yarp::dev::ReturnValue clear_all_paths_RPC() override
yarp::dev::ReturnValue clear_all_maps_RPC() override
return_get_map get_map_RPC(const std::string &map_name) override
yarp::dev::ReturnValue store_location_RPC(const std::string &location_name, const yarp::dev::Nav2D::Map2DLocation &loc) override
yarp::dev::ReturnValue remove_map_RPC(const std::string &map_name) override
yarp::dev::ReturnValue load_maps_collection_RPC(const std::string &maps_collection_file) override
yarp::dev::ReturnValue delete_location_RPC(const std::string &location_name) override
yarp::dev::ReturnValue retval
std::vector< yarp::dev::Nav2D::Map2DArea > areas
std::vector< yarp::dev::Nav2D::Map2DLocation > locations
std::vector< yarp::dev::Nav2D::Map2DObject > objects
yarp::dev::ReturnValue retval
std::vector< yarp::dev::Nav2D::Map2DPath > paths
yarp::dev::ReturnValue retval
yarp::dev::ReturnValue retval
yarp::dev::Nav2D::Map2DArea area
yarp::dev::ReturnValue retval
std::vector< std::string > areas
yarp::dev::ReturnValue retval
yarp::dev::Nav2D::Map2DLocation loc
std::vector< std::string > locations
yarp::dev::ReturnValue retval
std::vector< std::string > map_names
yarp::dev::ReturnValue retval
yarp::dev::Nav2D::MapGrid2D themap
yarp::dev::ReturnValue retval
yarp::dev::Nav2D::Map2DObject obj
yarp::dev::ReturnValue retval
std::vector< std::string > objects
yarp::dev::Nav2D::Map2DPath path
yarp::dev::ReturnValue retval
std::vector< std::string > paths
yarp::dev::ReturnValue retval
virtual yarp::dev::ReturnValue storeLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation loc)=0
Store a location specified by the user in the world reference frame.
virtual yarp::dev::ReturnValue storePath(std::string path_name, yarp::dev::Nav2D::Map2DPath path)=0
Store a path.
virtual yarp::dev::ReturnValue deleteLocation(std::string location_name)=0
Delete a location.
virtual yarp::dev::ReturnValue reloadLocationsAndExtras()=0
Reloads the last opened file containing the collection of locations/areas/paths etc from disk.
virtual yarp::dev::ReturnValue get_map_names(std::vector< std::string > &map_names)=0
Gets a list containing the names of all registered maps.
virtual yarp::dev::ReturnValue loadMapsCollection(std::string file_name)=0
Load a collection of maps from disk.
virtual yarp::dev::ReturnValue saveMapsCollection(std::string file_name)=0
Save a collection of maps to disk.
virtual yarp::dev::ReturnValue getPath(std::string path_name, yarp::dev::Nav2D::Map2DPath &path)=0
Retrieves a path.
virtual yarp::dev::ReturnValue renamePath(std::string original_name, std::string new_name)=0
Searches for a path and renames it.
virtual yarp::dev::ReturnValue saveLocationsAndExtras(std::string file_name)=0
Save a collection of locations/area/paths etc to disk.
virtual yarp::dev::ReturnValue getAllObjects(std::vector< yarp::dev::Nav2D::Map2DObject > &obj)=0
Get a list of all stored objects.
virtual yarp::dev::ReturnValue deleteArea(std::string area_name)=0
Delete an area.
virtual yarp::dev::ReturnValue getLocationsList(std::vector< std::string > &locations)=0
Get a list of the names of all stored locations.
virtual yarp::dev::ReturnValue loadLocationsAndExtras(std::string file_name)=0
Load a collection of locations/areas/paths etc from disk.
virtual yarp::dev::ReturnValue store_map(const yarp::dev::Nav2D::MapGrid2D &map)=0
Stores a map into the map server.
virtual yarp::dev::ReturnValue renameObject(std::string original_name, std::string new_name)=0
Searches for a object and renames it.
virtual yarp::dev::ReturnValue clearAllMaps()=0
Removes all the registered maps from the server.
virtual yarp::dev::ReturnValue clearAllMapsTemporaryFlags()=0
Clear all temporary flags from all stored maps.
virtual yarp::dev::ReturnValue clearMapTemporaryFlags(std::string map_name)=0
Clear all temporary flags from a specific map.
virtual yarp::dev::ReturnValue clearAllAreas()=0
Delete all stored areas.
virtual yarp::dev::ReturnValue storeObject(std::string object_name, yarp::dev::Nav2D::Map2DObject obj)=0
Store a object specified by the user in the world reference frame.
virtual yarp::dev::ReturnValue renameLocation(std::string original_name, std::string new_name)=0
Searches for a location and renames it.
virtual yarp::dev::ReturnValue get_map(std::string map_name, yarp::dev::Nav2D::MapGrid2D &map)=0
Gets a map from the map server.
virtual yarp::dev::ReturnValue getAllLocations(std::vector< yarp::dev::Nav2D::Map2DLocation > &locations)=0
Get a list of all stored locations.
virtual yarp::dev::ReturnValue getAreasList(std::vector< std::string > &areas)=0
Get a list of the names of all stored areas.
virtual yarp::dev::ReturnValue storeArea(std::string area_name, yarp::dev::Nav2D::Map2DArea area)=0
Store an area.
virtual yarp::dev::ReturnValue loadMapFromDisk(std::string file_name)=0
Load a map from disk.
virtual yarp::dev::ReturnValue enableMapsCompression(bool enable)=0
Enable/disables maps compression over the network.
virtual yarp::dev::ReturnValue clearAllLocations()=0
Delete all stored locations.
virtual yarp::dev::ReturnValue saveMapToDisk(std::string map_name, std::string file_name)=0
Save a map to disk.
virtual yarp::dev::ReturnValue getPathsList(std::vector< std::string > &paths)=0
Get a list of the names of all stored paths.
virtual yarp::dev::ReturnValue getAllPaths(std::vector< yarp::dev::Nav2D::Map2DPath > &paths)=0
Get a list of all stored paths.
virtual yarp::dev::ReturnValue getArea(std::string area_name, yarp::dev::Nav2D::Map2DArea &area)=0
Retrieves an area.
virtual yarp::dev::ReturnValue deleteObject(std::string object_name)=0
Delete an object.
virtual yarp::dev::ReturnValue deletePath(std::string path_name)=0
Delete a path.
virtual yarp::dev::ReturnValue remove_map(std::string map_name)=0
Removes a map from the map server.
virtual yarp::dev::ReturnValue renameArea(std::string original_name, std::string new_name)=0
Searches for an area and renames it.
virtual yarp::dev::ReturnValue getObject(std::string object_name, yarp::dev::Nav2D::Map2DObject &obj)=0
Retrieves a object specified by the user in the world reference frame.
virtual yarp::dev::ReturnValue getLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation &loc)=0
Retrieves a location specified by the user in the world reference frame.
virtual yarp::dev::ReturnValue getObjectsList(std::vector< std::string > &objects)=0
Get a list of the names of all stored objects.
virtual yarp::dev::ReturnValue getAllAreas(std::vector< yarp::dev::Nav2D::Map2DArea > &areas)=0
Get a list of all stored areas.
virtual yarp::dev::ReturnValue reloadMapsCollection()=0
Reloads the last opened file containing the maps from disk.
virtual yarp::dev::ReturnValue clearAllObjects()=0
Delete all stored objects.
virtual yarp::dev::ReturnValue clearAllPaths()=0
Delete all stored paths.
A mini-server for performing network communication in the background.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
STL namespace.
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.