-
Notifications
You must be signed in to change notification settings - Fork 0
/
templateCARLA.py
40 lines (31 loc) · 1.12 KB
/
templateCARLA.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import glob
import os
import sys
# Import CARLA from the egg
try:
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
pass
import carla
import random
def main():
print('This script does not check the version compatibility between carla and the script. It was developed under the 0.9.11 version. Errors might be expected if ran from another version.')
client = carla.Client('localhost', 2000) # Parameters of the CARLA server
client.set_timeout(10.0) # Timeout to connect to the server
print('You are connected to the simulator.')
try:
# Infinite loop to wait the end of the world
# print('Press Ctrl+C to quit')
# while True:
# world.wait_for_tick()
pass
finally:
# print('Destroying actors')
# client.apply_batch([carla.command.DestroyActor(x) for x in vehicle_list])
# print('Actors destroyed')
pass
if __name__ == '__main__':
main()