Branch data Line data Source code
1 : : // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 : : //
3 : : // Copyright (C) 2018-2021 Intel Corporation
4 : : //
5 : : // SPDX-License-Identifier: MIT
6 : : //
7 : : // ----------------- END LICENSE BLOCK -----------------------------------
8 : : /**
9 : : * @file
10 : : */
11 : :
12 : : #pragma once
13 : :
14 : : #include "ad/map/config/PointOfInterest.hpp"
15 : : #include "ad/map/match/Object.hpp"
16 : : #include "ad/map/route/Route.hpp"
17 : : #include "ad/map/route/RouteOperation.hpp"
18 : : #include "ad/map/route/Routing.hpp"
19 : : #include "ad/map/route/Types.hpp"
20 : :
21 : : /** @brief namespace ad */
22 : : namespace ad {
23 : : /** @brief namespace map */
24 : : namespace map {
25 : : /** @brief namespace route */
26 : : namespace route {
27 : : /**
28 : : * @brief provides route planning capabilities on the road network of the map
29 : : */
30 : : namespace planning {
31 : :
32 : : /**
33 : : * @brief create a RoutingParaPoint
34 : : *
35 : : * @param[in] laneId the lane id
36 : : * @param[in] parametricOffset the parametric offset
37 : : * @param[in] routingDirection the routing direction in respect to the lane orientation
38 : : * Be aware: this might be different from the nominal driving direction!
39 : : */
40 : : RoutingParaPoint createRoutingPoint(lane::LaneId const &laneId,
41 : : physics::ParametricValue const ¶metricOffset,
42 : : RoutingDirection const &routingDirection = RoutingDirection::DONT_CARE);
43 : :
44 : : /**
45 : : * @brief create a RoutingParaPoint
46 : : *
47 : : * @param[in] paraPoint the parametric point
48 : : * @param[in] routingDirection the routing direction in respect to the lane orientation
49 : : * Be aware: this might be different from the nominal driving direction!
50 : : */
51 : : RoutingParaPoint createRoutingPoint(point::ParaPoint const ¶Point,
52 : : RoutingDirection const &routingDirection = RoutingDirection::DONT_CARE);
53 : :
54 : : /**
55 : : * @brief create a RoutingParaPoint
56 : : *
57 : : * We select the routing point by either taking the maximum or minimum of the occupied region
58 : : * Since occupied regions span over a certain area, the point is selected in a way,
59 : : * that it is ensured that any other point within the region can be reached by routing with
60 : : * the given routing direction
61 : : *
62 : : * @param[in] occupiedRegion the occupied region
63 : : * @param[in] routingDirection the routing direction in respect to the lane orientation
64 : : * Be aware: this might be different from the nominal driving direction!
65 : : */
66 : : RoutingParaPoint createRoutingPoint(match::LaneOccupiedRegion const &occupiedRegion,
67 : : RoutingDirection const &routingDirection = RoutingDirection::DONT_CARE);
68 : :
69 : : /**
70 : : * @brief create a RoutingParaPoint
71 : : *
72 : : * @param[in] paraPoint the parametric point
73 : : * @param[in] heading the heading to be respected
74 : : */
75 : : RoutingParaPoint createRoutingPoint(point::ParaPoint const ¶Point, point::ENUHeading const &heading);
76 : :
77 : : /**
78 : : * @brief create a RoutingParaPoint
79 : : *
80 : : * We select the routing point by either taking the maximum or minimum of the occupied region
81 : : * Since occupied regions span over a certain area, the point is selected in a way,
82 : : * that it is ensured that any other point within the region can be reached by routing with
83 : : * the given routing direction
84 : : *
85 : : * @param[in] occupiedRegion the occupied region
86 : : * @param[in] heading the heading to be respected
87 : : */
88 : : RoutingParaPoint createRoutingPoint(match::LaneOccupiedRegion const &occupiedRegion, point::ENUHeading const &heading);
89 : :
90 : : /** @brief Calculates route between two points.
91 : : * @param[in] start Start point as RoutingParaPoint (Be aware: routing direction in respect to lane orientation!).
92 : : * @param[in] dest Destination point as RoutingParaPoint (Be aware: routing direction in respect to lane orientation!).
93 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
94 : : */
95 : : route::FullRoute planRoute(const RoutingParaPoint &start,
96 : : const RoutingParaPoint &dest,
97 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection);
98 : :
99 : : /** @brief Calculates route between two points.
100 : : *
101 : : * Orientation at start/dest are not considered.
102 : : *
103 : : * @param[in] start Start point.
104 : : * @param[in] dest Destination point.
105 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
106 : : */
107 : 2686 : inline route::FullRoute planRoute(const point::ParaPoint &start,
108 : : const point::ParaPoint &dest,
109 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection)
110 : : {
111 [ + - + - : 5372 : return planRoute(createRoutingPoint(start), createRoutingPoint(dest), routeCreationMode);
+ - ]
112 : : }
113 : :
114 : : /** @brief Calculates route between two points.
115 : : *
116 : : * Orientation at dest is not considered.
117 : : *
118 : : * @param[in] start Start point.
119 : : * @param[in] startHeading Heading at start point.
120 : : * @param[in] dest Destination point.
121 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
122 : : */
123 : : inline route::FullRoute planRoute(const point::ParaPoint &start,
124 : : point::ENUHeading const &startHeading,
125 : : const point::ParaPoint &dest,
126 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection)
127 : : {
128 : : return planRoute(createRoutingPoint(start, startHeading), createRoutingPoint(dest), routeCreationMode);
129 : : }
130 : :
131 : : /** @brief Calculates route between two points.
132 : : * @param[in] start Start point.
133 : : * @param[in] startHeading Heading at start point.
134 : : * @param[in] dest Destination point.
135 : : * @param[in] destHeading Heading at dest point.
136 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
137 : : */
138 : : inline route::FullRoute planRoute(const point::ParaPoint &start,
139 : : point::ENUHeading const &startHeading,
140 : : const point::ParaPoint &dest,
141 : : point::ENUHeading const &destHeading,
142 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection)
143 : : {
144 : : return planRoute(createRoutingPoint(start, startHeading), createRoutingPoint(dest, destHeading), routeCreationMode);
145 : : }
146 : :
147 : : /** @brief Calculates route between two points.
148 : : * @param[in] start Start point as RoutingParaPoint (Be aware: routing direction in respect to lane orientation!).
149 : : * @param[in] dest Destination point as geo point.
150 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
151 : : */
152 : : route::FullRoute planRoute(const RoutingParaPoint &start,
153 : : const point::GeoPoint &dest,
154 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection);
155 : :
156 : : /** @brief Calculates route between two points.
157 : : * @param[in] start Start point as RoutingParaPoint (Be aware: routing direction in respect to lane orientation!).
158 : : * @param[in] dest Destination point as ENU point.
159 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
160 : : */
161 : : route::FullRoute planRoute(const RoutingParaPoint &start,
162 : : const point::ENUPoint &dest,
163 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection);
164 : :
165 : : /** @brief Calculates route between two points.
166 : : * @param[in] start Start point.
167 : : * @param[in] dest Destination point as geo point.
168 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
169 : : */
170 : : inline route::FullRoute planRoute(const point::ParaPoint &start,
171 : : const point::GeoPoint &dest,
172 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection)
173 : : {
174 : : return planRoute(createRoutingPoint(start), dest, routeCreationMode);
175 : : }
176 : :
177 : : /** @brief Calculates route between two points.
178 : : * @param[in] start Start point.
179 : : * @param[in] startHeading Heading at start point.
180 : : * @param[in] dest Destination point as geo point.
181 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
182 : : */
183 : : inline route::FullRoute planRoute(const point::ParaPoint &start,
184 : : point::ENUHeading const &startHeading,
185 : : const point::GeoPoint &dest,
186 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection)
187 : : {
188 : : return planRoute(createRoutingPoint(start, startHeading), dest, routeCreationMode);
189 : : }
190 : :
191 : : /** @brief Calculates route between two points.
192 : : * @param[in] start Start point.
193 : : * @param[in] dest Destination point as point of interest.
194 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
195 : : */
196 : : inline FullRoute planRoute(const point::ParaPoint &start,
197 : : const config::PointOfInterest &dest,
198 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection)
199 : : {
200 : : return planRoute(start, dest.geoPoint, routeCreationMode);
201 : : }
202 : :
203 : : /** @brief Calculates route between two points considering supporting points on the way.
204 : : * @param[in] start Start point.
205 : : * @param[in] dest Vector with supporting points as geo points to be visited on the route. Last point in the list is the
206 : : * actual destination point.
207 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
208 : : *
209 : : * Be aware: Supporting points providing multiple map maptched positions (i.e. the ones located within intersections)
210 : : * are discarded to ensure the proper route is taken.
211 : : */
212 : : FullRoute planRoute(const RoutingParaPoint &start,
213 : : const std::vector<point::GeoPoint> &dest,
214 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection);
215 : :
216 : : /** @brief Calculates route between two points considering supporting points on the way.
217 : : * @param[in] start Start point.
218 : : * @param[in] dest Vector with supporting points as ENU points to be visited on the route. Last point in the list is the
219 : : * actual destination point.
220 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
221 : : *
222 : : * Be aware: Supporting points providing multiple map maptched positions (i.e. the ones located within intersections)
223 : : * are discarded to ensure the proper route is taken.
224 : : */
225 : : FullRoute planRoute(const RoutingParaPoint &start,
226 : : const std::vector<point::ENUPoint> &dest,
227 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection);
228 : :
229 : : /**
230 : : * @brief Calculates route between two points considering supporting points on the way
231 : : * @param[in] start Start point.
232 : : * @param[in] dest Vector with supporting points to be visited on the route. Last point in the list is the actual
233 : : * destination point.
234 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
235 : : */
236 : : FullRoute planRoute(const RoutingParaPoint &start,
237 : : std::vector<RoutingParaPoint> const &dest,
238 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection);
239 : :
240 : : /** @brief Calculates route between two points considering supporting points on the way.
241 : : * @param[in] start Start point.
242 : : * @param[in] startHeading Heading at start point.
243 : : * @param[in] dest Vector with supporting points as geo points to be visited on the route. Last point in the list is the
244 : : * actual destination point.
245 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
246 : : */
247 : : inline route::FullRoute planRoute(const point::ParaPoint &start,
248 : : point::ENUHeading const &startHeading,
249 : : const std::vector<point::GeoPoint> &dest,
250 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection)
251 : : {
252 : : return planRoute(createRoutingPoint(start, startHeading), dest, routeCreationMode);
253 : : }
254 : :
255 : : /** @brief mode for filtering duplicates in prediction
256 : : */
257 : : enum class FilterDuplicatesMode
258 : : {
259 : : /** no filtering at all
260 : : */
261 : : Off,
262 : : /** filter routes that are exactly equal
263 : : */
264 : : OnlyEqual,
265 : : /** filter real sub-routes, prefer shorter ones
266 : : */
267 : : SubRoutesPreferShorterOnes,
268 : : /** filter real sub-routes, prefer longer ones
269 : : */
270 : : SubRoutesPreferLongerOnes
271 : : };
272 : :
273 : : /**
274 : : * @brief perform route based prediction restricted by the prediction duration.
275 : : * Note: Route predictions will not stop in the middle of an intersection.
276 : : * They continue until the intersection is left again.
277 : : *
278 : : * @param[in] start start point.
279 : : * @param[in] predictionDuration duration when the prediction can be stopped.
280 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
281 : : * @param[in] filterMode the mode for filtering the routes (default: FilterDuplicatesMode::SubRoutesPreferLongerOnes)
282 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
283 : : *
284 : : * @return vector with all possible predicted routes.
285 : : */
286 : : std::vector<route::FullRoute>
287 : : predictRoutesOnDuration(const RoutingParaPoint &start,
288 : : physics::Duration const &predictionDuration,
289 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection,
290 : : FilterDuplicatesMode const filterMode = FilterDuplicatesMode::SubRoutesPreferLongerOnes,
291 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
292 : :
293 : : /**
294 : : * @brief perform route based prediction restricted by the prediction distance.
295 : : * Note: Route predictions will not stop in the middle of an intersection.
296 : : * They continue until the intersection is left again.
297 : : *
298 : : * @param[in] start start point.
299 : : * @param[in] predictionDistance distance when the prediction can be stopped.
300 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
301 : : * @param[in] filterMode the mode for filtering the routes (default: FilterDuplicatesMode::SubRoutesPreferLongerOnes)
302 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
303 : : *
304 : : * @return vector with all possible predicted routes.
305 : : */
306 : : std::vector<route::FullRoute>
307 : : predictRoutesOnDistance(const RoutingParaPoint &start,
308 : : physics::Distance const &predictionDistance,
309 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection,
310 : : FilterDuplicatesMode const filterMode = FilterDuplicatesMode::SubRoutesPreferLongerOnes,
311 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
312 : :
313 : : /**
314 : : * @brief perform route based prediction restricted by the prediction distance and duration.
315 : : * Note: Route predictions will not stop in the middle of an intersection.
316 : : * They continue until the intersection is left again.
317 : : *
318 : : * @param[in] start start point.
319 : : * @param[in] predictionDistance distance when the prediction can be stopped.
320 : : * @param[in] predictionDuration duration when the prediction can be stopped.
321 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
322 : : * @param[in] filterMode the mode for filtering the routes (default: FilterDuplicatesMode::SubRoutesPreferLongerOnes)
323 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
324 : : *
325 : : * @return vector with all possible predicted routes.
326 : : */
327 : : std::vector<route::FullRoute>
328 : : predictRoutes(const RoutingParaPoint &start,
329 : : physics::Distance const &predictionDistance,
330 : : physics::Duration const &predictionDuration,
331 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection,
332 : : FilterDuplicatesMode const filterMode = FilterDuplicatesMode::SubRoutesPreferLongerOnes,
333 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
334 : :
335 : : /**
336 : : * @brief perform route based prediction restricted by the prediction duration.
337 : : * Note: Route predictions will not stop in the middle of an intersection.
338 : : * They continue until the intersection is left again.
339 : : *
340 : : * @param[in] start start point as map matched bounding box.
341 : : * @param[in] predictionDuration duration when the prediction can be stopped.
342 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
343 : : * @param[in] filterMode the mode for filtering the routes (default: FilterDuplicatesMode::SubRoutesPreferLongerOnes)
344 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
345 : : *
346 : : * @return vector with all possible predicted routes.
347 : : */
348 : : std::vector<route::FullRoute>
349 : : predictRoutesOnDuration(const match::MapMatchedObjectBoundingBox &start,
350 : : physics::Duration const &predictionDuration,
351 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection,
352 : : FilterDuplicatesMode const filterMode = FilterDuplicatesMode::SubRoutesPreferLongerOnes,
353 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
354 : :
355 : : /**
356 : : * @brief perform route based prediction restricted by the prediction distance.
357 : : * Note: Route predictions will not stop in the middle of an intersection.
358 : : * They continue until the intersection is left again.
359 : : *
360 : : * @param[in] start start point as map matched bounding box.
361 : : * @param[in] predictionDistance distance when the prediction can be stopped.
362 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
363 : : * @param[in] filterMode the mode for filtering the routes (default: FilterDuplicatesMode::SubRoutesPreferLongerOnes)
364 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
365 : : *
366 : : * @return vector with all possible predicted routes.
367 : : */
368 : : std::vector<route::FullRoute>
369 : : predictRoutesOnDistance(const match::MapMatchedObjectBoundingBox &start,
370 : : physics::Distance const &predictionDistance,
371 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection,
372 : : FilterDuplicatesMode const filterMode = FilterDuplicatesMode::SubRoutesPreferLongerOnes,
373 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
374 : :
375 : : /**
376 : : * @brief perform route based prediction restricted by the prediction distance and duration.
377 : : * Note: Route predictions will not stop in the middle of an intersection.
378 : : * They continue until the intersection is left again.
379 : : *
380 : : * @param[in] start start point as map matched bounding box.
381 : : * @param[in] predictionDistance distance when the prediction can be stopped.
382 : : * @param[in] predictionDuration duration when the prediction can be stopped.
383 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::SameDrivingDirection)
384 : : * @param[in] filterMode the mode for filtering the routes (default: FilterDuplicatesMode::SubRoutesPreferLongerOnes)
385 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
386 : : *
387 : : * @return vector with all possible predicted routes.
388 : : */
389 : : std::vector<route::FullRoute>
390 : : predictRoutes(const match::MapMatchedObjectBoundingBox &start,
391 : : physics::Distance const &predictionDistance,
392 : : physics::Duration const &predictionDuration,
393 : : RouteCreationMode const routeCreationMode = RouteCreationMode::SameDrivingDirection,
394 : : FilterDuplicatesMode const filterMode = FilterDuplicatesMode::SubRoutesPreferLongerOnes,
395 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
396 : :
397 : : /**
398 : : * @brief perform route based prediction restricted by the prediction distance and duration.
399 : : * Note: Route predictions will not stop in the middle of an intersection.
400 : : * They continue until the intersection is left again.
401 : : *
402 : : * This variant of route prediction allows to travel in either road directions.
403 : : * Therefore, the start orientation is irrelevant (considered to be RoutingDirection::DONT_CARE).
404 : : *
405 : : * @param[in] start start point as parametric point.
406 : : * @param[in] predictionDistance distance when the prediction can be stopped.
407 : : * @param[in] predictionDuration duration when the prediction can be stopped.
408 : : * @param[in] routeCreationMode the mode of creating the route (default: RouteCreationMode::AllRoutableLanes)
409 : : * Be aware: selecting a routeCreationMode of RouteCreationMode::SameDrivingDirection will lead to incomplete
410 : : * FullRoutes
411 : : * since the routes starting in wrong direction cannot be presented by this!
412 : : * @param[in] filterMode the mode for filtering the routes (default: FilterDuplicatesMode::SubRoutesPreferLongerOnes)
413 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
414 : : *
415 : : * @return vector with all possible predicted routes.
416 : : */
417 : : std::vector<route::FullRoute>
418 : : predictRoutesDirectionless(const point::ParaPoint &start,
419 : : physics::Distance const &predictionDistance,
420 : : physics::Duration const &predictionDuration,
421 : : RouteCreationMode const routeCreationMode = RouteCreationMode::AllRoutableLanes,
422 : : FilterDuplicatesMode const filterMode = FilterDuplicatesMode::SubRoutesPreferLongerOnes,
423 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
424 : :
425 : : /**
426 : : * @brief Filter duplicated routes from a list of routes
427 : : *
428 : : * If one of the routes is a real sub-route of the other, the longer version of the route is kept, the shorter dropped
429 : : *
430 : : * @param[in] fullRoutes list of full routes to be filtered
431 : : * @param[in] filterMode the mode for filtering the routes
432 : : *
433 : : * @returns the filtered list of routes according to the provided \a filterMode
434 : : */
435 : : FullRouteList filterDuplicatedRoutes(const FullRouteList fullRoutes, FilterDuplicatesMode const filterMode);
436 : :
437 : : /** @brief result for comparing two routes with each other
438 : : */
439 : : enum class CompareRouteResult
440 : : {
441 : : /**
442 : : * equal
443 : : */
444 : : Equal,
445 : : /**
446 : : * shorter
447 : : */
448 : : Shorter,
449 : : /**
450 : : * longer
451 : : */
452 : : Longer,
453 : : /**
454 : : * differ
455 : : */
456 : : Differ
457 : : };
458 : :
459 : : std::ostream &operator<<(std::ostream &os, CompareRouteResult const &value);
460 : :
461 : : /**
462 : : * @brief Compare two routes on interval level
463 : : *
464 : : * @returns CompareRouteResult of the comparison
465 : : * @retval CompareRouteResult::Equal left route and right route are considered equal on interval level
466 : : * @retval CompareRouteResult::Shorter left route is a real sub-route of the right route, therefore left route is
467 : : * considered shorter
468 : : * @retval CompareRouteResult::Longer right route is a real sub-route of the left route, therefore left route is
469 : : * considered longer
470 : : * @retval CompareRouteResult::Differ left route and right route are considered different on interval level
471 : : *
472 : : */
473 : : CompareRouteResult compareRoutesOnIntervalLevel(FullRoute const &left, FullRoute const &right);
474 : :
475 : : /**
476 : : * @brief Calculate the connecting route between the the two objects
477 : : *
478 : : * For route calculations the route type core::Route::Type::SHORTEST_IGNORE_DIRECTION is used.
479 : : * The prediction hints are taken into account if no direct connecting route can be found in search of a merge route.
480 : : * If no prediction hints are given, respective route predictions are calculated internally.
481 : : *
482 : : * @param[in] startObject object at starting position
483 : : * @param[in] destObject object at destination position
484 : : * @param[in] maxDistance distance when the search can be stopped.
485 : : * @param[in] maxDuration duration when the search can be stopped.
486 : : * @param[in] startObjectPredictionHints route prediction hints for start object (optional)
487 : : * @param[in] destObjectPredictionHints route prediction hints for dest object (optional)
488 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
489 : : */
490 : : ConnectingRoute calculateConnectingRoute(
491 : : const match::Object &startObject,
492 : : const match::Object &destObject,
493 : : physics::Distance const &maxDistance,
494 : : physics::Duration const &maxDuration,
495 : : std::vector<route::FullRoute> const &startObjectPredictionHints = std::vector<route::FullRoute>(),
496 : : std::vector<route::FullRoute> const &destObjectPredictionHints = std::vector<route::FullRoute>(),
497 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
498 : :
499 : : /**
500 : : * @brief Calculate the connecting route between the the two objects
501 : : *
502 : : * For route calculations the route type core::Route::Type::SHORTEST_IGNORE_DIRECTION is used.
503 : : * The prediction hints are taken into account if no direct connecting route can be found in search of a merge route.
504 : : * If no prediction hints are given, respective route predictions are calculated internally.
505 : : *
506 : : * @param[in] startObject object at starting position
507 : : * @param[in] destObject object at destination position
508 : : * @param[in] maxDistance distance when the search can be stopped.
509 : : * @param[in] startObjectPredictionHints route prediction hints for start object (optional)
510 : : * @param[in] destObjectPredictionHints route prediction hints for dest object (optional)
511 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
512 : : */
513 : : ConnectingRoute calculateConnectingRoute(
514 : : const match::Object &startObject,
515 : : const match::Object &destObject,
516 : : physics::Distance const &maxDistance,
517 : : std::vector<route::FullRoute> const &startObjectPredictionHints = std::vector<route::FullRoute>(),
518 : : std::vector<route::FullRoute> const &destObjectPredictionHints = std::vector<route::FullRoute>(),
519 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
520 : :
521 : : /**
522 : : * @brief Calculate the connecting route between the the two objects
523 : : *
524 : : * For route calculations the route type core::Route::Type::SHORTEST_IGNORE_DIRECTION is used.
525 : : * The prediction hints are taken into account if no direct connecting route can be found in search of a merge route.
526 : : * If no prediction hints are given, respective route predictions are calculated internally.
527 : : *
528 : : * @param[in] startObject object at starting position
529 : : * @param[in] destObject object at destination position
530 : : * @param[in] maxDuration duration when the search can be stopped.
531 : : * @param[in] startObjectPredictionHints route prediction hints for start object (optional)
532 : : * @param[in] destObjectPredictionHints route prediction hints for dest object (optional)
533 : : * @param[in] relevantLanes if not empty, the function restricts the prediction to the given set of lanes
534 : : */
535 : : ConnectingRoute calculateConnectingRoute(
536 : : const match::Object &startObject,
537 : : const match::Object &destObject,
538 : : physics::Duration const &maxDuration,
539 : : std::vector<route::FullRoute> const &startObjectPredictionHints = std::vector<route::FullRoute>(),
540 : : std::vector<route::FullRoute> const &destObjectPredictionHints = std::vector<route::FullRoute>(),
541 : : ::ad::map::lane::LaneIdSet const &relevantLanes = ::ad::map::lane::LaneIdSet());
542 : :
543 : : /**
544 : : * @brief update route planning counters of the route
545 : : *
546 : : * mainly used internally.
547 : : */
548 : : void updateRoutePlanningCounters(route::FullRoute &route);
549 : :
550 : : /**
551 : : * @brief helper function to create a full route
552 : : *
553 : : * mainly used internally.
554 : : */
555 : : FullRoute createFullRoute(const Route::RawRoute &rawRoute,
556 : : RouteCreationMode const routeCreationMode,
557 : : lane::LaneIdSet const &relevantLanes);
558 : :
559 : : } // namespace planning
560 : : } // namespace route
561 : : } // namespace map
562 : : } // namespace ad
|