Open michael-mi opened 3 years ago
Are you referring to this file: https://github.com/carla-simulator/opendrive-test-files/blob/master/OpenDrive/Town04.xodr ?
Are you referring to this file: https://github.com/carla-simulator/opendrive-test-files/blob/master/OpenDrive/Town04.xodr ?
Yes
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.
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:
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.
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.
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.
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](https://user-images.githubusercontent.com/72929056/96139401-8413a600-0f07-11eb-8d28-fd6b842cba41.png)
Same junction using LHT:![Screenshot from 2020-10-15 16-51-54](https://user-images.githubusercontent.com/72929056/96139517-9db4ed80-0f07-11eb-9e2e-cf80511dd939.png)
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