NetworkTables class for interacting with NetworkTables over a WebSocket connection.

Accessors

Methods

  • Adds a listener for robot connection status updates.

    Parameters

    • callback: (_: boolean) => void

      The callback to call when the connection status changes.

    • OptionalimmediateNotify: boolean

      Whether to immediately notify the callback of the current connection status.

    Returns () => void

    A function to remove the listener.

  • Creates a new topic.

    Type Parameters

    • T extends string | number | boolean | string[] | ArrayBuffer | boolean[] | number[]

    Parameters

    • name: string

      The name of the topic.

    • typeInfo: NetworkTablesTypeInfo

      The type information of the topic.

    • OptionaldefaultValue: T

      The default value of the topic.

    Returns NetworkTablesTopic<T>

    The topic.

  • Creates a new NetworkTables instance if it does not exist.

    Parameters

    • team: number

      The team number of the robot.

    • port: number = 5810

      The port to connect to the robot on. Defaults to 5810.

    Returns NetworkTables

    The NetworkTables instance.

    Error if the team number is not provided.