fzi-forschungszentrum-informatik / Lanelet2

Map handling framework for automated driving
BSD 3-Clause "New" or "Revised" License
800 stars 327 forks source link

[Question] What types of zones does the 'shortestPathIncludingAreas' function work with? #107

Closed dymons closed 4 years ago

dymons commented 4 years ago

Hi! What types of zones does the shortestPathIncludingAreas function work with? For example, I have two roads connected through a Parking space, the lanelet (Road) -> Area (Parking) -> Lanelet (Road) scheme doesn't work. I looked at Google.Tests in lanelet2_routing, how to work with this function. Did I understand correctly that this function will only search for a pedestrian route (lanelet (Crosswalk) -> Area (Crosswalk) -> Lanelet (Crosswalk))? And how to make it work for the scheme the lanelet (Road) -> Area (Parking) -> Lanelet (Road)?

joeda commented 4 years ago

Using the shortestPath function will generally not use areas which many users will find convenient while the shortestPathIncludingAreas will consider areas as well. The TrafficRules used to create the routing graph determine passability. For instance, using GermanTrafficRules for vehicles will never find a path through areas since they are considered impassable:

https://github.com/fzi-forschungszentrum-informatik/Lanelet2/blob/master/lanelet2_traffic_rules/include/lanelet2_traffic_rules/GermanTrafficRules.h#L15

while there is no such constraint for pedestrians in those rules. See the documentation on the rules that come with the library for more information on this: https://github.com/fzi-forschungszentrum-informatik/Lanelet2/blob/master/lanelet2_core/doc/LaneletAndAreaTagging.md

I'm working on traffic rules for parking, they might become available in the near future. Depending on your purpose, it might be easiest to subclass or mimic the GenericTrafficRules class.

dymons commented 4 years ago

I understand, Thanks for the explanation!