Public Member Functions | Protected Attributes | List of all members
teb_local_planner::PointObstacle Class Reference

Implements a 2D point obstacle. More...

#include <obstacles.h>

Inheritance diagram for teb_local_planner::PointObstacle:
Inheritance graph
[legend]

Public Member Functions

virtual bool checkCollision (const Eigen::Vector2d &point, double min_dist) const
 Check if a given point collides with the obstacle. More...
 
virtual bool checkLineIntersection (const Eigen::Vector2d &line_start, const Eigen::Vector2d &line_end, double min_dist=0) const
 Check if a given line segment between two points intersects with the obstacle (and additionally keeps a safty distance min_dist) More...
 
virtual const Eigen::Vector2d & getCentroid () const
 Get centroid coordinates of the obstacle. More...
 
virtual std::complex< double > getCentroidCplx () const
 Get centroid coordinates of the obstacle as complex number. More...
 
virtual Eigen::Vector2d getClosestPoint (const Eigen::Vector2d &position) const
 Get the closest point on the boundary of the obstacle w.r.t. a specified reference position. More...
 
virtual double getMinimumDistance (const Eigen::Vector2d &line_start, const Eigen::Vector2d &line_end) const
 Get the minimum euclidean distance to the obstacle (line as reference) More...
 
virtual double getMinimumDistance (const Eigen::Vector2d &position) const
 Get the minimum euclidean distance to the obstacle (point as reference) More...
 
virtual double getMinimumDistance (const Point2dContainer &polygon) const
 Get the minimum euclidean distance to the obstacle (polygon as reference) More...
 
virtual double getMinimumSpatioTemporalDistance (const Eigen::Vector2d &line_start, const Eigen::Vector2d &line_end, double t) const
 Get the estimated minimum spatiotemporal distance to the moving obstacle using a constant velocity model (line as reference) More...
 
virtual double getMinimumSpatioTemporalDistance (const Eigen::Vector2d &position, double t) const
 Get the estimated minimum spatiotemporal distance to the moving obstacle using a constant velocity model (point as reference) More...
 
virtual double getMinimumSpatioTemporalDistance (const Point2dContainer &polygon, double t) const
 Get the estimated minimum spatiotemporal distance to the moving obstacle using a constant velocity model (polygon as reference) More...
 
 PointObstacle ()
 Default constructor of the point obstacle class. More...
 
 PointObstacle (const Eigen::Ref< const Eigen::Vector2d > &position)
 Construct PointObstacle using a 2d position vector. More...
 
 PointObstacle (double x, double y)
 Construct PointObstacle using x- and y-coordinates. More...
 
virtual void predictCentroidConstantVelocity (double t, Eigen::Ref< Eigen::Vector2d > position) const
 Predict position of the centroid assuming a constant velocity model. More...
 
virtual void toPolygonMsg (geometry_msgs::Polygon &polygon)
 Convert the obstacle to a polygon message. More...
 
- Public Member Functions inherited from teb_local_planner::Obstacle
 Obstacle ()
 Default constructor of the abstract obstacle class. More...
 
virtual ~Obstacle ()
 Virtual destructor. More...
 
bool isDynamic () const
 Check if the obstacle is a moving with a (non-zero) velocity. More...
 
void setCentroidVelocity (const Eigen::Ref< const Eigen::Vector2d > &vel)
 Set the 2d velocity (vx, vy) of the obstacle w.r.t to the centroid. More...
 
void setCentroidVelocity (const geometry_msgs::TwistWithCovariance &velocity, const geometry_msgs::Quaternion &orientation)
 Set the 2d velocity (vx, vy) of the obstacle w.r.t to the centroid. More...
 
void setCentroidVelocity (const geometry_msgs::TwistWithCovariance &velocity, const geometry_msgs::QuaternionStamped &orientation)
 
const Eigen::Vector2d & getCentroidVelocity () const
 Get the obstacle velocity (vx, vy) (w.r.t. to the centroid) More...
 
virtual void toTwistWithCovarianceMsg (geometry_msgs::TwistWithCovariance &twistWithCovariance)
 

Protected Attributes

