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

  1. 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 the MQTT broker. The API accepts a device. This hardware ID needs to be unique for every device. In the case of FE mobile apps.

  2. PUT trace API
    This API is used to insert trace data to MTS. This can be done by passing the following parameters:

  • tis: timestamp of trace event in milliseconds
  • lat: Latitude
  • lon: Longitude
  • seq: Sequence number of trace event
  • id: List of strings that contains the dispatchId, etc., to help keep a track of the device-dispatch mapping.
  • speed: Speed in km.
  • accuracy: Accuracy
  • event: Event consisting of device details.
  • name : Event name being sent.
  • data: Dynamic data sent in the event.
[
    {
        "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
    }
]
  1. GET trace API
    This API fetches trace data for a specific device within a specified time range.

  2. GET missing sequence numbers API
    This API fetches missing sequence numbers for a specific deviceId and app and in between the provided time.

  3. PUT API to deregister a device on MTS
    The PUT API is used to deregister devices in MTS by passing the isActive parameter in the body.

{
    "isActive": false
}
  1. GET devices API to fetch all devices that are registered on MTS.
    The GET devices API returns all devices pertaining to a specific tenant_id.

  2. GET device API to fetch details of a specific device.
    Get device API returns the device details of a specific device by deviceId.

  3. Filter API
    The GET trace API returns paginated trace data. The data can also be filtered based on dispatch_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:

  • lat: Latitude coordinate of the geofence.
  • lon: Longitude coordinate of the geofence.
  • radius: Radius of geofence polygon in meters. If not given default value will be 100m.
  • expiry: The time after which the geofence expires. The maximum allowed value is 1 day.
  • topic: The user can specify the Kafka topic name where the notification will be sent. If no topic is mentioned, callbackUrl is mandatory.
  • 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.
  • callbackURL: Callback URL for any state transition and send the status of the geofence (entered/exited).
{
    "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:

  • timeInterval: Time interval in seconds between two trace packets while streaming.
  • topicExpiry: Topic expiry time.
{
  "timeInterval": 30,
  "topicExpiry": "590m"
}

Did this page help you?