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

Public Member Functions

 ConstVelocityObstacle (const GEOM_TYPE &geom, Vector velocity, double max_time_horizon_sec)
 
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)
 
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
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ConstVelocityObstacle()

template<typename GEOM_TYPE >
ConstVelocityObstacle ( const GEOM_TYPE &  geom,
Vector  velocity,
double  max_time_horizon_sec 
)
explicit

Construct a ConstVelocityObstacle with GEOM_TYPE

Parameters
geomGEOM_TYPE to make obstacle with
velocityVelocity of the obstacle
max_time_horizon_secMaximum time into the future the position of the obstacle is predicted for in seconds. This is needed since the prediction of the obstacle's position in the future becomes less accurate as time increases.

Member Function Documentation

◆ contains()

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

Instead of shifting the obstacle, it is simpler to shift the point in the opposite direction.

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.

◆ 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.

◆ 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.


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