Eigen::Vector2d pos_
 Store the position of the PointObstacle. More...
 
- Protected Attributes inherited from teb_local_planner::Obstacle
bool dynamic_
 Store flag if obstacle is dynamic (resp. a moving obstacle) More...
 
Eigen::Vector2d centroid_velocity_
 Store the corresponding velocity (vx, vy) of the centroid (zero, if _dynamic is true) More...
 

Detailed Description

Implements a 2D point obstacle.

Definition at line 341 of file obstacles.h.

Constructor & Destructor Documentation

◆ PointObstacle() [1/3]

teb_local_planner::PointObstacle::PointObstacle ( )
inline

Default constructor of the point obstacle class.

Definition at line 348 of file obstacles.h.

◆ PointObstacle() [2/3]

teb_local_planner::PointObstacle::PointObstacle ( const Eigen::Ref< const Eigen::Vector2d > &  position)
inline

Construct PointObstacle using a 2d position vector.

Parameters
position2d position that defines the current obstacle position

Definition at line 355 of file obstacles.h.

◆ PointObstacle() [3/3]

teb_local_planner::PointObstacle::PointObstacle ( double  x,
double  y 
)
inline

Construct PointObstacle using x- and y-coordinates.

Parameters
xx-coordinate
yy-coordinate

Definition at line 363 of file obstacles.h.

Member Function Documentation

◆ checkCollision()

virtual bool teb_local_planner::PointObstacle::checkCollision ( const Eigen::Vector2d &  position,
double  min_dist 
) const
inlinevirtual

Check if a given point collides with the obstacle.

Parameters
position2D reference position that should be checked
min_distMinimum distance allowed to the obstacle to be collision free
Returns
true if position is inside the region of the obstacle or if the minimum distance is lower than min_dist

Implements teb_local_planner::Obstacle.

Definition at line 368 of file obstacles.h.

◆ checkLineIntersection()

virtual bool teb_local_planner::PointObstacle::checkLineIntersection ( const Eigen::Vector2d &  line_start,
const Eigen::Vector2d &  line_end,
double  min_dist = 0 
) const
inlinevirtual

Check if a given line segment between two points intersects with the obstacle (and additionally keeps a safty distance min_dist)

Parameters
line_start2D point for the end of the reference line
line_end2D point for the end of the reference line
min_distMinimum distance allowed to the obstacle to be collision/intersection free
Returns
true if given line intersects the region of the obstacle or if the minimum distance is lower than min_dist

Implements teb_local_planner::Obstacle.

Definition at line 375 of file obstacles.h.

◆ getCentroid()

virtual const Eigen::Vector2d& teb_local_planner::PointObstacle::getCentroid ( ) const
inlinevirtual

Get centroid coordinates of the obstacle.

Returns
Eigen::Vector2d containing the centroid

Implements teb_local_planner::Obstacle.

Definition at line 442 of file obstacles.h.

◆ getCentroidCplx()

virtual std::complex<double> teb_local_planner::PointObstacle::getCentroidCplx ( ) const
inlinevirtual

Get centroid coordinates of the obstacle as complex number.

Returns
std::complex containing the centroid coordinate

Implements teb_local_planner::Obstacle.

Definition at line 448 of file obstacles.h.

◆ getClosestPoint()

virtual Eigen::Vector2d teb_local_planner::PointObstacle::getClosestPoint ( const Eigen::Vector2d &  position) const
inlinevirtual

Get the closest point on the boundary of the obstacle w.r.t. a specified reference position.

Parameters
positionreference 2d position
Returns
closest point on the obstacle boundary

Implements teb_local_planner::Obstacle.

Definition at line 412 of file obstacles.h.

◆ getMinimumDistance() [1/3]

virtual double teb_local_planner::PointObstacle::getMinimumDistance ( const Eigen::Vector2d &  line_start,
const Eigen::Vector2d &  line_end 
) const
inlinevirtual

Get the minimum euclidean distance to the obstacle (line as reference)

Parameters
line_start2d position of the begin of the reference line
line_end2d position of the end of the reference line
Returns
The nearest possible distance to the obstacle

Implements teb_local_planner::Obstacle.

