pageldev / libOpenDRIVE

Small, lightweight C++ library for handling OpenDRIVE files
Apache License 2.0
368 stars 134 forks source link

Lane direction is not taken into account #74

Open hahne opened 1 year ago

hahne commented 1 year ago

Hi,

Thanks for the great work!

One question, is there a reason why the lane direction is not taken into account or am I missing something?

According to the OpenDRIVE standard, lanes are grouped in left and in right lanes: `

`

This tells you that the lane direction is equal to the center lane direction for for the lanes grouped under the -tag. But I don't see this information being available in libOpenDRIVE. Am I missing something?

I added it in my implementation. Can make a pull request if there's any interest.

Kind Regards, Johannes

pageldev commented 1 year ago

Hi Johannes, thanks for the feedback!

Can you point me to the chapter in the OpenDrive format spec for the lane direction info? Not 100% sure what you mean.

michikommader commented 1 year ago

As far as I always interpreted OpenDRIVE, lanes have their "direction" defined implicitly by their index and their road's rule attribute holding information about right-hand (RHT) or left-hand traffic (LHT):

Lanes -1, -2, etc. are defined as being right of the reference line geometry.

Lanes 1, 2, etc. are defined as being left of the reference line geometry.

Lane 0 is defined in direction of the course of the reference line geometry.

pageldev commented 1 year ago

Looks like the rule attribute was introduced in v1.45. When creating this project I targeted v1.4.