docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TFStream

    Maintains a time-ordered history of TFFrame samples for a named ROS transform frame, enabling lookup and interpolation at arbitrary timestamps.

    Inheritance
    object
    TFStream
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Global Namespace
    Assembly: Unity.SimulationPro.Foundation.dll
    Syntax
    public class TFStream

    Constructors

    TFStream(TFStream, string, string)

    Initializes a new TFStream with the given parent, name, and topic.

    Declaration
    public TFStream(TFStream parent, string name, string tfTopic)
    Parameters
    Type Name Description
    TFStream parent

    The parent stream, or null for a root frame.

    string name

    The ROS frame ID.

    string tfTopic

    The ROS topic associated with this frame.

    Properties

    Children

    Gets the child TFStream instances parented to this frame.

    Declaration
    public IEnumerable<TFStream> Children { get; }
    Property Value
    Type Description
    IEnumerable<TFStream>

    GameObject

    Gets the GameObject positioned at the most recently received frame.

    Declaration
    public GameObject GameObject { get; }
    Property Value
    Type Description
    GameObject

    Name

    Gets the ROS frame ID of this stream.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string

    Parent

    Gets the parent TFStream, or null if this is a root frame.

    Declaration
    public TFStream Parent { get; }
    Property Value
    Type Description
    TFStream

    TFTopic

    Gets the ROS topic on which transforms for this frame are published.

    Declaration
    public string TFTopic { get; }
    Property Value
    Type Description
    string

    Methods

    Add(long, Vector3, Quaternion)

    Adds or updates a transform sample at the given timestamp.

    Declaration
    public void Add(long timestamp, Vector3 translation, Quaternion rotation)
    Parameters
    Type Name Description
    long timestamp

    The ROS timestamp in nanoseconds since epoch.

    Vector3 translation

    The frame translation in Unity (RUF) space.

    Quaternion rotation

    The frame rotation in Unity (RUF) space.

    GetLocalTF(long)

    Returns the local TFFrame at the specified timestamp, interpolating if necessary. Passing 0 returns the most recent frame.

    Declaration
    public TFFrame GetLocalTF(long time = 0)
    Parameters
    Type Name Description
    long time

    The timestamp in nanoseconds, or 0 for the newest frame.

    Returns
    Type Description
    TFFrame

    The local TFFrame at the given time.

    GetLocalTF(TimeMsg)

    Returns the local TFFrame at the time encoded in the provided TimeMsg.

    Declaration
    public TFFrame GetLocalTF(TimeMsg time)
    Parameters
    Type Name Description
    TimeMsg time

    The ROS timestamp message.

    Returns
    Type Description
    TFFrame

    The local TFFrame at the given time.

    GetWorldTF(long)

    Returns the world-space TFFrame at the specified timestamp by composing all ancestor frames. Passing 0 returns the most recent world frame.

    Declaration
    public TFFrame GetWorldTF(long time = 0)
    Parameters
    Type Name Description
    long time

    The timestamp in nanoseconds, or 0 for the newest frame.

    Returns
    Type Description
    TFFrame

    The world-space TFFrame at the given time.

    GetWorldTF(TimeMsg)

    Returns the world-space TFFrame at the time encoded in the provided TimeMsg.

    Declaration
    public TFFrame GetWorldTF(TimeMsg time)
    Parameters
    Type Name Description
    TimeMsg time

    The ROS timestamp message.

    Returns
    Type Description
    TFFrame

    The world-space TFFrame at the given time.

    IsTimeStable(long)

    Returns true when this stream (and all its ancestors) have data bracketing the given timestamp, meaning the transform at that time will not change with future updates.

    Declaration
    public bool IsTimeStable(long time)
    Parameters
    Type Name Description
    long time

    The timestamp in nanoseconds to check stability for.

    Returns
    Type Description
    bool

    true if the transform at time is stable; otherwise false.

    SetParent(TFStream)

    Reparents this stream to the specified TFStream, updating the underlying GameObject hierarchy.

    Declaration
    public void SetParent(TFStream newParent)
    Parameters
    Type Name Description
    TFStream newParent

    The new parent stream, or null to become a root frame.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)