Class DataFrame

A data frame is information that is passed through each node in a positioning model.

DataFrame content



A data frame can be created with an optional source DataObject that represents the object responsible for generating the frame.

const dataFrame = new DataFrame(new DataObject("phone"));

Creating a custom DataFrame

Custom data frames can be created by extending the default DataFrame class. Important when handling data frames (and objects) is to add serializable decorators.

import { DataFrame, SerializableObject, SerializableArrayMember } from '@openhps/core';

export class CustomDataFrame extends DataFrame {
public customFrameAttribute: number[];

Adding DataObjects

Adding data object will clone the data objects to the data frame. Any changes made to the object after cloning will not be applied to the data frame.



createdTimestamp: number

Data frame created timestamp (ISO 8601)

phenomenonTimestamp?: number

Data frame sensor data pheonomenon timestamp (ISO 8601)

uid: string = ...

Data frame unique identifier



  • Add a new reference space relevant to this data frame.


    Returns void


    addObject Alias for addObject

  • Clear all objects


    • Optional objectFilter: ((object) => boolean)

      object filter

        • (object): boolean
        • Parameters

          Returns boolean

    Returns void

  • Get a specific object by its identifier

    Type Parameters


    • uid: string

      Object UID

    Returns T

    Data object if found

  • Get known objects used in this data frame

    Type Parameters


    • Optional dataType: (new () => T)

      Data object type

        • new (): T
        • Returns T

    Returns T[]

    Array of found data objects

  • Get known sensor objects used in this data frame

    Type Parameters


    • type: (new (uid?) => T)

      Sensor type

        • new (uid?): T
        • Parameters

          • Optional uid: string

          Returns T

    • Optional defaultUID: string

      Default UID. When sensor is not added, it will be created

    Returns T

    Found data objects

  • Check if the data frame has an object


    Returns boolean

    Object exist