modules/planning/tasks/traffic_decider/stop_sign.cc
/**
 * @brief: read watch vehicles from drop box
 */
@brief: read watch vehicles from drop box
@brief : read watch vehicles from drop box
int StopSign::GetWatchVehicles(
    const StopSignInfo& stop_sign_info,
    StopSignLaneVehicles* watch_vehicles) {
  watch_vehicles->clear();
  for (const LaneInfo* associate_lane_info : associate_lanes_) {
    std::string associate_lane_id = associate_lane_info->id().id();
    if (stop_status_ == StopSignStopStatus::TO_STOP) {
      ADEBUG << "ADC not stopped. clean/init watch vehicles.";
      (*watch_vehicles)[associate_lane_id].clear();
    } else {
       from dropbox
      std::string db_key_watch_vehicle =
          db_key_stop_sign_watch_vehicle_prefix_ + associate_lane_id;
      std::vector<std::string> *value =
          Dropbox<std::vector<std::string>>::Open()->Get(
              db_key_watch_vehicle);
      std::vector<std::string> watch_vehicle_ids;
      if (value != nullptr) {
        watch_vehicle_ids = *value;
      }
      ADEBUG << "watch_vehicle: lane_id[" << associate_lane_id << "] vehicle["
          << accumulate(watch_vehicle_ids.begin(),
                        watch_vehicle_ids.end(), std::string(","))
          << "]; size[" << watch_vehicle_ids.size() << "]";
      (*watch_vehicles)[associate_lane_id] = watch_vehicle_ids;
    }
  }
  return 0;
}
int StopSign :: GetWatchVehicles ( const StopSignInfo & stop_sign_info , StopSignLaneVehicles * watch_vehicles ) { watch_vehicles -> clear ( ) ; for ( const LaneInfo * associate_lane_info : associate_lanes_ ) { std :: string associate_lane_id = associate_lane_info -> id ( ) . id ( ) ; if ( stop_status_ == StopSignStopStatus :: TO_STOP ) { ADEBUG << " " ; ( * watch_vehicles ) [ associate_lane_id ] . clear ( ) ; } else { std :: string db_key_watch_vehicle = db_key_stop_sign_watch_vehicle_prefix_ + associate_lane_id ; std :: vector < std :: string > * value = Dropbox < std :: vector < std :: string > > :: Open ( ) -> Get ( db_key_watch_vehicle ) ; std :: vector < std :: string > watch_vehicle_ids ; if ( value != nullptr ) { watch_vehicle_ids = * value ; } ADEBUG << " " << associate_lane_id << " " << accumulate ( watch_vehicle_ids . begin ( ) , watch_vehicle_ids . end ( ) , std :: string ( " " ) ) << " " << watch_vehicle_ids . size ( ) << " " ; ( * watch_vehicles ) [ associate_lane_id ] = watch_vehicle_ids ; } } return 0 ; }
@brief: read watch vehicles from drop box
@brief : read watch vehicles from drop box
// get watch vehicles for associate_lanes // get watch vehicles for associate_lanes from dropbox