Pose

Rigid-transform schema composed from one translation vector and one orientation quaternion. The default alias Pose is the Real32 specialization.


Schema layout


Construction and casting


Transform and composition model


Examples

Construction Example

"Pose.pose" use
"Quaternion.identityQuaternion" use
"control" use

{} () {} [
  p: (1.0r32 2.0r32 3.0r32) Real32 identityQuaternion pose;
  @p.position printStack _:;
  @p.orientation printStack _:;
] "main" exportFunction

Expected Output During Compilation

(1.0r32 2.0r32 3.0r32) Cref
{
  QUATERNION: ();
  entries: (0.0r32 0.0r32 0.0r32 1.0r32);
} Cref

Identity Transform Example

"Pose.*" use
"Pose.identityPose" use
"control" use

{} () {} [
  p: identityPose;
  (1.0r32 2.0r32 3.0r32) @p * printStack _:;
] "main" exportFunction

Expected Output During Compilation

(1.0r32 2.0r32 3.0r32)

Cast Example

"Pose.pose" use
"Pose.poseCast" use
"Quaternion.identityQuaternion" use
"control" use

{} () {} [
  p: (1.0r32 2.0r32 3.0r32) Real32 identityQuaternion pose;
  q: @p Real64 poseCast;
  @q.position printStack _:;
  @q.orientation printStack _:;
] "main" exportFunction

Expected Output During Compilation

(1.0 2.0 3.0) Cref
{
  QUATERNION: ();
  entries: (0.0 0.0 0.0 1.0);
} Cref

Runtime transform check

"Pose.pose" use
"Pose.*" use
"Quaternion.identityQuaternion" use
"algebra" use
"String" use
"control" use

{} Int32 {} [
  p: (1.0r32 2.0r32 3.0r32) Real32 identityQuaternion pose;
  transformed: (1.0r32 1.0r32 1.0r32) @p *;
  expected: (2.0r32 3.0r32 4.0r32);
  transformed expected = print
  LF print
  0
] "main" exportFunction

Expected Output

TRUE

See also