Vehicle Crash Detection
Last updated
Last updated
This document refers to deprecated parts of the platform and has been left intact to help customers with legacy integrations. In order to access the latest platform features and documentation, please go to https://docs.sentiance.com.
Follow the below steps to set up vehicle crash detection in you app.
If you haven't already integrated the Sentiance SDK, follow the steps in our guide to complete the integration. Once you have completed those steps, continue along with the steps documented below.
There are several reasons why vehicle crash detection may not be supported on the device. The two most common of these are:
the feature is not enabled for your app;
the device lacks the necessary sensors (e.g. accelerometer).
You can check to see whether vehicle crash detection is support on the device, as follows.
As the Sentiance SDK supports both (i.e. explicitly starting and stopping a trip), the availability of vehicle crash detection is also controlled at the level of the trip type. In the above example, we pass a trip type of SDK_TRIP
or SENTTripTypeSDK
to check if the feature is available for automatic trips. To check if it's available for manually started trips, pass EXTERNAL_TRIP
or SENTTripTypeExternal
instead.
In order to be notified of vehicle crash events, you must set a listener that the SDK can invoke whenever it detects vehicle crashes.
The crash event contains the time and location of the detected crash, in addition to a number of metrics to estimate the severity of the crash.
The final step is checking your integration, to make sure that your vehicle crash listener is properly set up to handle crash events. Add the following method call in your app to trigger a dummy crash event.
This should invoke a dummy crash event, passing it to the listener that you previously set. You can then test how your app handles the event at runtime.
A crash report contains contextual information pertaining to a crash event. This includes information specific to the crash i.e., time, location, speed before impact, a severity indicator and sensor data. Also, it contains user timeline information before, during, and after the crash event, as well as weather and traffic data. A single crash event produces one or more aggregative crash reports. Each new crash report is generated asynchronously as soon as new information is available on the Sentiance platform or on external data sources. So, we recommend to look for the latest file for a given crash event.
Crash reports are securely stored on Amazon S3. Reports will be generated in client-specific root folders with the following directory structure:
CLIENT_APP_ID: The client app ID (e.g. 0000xxxxxxxxxxxxxxxxxxx).
UTC_DATE: The date of the crash event in UTC timezone in YYYY-MM-DD
format.
REPORT_ID: A unique identifier for a crash report, belonging to a single crash event.
UTC_TIMESTAMP: Unix timestamp (UTC) in milliseconds of when the report was generated.
A single crash report file may consist of multiple report segments. Each report segment contains different information related to the crash event.
CRASH EVENT: This segment contains the most basic information about a crash event and is usually generated first and as soon as possible after a crash event occurs (though this may change in the subsequent reports due to the asynchronous nature of the Sentiance platform).
TRANSPORTS: This segment contains information about one or more transports directly related to the crash event. Transports may include information like total distance traveled, trip waypoints, road types traveled, driving scores, and driving events.
TIMELINE: This segment contains information about the user’s timeline before, during, and after a crash event. This may include either stationaries (venues/locations where the user remained static) or other transports.
WEATHER: This segment contains information about the weather at the time and location of the crash event.
TRAFFIC: This segment contains information about traffic conditions (traffic incidents and the traffic flow) at the time and location of the crash event.
Here you can find sample data for each of those segments:
The data model of the fields in the above sample segments of the crash report are explained in the attached file.
The procedure to access the crash report files in Amazon S3 is the same as that of offload files. Please refer to .