Please do not try to test your application while in motion! Testing OpenXC apps while driving is absolutely a two person job.

The OpenXC Vehicle Simulator is a web application intended for developers to run on local machines to generate a simulated OpenXC vehicle data trace in real time, to be used for testing iOS applications.

Besides unit tests, the simulator is the recommended first step for testing your application.

Simulator Screenshot

Your iOS device likely doesn’t have any vehicle data flowing through it yet. The next step is to use a pre-recorded vehicle trace file to simulate a real vehicle interface on your desk. The library ships with a method for playing back previously recorded vehicle measurement trace files for testing. The Measurement objects received by your application are identical to those received from a live vehicle.

The trace file format is simply a plain text file of OpenXC JSON messages with an additional timestamp field, separated by newlines:

{"timestamp": 1351176963.426318, "name": "door_status", "value": "passenger", "event": true}
{"timestamp": 1351176963.438087, "name": "fine_odometer_since_restart", "value": 0.0}
{"timestamp": 1351176963.438211, "name": "brake_pedal_status", "value": false}
{"timestamp": 1351176963.438318, "name": "transmission_gear_position", "value": "second"}

Install the Demo App app if you haven’t already. That application helps control the source of vehicle data, e.g. a vehicle interface or a trace file.

Download the driving trace and copy it to your iOS device using iTunes.

Steps:

  • Connect the iOS device to your laptop/desktop.
  • Open iTunes
  • Drag and drop the trace file and Sync

Finally, the last steps:

  1. Run the OpenXC Demo app on the device
  2. In the Demo app, Go to Settings -> Data Sources and change the vehicle interface to a Pre-recorded Trace File.
  3. At the bottom of the screen under Trace File Playback, select a trace file for playback.
  4. Return to the front view of the Demo app - the message count should be increasing, indicating the trace is playing.

User interface design for automotive environments is increasingly attracting attention, particularly due to concerns with driver distraction. While building your OpenXC application, keep in mind the U.S. government’s recently released guidelines (PDF) for application design.

Driver distraction aside, the most useful and interesting applications tend to be those without much driver interaction. The more you can automate or let the user deal with outside of their vehicle, the better the experience will likely be.