Fix camera position in vehicle_gallery.py

This commit is contained in:
nsubiron 2018-10-30 12:52:38 +01:00
parent f99fc82f4a
commit 362d613c6c
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ import time
def get_transform(vehicle_location, angle, d=6.4):
a = math.radians(angle)
location = carla.Location(d * math.cos(a), d * math.sin(a), 2.0) + vehicle_location
return carla.Transform(location, carla.Rotation(yaw=180 + angle, pitch=-20))
return carla.Transform(location, carla.Rotation(yaw=180 + angle, pitch=-15))
def main():
@ -52,7 +52,7 @@ def main():
while angle < 356:
timestamp = world.wait_for_tick()
angle += timestamp.delta_seconds * 60.0
spectator.set_transform(get_transform(location, angle - 90))
spectator.set_transform(get_transform(vehicle.get_location(), angle - 90))
finally: