---
url: /dyad/stable/stdlib/MultibodyComponents/examples/tests.PrescribedPoseTest.md
description: >-
  Dyad tests.PrescribedPoseTest docs.  A body whose frame_a is driven by a
  PrescribedPose component. Position follows [t, 0.5t, 0], and orientation is a
  rotation around the z-axis...
---

# `tests.PrescribedPoseTest` {#tests.PrescribedPoseTest}

# Prescribed Pose Test {#Prescribed-Pose-Test}

A body whose `frame_a` is driven by a `PrescribedPose` component. Position follows `[t, 0.5t, 0]`, and orientation is a rotation around the z-axis at unit angular velocity, encoded as the quaternion `[cos(t/2), 0, 0, sin(t/2)]`.

## Usage {#Usage}

`MultibodyComponents.tests.PrescribedPoseTest()`

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
# Prescribed Pose Test

A body whose `frame_a` is driven by a `PrescribedPose` component. Position
follows `[t, 0.5t, 0]`, and orientation is a rotation around the z-axis at
unit angular velocity, encoded as the quaternion `[cos(t/2), 0, 0, sin(t/2)]`.
"""
example component PrescribedPoseTest
  world = MultibodyComponents.World() {}
  prescribed = MultibodyComponents.PrescribedPose() {}
  body = MultibodyComponents.Body(m = 1, r_cm = [0, 0, 0]) {}
relations
  prescribed.r_x = time
  prescribed.r_y = 0.5 * time
  prescribed.r_z = 0
  prescribed.q_w = cos(0.5 * time)
  prescribed.q_x = 0
  prescribed.q_y = 0
  prescribed.q_z = sin(0.5 * time)
  connect(prescribed.frame_b, body.frame_a) {}
end
```

```dyad
"""
# Prescribed Pose Test

A body whose `frame_a` is driven by a `PrescribedPose` component. Position
follows `[t, 0.5t, 0]`, and orientation is a rotation around the z-axis at
unit angular velocity, encoded as the quaternion `[cos(t/2), 0, 0, sin(t/2)]`.
"""
example component PrescribedPoseTest
  world = MultibodyComponents.World() {}
  prescribed = MultibodyComponents.PrescribedPose() {}
  body = MultibodyComponents.Body(m = 1, r_cm = [0, 0, 0]) {}
relations
  prescribed.r_x = time
  prescribed.r_y = 0.5 * time
  prescribed.r_z = 0
  prescribed.q_w = cos(0.5 * time)
  prescribed.q_x = 0
  prescribed.q_y = 0
  prescribed.q_z = sin(0.5 * time)
  connect(prescribed.frame_b, body.frame_a) {}
metadata {}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`Body`](tests.PrescribedPoseTest.md)

  * [`PrescribedPose`](tests.PrescribedPoseTest.md)

  * [`World`](tests.PrescribedPoseTest.md)
