|
|
# Traffic Simulator
|
|
|
|
|
|
This is the traffic simulator global wiki.
|
|
|
Check [installation](#Installation) for the steps to install every components of the system.
|
|
|
Check [Run](#Run) for the steps to make the project run.
|
|
|
This is the traffic simulator global wiki.
|
|
|
|
|
|
## Installation
|
|
|
### Client
|
... | ... | @@ -10,7 +8,7 @@ The client runs [SUMO](https://sumo.dlr.de/wiki/Downloads) as a traffic simulato |
|
|
The gitlab repository [sumo](https://gitlab.orbit-lab.org/traffic-simulator/sumo) contains the full Unity project and sumo files.
|
|
|
Clone it on your computer : `git clone --recurse-submodules https://gitlab.orbit-lab.org/traffic-simulator/sumo.git`. The Unity project is under the `sumo-unity` folder, and the SUMO configuration files are under the `sumo-simulator` folder.
|
|
|
|
|
|
Once on Unity, open the scene named "scene" on the assets folder, and open the inspector on the SumoConnection object. Make sure that Sumo Config File is set to `<path-to-sumo>\sumo-simulator\config.sumo.cfg` (choose your sumo clone folder). The ConnectionSettings set of parameters alows you to set the sumo server ip and port.
|
|
|
Once on Unity, open the scene named "scene" on the assets folder, and open the inspector on the SumoConnection object. Make sure that Sumo Config File is set to `<path-to-sumo>\sumo-simulator\config.sumo.cfg` (choose your sumo clone folder). The ConnectionSettings set of parameters allows you to set the sumo server IP and port. The Unity scene has by default the oculus VR setup but you can remove the vr camera and replace it by a standard Unity camera.
|
|
|
|
|
|
Make sure that the SUMO installation folder is added to your PATH variable (typically `C:\Users\native\Desktop\sumo-1.2.0\bin` on Windows).
|
|
|
|
... | ... | @@ -21,6 +19,8 @@ The central server runs [RabbitMQ](https://www.rabbitmq.com/download.html) as th |
|
|
|
|
|
Make sure to install them using pip3 and additional libraries if required by these packages.
|
|
|
### Cars
|
|
|
python3 with pika
|
|
|
The cars need to have python 3 installed with the package pika.
|
|
|
|
|
|
## Run |
|
|
\ No newline at end of file |
|
|
## Run
|
|
|
Firstly, you have to run the scripts on the server and cars. On the central server you have to run the rpc_client.py and tl.py scripts (located on the python_rpc folder). On the machine that the cars are running on you have to run the rpc_server.py script (the syntax is `./rpc_server.py [car id] [host] [subscriptions...]`, for example `./rpc_server.py car1 localhost *.side`).
|
|
|
Once those scripts are running, you can start the Unity scene, making sure that all IP addresses and ports are correctly set up. |
|
|
\ No newline at end of file |