Compute speed of a vehicle in Km/h. :param vehicle: the vehicle for which speed is calculated :return: speed as a float in Km/h
(vehicle)
| 29 | |
| 30 | |
| 31 | def get_speed(vehicle): |
| 32 | """ |
| 33 | Compute speed of a vehicle in Km/h. |
| 34 | |
| 35 | :param vehicle: the vehicle for which speed is calculated |
| 36 | :return: speed as a float in Km/h |
| 37 | """ |
| 38 | vel = vehicle.get_velocity() |
| 39 | |
| 40 | return 3.6 * math.sqrt(vel.x ** 2 + vel.y ** 2 + vel.z ** 2) |
| 41 | |
| 42 | def is_within_distance_ahead(target_transform, current_transform, max_distance): |
| 43 | """ |
no test coverage detected