Skip to content

Commit

Permalink
lane size
Browse files Browse the repository at this point in the history
  • Loading branch information
QuanyiLi committed Sep 18, 2023
1 parent b572cac commit cc26984
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion metadrive/obs/top_down_obs_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from metadrive.constants import PGLineType, PGLineColor
from metadrive.utils.utils import import_pygame
from metadrive.type import MetaDriveType
from metadrive.constants import DrivableAreaProperty

PositionType = Union[Tuple[float, float], np.ndarray]
pygame, gfxdraw = import_pygame()
Expand Down Expand Up @@ -419,7 +420,7 @@ def draw_stripes(cls, lane, surface, starts: List[float], ends: List[float], lat
pygame.draw.line(
surface, color, (surface.vec2pix(lane.position(starts[k], lats[k]))),
(surface.vec2pix(lane.position(ends[k], lats[k]))),
max(surface.pix(cls.STRIPE_WIDTH), surface.pix(cls.LANE_LINE_WIDTH))
2 * DrivableAreaProperty.LANE_LINE_WIDTH
)

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions metadrive/obs/top_down_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def draw_top_down_map(
TopDownSemanticColor.get_color(obj["type"], True),
surface.vec2pix([s_p[0], s_p[1]]),
surface.vec2pix([e_p[0], e_p[1]]),
max(surface.pix(LaneGraphics.STRIPE_WIDTH),
surface.pix(LaneGraphics.LANE_LINE_WIDTH))
# max(surface.pix(LaneGraphics.STRIPE_WIDTH),
surface.pix(DrivableAreaProperty.LANE_LINE_WIDTH) * 2
)
else:
for id, data in map.blocks[-1].map_data.items():
Expand Down

0 comments on commit cc26984

Please sign in to comment.