YARP
Yet Another Robot Platform
Map2DPath.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_MAP2DPATH_H
10 #define YARP_DEV_MAP2DPATH_H
11 
12 #include <vector>
13 #include <yarp/dev/MapGrid2D.h>
14 #include <yarp/dev/Map2DLocation.h>
15 #include <yarp/dev/Map2DPathData.h>
16 
20 namespace yarp
21 {
22  namespace dev
23  {
24  namespace Nav2D
25  {
27  {
28  public:
33  Map2DPath(const std::vector<yarp::dev::Nav2D::Map2DLocation> map_waypoints);
34 
38  Map2DPath();
39 
44  std::string toString() const;
45 
50  bool operator!=(const Map2DPath& r) const;
51 
56  bool operator==(const Map2DPath& r) const;
57 
63  yarp::dev::Nav2D::Map2DLocation& operator[](size_t index);
64 
69  size_t size() const;
70 
75  double getLength() const;
76 
81  bool isOnSingleMap() const;
82 
83  public:
84  bool read(yarp::os::idl::WireReader& reader) override { return Map2DPathData::read(reader); }
85  bool write(const yarp::os::idl::WireWriter& writer) const override { return Map2DPathData::write(writer); }
86  bool read(yarp::os::ConnectionReader& reader) override { return Map2DPathData::read(reader); }
87  bool write(yarp::os::ConnectionWriter& writer) const override { return Map2DPathData::write(writer); }
88 
89  public:
93  void clear();
94 
95  using iterator = std::vector<Map2DLocation>::iterator;
96  using const_iterator = std::vector<Map2DLocation>::const_iterator;
97 
101  iterator begin() noexcept;
102 
106  iterator end() noexcept;
107 
111  const_iterator cbegin() const noexcept;
112 
116  const_iterator cend() const noexcept;
117 
122  void push_back(yarp::dev::Nav2D::Map2DLocation loc);
123  };
124  }
125  }
126 }
127 
128 #endif
yarp::dev::Nav2D::Map2DPath::read
bool read(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
Definition: Map2DPath.h:86
MapGrid2D.h
contains the definition of a map type
yarp::dev::Nav2D::Map2DPath::write
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
Definition: Map2DPath.h:87
yarp::dev::Map2DPathData
Definition: Map2DPathData.h:28
yarp::dev::Nav2D::Map2DPath::const_iterator
std::vector< Map2DLocation >::const_iterator const_iterator
Definition: Map2DPath.h:96
yarp::dev::Map2DPathData::write
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition: Map2DPathData.cpp:53
yarp::os::idl::WireWriter
IDL-friendly connection writer.
Definition: WireWriter.h:33
yarp::dev::Nav2D::Map2DPath::read
bool read(yarp::os::idl::WireReader &reader) override
Definition: Map2DPath.h:84
Map2DPathData.h
yarp::dev::Map2DPathData::read
bool read(yarp::os::idl::WireReader &reader) override
Definition: Map2DPathData.cpp:34
yarp::dev::Nav2D::Map2DPath::iterator
std::vector< Map2DLocation >::iterator iterator
Definition: Map2DPath.h:95
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::dev::Nav2D::Map2DPath::write
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition: Map2DPath.h:85
Map2DLocation.h
contains the definition of a Map2DLocation type
yarp::dev::Nav2D::Map2DPath
Definition: Map2DPath.h:27
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::Nav2D::Map2DLocation
Definition: Map2DLocation.h:30
yarp::os::idl::WireReader
IDL-friendly connection reader.
Definition: WireReader.h:33
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
toString
std::string toString(const T &value)
convert an arbitrary type to string.
Definition: fakeMotionControl.cpp:121
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18