eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.47k stars 1.4k forks source link

OpenDRIVE: problems when importing a network for left-hand traffic #7692

Open michael-mi opened 3 years ago

michael-mi commented 3 years ago

When trying to convert Town04.xodr map using left hand traffic, an invalid map is generated. Screenshot of RHT map: Screenshot from 2020-10-15 16-52-30

Same junction using LHT: Screenshot from 2020-10-15 16-51-54

As can be seen from the screenshot, the direction of connecting road is not changed according to traffic direction and we get a road connecting to opposite direction.

I'm using the following options of netconvert: --output.original-names true --opendrive.import-all-lanes true --precision 8 --lefthand true

behrisch commented 3 years ago

Are you referring to this file: https://github.com/carla-simulator/opendrive-test-files/blob/master/OpenDrive/Town04.xodr ?

michael-mi commented 3 years ago

Are you referring to this file: https://github.com/carla-simulator/opendrive-test-files/blob/master/OpenDrive/Town04.xodr ?

Yes

behrisch commented 3 years ago

netconvert is not meant to convert an arbitrary RHT network into a LHT network. The network should originate from data of a real left hand driving region. I am not sure whether this is the case here.

ohadsch commented 3 years ago

How can an ODR 1.4 map file represent a real left hand driving region? what is its expected structure?

As I understand it, since ODR 1.4 does not define driving direction, the "right" way to parse the map is as follows:

behrisch commented 3 years ago

Problems arise with one way streets as in your example. You probably would expect them to be reverted but there is no general rule to follow whether a one way street should be reverted.

ohadsch commented 3 years ago

I agree, this is why I suggested the heuristic above. Without some kind of heuristic there is no way to convert ODR file properly using the "--lefthand" option.

namdre commented 3 years ago

The problem arises because the lefthand logic of netconvert is tailored for osm-style networks that define a forward direction for all edges and this direction will correctly indicate driving direction in one-way lefthand roads. Put in another way: OSM defines forward/backward rather than right/left.

What netconvert does in ODR import right now is to assume that the right-hand lanes always correspond to the forward direction and then it moves geometries to the other side of center-line geometry when using the lefthand option. I think this needs to be changed.

I don't even think this is a question of heuristics. In a lefthand network, left means forward and right means backward. The above statement corresponds to Michaels point that a lefthand network is encoded differently from a right hand network. When trying to re-interpret a right-hand network as lefthand, some sort of heuristic is indeed needed.