Skip to content
LIBRARY
tests.PrescribedPoseTest.md

tests.PrescribedPoseTest

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

MultibodyComponents.tests.PrescribedPoseTest()

Behavior

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
Flattened 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) {}
metadata {}
end


Test Cases

No test cases defined.