MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / _render_walkers

Method _render_walkers

scenario_runner/no_rendering_mode.py:1074–1088  ·  view source on GitHub ↗
(self, surface, list_w, world_to_pixel)

Source from the content-addressed store, hash-verified

1072 surface.blit(font_surface, (x - radius / 2, y - radius / 2))
1073
1074 def _render_walkers(self, surface, list_w, world_to_pixel):
1075 for w in list_w:
1076 color = COLOR_PLUM_0
1077
1078 # Compute bounding box points
1079 bb = w[0].bounding_box.extent
1080 corners = [
1081 carla.Location(x=-bb.x, y=-bb.y),
1082 carla.Location(x=bb.x, y=-bb.y),
1083 carla.Location(x=bb.x, y=bb.y),
1084 carla.Location(x=-bb.x, y=bb.y)]
1085
1086 w[1].transform(corners)
1087 corners = [world_to_pixel(p) for p in corners]
1088 pygame.draw.polygon(surface, color, corners)
1089
1090 def _render_vehicles(self, surface, list_v, world_to_pixel):
1091

Callers 1

render_actorsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected