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
>
12
#include <
yarp/os/ConnectionReader.h
>
13
#include <
yarp/sig/Image.h
>
14
#include <
yarp/math/Vec2D.h
>
15
#include <
yarp/dev/api.h
>
16
#include <
yarp/dev/Map2DLocation.h
>
17
#include <
yarp/dev/NavTypes.h
>
18
22
namespace
yarp::dev::Nav2D
{
23
class
YARP_dev_API
MapGrid2DOrigin
24
{
25
private
:
26
double
sa;
27
double
ca;
28
29
private
:
30
double
x;
31
double
y;
32
double
theta;
33
public
:
34
MapGrid2DOrigin
();
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
51
public
:
52
inline
double
get_ca
()
const
53
{
54
return
ca;
55
}
56
inline
double
get_sa
()
const
57
{
58
return
sa;
59
}
60
};
61
62
class
YARP_dev_API
MapGrid2DInfo
63
{
64
public
:
65
MapGrid2DInfo
();
66
67
YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG
(std::string)
m_map_name
;
68
double
m_resolution
;
69
MapGrid2DOrigin
m_origin
;
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
ConnectionReader.h
Image.h
Map2DLocation.h
contains the definition of a Map2DLocation type
NavTypes.h
contains definitions for common types used in navigation interfaces
Portable.h
Vec2D.h
yarp::dev::Nav2D::MapGrid2DInfo
Definition
MapGrid2DInfo.h:63
yarp::dev::Nav2D::MapGrid2DInfo::m_width
size_t m_width
cells
Definition
MapGrid2DInfo.h:70
yarp::dev::Nav2D::MapGrid2DInfo::m_origin
MapGrid2DOrigin m_origin
pose of the map frame w.r.t. the bottom left corner of the map image
Definition
MapGrid2DInfo.h:69
yarp::dev::Nav2D::MapGrid2DInfo::m_map_name
std::string m_map_name
Definition
MapGrid2DInfo.h:67
yarp::dev::Nav2D::MapGrid2DInfo::m_resolution
double m_resolution
meters/pixel
Definition
MapGrid2DInfo.h:68
yarp::dev::Nav2D::MapGrid2DInfo::m_height
size_t m_height
cells
Definition
MapGrid2DInfo.h:71
yarp::dev::Nav2D::MapGrid2DOrigin
Definition
MapGrid2DInfo.h:24
yarp::dev::Nav2D::MapGrid2DOrigin::get_ca
double get_ca() const
Definition
MapGrid2DInfo.h:52
yarp::dev::Nav2D::MapGrid2DOrigin::get_theta
double get_theta() const
Definition
MapGrid2DInfo.h:44
yarp::dev::Nav2D::MapGrid2DOrigin::get_y
double get_y() const
Definition
MapGrid2DInfo.h:40
yarp::dev::Nav2D::MapGrid2DOrigin::get_sa
double get_sa() const
Definition
MapGrid2DInfo.h:56
yarp::dev::Nav2D::MapGrid2DOrigin::get_x
double get_x() const
Definition
MapGrid2DInfo.h:36
yarp::math::Vec2D< double >
yarp::dev::Nav2D
Definition
ILocalization2D.h:17
yarp::dev::Nav2D::Map2DLocation
Definition
Map2DLocation.h:22
YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG
#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG(x)
Suppress MSVC C4251 warning for the declaration.
Definition
system.h:338
api.h
YARP_dev_API
#define YARP_dev_API
Definition
api.h:18
YARP
3.11.100+20250401.4+gitb9213d601
src
libYARP_dev
src
yarp
dev
MapGrid2DInfo.h
Generated on Sun Apr 20 2025 02:40:03 for YARP by
1.9.8