"Index 0 out of bounds for length 0" while reading lanes in XMLParser
Hello,
I'm attempting to use this tool on my own XODR file and am encountering the following error:
Type of element 0: sidewalk
Type of element 1: driving
Type of element 2: driving
Type of element 0: none
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:458)
at converter.importer.XMLParser.parse(XMLParser.java:134)
I did some debugging and it seems that this error is generated for every single road in my XODR file. Here's what one of the roads looks like:
<road id="730" length="166.54722835" name="" junction="-1">
<link>
<predecessor elementType="junction" elementId="1"/>
<successor elementType="junction" elementId="2"/>
</link>
<planView>
<geometry x="2863.48069727" hdg="3.146951407179586" y="213.61326329" length="166.54722835" s="0">
<line/>
</geometry>
</planView>
<elevationProfile>
<elevation b="0" d="0" a="0" s="0" c="0"/>
</elevationProfile>
<lateralProfile>
<superelevation b="0" d="0" a="0" s="0" c="0"/>
<crossfall b="0" d="0" side="both" a="0" s="0" c="0"/>
</lateralProfile>
<lanes>
<laneSection s="0" singleSide="false">
<right>
<lane id="-3" type="sidewalk" level="1">
<width b="0" d="0" a="3" sOffset="0" c="0"/>
<roadMark laneChange="both" color="standard" height="0" type="solid" weight="standard" width="0.13" material="none" sOffset="0"/>
<speed max="13.89" unit="m/s" sOffset="0"/>
</lane>
<lane id="-2" type="driving" level="1">
<width b="0" d="0" a="3.3" sOffset="0" c="0"/>
<roadMark laneChange="both" color="standard" height="0" type="solid" weight="standard" width="0.13" material="none" sOffset="0"/>
<speed max="13.89" unit="m/s" sOffset="0"/>
</lane>
<lane id="-1" type="driving" level="1">
<width b="0" d="0" a="3.3" sOffset="0" c="0"/>
<roadMark laneChange="both" color="standard" height="0" type="broken" weight="standard" width="0.13" material="none" sOffset="0"/>
<speed max="13.89" unit="m/s" sOffset="0"/>
</lane>
</right>
<center>
<lane id="0" type="none" level="1">
<roadMark laneChange="both" color="standard" height="0" type="solid" weight="standard" width="0.13" material="none" sOffset="0"/>
</lane>
</center>
</laneSection>
</lanes>
<type type="town" s="0"/>
</road>
Any help you could provide would be greatly appreciated. Thanks in advance.