You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I load an .xodr file where a right lane has as type 'none', and call RoadNetwork.get_roads(), I get the error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/aron/.local/lib/python3.8/site-packages/pyxodr/road_objects/network.py", line 153, in get_roads
self._link_roads()
File "/home/aron/.local/lib/python3.8/site-packages/pyxodr/road_objects/network.py", line 123, in _link_roads
road._link_lane_sections()
File "/home/aron/.local/lib/python3.8/site-packages/pyxodr/road_objects/road.py", line 420, in _link_lane_sections
lane_section._link_lanes()
File "/home/aron/.local/lib/python3.8/site-packages/pyxodr/road_objects/lane_section.py", line 239, in _link_lanes
for lane in self.lanes:
File "/home/aron/.local/lib/python3.8/site-packages/pyxodr/road_objects/lane_section.py", line 170, in lanes
lanes = self.left_lanes + self.right_lanes
File "/usr/lib/python3.8/functools.py", line 967, in __get__
val = self.func(instance)
File "/home/aron/.local/lib/python3.8/site-packages/pyxodr/road_objects/lane_section.py", line 165, in right_lanes
return self.__get_lanes_by_orientation(LaneOrientation.RIGHT)
File "/home/aron/.local/lib/python3.8/site-packages/pyxodr/road_objects/lane_section.py", line 111, in __get_lanes_by_orientation
if lane_obj.type not in self.ignored_lane_types:
TypeError: 'in <string>' requires string as left operand, not NoneType
EDIT: This only happens when I set ignored_lane_types='shoulder', if I do not specify lanes to ignore this is no issue.
The specification of this lane in the xodr file is given below, and if I change the type from "none" to something, the error is not given. The xodr file is generated by Matlab RoadRunner, so I guess this is an artefact on that side. I have solved it for now by ignoring the lane when it's type is None, but I'm not sure how this influences the outcome.
@aertssenaron Sorry for late, as I haven’t worked on this project for quite a while.
In this project, the issue you mentioned about ignored_lane_types is indeed something that hasn’t been fully addressed in the OpenScenario (1.0.0) & OpenDrive format files (1.6). So, encountering such issues is expected. The solution you implemented is also a method I used in the earlier stages.
From what I observed using visualization software back then, the impact seemed minimal. However, there are a few key points you may want to check:
Impact on Road Geometry: Ignoring lanes marked as 'none' should not affect the computation of usable lanes, but it might impact the overall geometry if these lanes contribute to lane widths or road markings.
Road Markings: Road markings (if present) associated with these lanes might also be skipped, which could be relevant depending on your use case.
Lane Linking: In cases where the 'none' lanes form boundaries or are used for linking lanes, this may affect how lanes are connected, potentially leading to unexpected gaps or breaks in the road network.
To resolve this issue, you may want to check if ASAM OpenDRIVE has any updates or fixes (I only have the old version linked in my README.md).
Alternatively, a possible workaround is to modify the compiled Python script, similar to the following:
def__get_lanes_by_orientation(self, orientation):
lanes= []
forlane_objinself._lanes:
iflane_obj.orientation==orientation:
# Only process if the lane type is not 'none' and respects the ignored types.iflane_obj.typeisnotNoneandlane_obj.typenotinself.ignored_lane_types:
lanes.append(lane_obj)
returnlanes
When I load an .xodr file where a right lane has as type 'none', and call
RoadNetwork.get_roads()
, I get the error:EDIT: This only happens when I set
ignored_lane_types='shoulder'
, if I do not specify lanes to ignore this is no issue.The specification of this lane in the xodr file is given below, and if I change the type from "none" to something, the error is not given. The xodr file is generated by Matlab RoadRunner, so I guess this is an artefact on that side. I have solved it for now by ignoring the lane when it's type is
None
, but I'm not sure how this influences the outcome.The text was updated successfully, but these errors were encountered: