Simulator GUI


The simulator GUI is built by initating and using modules from the simulator, if you use several modules that both support a certain signal both signals will be sent which can cause the values to jump around as the modules have influence over each other.

Git clone adress:

git clone git@developer.lindholmen.se:simulator-gui

The simulator GUI is built using the Vaadin framework. When started using gradle it will start a jetty server and then put the GUI on that server.

Using the simulator-gui is simple the only thing you need is to have gradle installed and the git repository cloned. Once those steps are done, navigate to the simulator-gui folder with a terminal and use the following command:

gradle build vaadinCreateTheme vR

When prompted for name for the gui please enter simulatorgui otherwise the project will fail to compile.

The vR command is the abbreviated version of the following gradle task and they both do that same thing.

gradle vaadinRun

Gradle will not finish this task like it normally does, instead it will show the message:

Building 90% > :vaadinRun

The percentage may very but this is normal and while the server is running it will continue like this. To stop the server press the enter key
Currently there is a known problem that windows users can not stop the server with the enter key as promted istead press the ctrl + c (control key + c key)

When the server is up and running it will open a browser aswell as opening the correct adress for the GUI. The first tab is for connecting to the device and while you can look around do not start any simulation before an actual connection has been made or you will get an error. From here you will require a application running on a device or emulator with an AutomotiveManager in order to connect the simulator-gui and to send signals. On the Network Setup tab make sure the ip adress is correct. If you are using USB the IP adress should stay 127.0.0.1 and you should also in a terminal window use the following adb commands(the adb is inside the android sdk in the platform-tools folder):

adb forward tcp:8251 tcp:8251
adb forward tcp:9898 tcp:9898
adb forward tcp:9899 tcp:9899

this will forward the ports to the devices emulated network while it is connected. If both devices are connected to the same WLAN or LAN you do not need to use the commands above. In that case you just need the device ip in order to connect. While it is possible to change the ports please do not change them as they are vital for the connection to be successful. Below you can see the simulator directly after it has been started.

Once both devices are present and ready press the connect button. After rougly one second the text should change into "Server is connected!". 

File Reader


The file reader is used when one have data recordings on car signals. The structure of the datafile is simple, use the following template when creating a pre-recorded data file:

{"timestamp":X,"name":"Y","value":Z}

Have exactly one recorded value in each row and have no empty rows. Replace X with a UNIX timestamp. The timestamp is of the data type long and represent a relative time between this signal and the next. The timestamps must be ordered in chronological order with lowest values first and heigher values after.

Replace Y with one of the following values

fuel_level
engine_speed
transmission_gear_position
vehicle_speed
parking_brake_status

The Z will depend on what you picked for Y:

  • fuel_level -> Z = float
  • engine_speed -> Z = float
  • transmission_gear_position -> string
    • first
    • second
    • third
    • fourth
    • fifth
    • sixth
    • reverse
    • neutral
    • parking
  • vehicle_speed -> Z = float
  • parking_brake_status -> string
    • true
    • false

The path to the file should be an absolute path such as this windows path:

C://foo/bar/file

or this linux path

/home/foo/bar/file

Limitations

As of now the file reader only supports a few values from the openXC format 

Direct Simulation


Each checkbox will enable or disable the signal to its immediate right. The signals are taken from FMS (exept for one) and they appear in the following order in the tab

  • Wheel Based Speed
  • Fuel Level 1
  • Driver Distraction Level (not in FMS)
  • Fuel Rate
  • Engine Speed
  • Current Gear
  • Instantaneous fuel Economy
  • Parking Brake
  • Brake Switch
  • High Resolution Total Vehicle Distance
  • Direction Indicator
  • Accelerator Pedal Position 1

Arduino Sensor


The Arduino tab is a usb device connected to a arduino board that have a sonar sensor. This module when activated will continuously send sonar signal data with with the integer id value of 261. This module might work for other sonars but it is not guaranteed as it was designed for a specific device.
 
 

Trust GXT27 Steering Wheel


A steering wheel can be connected to the simulator and provide vehicle data to your application. In our case we added a very inexpensive steering wheel which will allow you to control your application.

TORCS Connection


The driver simulator can be connected to the simulator and the infotainment system to provide vehicle data to your application.