|
LARS
LARS (Light Augmented Reality System) is an open-source framework for light-based interaction and real-time tracking in multi-robot experiments. Inspired by ARK, LARS extends the augmented reality paradigm to robotic collectives by projecting dynamic visual cues and environments onto the arena, enabling new experimental possibilities for collective robotics research, education, and outreach. LARS features integrated tracking, light projection, and modular experiment control with a user-friendly Qt GUI.
|
2D rectangle regin class. More...
#include <rect_2d.h>
Public Member Functions | |
| Rect2D () | |
| default constructor creates a zero area rectanble at (0,0) | |
| Rect2D (const Vector2D &top_left, const Size2D &size) | |
| constructor with variables | |
| Rect2D (const Vector2D &top_left, const Vector2D &bottom_right) | |
| constructor with 2 points. | |
| const Rect2D & | assign (const Vector2D &top_left, const Size2D &size) |
| assign new values | |
| const Rect2D & | moveCenter (const Vector2D &point) |
| move the rectangle. the center point is set to the given position. the size is unchanged. | |
| const Rect2D & | moveTopLeft (const Vector2D &point) |
| move the rectangle. the top-left coner is set to the given position. the size is unchanged. | |
| const Rect2D & | moveBottomRight (const Vector2D &point) |
| move the rectangle. the bottom-right coner is set to the given position. the size is unchanged. | |
| const Rect2D & | moveLeft (const double &x) |
| move the rectangle. the left line is set to the given position. the size is unchanged. | |
| const Rect2D & | moveMinX (const double &x) |
| alias of moveLeft. | |
| const Rect2D & | moveRight (const double &x) |
| move the rectangle. the right line is set to the given value. the size is unchanged. | |
| const Rect2D & | moveMaxX (const double &x) |
| alias of moveRight. | |
| const Rect2D & | moveTop (const double &y) |
| move the rectangle. the top line is set to the given value. the size is unchanged. | |
| const Rect2D & | moveMinY (const double &y) |
| alias of moveTop. | |
| const Rect2D & | moveBottom (const double &y) |
| move the rectangle. the top line is set to the given value. the size is unchanged. | |
| const Rect2D & | moveMaxY (const double &y) |
| alias of moveTop. | |
| const Rect2D & | setTopLeft (const double &x, const double &y) |
| set the top-left corner of the rectangle. the size may be changed, but the bottom-right corner will never be changed. | |
| const Rect2D & | setTopLeft (const Vector2D &point) |
| set the top-left corner of the rectangle. the size may be changed, but the bottom-right corner will never be changed. | |
| const Rect2D & | setBottomRight (const double &x, const double &y) |
| set the bottom-right corner of the rectangle. the size may be changed, but the top-left corner will never be changed. | |
| const Rect2D & | setBottomRight (const Vector2D &point) |
| set the bottom-right corner of the rectangle. the size may be changed, but the top-left corner will never be changed. | |
| const Rect2D & | setLeft (const double &x) |
| set the left of rectangle. the size may be changed, but the right will never be changed. | |
| const Rect2D & | setMinX (const double &x) |
| alias of setLeft. | |
| const Rect2D & | setRight (const double &x) |
| set the right of rectangle. the size may be changed, but the left will never be changed. | |
| const Rect2D & | setMaxX (const double &x) |
| alias of setRight. | |
| const Rect2D & | setTop (const double &y) |
| set the top of rectangle. the size may be changed, but the bottom will never be changed. | |
| const Rect2D & | setMinY (const double &y) |
| alias of setTop. | |
| const Rect2D & | setBottom (const double &y) |
| set the bottom of rectangle. the size may be changed, but the top will never be changed. | |
| const Rect2D & | setMaxY (const double &y) |
| alias of setBottom. | |
| const Rect2D & | setLength (const double &length) |
| set a new x-range | |
| const Rect2D & | setWidth (const double &width) |
| set a new y-range | |
| const Rect2D & | setSize (const double &length, const double &width) |
| set a new size | |
| const Rect2D & | setSize (const Size2D &size) |
| set a new size | |
| bool | isValid () const |
| check if this rectangle is valid or not. | |
| virtual double | area () const |
| get the area value of this rectangle. | |
| virtual bool | contains (const Vector2D &point) const |
| check if point is within this region. | |
| bool | contains (const Vector2D &point, const double &error_thr) const |
| check if point is within this region with error threshold. | |
| const double & | left () const |
| get the left x coordinate of this rectangle. | |
| double | right () const |
| get the right x coordinate of this rectangle. | |
| const double & | top () const |
| get the top y coordinate of this rectangle. | |
| double | bottom () const |
| get the bottom y coordinate of this rectangle. | |
| double | minX () const |
| get minimum value of x coordinate of this rectangle | |
| double | maxX () const |
| get maximum value of x coordinate of this rectangle | |
| double | minY () const |
| get minimum value of y coordinate of this rectangle | |
| double | maxY () const |
| get maximum value of y coordinate of this rectangle | |
| const Size2D & | size () const |
| get the XY range of this rectangle | |
| Vector2D | center () const |
| get center point | |
| const Vector2D & | topLeft () const |
| get the top-left corner point | |
| Vector2D | topRight () const |
| get the top-right corner point | |
| Vector2D | bottomLeft () const |
| get the bottom-left corner point | |
| Vector2D | bottomRight () const |
| get the bottom-right corner point | |
| Line2D | leftEdge () const |
| get the left edge line | |
| Line2D | rightEdge () const |
| get the right edge line | |
| Line2D | topEdge () const |
| get the top edge line | |
| Line2D | bottomEdge () const |
| get the bottom edge line | |
| int | intersection (const Line2D &line, Vector2D *sol1, Vector2D *sol2) const |
| calculate intersection point with line. | |
| int | intersection (const Ray2D &ray, Vector2D *sol1, Vector2D *sol2) const |
| calculate intersection point with ray. | |
| int | intersection (const Segment2D &segment, Vector2D *sol1, Vector2D *sol2) const |
| calculate intersection point with line segment. | |
| const Rect2D & | operator&= (const Rect2D &other) |
| convert this rectangle to the intersection rectangle with other. If no intersection between rectangles, this rectangle becomes empty. | |
| Rect2D | intersected (const Rect2D &other) const |
| get the intersected rectangle of this rectangle and the other rectangle. This method is equivalent to operator '&'. If no intersection between rectangles, empty rectangle is returned. | |
| const Rect2D & | operator|= (const Rect2D &other) |
| convert this rectangle to the united rectangle with other. | |
| Rect2D | united (const Rect2D &other) const |
| get the united rectangle of this rectangle and the other rectangle. This method is equivalent to operator '|'. | |
| Public Member Functions inherited from rcsc::Region2D | |
| virtual | ~Region2D () |
| virtual destructor. | |
Static Public Member Functions | |
| static Rect2D | from_center (const Vector2D ¢er, const double &length, const double &width) |
| create rectangle with center point and size. | |
| static Rect2D | from_center (const double ¢er_x, const double ¢er_y, const double &length, const double &width) |
| create rectangle with center point and size. | |
| static Rect2D | from_corners (const Vector2D &top_left, const Vector2D &bottom_right) |
| create rectangle with 2 corner points. just call one of constructor. | |
| static Rect2D | from_corners (const double &l, const double &t, const double &r, const double &b) |
| create rectangle with 2 corner points. just call one of constructor. | |
Additional Inherited Members | |
| Protected Member Functions inherited from rcsc::Region2D | |
| Region2D () | |
| accessible only from derived classes | |
2D rectangle regin class.
The model and naming rules are depend on soccer simulator environment -34.0 | | -52.5 ---—+----— 52.5 | | 34.0
constructor with variables
| top_left | top left point |
| size | XY range |
constructor with 2 points.
| top_left | top left vertex |
| bottom_right | bottom right vertex |
Even if argument point has incorrect values, the assigned values are normalized automatically.
|
inlinevirtual |
assign new values
| top_left | top left |
| size | XY range |
|
inline |
get the bottom y coordinate of this rectangle.
|
inline |
get the bottom edge line
|
inline |
get the bottom-left corner point
|
inline |
get the bottom-right corner point
|
inline |
get center point
|
inlinevirtual |
check if point is within this region.
| point | considered point |
Implements rcsc::Region2D.
|
inline |
check if point is within this region with error threshold.
| point | considered point |
| error_thr | error threshold |
|
inlinestatic |
create rectangle with center point and size.
| center_x | x value of center point of new rectangle. |
| center_y | y value of center point of new rectangle. |
| length | length(x-range) of new rectangle. |
| width | width(y-range) of new rectangle. |
|
inlinestatic |
create rectangle with center point and size.
| center | center point of new rectangle. |
| length | length(x-range) of new rectangle. |
| width | width(y-range) of new rectangle. |
|
inlinestatic |
create rectangle with 2 corner points. just call one of constructor.
| l | left x |
| t | top y |
| r | right x |
| b | bottom y |
|
inlinestatic |
create rectangle with 2 corner points. just call one of constructor.
| top_left | top left vertex |
| bottom_right | bottom right vertex |
get the intersected rectangle of this rectangle and the other rectangle. This method is equivalent to operator '&'. If no intersection between rectangles, empty rectangle is returned.
| other | other rectangle |
calculate intersection point with line.
| line | considerd line. |
| sol1 | pointer to the 1st solution variable |
| sol2 | pointer to the 2nd solution variable |
calculate intersection point with ray.
| ray | considerd ray line. |
| sol1 | pointer to the 1st solution variable |
| sol2 | pointer to the 2nd solution variable |
| int rcsc::Rect2D::intersection | ( | const Segment2D & | segment, |
| Vector2D * | sol1, | ||
| Vector2D * | sol2 ) const |
calculate intersection point with line segment.
| segment | considerd line segment. |
| sol1 | pointer to the 1st solution variable |
| sol2 | pointer to the 2nd solution variable |
|
inline |
check if this rectangle is valid or not.
|
inline |
get the left x coordinate of this rectangle.
|
inline |
get the left edge line
|
inline |
get maximum value of x coordinate of this rectangle
|
inline |
get maximum value of y coordinate of this rectangle
|
inline |
get minimum value of x coordinate of this rectangle
|
inline |
get minimum value of y coordinate of this rectangle
|
inline |
move the rectangle. the top line is set to the given value. the size is unchanged.
| y | new top value |
move the rectangle. the bottom-right coner is set to the given position. the size is unchanged.
| point | new bottom-right conrer |
move the rectangle. the center point is set to the given position. the size is unchanged.
| point | new center coordinates |
|
inline |
move the rectangle. the left line is set to the given position. the size is unchanged.
| x | new left value |
|
inline |
alias of moveRight.
| x | new right value |
|
inline |
alias of moveTop.
| y | new top value |
|
inline |
alias of moveLeft.
| x | new left value |
|
inline |
alias of moveTop.
| y | new top value |
|
inline |
move the rectangle. the right line is set to the given value. the size is unchanged.
| x | new right value |
|
inline |
move the rectangle. the top line is set to the given value. the size is unchanged.
| y | new top value |
move the rectangle. the top-left coner is set to the given position. the size is unchanged.
| point | new top-left corner |
convert this rectangle to the intersection rectangle with other. If no intersection between rectangles, this rectangle becomes empty.
| other | other rectangle. |
convert this rectangle to the united rectangle with other.
| other | other rectangle. |
|
inline |
get the right x coordinate of this rectangle.
|
inline |
get the right edge line
| const Rect2D & rcsc::Rect2D::setBottom | ( | const double & | y | ) |
set the bottom of rectangle. the size may be changed, but the top will never be changed.
| y | new bottom value |
| const Rect2D & rcsc::Rect2D::setBottomRight | ( | const double & | x, |
| const double & | y ) |
set the bottom-right corner of the rectangle. the size may be changed, but the top-left corner will never be changed.
| x | new x coordinate |
| y | new y coordinate |
set the bottom-right corner of the rectangle. the size may be changed, but the top-left corner will never be changed.
| point | new coordinate |
| const Rect2D & rcsc::Rect2D::setLeft | ( | const double & | x | ) |
set the left of rectangle. the size may be changed, but the right will never be changed.
| x | new left value |
|
inline |
set a new x-range
| length | new range |
|
inline |
alias of setRight.
| x | new right value |
|
inline |
alias of setBottom.
| y | new top value |
|
inline |
alias of setLeft.
| x | new left value |
|
inline |
alias of setTop.
| y | new top value |
| const Rect2D & rcsc::Rect2D::setRight | ( | const double & | x | ) |
set the right of rectangle. the size may be changed, but the left will never be changed.
| x | new right value |
|
inline |
set a new size
| length | new range |
| width | new range |
set a new size
| size | new range |
| const Rect2D & rcsc::Rect2D::setTop | ( | const double & | y | ) |
set the top of rectangle. the size may be changed, but the bottom will never be changed.
| y | new top value |
| const Rect2D & rcsc::Rect2D::setTopLeft | ( | const double & | x, |
| const double & | y ) |
set the top-left corner of the rectangle. the size may be changed, but the bottom-right corner will never be changed.
| x | new x coordinate |
| y | new y coordinate |
set the top-left corner of the rectangle. the size may be changed, but the bottom-right corner will never be changed.
| point | new coordinate |
|
inline |
set a new y-range
| width | new range |
|
inline |
get the XY range of this rectangle
|
inline |
get the top y coordinate of this rectangle.
|
inline |
get the top edge line
|
inline |
get the top-left corner point
|
inline |
get the top-right corner point
get the united rectangle of this rectangle and the other rectangle. This method is equivalent to operator '|'.
| other | other rectangle |