Class TransformTree
Abstract base for a node in a Unity transform hierarchy that can be serialized to ROS /tf messages.
Inherited Members
Namespace: Unity.SimulationPro.Foundation
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
public abstract class TransformTree
Remarks
Concrete subclasses are parameterized by a Component type that determines which GameObject nodes are included in the tree. Call PropagateTimeStamp(double) each fixed update before publishing, then pass the root node to ConvertToMessage(TransformTree) to obtain a TFMessageMsg suitable for publication.
Fields
m_Frame
The ROS frame ID of this node.
Declaration
protected string m_Frame
Field Value
| Type | Description |
|---|---|
| string |
m_Parent
The ROS frame ID of this node's parent frame.
Declaration
protected string m_Parent
Field Value
| Type | Description |
|---|---|
| string |
m_SceneObject
The Unity scene object whose Transform this node represents.
Declaration
protected GameObject m_SceneObject
Field Value
| Type | Description |
|---|---|
| GameObject |
Properties
Children
Gets the list of direct child TransformTree nodes.
Declaration
public List<TransformTree> Children { get; protected set; }
Property Value
| Type | Description |
|---|---|
| List<TransformTree> |
IsALeafNode
Gets a value indicating whether this node has no children.
Declaration
public bool IsALeafNode { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsRoot
Gets a value indicating whether this node is the root of the transform tree.
Declaration
public bool IsRoot { get; protected set; }
Property Value
| Type | Description |
|---|---|
| bool |
TimeStamp
Gets the simulation timestamp (in seconds) associated with the most recent PropagateTimeStamp(double) call.
Declaration
public double TimeStamp { get; protected set; }
Property Value
| Type | Description |
|---|---|
| double |
Transform
Gets the Unity Transform of the underlying scene object.
Declaration
protected Transform Transform { get; }
Property Value
| Type | Description |
|---|---|
| Transform |
Methods
ConvertToMessage(TransformTree)
Converts a TransformTree into a TFMessageMsg containing all parent-relative transform relationships in the tree, anchored to the configured global frames.
Declaration
public static TFMessageMsg ConvertToMessage(TransformTree transformTree)
Parameters
| Type | Name | Description |
|---|---|---|
| TransformTree | transformTree | The root of the transform tree to convert. |
Returns
| Type | Description |
|---|---|
| TFMessageMsg | A TFMessageMsg representing the full transform hierarchy. |
GetTimeMsg(double)
GetTimeMsg method.
Declaration
protected static TimeMsg GetTimeMsg(double timeInSeconds)
Parameters
| Type | Name | Description |
|---|---|---|
| double | timeInSeconds | The timeInSeconds. |
Returns
| Type | Description |
|---|---|
| TimeMsg | The result. |
PropagateTimeStamp(double)
Updates the timestamp on this node and all descendant nodes.
Declaration
public abstract void PropagateTimeStamp(double newTime)
Parameters
| Type | Name | Description |
|---|---|---|
| double | newTime | The new simulation time in seconds, typically sourced from Now. |