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)
| 13 | import carla |
| 14 | |
| 15 | def 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 | |
| 31 | def get_speed(vehicle): |
no test coverage detected