YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Map2DArea.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_MAP2DAREA_H
7#define YARP_DEV_MAP2DAREA_H
8
9#include <yarp/os/Portable.h>
10#include <yarp/math/Vec2D.h>
11#include <yarp/dev/api.h>
14#include <sstream>
15#include <string>
16#include <vector>
17
21namespace yarp::dev::Nav2D {
23{
24public:
30 Map2DArea(const std::string& map_name, const std::vector<yarp::math::Vec2D<double>>& area_points, const std::string& desc = "");
31
37 Map2DArea(const std::string& map_name, const std::vector<yarp::dev::Nav2D::Map2DLocation>& area_points, const std::string& desc = "");
38
42 Map2DArea();
43
48 std::string toString() const;
49
54 bool operator!=(const Map2DArea& r) const;
55
60 bool operator==(const Map2DArea& r) const;
61
66 bool isValid() const;
67
73 bool checkLocationInsideArea(yarp::dev::Nav2D::Map2DLocation loc);
74
82
88 bool getCentroid(yarp::dev::Nav2D::Map2DLocation& cent);
89
95 bool getRandomLocation(yarp::dev::Nav2D::Map2DLocation& loc);
96
102 yarp::math::Vec2D<double>& operator[](size_t index);
103
107 void clear();
108
112 bool read(yarp::os::idl::WireReader& reader) override
113 {
114 return Map2DAreaData::read(reader);
115 }
116 bool write(const yarp::os::idl::WireWriter& writer) const override
117 {
118 return Map2DAreaData::write(writer);
119 }
120 bool read(yarp::os::ConnectionReader& reader) override
121 {
122 return Map2DAreaData::read(reader);
123 }
124 bool write(yarp::os::ConnectionWriter& writer) const override
125 {
126 return Map2DAreaData::write(writer);
127 }
128};
129} // namespace yarp::dev::Nav2D
130
131#endif // YARP_DEV_MAP2DAREA_H
bool operator==(const struct v4l2_control &left, const struct v4l2_control &right)
Definition CApiMock.h:65
std::string toString(const T &value)
convert an arbitrary type to string.
contains the definition of a Map2DLocation type
bool read(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
Definition Map2DArea.h:120
bool read(yarp::os::idl::WireReader &reader) override
Serialization methods.
Definition Map2DArea.h:112
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition Map2DArea.h:116
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
Definition Map2DArea.h:124
An interface for reading from a network connection.
An interface for writing to a network connection.
IDL-friendly connection reader.
Definition WireReader.h:27
IDL-friendly connection writer.
Definition WireWriter.h:28
#define YARP_dev_API
Definition api.h:18