Awesome
Interactive Test Tool: Simulation and Testing of Multi-Vendor CACC
This repository is an implementation of the Interactive Test Tool (ITT) for interoperability testing of Cooperative Intelligent Transport Systems (C-ITS). The ITT allows remote interoperability testing of e.g. platooning. It is much simpler that HLA or DIS. Each client is a black box, so they can run different operating systems, simulation environments, or even hardware, to allow Model-in-the-Loop, Controller-in-the-Loop, Hardware-in-the-Loop or even combination of physical and virtual vehicles.
For more details, see ITT paper (DOI:10.1109/ITSC.2015.278).
ITT provides the basic framework, while the rest can be implemented as external modules. One such module is Interaction and Validation Toolkit.
Vehicle control system
Vehicle control system takes n<nbsp/>⋅<nbsp/>V2X and SENSOR data, and outputs V2X and MOVE data. SENSOR is anything measured: camera, radar, anything (V2X actually also can be considered as a part of SENSOR). MOVE is what is sent to the steering wheel and acceleration/braking.
When you simulate your control system, you send MOVE to the vehicle dynamics model, which computes how the physical vehicle would have reacted. SENSOR comes from a sensor model. Sensor model takes a view of the world, so-called Ground Truth, and gives back detection angles and distances for the radars, and image frames for the cameras (e.g. OpenDaVINCI can literally take screenshots from VDrift).
Connecting two control systems
We need ground truth for the sensor model. Pieces of ground truth are generated by the vehicle dynamics models. The only thing needed is to gather all ground truth pieces from everyone and deliver the complete picture back to everyone. This is the main purpose of this software.
V2X part is even simpler than that. Just connect everyone using OpenVPN bridge, and an OpenVPN server will take care of gathering V2X pieces from everyone and redistributing them back. See V2X notes for mode details.
Complete client
Image below shows a complete client with V2X GeoNetworking stack.
The data to- and from Ground Truth Server is delivered as a JSON string over a TCP connection. If your sensor model and vehicle dynamics model can't talk JSON over TCP (e.g. Simulink can't), then you can use a simple adapter.
Adapter (optional)
A simple adapter for Simulink could take binary data from UDP (via Instrument Control Toolbox, DSP toolbox or Real Time Toolbox), pack it into JSON and send it over TCP. There could also be all sorts of file-based adapters, shared-memory adaptes, anything to get data encoded into JSON and communicated via TCP.
Status
The code here contains:
- ITT Ground Truth server.
- Example of an ITT Ground Truth Client Adapter.
The code here does not contain the Client itself (vehicle, implemented in e.g. Simulink). The code here does not contain V2X part either, see V2X notes for V2X part.
Running
Example assumes that you need a client adapter, and that the vehicle control system is implemented in Simulink.
Then running an examples is as simple as 1-2-3 :-)
- Start the server
- Start the adapter
- Start the control system (simulink)
If control system would be implemented in C++ or Java, the adapter could be integrated into the vehicle dynamics and sensor model binary, and you'd have only two steps.
Detailed steps
For Java sources, Maven is used as a build tool.
-
Start a server.
Here's how to start an ITT Server on port 5001 with the initial WorldModel defined in
test1.json
:mvn exec:java -Dexec.mainClass="net.gcdc.ittgt.server.BasicGroTrServer" -Dexec.args="5001 src/test/resources/test1.json"
-
Start a client adapter.
Here's how to start a client adapter connected to the ITT server on TCP 127.0.0.1:5001, listening for Simulink client on UDP 9080 and sending back to Simulink to UDP 127.0.0.1:9081:
mvn exec:java -Dexec.mainClass="net.gcdc.ittgt.client.GroTrClient" -Dexec.args="--localPortForSimulink=9080 --remoteSimulinkAddress=127.0.0.1:9081 --grotrServerAddress=127.0.0.1:5001"
-
Start the client itself.
If using Simulink, start a simulation using the GUI.
Implementation
ITT GT Server
Server listens on TCP for GT data from clients, then bundles it into WorldModel data, and sends it back to each client. On the first step, the server provides all the clients with their initial positions.
ITT GT Client Adapter
Client adapter listens on a UDP port for data from Simulink. Adapter unpacks Simulink data from UDP, then repacks it into JSON and sends it over TCP to the ITT GT Server.
Adapter receives WorldModel from ITT GT Server as JSON, unpacks JSON, then repacks the data as a UDP payload and sends it over UDP back to Simulink.
Java model of GT
Java model is just a simple Vehicle class (POJO) that is encoded to JSON by GSON. GT data of all clients constitutes a WorldModel.
Acknowledgements
This implementation was partly developed within i-GAME project that has received funding from the European Union's Seventh Framework Programme for research, technological development and demonstration under grant agreement no 612035.
License
This code is released under the business-friendly Apache 2.0 license.