modules/planning/tasks/traffic_decider/stop_sign.cc
/**
 * @brief: fine next stop sign ahead of adc along reference line
 */
@brief: fine next stop sign ahead of adc along reference line
@brief : fine next stop sign ahead of adc along reference line
bool StopSign::FindNextStopSign(
    ReferenceLineInfo* const reference_line_info) {
  next_stop_sign_overlap_ = nullptr;
  const std::vector<PathOverlap>& stop_sign_overlaps =
      reference_line_info->reference_line().map_path().stop_sign_overlaps();
  double adc_front_edge_s = reference_line_info->AdcSlBoundary().end_s();
  double min_start_s = std::numeric_limits<double>::max();
  for (const PathOverlap& stop_sign_overlap : stop_sign_overlaps) {
    if (stop_sign_overlap.start_s + FLAGS_stop_max_distance_buffer
        > adc_front_edge_s &&
        stop_sign_overlap.start_s < min_start_s ) {
      min_start_s = stop_sign_overlap.start_s;
      next_stop_sign_overlap_ = const_cast<PathOverlap*>(&stop_sign_overlap);
    }
  }
  if (next_stop_sign_overlap_ == nullptr) {
    return false;
  }
  auto next_stop_sign_ptr = HDMapUtil::BaseMap().GetStopSignById(
      hdmap::MakeMapId(next_stop_sign_overlap_->object_id));
  next_stop_sign_ = std::move(
      const_cast<StopSignInfo*>(next_stop_sign_ptr.get()));
  GetAssociateLanes(*next_stop_sign_);
  return true;
}
bool StopSign :: FindNextStopSign ( ReferenceLineInfo * const reference_line_info ) { next_stop_sign_overlap_ = nullptr ; const std :: vector < PathOverlap > & stop_sign_overlaps = reference_line_info -> reference_line ( ) . map_path ( ) . stop_sign_overlaps ( ) ; double adc_front_edge_s = reference_line_info -> AdcSlBoundary ( ) . end_s ( ) ; double min_start_s = std :: numeric_limits < double > :: max ( ) ; for ( const PathOverlap & stop_sign_overlap : stop_sign_overlaps ) { if ( stop_sign_overlap . start_s + FLAGS_stop_max_distance_buffer > adc_front_edge_s && stop_sign_overlap . start_s < min_start_s ) { min_start_s = stop_sign_overlap . start_s ; next_stop_sign_overlap_ = const_cast < PathOverlap * > ( & stop_sign_overlap ) ; } } if ( next_stop_sign_overlap_ == nullptr ) { return false ; } auto next_stop_sign_ptr = HDMapUtil :: BaseMap ( ) . GetStopSignById ( hdmap :: MakeMapId ( next_stop_sign_overlap_ -> object_id ) ) ; next_stop_sign_ = std :: move ( const_cast < StopSignInfo * > ( next_stop_sign_ptr . get ( ) ) ) ; GetAssociateLanes ( * next_stop_sign_ ) ; return true ; }
@brief: fine next stop sign ahead of adc along reference line
@brief : fine next stop sign ahead of adc along reference line
// find all the lanes associated/guarded by the stop sign