Motion Tracking System
Introduction to Motion Tracking System (MTS)
The Motion Tracking System (a.ka., Device Tracking System) is a collection of location-data-driven services that allow a User to query and extract location data from the system in multiple formats granting various insights, alerts, and notifications based on different events and rules. These triggers are offered by the system or configured by the User.
Devices send real-time tracking data to MTS in a predefined format and MTS is responsible to store it and make it available for various data consumers(dashboard/UI/other platform applications). Appropriate APIs are exposed to insert as well as extract data from MTS.
MTS Service provides APIs and Pub-Sub mechanisms for continuous tracking of device location or geofence entry/exit events.
What is GPS Tracking Device?
A GPS tracking device is a navigation device normally on a vehicle, asset, or person that uses the Global Positioning System(GPS) to determine its movement and also determine its geographic position to determine its location.
Use-case for Movement Tracking System
App developers can leverage MTS for storing and managing real-time tracking data for their use, reducing their development effort and time. Developers can use data from MTS and write their business logic using the APIs exposed by MTS.
APIs exposed by MTS Core Service
-
Onboard a new device onto MTS so that it can start sending trace data via
MQTT broker
or via API.
This POST API can be used by any source that needs to send data to MTS via theMQTT broker
. The API accepts a device. This hardware ID needs to be unique for every device. In the case of FE mobile apps. -
PUT trace API
This API is used to insert trace data to MTS. This can be done by passing the following parameters:
Member | Description | Data type |
---|---|---|
tis | timestamp of trace event in milliseconds | integer |
lat | Latitude | number |
lon | Longitude | number |
seq | Sequence number of trace event | integer |
id | List of strings that contains the dispatchId , etc., to help keep a track of the device-dispatch mapping. | string |
speed | Speed in km. | number |
`accuracy | Accuracy | number |
event | Event consisting of device details. | string |
name | Event name being sent. | string |
data | Dynamic data sent in the event. | string |
[
{
"tis": 1636108615000,
"lat": 11.456,
"lon": 72.456,
"seq": 2,
"id": [
"dispatch-1",
"dispatch-2"
],
"speed": 0.06
},
{
"tis": 1636108616000,
"lat": 11.456,
"lon": 72.456,
"seq": 2,
"accuracy": 20,
"evt": {
"name": "event52",
"data": {}
},
"id": [
"dispatch-1",
"dispatch-2"
],
"speed": 0.06
}
]
-
GET trace API
This API fetches trace data for a specific device within a specified time range. -
GET missing sequence numbers API
This API fetches missing sequence numbers for a specific deviceId and app and in between the provided time. -
PUT API to deregister a device on MTS
The PUT API is used to deregister devices in MTS by passing theisActive
parameter in the body.
{
"isActive": false
}
-
GET devices API to fetch all devices that are registered on MTS.
The GET devices API returns all devices pertaining to a specifictenant_id
. -
GET device API to fetch details of a specific device.
Get device API returns the device details of a specific device bydeviceId
. -
Filter API
The GET trace API returns paginated trace data. The data can also be filtered based ondispatch_id
.
MTS Geofence Service
MTS also has the functionality of sending a notification once the location of a GPS device is close to a mentioned geographic location.
Using the POST API, you can create a new geofence entry in the database for which the notification is to be sent when the GPS device approaches the location. It requires you to pass the following parameters in the body:
Member | Description | Data type |
---|---|---|
lat | Latitude coordinate of the geofence. | integer |
lon | Longitude coordinate of the geofence. | integer |
radius | Radius of geofence polygon in meters. If not given default value will be 100m. | number |
expiry | The time after which the geofence expires. The maximum allowed value is 1 day. | string |
topic | The user can specify the Kafka topic name where the notification will be sent. If no topic is mentioned, callbackUrl is mandatory. | string |
type | Users can specify whether it's an entry/exit type or both. If entry - notification will be sent out only upon entry; if exit - notification will be sent out only during exiting; if both - notification will be sent out both during entry and exit. | string |
callbackURL | Callback URL for any state transition and send the status of the geofence (entered/exited). | string |
{
"lat": 11.456,
"lon": 72.456,
"radius": 1000,
"expiry": "3h",
"topic": "geofence_notification_info",
"type": "entry",
"callbackURL": "https://examplecallbackurl.com"
}
MTS Subscription
The POST subscription data API can be used to add a new subscription configuration to the Cassandra table. The following parameters will be passed in the body:
Member | Description | Data type |
---|---|---|
interval | Time interval in seconds between two trace packets while streaming. | integer |
expiry | Topic expiry time. | string |
{
"interval": 30,
"expiry": "590m"
}
Updated 7 months ago