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

Public Member Functions

 TrajectoryObstacle (const GEOM_TYPE &geom, TrajectoryPath traj)
 
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
 
- Public Member Functions inherited from GeomObstacle< GEOM_TYPE >
 GeomObstacle (const GEOM_TYPE &geom)
 
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
 

Additional Inherited Members

- Protected Attributes inherited from GeomObstacle< GEOM_TYPE >
const GEOM_TYPE geom_
 

Constructor & Destructor Documentation

◆ TrajectoryObstacle()

template<typename GEOM_TYPE >
TrajectoryObstacle ( const GEOM_TYPE &  geom,
TrajectoryPath  traj 
)
explicit

Construct a TrajectoryObstacle with GEOM_TYPE

Parameters
geomGEOM_TYPE to make obstacle with
trajTrajectory which the obstacle is following

Member Function Documentation

◆ 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

Reimplemented from GeomObstacle< GEOM_TYPE >.

◆ 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

Reimplemented from GeomObstacle< 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

Reimplemented from GeomObstacle< GEOM_TYPE >.

◆ 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

Reimplemented from GeomObstacle< GEOM_TYPE >.


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