6#define _USE_MATH_DEFINES
18#define DEG2RAD M_PI/180.0
21MapGrid2DOrigin::MapGrid2DOrigin()
32 theta = fmod(t_init, 360.0);
50 if (theta != other.theta) {
92 int x = int((+world2.
x - this->m_origin.get_x()) / this->m_resolution) + 0;
93 int y = int((-world2.
y + this->m_origin.get_y()) / this->m_resolution) +
m_height - 1;
95 c.
x = (x < 0) ? 0 : x;
96 c.
y = (y < 0) ? 0 : y;
110 c.
x = int((+world2.
x - this->m_origin.get_x()) / this->m_resolution) + 0;
111 c.
y = int((-world2.
y + this->m_origin.get_y()) / this->m_resolution) +
m_height - 1;
double y
y position of the location [m], expressed in the map reference frame
double x
x position of the location [m], expressed in the map reference frame
XYCell world2Cell(XYWorld world) const
bool isInsideMap(XYCell cell) const
Checks if a cell is inside the map.
XYWorld toXYWorld(yarp::dev::Nav2D::Map2DLocation loc) const
XYWorld cell2World(XYCell cell) const
yarp::dev::Nav2D::Map2DLocation toLocation(XYCell cell) const
XYCell toXYCell(yarp::dev::Nav2D::Map2DLocation loc) const
MapGrid2DOrigin m_origin
pose of the map frame w.r.t. the bottom left corner of the map image
XYCell world2Cell_unsafeFast(XYWorld world) const
double m_resolution
meters/pixel
void setOrigin(double x_init, double y_init, double t_init)
bool operator!=(const MapGrid2DOrigin &other) const
yarp::math::Vec2D< double > XYWorld
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.