Definition at line 400 of file obstacles.h.

◆ getMinimumDistance() [2/3]

virtual double teb_local_planner::PointObstacle::getMinimumDistance ( const Eigen::Vector2d &  position) const
inlinevirtual

Get the minimum euclidean distance to the obstacle (point as reference)

Parameters
position2d reference position
Returns
The nearest possible distance to the obstacle

Implements teb_local_planner::Obstacle.

Definition at line 394 of file obstacles.h.

◆ getMinimumDistance() [3/3]

virtual double teb_local_planner::PointObstacle::getMinimumDistance ( const Point2dContainer polygon) const
inlinevirtual

Get the minimum euclidean distance to the obstacle (polygon as reference)

Parameters
polygonVertices (2D points) describing a closed polygon
Returns
The nearest possible distance to the obstacle

Implements teb_local_planner::Obstacle.

Definition at line 406 of file obstacles.h.

◆ getMinimumSpatioTemporalDistance() [1/3]

virtual double teb_local_planner::PointObstacle::getMinimumSpatioTemporalDistance ( const Eigen::Vector2d &  line_start,
const Eigen::Vector2d &  line_end,
double  t 
) const
inlinevirtual

Get the estimated minimum spatiotemporal distance to the moving obstacle using a constant velocity model (line as reference)

Parameters
line_start2d position of the begin of the reference line
line_end2d position of the end of the reference line
ttime, for which the minimum distance to the obstacle is estimated
Returns
The nearest possible distance to the obstacle at time t

Implements teb_local_planner::Obstacle.

Definition at line 424 of file obstacles.h.

◆ getMinimumSpatioTemporalDistance() [2/3]

virtual double teb_local_planner::PointObstacle::getMinimumSpatioTemporalDistance ( const Eigen::Vector2d &  position,
double  t 
) const
inlinevirtual

Get the estimated minimum spatiotemporal distance to the moving obstacle using a constant velocity model (point as reference)

Parameters
position2d reference position
ttime, for which the minimum distance to the obstacle is estimated
Returns
The nearest possible distance to the obstacle at time t

Implements teb_local_planner::Obstacle.

Definition at line 418 of file obstacles.h.

◆ getMinimumSpatioTemporalDistance() [3/3]

virtual double teb_local_planner::PointObstacle::getMinimumSpatioTemporalDistance ( const Point2dContainer polygon,
double  t 
) const
inlinevirtual

Get the estimated minimum spatiotemporal distance to the moving obstacle using a constant velocity model (polygon as reference)

Parameters
polygonVertices (2D points) describing a closed polygon
ttime, for which the minimum distance to the obstacle is estimated
Returns
The nearest possible distance to the obstacle at time t

Implements teb_local_planner::Obstacle.

Definition at line 430 of file obstacles.h.

◆ predictCentroidConstantVelocity()

virtual void teb_local_planner::PointObstacle::predictCentroidConstantVelocity ( double  t,
Eigen::Ref< Eigen::Vector2d >  position 
) const
inlinevirtual

Predict position of the centroid assuming a constant velocity model.

Parameters
[in]ttime in seconds for the prediction (t>=0)
[out]positionpredicted 2d position of the centroid

Reimplemented from teb_local_planner::Obstacle.

Definition at line 436 of file obstacles.h.

◆ toPolygonMsg()

virtual void teb_local_planner::PointObstacle::toPolygonMsg ( geometry_msgs::Polygon &  polygon)
inlinevirtual

Convert the obstacle to a polygon message.

Convert the obstacle to a corresponding polygon msg. Point obstacles have one vertex, lines have two vertices and polygons might are implictly closed such that the start vertex must not be repeated.

Parameters
[out]polygonthe polygon message

Implements teb_local_planner::Obstacle.

Definition at line 462 of file obstacles.h.

Member Data Documentation

◆ pos_

Eigen::Vector2d teb_local_planner::PointObstacle::pos_
protected

Store the position of the PointObstacle.

Definition at line 472 of file obstacles.h.


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


teb_local_planner
Author(s): Christoph Rösmann
autogenerated on Sun Jan 7 2024 03:45:15