Apollo  6.0
Open source self driving car software
Classes | Public Member Functions | Static Public Member Functions | List of all members
apollo::planning::Obstacle Class Reference

This is the class that associates an Obstacle with its path properties. An obstacle's path properties relative to a path. The s and l values are examples of path properties. The decision of an obstacle is also associated with a path. More...

#include <obstacle.h>

Collaboration diagram for apollo::planning::Obstacle:
Collaboration graph

Public Member Functions

 Obstacle ()=default
 
 Obstacle (const std::string &id, const perception::PerceptionObstacle &perception_obstacle, const prediction::ObstaclePriority::Priority &obstacle_priority, const bool is_static)
 
 Obstacle (const std::string &id, const perception::PerceptionObstacle &perception_obstacle, const prediction::Trajectory &trajectory, const prediction::ObstaclePriority::Priority &obstacle_priority, const bool is_static)
 
const std::string & Id () const
 
void SetId (const std::string &id)
 
double speed () const
 
int32_t PerceptionId () const
 
bool IsStatic () const
 
bool IsVirtual () const
 
common::TrajectoryPoint GetPointAtTime (const double time) const
 
common::math::Box2d GetBoundingBox (const common::TrajectoryPoint &point) const
 
const common::math::Box2dPerceptionBoundingBox () const
 
const common::math::Polygon2dPerceptionPolygon () const
 
const prediction::Trajectory & Trajectory () const
 
common::TrajectoryPoint * AddTrajectoryPoint ()
 
bool HasTrajectory () const
 
const perception::PerceptionObstacle & Perception () const
 
bool IsCautionLevelObstacle () const
 
const ObjectDecisionType & LateralDecision () const
 
const ObjectDecisionType & LongitudinalDecision () const
 return the merged longitudinal decision Longitudinal decision is one of {Stop, Yield, Follow, Overtake, Ignore} More...
 
std::string DebugString () const
 
const SLBoundary & PerceptionSLBoundary () const
 
const STBoundaryreference_line_st_boundary () const
 
const STBoundarypath_st_boundary () const
 
const std::vector< std::string > & decider_tags () const
 
const std::vector< ObjectDecisionType > & decisions () const
 
void AddLongitudinalDecision (const std::string &decider_tag, const ObjectDecisionType &decision)
 
void AddLateralDecision (const std::string &decider_tag, const ObjectDecisionType &decision)
 
bool HasLateralDecision () const
 
void set_path_st_boundary (const STBoundary &boundary)
 
bool is_path_st_boundary_initialized ()
 
void SetStBoundaryType (const STBoundary::BoundaryType type)
 
void EraseStBoundary ()
 
void SetReferenceLineStBoundary (const STBoundary &boundary)
 
void SetReferenceLineStBoundaryType (const STBoundary::BoundaryType type)
 
void EraseReferenceLineStBoundary ()
 
bool HasLongitudinalDecision () const
 
bool HasNonIgnoreDecision () const
 
double MinRadiusStopDistance (const common::VehicleParam &vehicle_param) const
 Calculate stop distance with the obstacle using the ADC's minimum turning radius. More...
 
bool IsIgnore () const
 Check if this object can be safely ignored. The object will be ignored if the lateral decision is ignore and the longitudinal decision is ignore return longitudinal_decision_ == ignore && lateral_decision == ignore. More...
 
bool IsLongitudinalIgnore () const
 
bool IsLateralIgnore () const
 
void BuildReferenceLineStBoundary (const ReferenceLine &reference_line, const double adc_start_s)
 
void SetPerceptionSlBoundary (const SLBoundary &sl_boundary)
 
void SetBlockingObstacle (bool blocking)
 
bool IsBlockingObstacle () const
 
bool IsLaneBlocking () const
 
void CheckLaneBlocking (const ReferenceLine &reference_line)
 
bool IsLaneChangeBlocking () const
 
void SetLaneChangeBlocking (const bool is_distance_clear)
 

Static Public Member Functions

static std::list< std::unique_ptr< Obstacle > > CreateObstacles (const prediction::PredictionObstacles &predictions)
 This is a helper function that can create obstacles from prediction data. The original prediction may have multiple trajectories for each obstacle. But this function will create one obstacle for each trajectory. More...
 
static std::unique_ptr< ObstacleCreateStaticVirtualObstacles (const std::string &id, const common::math::Box2d &obstacle_box)
 
static bool IsValidPerceptionObstacle (const perception::PerceptionObstacle &obstacle)
 
static bool IsValidTrajectoryPoint (const common::TrajectoryPoint &point)
 
static bool IsLongitudinalDecision (const ObjectDecisionType &decision)
 check if an ObjectDecisionType is a longitudinal decision. More...
 
