Motion, Trips and Stops
Following configuration parameters can be adjusted:
- report.trip.minimalTripDuration – Trips of less than minimal duration and minimal distance are ignored. 300 seconds and 500 meters are default.
- report.trip.minimalTripDistance – Trips of less than minimal duration and minimal distance are ignored. 300 seconds and 500 meters are default.
- report.trip.minimalParkingDuration – Parking for less than minimal duration does not detected as stop. Default 300 seconds.
- report.trip.minimalNoDataDuration – Gaps in reported positions longer than the value are considered as stops. Default 3600 second.
- report.trip.useIgnition – Force switch to stop state if ignition is reported and OFF. Default false.
- status.updateDeviceState – Force additional state check when device status changes to “offline” or “unknown”. Default false.
It was introduced to standardize how TrackinT handle device motion. Some devices report this attribute directly. For other devices it is automatically calculated according to speed and speedThreshold parameter. It can also be corrected using “computed attributes”.
Motion detection became more complex, now it is virtual device state. TrackinT analyzes positions flow and switch motion state according to configuration. TrackinT switches state from “stopped” to “moving” if device is reporting “motion = true” more than minimalTripDuration seconds or tripped distance more than minimalTripDistance meters. TrackinT switches state from “moving” to “stopped” if device is reporting “motion = false” more than minimalParkingDuration seconds or useIgnition enabled and ignition is OFF. Only continuous periods can switch the state, any fluctuations reset detection.
Last chance check might be applied when device changes status to “offline” or “unknown” if status.updateDeviceState parameter enabled. Might be helpful if device goes sleep faster than minimalParkingDuration or connection is not very stable.
Trips and Stops
TrackinT provides two advanced report types Trips and Stops. It uses the same motion detection algorithm to determine trips and stops. Algorithm uses following parameters to check if device was moving or stopped:
- Value of the “motion” attribute
- Directly compare speed to event.motion.speedThreshold configuration parameter (for backward compatibility with old data that does not have “motion” attribute)
- Detect gaps between reported position and treat them as parking period
Following are two examples to illustrate how it works.
First one shows how most devices report. Devices that have internal battery or connected to vehicle power supply all the time, but they can go into a sleep mode after some period (row #19-21) if there is no movement.
Trip 1 detected correctly, because period started from zero speed (initialized as stopped), distance longer than default 500 meters or duration longer than 5 minutes, and it is followed by stop longer than minimalParkingDuration.
Stop 1 detected because it has duration longer than minimalParkingDuration and the speed is close to zero.
Trip 2 also detected correctly from row 27, row 24-25 are ignored as fluctuation. Parameters are more than minimal, and it started and followed by positions with zero speed.
Second example illustrates case when device does not have internal battery and powered only when ignition is ON. Such devices always cold-start and have delay in GPS fix. Therefore such devices start reporting with speed much more than zero. It is impossible to use same algorithm as in the first example, so additional logic was introduced. Gaps between reporting intervals are detected as stops.
The report.trip.minimalNoDataDuration parameter is set to 600 (10 minutes). You can see that the speed is never less than speedThreshold, but the gap (row 15 – row 28) is more than 10 minutes. It is interpreted as a stop. Preceding trip is detected correctly. Following movement period is not detected as a trip because algorithm cannot determine when it ends.