Transform & TransformTime


level_1


Transform

A Transform represents a geometric transform.

It is composed of:

  • a translation: Vector3,
  • a rotation: Quaternion.

See also API doc: Transform, Vector3 and Quaternion.

TransformTime

A TransformTime is a structure grouping a Transform and a timestamp.

Typically, a TransformTime represents a geometric transform between 2 Frames that is correct at a given time. The time component is equal to this specific time.

See also API doc: TransformTime and Timestamps.

How to use it

Making and managing attached frames

Create an AttachedFrame from a base Frame and a Transform:

val baseFrame: Frame = ...
val transform: Transform = TransformBuilder.create().fromXTranslation(1.0)
val attachedFrame: AttachedFrame = baseFrame.makeAttachedFrame(transform)
Frame baseFrame = ...;
Transform transform = TransformBuilder.create().fromXTranslation(1);
AttachedFrame attachedFrame = baseFrame.makeAttachedFrame(transform);

Update the Transform between an AttachedFrame and its parent Frame:

val attachedFrame: AttachedFrame = ...
val transform: Transform = TransformBuilder.create().fromXTranslation(2.0)
attachedFrame.update(transform)
AttachedFrame attachedFrame = ...;
Transform transform = TransformBuilder.create().fromXTranslation(2);
attachedFrame.update(transform);

Managing free frames

Update the Transform between a FreeFrame and a base Frame, based on sensor data acquired at a given timestamp:

val freeFrame: FreeFrame = ...
val baseFrame: Frame = ...
val transform: Transform = ...
freeFrame.update(baseFrame, transform, timestamp)
FreeFrame freeFrame = ...;
Frame baseFrame = ...;
Transform transform = ...;
freeFrame.update(baseFrame, transform, timestamp);

See also API doc: FreeFrame and Timestamps.

Getting a transform between 2 Frames

Retrieve a TransformTime between 2 Frames:

val baseFrame: Frame = ...
val transformedFrame: Frame = ...
val transformTime: TransformTime = transformedFrame.computeTransform(baseFrame)
Frame baseFrame = ...;
Frame transformedFrame = ...;
TransformTime transformTime = transformedFrame.computeTransform(baseFrame);