Thunderbots Project
Loading...
Searching...
No Matches
Obstacle Class Referenceabstract

#include <obstacle.hpp>

Inheritance diagram for Obstacle:

Public Member Functions

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

Detailed Description

An obstacle is an area to avoid for navigation

Member Function Documentation

◆ accept()

virtual void accept ( ObstacleVisitor visitor) const
pure virtual

Accepts an Obstacle Visitor and calls the visit function

Parameters
visitorAn Obstacle Visitor

Implemented in GeomObstacle< GEOM_TYPE >.

◆ axisAlignedBoundingBox()

virtual Rectangle axisAlignedBoundingBox ( const double  inflation_radius) const
pure virtual

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

Implemented in GeomObstacle< GEOM_TYPE >.

◆ closestPoint()

virtual Point closestPoint ( const Point p) const
pure virtual

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.

Implemented in GeomObstacle< GEOM_TYPE >.

◆ contains()

virtual bool contains ( const Point p,
const double  t_sec = 0 
) const
pure virtual

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

Implemented in ConstVelocityObstacle< GEOM_TYPE >, GeomObstacle< GEOM_TYPE >, and TrajectoryObstacle< GEOM_TYPE >.

◆ createObstacleProto()

virtual TbotsProto::Obstacle createObstacleProto ( ) const
pure virtual

Creates an obstacle proto representation

Returns
the obstacle proto

Implemented in GeomObstacle< GEOM_TYPE >.

◆ distance()

virtual double distance ( const Point p,
const double  t_sec = 0 
) const
pure virtual

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

Implemented in ConstVelocityObstacle< GEOM_TYPE >, GeomObstacle< GEOM_TYPE >, and TrajectoryObstacle< GEOM_TYPE >.

◆ intersects()

virtual bool intersects ( const Segment segment,
const double  t_sec = 0 
) const
pure virtual

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

Implemented in ConstVelocityObstacle< GEOM_TYPE >, GeomObstacle< GEOM_TYPE >, and TrajectoryObstacle< GEOM_TYPE >.

◆ rasterize()

virtual std::vector< Point > rasterize ( const double  resolution_size) const
pure virtual

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

Implemented in GeomObstacle< GEOM_TYPE >.

◆ signedDistance()

virtual double signedDistance ( const Point point,
const double  t_sec = 0 
) const
pure virtual

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

Implemented in ConstVelocityObstacle< GEOM_TYPE >, GeomObstacle< GEOM_TYPE >, and TrajectoryObstacle< GEOM_TYPE >.

◆ toString()

virtual std::string toString ( void  ) const
pure virtual

Output string to describe the obstacle

Returns
string that describes the obstacle

Implemented in GeomObstacle< GEOM_TYPE >.


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