static bool IsLateralDecision (const ObjectDecisionType &decision)
 check if an ObjectDecisionType is a lateral decision. More...
 

Detailed Description

This is the class that associates an Obstacle with its path properties. An obstacle's path properties relative to a path. The s and l values are examples of path properties. The decision of an obstacle is also associated with a path.

The decisions have two categories: lateral decision and longitudinal decision. Lateral decision includes: nudge, ignore. Lateral decision safety priority: nudge > ignore. Longitudinal decision includes: stop, yield, follow, overtake, ignore. Decision safety priorities order: stop > yield >= follow > overtake > ignore

Ignore decision belongs to both lateral decision and longitudinal decision, and it has the lowest priority.

Constructor & Destructor Documentation

◆ Obstacle() [1/3]

apollo::planning::Obstacle::Obstacle ( )
default

◆ Obstacle() [2/3]

apollo::planning::Obstacle::Obstacle ( const std::string &  id,
const perception::PerceptionObstacle &  perception_obstacle,
const prediction::ObstaclePriority::Priority &  obstacle_priority,
const bool  is_static 
)

◆ Obstacle() [3/3]

apollo::planning::Obstacle::Obstacle ( const std::string &  id,
const perception::PerceptionObstacle &  perception_obstacle,
const prediction::Trajectory &  trajectory,
const prediction::ObstaclePriority::Priority &  obstacle_priority,
const bool  is_static 
)

Member Function Documentation

◆ AddLateralDecision()

void apollo::planning::Obstacle::AddLateralDecision ( const std::string &  decider_tag,
const ObjectDecisionType &  decision 
)

◆ AddLongitudinalDecision()

void apollo::planning::Obstacle::AddLongitudinalDecision ( const std::string &  decider_tag,
const ObjectDecisionType &  decision 
)

◆ AddTrajectoryPoint()

common::TrajectoryPoint* apollo::planning::Obstacle::AddTrajectoryPoint ( )
inline

◆ BuildReferenceLineStBoundary()

void apollo::planning::Obstacle::BuildReferenceLineStBoundary ( const ReferenceLine reference_line,
const double  adc_start_s 
)

◆ CheckLaneBlocking()

void apollo::planning::Obstacle::CheckLaneBlocking ( const ReferenceLine reference_line)

◆ CreateObstacles()

static std::list<std::unique_ptr<Obstacle> > apollo::planning::Obstacle::CreateObstacles ( const prediction::PredictionObstacles &  predictions)
static

This is a helper function that can create obstacles from prediction data. The original prediction may have multiple trajectories for each obstacle. But this function will create one obstacle for each trajectory.

Parameters
predictionsThe prediction results
Returns
obstacles The output obstacles saved in a list of unique_ptr.

◆ CreateStaticVirtualObstacles()

static std::unique_ptr<Obstacle> apollo::planning::Obstacle::CreateStaticVirtualObstacles ( const std::string &  id,
const common::math::Box2d obstacle_box 
)
static

◆ DebugString()

std::string apollo::planning::Obstacle::DebugString ( ) const

◆ decider_tags()

const std::vector<std::string>& apollo::planning::Obstacle::decider_tags ( ) const

◆ decisions()

const std::vector<ObjectDecisionType>& apollo::planning::Obstacle::decisions ( ) const

◆ EraseReferenceLineStBoundary()

void apollo::planning::Obstacle::EraseReferenceLineStBoundary ( )

◆ EraseStBoundary()

void apollo::planning::Obstacle::EraseStBoundary ( )

◆ GetBoundingBox()

common::math::Box2d apollo::planning::Obstacle::GetBoundingBox ( const common::TrajectoryPoint &  point) const

◆ GetPointAtTime()

common::TrajectoryPoint apollo::planning::Obstacle::GetPointAtTime ( const double  time) const

◆ HasLateralDecision()

bool apollo::planning::Obstacle::HasLateralDecision ( ) const

◆ HasLongitudinalDecision()

bool apollo::planning::Obstacle::HasLongitudinalDecision ( ) const

◆ HasNonIgnoreDecision()

bool apollo::planning::Obstacle::HasNonIgnoreDecision ( ) const

◆ HasTrajectory()

bool apollo::planning::Obstacle::HasTrajectory ( ) const
inline

◆ Id()

const std::string& apollo::planning::Obstacle::Id ( ) const
inline

◆ is_path_st_boundary_initialized()

bool apollo::planning::Obstacle::is_path_st_boundary_initialized ( )
inline

◆ IsBlockingObstacle()

bool apollo::planning::Obstacle::IsBlockingObstacle ( ) const
inline

◆ IsCautionLevelObstacle()

