Class PoseExtensions
Provides extension methods for class Transform and struct Pose.
Namespace: Mechatronics.SensorSDK
Syntax
public static class PoseExtensions
Methods
Compose(in Pose, in Pose)
Composes two poses, as if by multiplying their corresponding transformation matrices.
Declaration
public static Pose Compose(this in Pose lhs, in Pose rhs)
Parameters
Type | Name | Description |
---|---|---|
Pose | lhs | The left-hand side pose. |
Pose | rhs | The right-hand side pose. |
Returns
Type | Description |
---|---|
Pose | The composed pose. |
Remarks
Given Pose AtoB and Pose BtoC: Pose AtoC = BtoC.Compose(AtoB);
ComputePoseBetween(in Pose, in Pose)
Creates the pose (transformation) between the two given poses.
Declaration
public static Pose ComputePoseBetween(in Pose initialToXPose, in Pose finalToXPose)
Parameters
Type | Name | Description |
---|---|---|
Pose | initialToXPose | The initial pose. |
Pose | finalToXPose | The final pose. |
Returns
Type | Description |
---|---|
Pose | The pose going from the initial pose to the final pose. |
Remarks
For example, given AliceToCharliePose and BobToCharliePose, the function returns the AliceToBobPose. It is important that the destination (Charlie) be the same in both input poses.
GetInverse(in Pose)
Creates the inverse pose, as if inverting the corresponding transformation matrix.
Declaration
public static Pose GetInverse(this in Pose pose)
Parameters
Type | Name | Description |
---|---|---|
Pose | pose | The pose to invert. |
Returns
Type | Description |
---|---|
Pose | The inverse pose. |
GetLocalToWorldPose(Transform)
Creates a Pose out of the local-to-world transformation.
Declaration
public static Pose GetLocalToWorldPose(this Transform transform)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The Transform to extract the pose from. |
Returns
Type | Description |
---|---|
Pose | The extracted Pose. |
Transform(in Pose, in Vector3)
Transforms the point expressed in the given pose, as if by multiplying the pose's corresponding transformation matrix to the point.
Declaration
public static Vector3 Transform(this in Pose pose, in Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
Pose | pose | The pose in which the point is expressed. |
Vector3 | point | The point to transform. |
Returns
Type | Description |
---|---|
Vector3 | The transformed point. |