Skip to content

Instantly share code, notes, and snippets.

@DriveQuantPublic
Last active December 13, 2023 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DriveQuantPublic/66b90111a046739f1392bfb3fdae0da8 to your computer and use it in GitHub Desktop.
Save DriveQuantPublic/66b90111a046739f1392bfb3fdae0da8 to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: Crash
version: '1.0'
description: ''
servers:
- url: 'https://service.drivequant.com/v1'
description: prod
paths:
/pushcrash:
post:
summary: ''
operationId: post-pushcrash
responses: {}
parameters: []
requestBody:
content:
application/json:
schema:
description: ''
type: object
properties:
crashId:
type: string
description: DriveQuant crash id
customerId:
type: string
description: DriveQuant customer ID
driverId:
type: string
description: DriveQuant user ID
userId:
type: string
description: DriveKit user ID
parameters:
type: object
description: DriveKit SDK crash recording configuration
required:
- localTripId
- date
- gpsWindowPos
- gpsWindowNeg
- imuWindowNeg
- imuWindowPos
- imuFrequency
properties:
localTripId:
type: string
description: Temporary unique trip ID
date:
type: string
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSSZ'
description: Crash date
tripStartDate:
type: string
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSSZ'
description: Trip start date
gpsWindowPos:
type: number
description: Recording time of GPS data after detection in second
gpsWindowNeg:
type: number
description: Recording time of GPS data before detection in second
imuWindowNeg:
type: number
description: Recording time of IMU data before detection in second
imuWindowPos:
type: number
description: Recording time of IMU data after detection in second
imuFrequency:
type: number
description: Recording frequency of the accelerometer in Hz
gps:
type: object
description: GPS data recorded during the crash
required:
- timestamp
- latitude
- longitude
- velocity
- heading
- accuracy
- elevation
properties:
timestamp:
type: array
description: Time in second
items:
type: number
latitude:
type: array
description: Latitude in degree
items:
type: number
longitude:
type: array
description: Longitude in degree
items:
type: number
velocity:
type: array
description: Velovity in km/h
items:
type: number
heading:
type: array
description: Heading in degree
items:
type: number
accuracy:
type: array
description: Accuracy in meter
items:
type: number
elevation:
type: array
description: GPS elevation in meter
items:
type: number
movements:
type: object
description: Accelerometer data recorded during the crash
required:
- timestamp
- accelerationX
- accelerationY
- accelerationZ
properties:
timestamp:
type: array
description: Time in ms
items:
type: integer
accelerationX:
type: array
description: X axis acceleration in milli-G
items:
type: integer
accelerationY:
type: array
description: Y axis acceleration in milli-G
items:
type: integer
accelerationZ:
type: array
description: Z axis acceleration in milli-G
items:
type: integer
gpsFeatures:
type: object
description: Features computed from GPS data
required:
- index
- time
- latitude
- longitude
- crashType
- stopTime
- stopDuration
- stopDistance
- velocity
- velocityMin
- velocityMax
- velocityClass
- velocityPreNear
- velocityPreFar
- velocityPostNear
- velocityPostFar
- velocityOffsetNear
- velocityOffsetFar
- acceleration
- accelerationMin
- accelerationMax
- heading
- yawRate
- yawRateMin
- yawRateMax
- available
properties:
index:
type: integer
description: Index of crash in the GPS array
time:
type: number
description: Time of crash in the GPS array
latitude:
type: number
description: Latitude at time of crash in degree
longitude:
type: number
description: Longitude at time of crash in degree
crashType:
type: integer
description: Type of crash
stopTime:
type: number
description: Vehicle stop time in s
stopDuration:
type: number
description: Vehicle stop duration in s
stopDistance:
type: integer
description: Vehicle stop distance in m
velocity:
type: number
description: Velocity at time of crash in km/h
velocityMin:
type: number
description: Maximum velocity in km/h
velocityMax:
type: number
description: Minimum velocity in km/h
velocityClass:
type: integer
description: Velocity class
velocityPreNear:
type: number
description: Velocity 2 seconds before the crash in km/h
velocityPreFar:
type: number
description: Velocity 10 seconds before the crash in km/h
velocityPostNear:
type: number
description: Velocity 2 seconds after the crash in km/h
velocityPostFar:
type: number
description: Velocity 10 seconds after the crash in km/h
velocityOffsetNear:
type: number
description: Velocity difference around the crash (-2s/+2s) in km/h
velocityOffsetFar:
type: number
description: Velocity difference around the crash (-2s/+10s) in km/h
acceleration:
type: number
description: Acceleration at time of crash in m/s2
accelerationMin:
type: number
description: Minimum value of the acceleration over the whole recording windows in m/s2
accelerationMax:
type: number
description: Maximum value of the acceleration over the whole recording windows in m/s2
heading:
type: number
description: Heading at time of crash in degree
yawRate:
type: number
description: Yaw rate at time of crash in rad/s
yawRateMin:
type: number
description: Minimum value of the yaw rate over the whole recording windows in rad/s
yawRateMax:
type: number
description: Maximum value of the yaw rate over the whole recording windows in rad/s
available:
type: boolean
description: GPS data availability
movementFeatures:
type: object
description: Features computed from accelerometer data
required:
- index
- module
- time
- energy
- power
- energyNear
- energyFar
- powerNear
- powerFar
- stdModuleNear
- stdModuleFar
- stdModuleOffset
- entropyNear
- entropyFar
- entropyOffset
- meanModuleNear
- meanModuleFar
- meanModuleOffset
properties:
index:
type: integer
description: Index corresponding to the maximum value of the acceleration Euclidean norm
module:
type: number
description: Maximum value of the acceleration Euclidean norm
time:
type: number
description: Relative time of the maximum value of the acceleration Euclidean norm
energy:
type: number
description: Energy of the acceleration Euclidean norm vector over the whole recording windows
power:
type: number
description: Power of the acceleration Euclidean norm vector over the whole recording windows
energyNear:
type: number
description: Energy of the acceleration Euclidean norm vector around the crash
energyFar:
type: number
description: Energy of the acceleration Euclidean norm vector after crash
powerNear:
type: number
description: Power of the acceleration Euclidean norm vector around the crash
powerFar:
type: number
description: Power of the acceleration Euclidean norm vector after crash
stdModuleNear:
type: number
description: Standard deviation of the acceleration Euclidean norm vector around the crash
stdModuleFar:
type: number
description: Standard deviation of the acceleration Euclidean norm vector after crash
stdModuleOffset:
type: number
description: Acceleration Euclidean norm standard deviation offset
entropyNear:
type: number
description: Shannon entropy of the acceleration Euclidean norm vector around the crash
entropyFar:
type: number
description: Shannon entropy of the acceleration Euclidean norm vector after crash
entropyOffset:
type: number
description: Shannon entropy offset
meanModuleNear:
type: number
description: Mean value of the acceleration Euclidean norm vector around the crash
meanModuleFar:
type: number
description: Mean value of the acceleration Euclidean norm vector after crash
meanModuleOffset:
type: number
description: Acceleration Euclidean norm mean value offset
state:
type: string
enum:
- CONFIRMED
- UNCONFIRMED
- FAILED_TO_PREDICT
description: Crash status
probability:
type: number
minimum: 0
maximum: 100
description: Crash probability in %
predictionVersion:
type: string
description: Crash classifier version
metaData:
type: object
description: 'HashMap<String,String> of metaData set in DriveKit SDK'
required:
- crashId
- customerId
- driverId
- userId
- parameters
- gps
- movements
- gpsFeatures
- movementFeatures
- state
- probability
- predictionVersion
- metaData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment