move ident request to orchestration_server.py;
import sys modules for proper pickling;
This commit is contained in:
@@ -1,23 +1,33 @@
|
||||
import sys
|
||||
import time
|
||||
import requests
|
||||
|
||||
from devices.traffic_light import TrafficLight, SWITCHING_TIME
|
||||
import requests
|
||||
from dse_shared_libs import daf, traffic_light_state, traffic_light_color, target_velocity
|
||||
|
||||
from devices.traffic_light import TrafficLight
|
||||
from devices.vehicle import Vehicle
|
||||
|
||||
sys.modules['daf'] = daf
|
||||
sys.modules['traffic_light_state'] = traffic_light_state
|
||||
sys.modules['traffic_light_color'] = traffic_light_color
|
||||
sys.modules['target_velocity'] = target_velocity
|
||||
|
||||
"""
|
||||
USED AS ENTRYPOINT FOR DOCKERFILE
|
||||
Start all vehicles / traffic lights here
|
||||
"""
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
ENTITY_IDENT_URL = 'http://entityident:5002/api/v1/resources/'
|
||||
try:
|
||||
response = requests.get(ENTITY_IDENT_URL + 'cars')
|
||||
cars = response.json()
|
||||
|
||||
response = requests.get(ENTITY_IDENT_URL + 'cars')
|
||||
cars = response.json()
|
||||
|
||||
response = requests.get(ENTITY_IDENT_URL + 'traffic_lights')
|
||||
traffic_lights = response.json()
|
||||
response = requests.get(ENTITY_IDENT_URL + 'traffic_lights')
|
||||
traffic_lights = response.json()
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print("Is the entity_ident_server running and reachable?")
|
||||
raise e
|
||||
|
||||
print('Traffic lights', traffic_lights['cursor'])
|
||||
for traffic_light in traffic_lights['cursor']:
|
||||
|
||||
Reference in New Issue
Block a user