170 {
171 if (!MapReady()) {
172 return;
173 }
174 boost::shared_lock<boost::shared_mutex> reader_lock(mutex_);
175
176 std::vector<LaneInfoConstPtr> lanes;
177 if (SimMap()->GetLanes(point, radius, &lanes) != 0) {
178 AERROR <<
"Fail to get lanes from sim_map.";
179 }
180 ExtractRoadAndLaneIds(lanes, ids->mutable_lane(), ids->mutable_road());
181
182 std::vector<ClearAreaInfoConstPtr> clear_areas;
183 if (SimMap()->GetClearAreas(point, radius, &clear_areas) != 0) {
184 AERROR <<
"Fail to get clear areas from sim_map.";
185 }
186 ExtractIds(clear_areas, ids->mutable_clear_area());
187
188 std::vector<CrosswalkInfoConstPtr> crosswalks;
189 if (SimMap()->GetCrosswalks(point, radius, &crosswalks) != 0) {
190 AERROR <<
"Fail to get crosswalks from sim_map.";
191 }
192 ExtractIds(crosswalks, ids->mutable_crosswalk());
193
194 std::vector<JunctionInfoConstPtr> junctions;
195 if (SimMap()->GetJunctions(point, radius, &junctions) != 0) {
196 AERROR <<
"Fail to get junctions from sim_map.";
197 }
198 ExtractIds(junctions, ids->mutable_junction());
199
200 std::vector<PNCJunctionInfoConstPtr> pnc_junctions;
201 if (SimMap()->GetPNCJunctions(point, radius, &pnc_junctions) != 0) {
202 AERROR <<
"Fail to get pnc junctions from sim_map.";
203 }
204 ExtractIds(pnc_junctions, ids->mutable_pnc_junction());
205
206 std::vector<ParkingSpaceInfoConstPtr> parking_spaces;
207 if (SimMap()->GetParkingSpaces(point, radius, &parking_spaces) != 0) {
208 AERROR <<
"Fail to get parking space from sim_map.";
209 }
210 ExtractIds(parking_spaces, ids->mutable_parking_space());
211
212 std::vector<SpeedBumpInfoConstPtr> speed_bumps;
213 if (SimMap()->GetSpeedBumps(point, radius, &speed_bumps) != 0) {
214 AERROR <<
"Fail to get speed bump from sim_map.";
215 }
216 ExtractIds(speed_bumps, ids->mutable_speed_bump());
217
218 std::vector<SignalInfoConstPtr> signals;
219 if (SimMap()->GetSignals(point, radius, &signals) != 0) {
220 AERROR <<
"Failed to get signals from sim_map.";
221 }
222
223 ExtractIds(signals, ids->mutable_signal());
224
225 std::vector<StopSignInfoConstPtr> stop_signs;
226 if (SimMap()->GetStopSigns(point, radius, &stop_signs) != 0) {
227 AERROR <<
"Failed to get stop signs from sim_map.";
228 }
229 ExtractIds(stop_signs, ids->mutable_stop_sign());
230
231 std::vector<YieldSignInfoConstPtr> yield_signs;
232 if (SimMap()->GetYieldSigns(point, radius, &yield_signs) != 0) {
233 AERROR <<
"Failed to get yield signs from sim_map.";
234 }
235 ExtractIds(yield_signs, ids->mutable_yield());
236
237 std::vector<AreaInfoConstPtr> ad_areas;
238 if (SimMap()->GetAreas(point, radius, &ad_areas) != 0) {
239 AERROR <<
"Failed to get ad areas from sim_map.";
240 }
241 ExtractIds(ad_areas, ids->mutable_ad_area());
242
243 std::vector<BarrierGateInfoConstPtr> barrier_gates;
244 if (SimMap()->GetBarrierGates(point, radius, &barrier_gates) != 0) {
245 AERROR <<
"Failed to get barrier gate from sim_map.";
246 }
247 ExtractIds(barrier_gates, ids->mutable_barrier_gate());
248}