YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
MapGrid2DInfo.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_MAPGRID2DINFO_H
7#define YARP_DEV_MAPGRID2DINFO_H
8
9#include <string>
10
11#include <yarp/os/Portable.h>
13#include <yarp/sig/Image.h>
14#include <yarp/math/Vec2D.h>
15#include <yarp/dev/api.h>
17#include <yarp/dev/NavTypes.h>
18
22namespace yarp::dev::Nav2D {
24{
25private:
26 double sa;
27 double ca;
28
29private:
30 double x;
31 double y;
32 double theta;
33public:
35 MapGrid2DOrigin(double x_init, double y_init, double t_init);
36 inline double get_x() const
37 {
38 return x;
39 }
40 inline double get_y() const
41 {
42 return y;
43 }
44 inline double get_theta() const
45 {
46 return theta;
47 }
48 void setOrigin(double x_init, double y_init, double t_init);
49 bool operator!=(const MapGrid2DOrigin& other) const;
50
51public:
52 inline double get_ca() const
53 {
54 return ca;
55 }
56 inline double get_sa() const
57 {
58 return sa;
59 }
60};
61
63{
64public:
66
68 double m_resolution;
70 size_t m_width;
71 size_t m_height;
72
73 //------------------------------utility functions-------------------------------
74 //convert a cell (from the upper-left corner) to the map reference frame (located in m_origin, measured in meters)
75 XYWorld cell2World(XYCell cell) const;
76 yarp::dev::Nav2D::Map2DLocation toLocation(XYCell cell) const;
77 XYCell toXYCell(yarp::dev::Nav2D::Map2DLocation loc) const;
78
79 //convert a world location (wrt the map reference frame located in m_origin, measured in meters), to a cell from the upper-left corner.
80 XYCell world2Cell(XYWorld world) const;
81 XYCell world2Cell_unsafeFast(XYWorld world) const;
82 yarp::dev::Nav2D::Map2DLocation toLocation(XYWorld cell) const;
83 XYWorld toXYWorld(yarp::dev::Nav2D::Map2DLocation loc) const;
84
89 bool isInsideMap(XYCell cell) const;
90
96 bool isInsideMap(XYWorld world) const;
97};
98} // namespace yarp::dev::Nav2D
99
100#endif // YARP_DEV_MAPGRID2D_H
contains the definition of a Map2DLocation type
contains definitions for common types used in navigation interfaces
MapGrid2DOrigin m_origin
pose of the map frame w.r.t. the bottom left corner of the map image
double m_resolution
meters/pixel
#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG(x)
Suppress MSVC C4251 warning for the declaration.
Definition system.h:338
#define YARP_dev_API
Definition api.h:18