Class polygon2D_visualizer

Class Documentation

class polygon2D_visualizer

Renders a 2D polygon (including the vertices) in the plane specified by the robot’s Z coordinate. Polygons generally are related to a given robot in some way (e.g., a LOS, the nearest known target region, etc.).

Rendered polygons can be:

  • Relative to a robot’s current location

  • Specified in absolute coordinates.

Public Functions

inline explicit polygon2D_visualizer(::argos::CQTOpenGLUserFunctions *qt)
polygon2D_visualizer(const polygon2D_visualizer&) = delete
void abs_draw(const rmath::vector3d &pos, const ::argos::CQuaternion &orientation, const std::vector<rmath::vector2d> &points, const rutils::color &color)

Draw the polygon vertices specified in absolute coordinates.

pos and orientation are required to rotate and translate the Qt drawing canvas out of the robot’s reference frame.

Parameters:
  • pos – The robot’s current position.

  • orientation – The robot’s current orientation.

  • points – The points of the polygon, specified in counter clockwise order.

  • color – The color of the polygon LINES; vertices are always drawn in cyan.

polygon2D_visualizer &operator=(const polygon2D_visualizer&) = delete
void relative_draw(const rmath::vector3d &pos, const std::vector<rmath::vector2d> &points, const rutils::color &color)

Draw the polygon vertices specified in coordinates relative to the robot’s current location (i.e., will move as the robot moves).

pos and orientation are required to rotate and translate the Qt drawing canvas out of the robot’s reference frame.

Parameters:
  • pos – The robot’s current position (needed for Z offset).

  • points – The points of the polygon, specified in counter clockwise order.

  • color – The color of the polygon LINES; vertices are always drawn in cyan.