Thunderbots Project
Loading...
Searching...
No Matches
GeomObstacle< GEOM_TYPE > Class Template Reference
Inheritance diagram for GeomObstacle< GEOM_TYPE >:
Collaboration diagram for GeomObstacle< GEOM_TYPE >:

Public Member Functions

 GeomObstacle (const GEOM_TYPE &geom)
 
bool contains (const Point &p, const double t_sec=0) const override
 
double distance (const Point &p, const double t_sec=0) const override
 
double signedDistance (const Point &p, const double t_sec=0) const override
 
bool intersects (const Segment &segment, const double t_sec=0) const override
 
Point closestPoint (const Point &p) const override
 
TbotsProto::Obstacle createObstacleProto () const override
 
Rectangle axisAlignedBoundingBox (double inflation_radius=0) const override
 
std::string toString (void) const override
 
void accept (ObstacleVisitor &visitor) const override
 
std::vector< Pointrasterize (const double resolution_size) const override
 
const GEOM_TYPE getGeom (void) const
 

Protected Attributes

const GEOM_TYPE geom_
 

Constructor & Destructor Documentation

◆ GeomObstacle()

template<typename GEOM_TYPE >
GeomObstacle ( const GEOM_TYPE &  geom)
explicit

Construct a static GeomObstacle with GEOM_TYPE

Parameters
geomGEOM_TYPE to make obstacle with

Member Function Documentation

◆ accept()

template<typename GEOM_TYPE >
void accept ( ObstacleVisitor visitor) const
overridevirtual

Accepts an Obstacle Visitor and calls the visit function

Parameters
visitorAn Obstacle Visitor

Implements Obstacle.

◆ axisAlignedBoundingBox()

template<typename GEOM_TYPE >
Rectangle axisAlignedBoundingBox ( double  inflation_radius = 0) const
overridevirtual

Create the axis aligned bounding box for this obstacle

Parameters
inflation_radiusThe radius to inflate the obstacle by before creating the AABB
Returns
Rectangle representing the axis aligned bounding box

Implements Obstacle.

◆ closestPoint()

template<typename GEOM_TYPE >
Point closestPoint ( const Point p) const
overridevirtual

Finds the Point closest to the given Point that is outside of the obstacle.

Parameters
pthe point.
Returns
the Point on polygon closest to point.

Implements Obstacle.

◆ contains()

template<typename GEOM_TYPE >
bool contains ( const Point p,
const double  t_sec = 0 
) const
overridevirtual

Determines whether the given Point is contained within this Obstacle

Parameters
pPoint to check if contained by obstacle
t_secTime in seconds into the future to check if point is contained.
Returns
whether the Point p is contained within this Obstacle

Implements Obstacle.

Reimplemented in TrajectoryObstacle< GEOM_TYPE >.

◆ createObstacleProto()

template<typename GEOM_TYPE >
TbotsProto::Obstacle createObstacleProto ( ) const
overridevirtual

Creates an obstacle proto representation

Returns
the obstacle proto

Implements Obstacle.

◆ distance()

template<typename GEOM_TYPE >
double distance ( const Point p,
const double  t_sec = 0 
) const
overridevirtual

Gets the minimum distance from the obstacle to the point

Parameters
pPoint to get distance to
t_secTime in seconds into the future to get distance to.
Returns
distance to point

Implements Obstacle.

Reimplemented in TrajectoryObstacle< GEOM_TYPE >.

◆ getGeom()

template<typename GEOM_TYPE >
const GEOM_TYPE getGeom ( void  ) const

Gets the underlying GEOM_TYPE

Returns
geom type

◆ intersects()

template<typename GEOM_TYPE >
bool intersects ( const Segment segment,
const double  t_sec = 0 
) const
overridevirtual

Determines whether the given Segment intersects this Obstacle

Parameters
segmentSegment to check if intersects with this Obstacle
t_secTime in seconds into the future to check if segment intersects.
Returns
true if the given Segment intersects this Obstacle

Implements Obstacle.

Reimplemented in TrajectoryObstacle< GEOM_TYPE >.

◆ rasterize()

template<typename GEOM_TYPE >
std::vector< Point > rasterize ( const double  resolution_size) const
overridevirtual

Determines what coordinates on the field are blocked by this Obstacle

Parameters
resolution_sizeThe minimum size of the grid cells to rasterize the obstacle into
Returns
a set of points covered by this Obstacle

Implements Obstacle.

◆ signedDistance()

template<typename GEOM_TYPE >
double signedDistance ( const Point point,
const double  t_sec = 0 
) const
overridevirtual

Gets the signed distance from the obstacle's perimeter to the point. That is, if point is inside the obstacle then distance will be negative. See https://iquilezles.org/articles/distfunctions2d/ for details on the maths

Parameters
pointPoint to get distance to
t_secTime in seconds into the future to get distance to.
Returns
distance from point to nearest point on perimeter of obstacle. Positive if outside, negative if inside

Implements Obstacle.

Reimplemented in TrajectoryObstacle< GEOM_TYPE >.

◆ toString()

template<typename GEOM_TYPE >
std::string toString ( void  ) const
overridevirtual

Output string to describe the obstacle

Returns
string that describes the obstacle

Implements Obstacle.


The documentation for this class was generated from the following file: