Class WorldScopedMaps

Inheritance Relationships

Derived Types

Class Documentation

class WorldScopedMaps

class to visualize information using OpenCV matrices

Subclassed by tuw::Figure, tuw::GridMap< T >, tuw::LayeredMaps

Public Functions

WorldScopedMaps()
virtual ~WorldScopedMaps() = default
WorldScopedMaps(const WorldScopedMaps&) = default
WorldScopedMaps &operator=(const WorldScopedMaps&) = default
WorldScopedMaps(WorldScopedMaps&&) = default
WorldScopedMaps &operator=(WorldScopedMaps&&) = default
inline void init(int width_pixel, int height_pixel, cv::Matx33d Mw2m)

used to initialize the figure

Parameters:
  • width_pixel – pixel size of the canvas

  • height_pixel – pixel size of the canvas

  • Mw2m – transformation world to map

void init(int width_pixel, int height_pixel, double min_y, double max_y, double min_x, double max_x, double rotation = 0)

used to initialize the figure

Parameters:
  • width_pixel – pixel size of the canvas

  • height_pixel – pixel size of the canvas

  • min_y – minimal y of the visualized space

  • max_y – maximal y of the visualized space

  • min_x – minimal x of the visualized space

  • max_x – maximal x of the visualized space

  • rotation – rotation of the visualized spaces

template<typename T>
inline void init(const T &metadata)

used to initialize the figure based on a ROS nav_msgs/MapMetaData

Parameters:

T – nav_msgs/MapMetaData

bool initialized()
Returns:

true if the figure is initialized

template<typename T>
inline void line(T &map, const Point2D &p0, const Point2D &p1, const cv::Scalar &color, int thickness = 1, int lineType = cv::LINE_AA) const

draws a line given in the visualization space (meter, ….) into a pixel map

See also

opencv

See also

opencv

See also

opencv

Parameters:
  • map – opencv matrix

  • p0 – start point

  • p1 – end point

  • color – color –>

  • thickness – line thickness –>

  • lineType – line type –>

template<typename T>
inline void circle(T &map, const Point2D &p, int radius, const cv::Scalar &color, int thickness = 1, int lineType = cv::LINE_AA) const

draws a circle given in the visualization space (meter, ….) into a pixel map

See also

opencv

See also

opencv

See also

opencv

Parameters:
  • map – opencv matrix

  • p – location

  • radius – radius

  • color – color –>

  • thickness – line thickness –>

  • lineType – line type –>

template<typename T>
inline cv::Scalar_<T> get(cv::Mat_<T> &map, const Point2D &p) const

return a copy of the value located at p in the visual space (meter, ….)

Parameters:
  • map – opencv matrix

  • p – location

const cv::Matx33d &Mw2m() const
Returns:

transformation matrix from the visualization space to image space (world -> map)

const cv::Matx33d &Mm2w() const
Returns:

transformation matrix from the image space to visualization space (map -> world)

Point2D w2m(const Point2D &src) const

transforms a point from the visualization space to image space (world -> map)

Parameters:

src – point in visualization space (world)

Returns:

point in image space (map [pixel])

Point2D w2m(double x, double y) const

transforms a point from the visualization space to image space (world -> map)

Parameters:
  • x – x coordinate in visualization space (world) eg. [m]

  • y – y coordinate in visualization space (world) eg. [m]

Returns:

point in image space eg. [pixel]

Point2D &w2m(const Point2D &src, Point2D &des) const

transforms a point from the visualization space to image space (world -> map)

Parameters:
  • src – point in visualization space (world)

  • des – point in image space (map [pixel])

Returns:

reference to des

Point2D m2w(const Point2D &src) const

transforms a point from the image space to visualization space (map -> world)

Parameters:

src – point in image space (map [pixel])

Returns:

point in visualization space (world)

Point2D m2w(double x, double y) const

transforms a point from the image space to visualization space (map -> world)

Parameters:
  • x – x coordinate in image space eg. [pixel]

  • y – y coordinate in image space eg. [pixel]

Returns:

point in visualization space (world) eg. [m]

Point2D &m2w(const Point2D &src, Point2D &des) const

transforms a point from the image space to visualization space (map -> world)

Parameters:
  • src – point in image space (map [pixel])

  • des – point in visualization space (world)

Returns:

reference to des

int width() const
Returns:

canvas (image) width

int height() const
Returns:

canvas (image) height

double scale_x() const
Returns:

computed x scale

double scale_y() const
Returns:

computed y scale

double min_x() const
Returns:

minimal x of the visualized space

double max_x() const
Returns:

maximal x of the visualized space

double min_y() const
Returns:

minimal y of the visualized space

double max_y() const
Returns:

maximal y of the visualized space

double scale_w2m(double v) const

returns a distance measure scaled

Parameters:

v – value to be scaledt

Returns:

distance

std::string infoHeader() const

returns information about the maps metadata

Parameters:

format – using printf format

Returns:

string