pageldev/libOpenDRIVE

Lane direction is not taken into account

hahne opened this issue · 3 comments

hahne commented

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:
<lanes> <laneSection s="0.0"> <left> <lane id="2" type="border" level="false"> <link> </link> <width sOffset="0.0" a="1.0" b="0.0" c="0.0" d="0.0"/> </lane> <lane id="1" type="driving" level="false"> <link> </link> <width sOffset="0.0" a="4.0" b="0.0" c="0.0" d="0.0"/> </lane> </left> <center> <lane id="0" type="none" level="false"> <link> </link> </lane> </center> <right> <lane id="-1" type="driving" level="false"> <link> </link> <width sOffset="0.0" a="4.0" b="0.0" c="0.0" d="0.0"/> </lane> <lane id="-2" type="border" level="false"> <link> </link> <width sOffset="0.0" a="1.0" b="0.0" c="0.0" d="0.0"/> </lane> </right> </laneSection> </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

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.

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.

  • If rule == RHT, their direction is the same as the geometric direction of the reference line.
  • If rule == LHT, their direction is the opposite of the geometric direction of the reference line.

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

  • If rule == RHT, their direction is the opposite of the geometric direction of the reference line.
  • If rule == LHT, their direction is the same as the geometric direction of the reference line.

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

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