Skip to content

Commit

Permalink
STD_ROADMARK_<RoadMarkType> removed
Browse files Browse the repository at this point in the history
  • Loading branch information
atingber committed Nov 13, 2024
1 parent 62a36d3 commit 00fc162
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 32 deletions.
2 changes: 1 addition & 1 deletion examples/xodr/full_junction.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def road(self, **kwargs):
xodr.create_road(
[xodr.Line(100)],
i,
center_road_mark=xodr.STD_ROADMARK_BROKEN,
center_road_mark=xodr.std_roadmark_broken(),
left_lanes=nlanes,
right_lanes=nlanes,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/xodr/junction_with_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def road(self, **kwargs):
xodr.create_road(
[xodr.Line(100)],
i,
center_road_mark=xodr.STD_ROADMARK_BROKEN,
center_road_mark=xodr.std_roadmark_broken(),
left_lanes=nlanes,
right_lanes=nlanes,
)
Expand Down
4 changes: 2 additions & 2 deletions examples/xodr/manual_add_of_geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def road(self, **kwargs):
# create simple lanes
lanes = xodr.Lanes()
lanesection1 = xodr.LaneSection(0, xodr.standard_lane())
lanesection1.add_left_lane(xodr.standard_lane(rm=xodr.STD_ROADMARK_SOLID))
lanesection1.add_right_lane(xodr.standard_lane(rm=xodr.STD_ROADMARK_SOLID))
lanesection1.add_left_lane(xodr.standard_lane(rm=xodr.std_roadmark_solid()))
lanesection1.add_right_lane(xodr.standard_lane(rm=xodr.std_roadmark_solid()))
lanes.add_lanesection(lanesection1)

road1 = xodr.Road(0, planview, lanes)
Expand Down
4 changes: 2 additions & 2 deletions examples/xodr/road_with_custom_lanes.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def road(self, **kwargs):

# add driving lanes with roadmarks
left_lane_with_roadmark = xodr.Lane(a=4)
left_lane_with_roadmark.add_roadmark(xodr.STD_ROADMARK_BROKEN)
left_lane_with_roadmark.add_roadmark(xodr.std_roadmark_solid())
lanesection.add_left_lane(left_lane_with_roadmark)

right_lane_with_roadmark = xodr.Lane(a=4)
right_lane_with_roadmark.add_roadmark(xodr.STD_ROADMARK_SOLID)
right_lane_with_roadmark.add_roadmark(xodr.std_roadmark_solid())
lanesection.add_right_lane(right_lane_with_roadmark)

# add driving lanes to end in border
Expand Down
8 changes: 4 additions & 4 deletions examples/xodr/road_with_custom_roadmarkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def road(self, **kwargs):
# standard solid solid

solid_solid = xodr.Lane()
solid_solid.add_roadmark(xodr.STD_ROADMARK_SOLID_SOLID)
solid_solid.add_roadmark(xodr.std_roadmark_solid_solid())
centerlanes.append(solid_solid)

# standard solid broken
solid_broken = xodr.Lane()
solid_broken.add_roadmark(xodr.STD_ROADMARK_SOLID_BROKEN)
solid_broken.add_roadmark(xodr.std_roadmark_solid_broken())
centerlanes.append(solid_broken)

# customized broken broken
Expand All @@ -62,10 +62,10 @@ def road(self, **kwargs):
for i in centerlanes:
lanesection = xodr.LaneSection(ls_start, i)
left_lane_with_roadmark = xodr.Lane(a=4)
left_lane_with_roadmark.add_roadmark(xodr.STD_ROADMARK_BROKEN)
left_lane_with_roadmark.add_roadmark(xodr.std_roadmark_broken())

right_lane_with_roadmark = xodr.Lane(a=4)
right_lane_with_roadmark.add_roadmark(xodr.STD_ROADMARK_SOLID)
right_lane_with_roadmark.add_roadmark(xodr.std_roadmark_solid())
lanesection.add_left_lane(left_lane_with_roadmark)
lanesection.add_right_lane(right_lane_with_roadmark)
ls_start += 100
Expand Down
19 changes: 2 additions & 17 deletions scenariogeneration/xodr/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,6 @@

from warnings import warn


warn(
"STD_ROADMARK_<RoadMarkType> is deprecated and will be removed in a few releases! Use std_roadmark_<RoadMarkType> functions instead.",
DeprecationWarning,
5,
)
STD_ROADMARK_SOLID = std_roadmark_solid()
STD_ROADMARK_BROKEN = std_roadmark_broken()
STD_ROADMARK_BROKEN_TIGHT = std_roadmark_broken_tight()
STD_ROADMARK_BROKEN_BROKEN = std_roadmark_broken_broken()
STD_ROADMARK_SOLID_SOLID = std_roadmark_solid_solid()
STD_ROADMARK_SOLID_BROKEN = std_roadmark_solid_broken()
STD_ROADMARK_BROKEN_SOLID = std_roadmark_broken_solid()

STD_START_CLOTH = 1 / 1000000000


Expand All @@ -80,7 +66,7 @@ def standard_lane(offset=3, rm=std_roadmark_broken()):
default: 3
rm (RoadMark): road mark used for the standard lane
default: RoadMark(STD_ROADMARK_BROKEN)
default: RoadMark(solid)
Returns
-------
lane (Lane): the lane
Expand Down Expand Up @@ -195,7 +181,6 @@ def create_road(

def create_straight_road(road_id, length=100, junction=-1, n_lanes=1, lane_offset=3):
"""creates a standard straight road with two lanes
STD_ROADMARK_SOLID
Parameters
----------
road_id (int): id of the road to create
Expand Down Expand Up @@ -707,7 +692,7 @@ def create_junction_roads(
Default: None
outer_road_marks (RoadMark): the roadmark that will be on the edge of the connecting roads (limit the junction)
Default: STD_ROADMARK_SOLID
Default: std_roadmark_solid()
Returns
-------
junction_roads (list of Road): a list of all roads needed for all traffic connecting the roads
Expand Down
9 changes: 4 additions & 5 deletions tests/test_lane.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

from scenariogeneration import xodr
from scenariogeneration import prettyprint
from scenariogeneration.xodr.generators import STD_ROADMARK_BROKEN, STD_ROADMARK_SOLID
from .xml_validator import version_validation, ValidationResponse


Expand Down Expand Up @@ -260,14 +259,14 @@ def test_lane_with_material():
def test_lane_with_roadmarks():
lane = xodr.Lane()
lane._set_lane_id(1)
lane.add_roadmark(STD_ROADMARK_BROKEN)
lane.add_roadmark(xodr.std_roadmark_broken())
lane2 = xodr.Lane()
lane2._set_lane_id(1)
lane2.add_roadmark(STD_ROADMARK_BROKEN)
lane2.add_roadmark(xodr.std_roadmark_broken())
lane3 = xodr.Lane()
lane3._set_lane_id(1)
lane3.add_roadmark(STD_ROADMARK_BROKEN)
lane3.add_roadmark(STD_ROADMARK_SOLID)
lane3.add_roadmark(xodr.std_roadmark_broken())
lane3.add_roadmark(xodr.std_roadmark_solid())
prettyprint(lane)
prettyprint(lane3)
assert lane == lane2
Expand Down

0 comments on commit 00fc162

Please sign in to comment.