asam-ev / qc-opendrive

Mozilla Public License 2.0
7 stars 1 forks source link

[XODR] Implement Check for Rule 105 "road.lane.link.lanes_across_lane_sections" #3

Closed JonasConrad-PES closed 3 months ago

JonasConrad-PES commented 5 months ago

link Rules excel:

https://asamev.sharepoint.com/:x:/r/sites/opendrive/_layouts/15/Doc.aspx?sourcedoc=%7BA61CD61B-1189-45B7-95C8-65623A8C7376%7D&file=Rules.xlsx&action=default&mobileredirect=true Rule excel ref ID: "105" Rule name: "road.lane.link.lanes_across_lane_sections" Rule group: "lane_linkage" Severity: ERROR Complexity: 1

link to standard:

1.7:

9.4. Lane linkage https://www.asam.net/standards/detail/opendrive/older/

1.8:

11.5. Lane linkage https://publications.pages.asam.net/standards/ASAM_OpenDRIVE/ASAM_OpenDRIVE_Specification/latest/specification/11_lanes/11_05_lane_link.html

Rule Text

Lanes that continues across the lane sections shall be connected in both directions. (This text can be found in the Examples section)

Additional context

If a lane is followed (or preceded) by another lane of another lane section, linking shall be used to define that the two lanes are connected. This only applies to lanes with a non-zero width at their connection point. (see rule 106!) This means that if a lane starts from zero width (such as when a road widens, going from 2 lanes to 3 lanes), this new lane shall not have linking information related to its predecessor (as it does not have one). The same goes for the end: if a lane ends with zero width, it shall have no linking information to its successor (as it does not have one).

Sepc 1.8 : Example where lane linkage should not be used: Parking lane at the roadside ends and a grass strip begins.

Example

<lanes>
    <laneSection s="0">
        <left>
            <lane id="1" type="driving" level= "false">
                <link>
                    <successor id="1" />
                </link>
                <width sOffset="0" a="3" b="0" c="0" d="0"/>
            </lane>
        </left>
        <center>
            <lane id="0" type="driving" level= "false">
            </lane>
        </center>
        <right>
            <lane id="-1" type="driving" level= "false">
                <link>
                    <successor id="-1" />
                </link>
                <width sOffset="0" a="3" b="0" c="0" d="0"/>
            </lane>
        </right>
    </laneSection>
    <laneSection s="50">
        <left>
            <lane id="1" type="driving" level= "false">
                <link>
                    <predecessor id="1" />
                </link>
                <width sOffset="0" a="3" b="0" c="0" d="0"/>
            </lane>
        </left>
        <center>
            <lane id="0" type="driving" level= "false">
            </lane>
        </center>
        <right>
            <lane id="-1" type="driving" level= "false">
                <link>
                    <predecessor id="-1" />
                </link>
                <width sOffset="0" a="3" b="0" c="0" d="0"/>
            </lane>
        </right>
    </laneSection>
</lanes>

# Not OK
<lanes>
    <laneSection s="0">
        <left>
            <lane id="1" type="driving" level= "false">
                <link>
                    <successor id="1" />
                </link>
                <width sOffset="0" a="3" b="0" c="0" d="0"/>
            </lane>
        </left>
        <center>
            <lane id="0" type="driving" level= "false">
            </lane>
        </center>
        <right>
            <lane id="-1" type="driving" level= "false">
                <link>
                    <successor id="-1" />
                </link>
                <width sOffset="0" a="3" b="0" c="0" d="0"/>
            </lane>
        </right>
    </laneSection>
    <laneSection s="50">
        <left>
            <lane id="1" type="driving" level= "false">
                <link>
                    <predecessor id="1" />
                </link>
                <width sOffset="0" a="3" b="0" c="0" d="0"/>
            </lane>
        </left>
        <center>
            <lane id="0" type="driving" level= "false">
            </lane>
        </center>
        <right>
            <lane id="-1" type="driving" level= "false">
                <link>
                # here a link is missing!
                </link>
                <width sOffset="0" a="3" b="0" c="0" d="0"/>
            </lane>
        </right>
    </laneSection>
</lanes>
MircoNierenz commented 4 months ago

in the appendix xord examples (valid/invalid) The invalid contains missing lane links as well as links to non-existent lanes road_lane_link_lanes_across_laneSections.zip

MircoNierenz commented 4 months ago

when checking in the current pychecker, I found that the missing links are already covered by the check “check road lane linkage”. Here is the output from this check: road 1 has invalid (not existing) linked predecessor lane in laneSection s=50.0, lane=-3 road 1 has invalid (not existing) linked predecessor lane in laneSection s=50.0, lane=3

hoangtungdinh commented 4 months ago

Hi @MircoNierenz and @JonasConrad-PES, we have few questions regarding the examples and the rule.

  1. In the valid example, the right lanes in the first lane section have predecessors. But similar to the discussion in https://github.com/asam-ev/qc-opendrive/issues/2, I think it should be successor, is that correct? If so, we can change the file.

        <right>
          <lane id="-1" type="driving">
            <link>
              <predecessor id="-1"/>
            </link>
            <width sOffset="0.0000000000000000e+00" a="3.0000000000000000e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00"/>
          </lane>
          <lane id="-2" type="border">
            <link>
              <predecessor id="-2"/>
            </link>
            <width sOffset="0.0000000000000000e+00" a="3.0000000000000000e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00"/>
          </lane>
          <lane id="-3" type="sidewalk">
            <link>
              <predecessor id="-3"/>
            </link>
            <width sOffset="0.0000000000000000e+00" a="3.0000000000000000e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00"/>
          </lane>          
        </right>
  2. The invalid example indicates that there should be a problem if the linked lane id doesn't exist in the linked lane section. However, this seems to be covered by rule 374. And while the severity of rule 374 is WARNING, the severity of this rule 105 is ERROR. Could you confirm whether rule 105 should also raise an issue with ERROR severity if the lane id does not exist in the linked lane section?

          <lane id="3" type="sidewalk">
            <link>
              <predecessor id="4"/> <!-- issue: lane id not exist in previous lane section -->
            </link>
            <width sOffset="0.0000000000000000e+00" a="1.0000000000000000e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00"/>
          </lane> 
  3. Is it correct that this rule should also apply to lanes that continue across roads and junctions (e.g. where a lane in the last lane section of one road joins a lane in the first lane section of another road)?

MircoNierenz commented 4 months ago

Hi Tung,

I am unfortunately ill, so I can only answer now: here are the corrected examples: road_lane_link_lanes_across_laneSections.zip

with the following changes:

to 3) the colleagues from the OpenDRIVE Maintenance Project should please provide information here