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.
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:
Finally, the last steps:
OpenXC Demo app
on the deviceSettings -> Data Sources
and change the vehicle
interface to a Pre-recorded Trace File.Trace File Playback
, select a trace file
for playback.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.