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

Function draw_waypoints

agents/tools/misc.py:15–28  ·  view source on GitHub ↗

Draw a list of waypoints at a certain height given in z. :param world: carla.world object :param waypoints: list or iterable container with the waypoints to draw :param z: height in meters

(world, waypoints, z=0.5)

Source from the content-addressed store, hash-verified

13import carla
14
15def draw_waypoints(world, waypoints, z=0.5):
16 """
17 Draw a list of waypoints at a certain height given in z.
18
19 :param world: carla.world object
20 :param waypoints: list or iterable container with the waypoints to draw
21 :param z: height in meters
22 """
23 for wpt in waypoints:
24 wpt_t = wpt.transform
25 begin = wpt_t.location + carla.Location(z=z)
26 angle = math.radians(wpt_t.rotation.yaw)
27 end = begin + carla.Location(x=math.cos(angle), y=math.sin(angle))
28 world.debug.draw_arrow(begin, end, arrow_size=0.3, life_time=1.0)
29
30
31def get_speed(vehicle):

Callers 2

run_stepMethod · 0.90
run_stepMethod · 0.90

Calls 1

draw_arrowMethod · 0.80

Tested by

no test coverage detected