bool apollo::planning::Obstacle::IsCautionLevelObstacle ( ) const
inline

◆ IsIgnore()

bool apollo::planning::Obstacle::IsIgnore ( ) const

Check if this object can be safely ignored. The object will be ignored if the lateral decision is ignore and the longitudinal decision is ignore return longitudinal_decision_ == ignore && lateral_decision == ignore.

◆ IsLaneBlocking()

bool apollo::planning::Obstacle::IsLaneBlocking ( ) const
inline

◆ IsLaneChangeBlocking()

bool apollo::planning::Obstacle::IsLaneChangeBlocking ( ) const
inline

◆ IsLateralDecision()

static bool apollo::planning::Obstacle::IsLateralDecision ( const ObjectDecisionType &  decision)
static

check if an ObjectDecisionType is a lateral decision.

◆ IsLateralIgnore()

bool apollo::planning::Obstacle::IsLateralIgnore ( ) const

◆ IsLongitudinalDecision()

static bool apollo::planning::Obstacle::IsLongitudinalDecision ( const ObjectDecisionType &  decision)
static

check if an ObjectDecisionType is a longitudinal decision.

◆ IsLongitudinalIgnore()

bool apollo::planning::Obstacle::IsLongitudinalIgnore ( ) const

◆ IsStatic()

bool apollo::planning::Obstacle::IsStatic ( ) const
inline

◆ IsValidPerceptionObstacle()

static bool apollo::planning::Obstacle::IsValidPerceptionObstacle ( const perception::PerceptionObstacle &  obstacle)
static

◆ IsValidTrajectoryPoint()

static bool apollo::planning::Obstacle::IsValidTrajectoryPoint ( const common::TrajectoryPoint &  point)
static

◆ IsVirtual()

bool apollo::planning::Obstacle::IsVirtual ( ) const
inline

◆ LateralDecision()

const ObjectDecisionType& apollo::planning::Obstacle::LateralDecision ( ) const

return the merged lateral decision Lateral decision is one of {Nudge, Ignore}

◆ LongitudinalDecision()

const ObjectDecisionType& apollo::planning::Obstacle::LongitudinalDecision ( ) const

return the merged longitudinal decision Longitudinal decision is one of {Stop, Yield, Follow, Overtake, Ignore}

◆ MinRadiusStopDistance()

double apollo::planning::Obstacle::MinRadiusStopDistance ( const common::VehicleParam &  vehicle_param) const

Calculate stop distance with the obstacle using the ADC's minimum turning radius.

◆ path_st_boundary()

const STBoundary& apollo::planning::Obstacle::path_st_boundary ( ) const

◆ Perception()

const perception::PerceptionObstacle& apollo::planning::Obstacle::Perception ( ) const
inline

◆ PerceptionBoundingBox()

const common::math::Box2d& apollo::planning::Obstacle::PerceptionBoundingBox ( ) const
inline

◆ PerceptionId()

int32_t apollo::planning::Obstacle::PerceptionId ( ) const
inline

◆ PerceptionPolygon()

const common::math::Polygon2d& apollo::planning::Obstacle::PerceptionPolygon ( ) const
inline

◆ PerceptionSLBoundary()

const SLBoundary& apollo::planning::Obstacle::PerceptionSLBoundary ( ) const

◆ reference_line_st_boundary()

const STBoundary& apollo::planning::Obstacle::reference_line_st_boundary ( ) const

◆ set_path_st_boundary()

void apollo::planning::Obstacle::set_path_st_boundary ( const STBoundary boundary)

◆ SetBlockingObstacle()

void apollo::planning::Obstacle::SetBlockingObstacle ( bool  blocking)
inline

◆ SetId()

void apollo::planning::Obstacle::SetId ( const std::string &  id)
inline

◆ SetLaneChangeBlocking()

void apollo::planning::Obstacle::SetLaneChangeBlocking ( const bool  is_distance_clear)

◆ SetPerceptionSlBoundary()

void apollo::planning::Obstacle::SetPerceptionSlBoundary ( const SLBoundary &  sl_boundary)

◆ SetReferenceLineStBoundary()

void apollo::planning::Obstacle::SetReferenceLineStBoundary ( const STBoundary boundary)

◆ SetReferenceLineStBoundaryType()

void apollo::planning::Obstacle::SetReferenceLineStBoundaryType ( const STBoundary::BoundaryType  type)

◆ SetStBoundaryType()

void apollo::planning::Obstacle::SetStBoundaryType ( const STBoundary::BoundaryType  type)

◆ speed()

double apollo::planning::Obstacle::speed ( ) const
inline

◆ Trajectory()

const prediction::Trajectory& apollo::planning::Obstacle::Trajectory ( ) const
inline

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