Skip to content
LIBRARY
TransformRelativeVector.md

TransformRelativeVector

Rotates a pure-rotation 3-vector between frames via a two-step rotation through the world frame: frame_r_in -> world -> frame_r_out.

Same as TransformAbsoluteVector, but frame_r_in/frame_r_out may also resolve in frame_b, since two physical frames are available as orientation sources here.

Usage

MultibodyComponents.TransformRelativeVector()

Parameters:

NameDescriptionUnitsDefault value
frame_r_inFrame in which r_in is resolvedResolveInFrame.FrameA()
frame_r_outFrame in which r_out is resolvedResolveInFrame.FrameA()

Connectors

  • frame_a - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several Frame

connectors that can be connected together (Frame3D)

  • frame_b - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several Frame

connectors that can be connected together (Frame3D)

  • frame_resolve - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several Frame

connectors that can be connected together (Frame3D)

  • r_in_x - This connector represents a real signal as an input to a component (RealInput)

  • r_in_y - This connector represents a real signal as an input to a component (RealInput)

  • r_in_z - This connector represents a real signal as an input to a component (RealInput)

  • r_out_x - This connector represents a real signal as an output from a component (RealOutput)

  • r_out_y - This connector represents a real signal as an output from a component (RealOutput)

  • r_out_z - This connector represents a real signal as an output from a component (RealOutput)

Variables

NameDescriptionUnits
r_in
R1Rotation matrix from world into frame_r_in
r_out

Behavior

Dict{MIME{Symbol("text/plain")}, String} with 1 entry: MIME type text/plain => "Error displaying result"

Source

dyad
"""
Rotates a pure-rotation 3-vector between frames via a two-step rotation
through the world frame: `frame_r_in -> world -> frame_r_out`.

Same as `TransformAbsoluteVector`, but `frame_r_in`/`frame_r_out` may also
resolve in `frame_b`, since two physical frames are available as orientation
sources here.
"""
component TransformRelativeVector
  frame_a = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 200, "y1": 950, "x2": 300, "y2": 1050}}}
  }
  frame_b = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 700, "y1": 950, "x2": 800, "y2": 1050}}}
  }
  frame_resolve = Frame3D() if case(frame_r_in, ResolveInFrame.FrameResolve) or case(frame_r_out, ResolveInFrame.FrameResolve) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  r_in_x = RealInput() {
    "Dyad": {"placement": {"diagram": {"x1": -50, "y1": 140, "x2": 50, "y2": 240}}}
  }
  r_in_y = RealInput() {
    "Dyad": {"placement": {"diagram": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}
  }
  r_in_z = RealInput() {
    "Dyad": {"placement": {"diagram": {"x1": -50, "y1": 760, "x2": 50, "y2": 860}}}
  }
  r_out_x = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "y1": 140, "x2": 1100, "y2": 240}}}
  }
  r_out_y = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "y1": 450, "x2": 1100, "y2": 550}}}
  }
  r_out_z = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "y1": 760, "x2": 1100, "y2": 860}}}
  }
  "Frame in which r_in is resolved"
  structural parameter frame_r_in::ResolveInFrame = ResolveInFrame.FrameA()
  "Frame in which r_out is resolved"
  structural parameter frame_r_out::ResolveInFrame = ResolveInFrame.FrameA()
  variable r_in::Real[3] if frame_r_in != frame_r_out
  "Rotation matrix from world into frame_r_in"
  variable R1::Real[3, 3] if frame_r_in != frame_r_out
  variable r_out::Real[3] if frame_r_in != frame_r_out
relations
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
  frame_b.f = [0, 0, 0]
  frame_b.tau = [0, 0, 0]
  if case(frame_r_in, ResolveInFrame.FrameResolve) or case(frame_r_out, ResolveInFrame.FrameResolve)
    frame_resolve.f = [0, 0, 0]
    frame_resolve.tau = [0, 0, 0]
  end
  if frame_r_in == frame_r_out
    r_out_x = r_in_x
    r_out_y = r_in_y
    r_out_z = r_in_z
  else
    r_in = [r_in_x, r_in_y, r_in_z]
    switch frame_r_in
      case World
        R1 = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
      case FrameA
        R1 = frame_a.R
      case FrameB
        R1 = frame_b.R
      case FrameResolve
        R1 = frame_resolve.R
    end
    switch frame_r_out
      case World
        r_out = resolve1(R1, r_in)
      case FrameA
        r_out = resolve_relative(r_in, R1, frame_a.R)
      case FrameB
        r_out = resolve_relative(r_in, R1, frame_b.R)
      case FrameResolve
        r_out = resolve_relative(r_in, R1, frame_resolve.R)
    end
    [r_out_x, r_out_y, r_out_z] = r_out
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/TwoFrameSensor.svg"},
    "labels": [{"label": "transform rel", "x": 500, "y": 680, "rot": 0}]
  }
}
end
Flattened Source
dyad
"""
Rotates a pure-rotation 3-vector between frames via a two-step rotation
through the world frame: `frame_r_in -> world -> frame_r_out`.

Same as `TransformAbsoluteVector`, but `frame_r_in`/`frame_r_out` may also
resolve in `frame_b`, since two physical frames are available as orientation
sources here.
"""
component TransformRelativeVector
  frame_a = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 200, "y1": 950, "x2": 300, "y2": 1050}}}
  }
  frame_b = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 700, "y1": 950, "x2": 800, "y2": 1050}}}
  }
  frame_resolve = Frame3D() if case(frame_r_in, ResolveInFrame.FrameResolve) or case(frame_r_out, ResolveInFrame.FrameResolve) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  r_in_x = RealInput() {
    "Dyad": {"placement": {"diagram": {"x1": -50, "y1": 140, "x2": 50, "y2": 240}}}
  }
  r_in_y = RealInput() {
    "Dyad": {"placement": {"diagram": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}
  }
  r_in_z = RealInput() {
    "Dyad": {"placement": {"diagram": {"x1": -50, "y1": 760, "x2": 50, "y2": 860}}}
  }
  r_out_x = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "y1": 140, "x2": 1100, "y2": 240}}}
  }
  r_out_y = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "y1": 450, "x2": 1100, "y2": 550}}}
  }
  r_out_z = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "y1": 760, "x2": 1100, "y2": 860}}}
  }
  "Frame in which r_in is resolved"
  structural parameter frame_r_in::ResolveInFrame = ResolveInFrame.FrameA()
  "Frame in which r_out is resolved"
  structural parameter frame_r_out::ResolveInFrame = ResolveInFrame.FrameA()
  variable r_in::Real[3] if frame_r_in != frame_r_out
  "Rotation matrix from world into frame_r_in"
  variable R1::Real[3, 3] if frame_r_in != frame_r_out
  variable r_out::Real[3] if frame_r_in != frame_r_out
relations
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
  frame_b.f = [0, 0, 0]
  frame_b.tau = [0, 0, 0]
  if case(frame_r_in, ResolveInFrame.FrameResolve) or case(frame_r_out, ResolveInFrame.FrameResolve)
    frame_resolve.f = [0, 0, 0]
    frame_resolve.tau = [0, 0, 0]
  end
  if frame_r_in == frame_r_out
    r_out_x = r_in_x
    r_out_y = r_in_y
    r_out_z = r_in_z
  else
    r_in = [r_in_x, r_in_y, r_in_z]
    switch frame_r_in
      case World
        R1 = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
      case FrameA
        R1 = frame_a.R
      case FrameB
        R1 = frame_b.R
      case FrameResolve
        R1 = frame_resolve.R
    end
    switch frame_r_out
      case World
        r_out = resolve1(R1, r_in)
      case FrameA
        r_out = resolve_relative(r_in, R1, frame_a.R)
      case FrameB
        r_out = resolve_relative(r_in, R1, frame_b.R)
      case FrameResolve
        r_out = resolve_relative(r_in, R1, frame_resolve.R)
    end
    [r_out_x, r_out_y, r_out_z] = r_out
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/TwoFrameSensor.svg"},
    "labels": [{"label": "transform rel", "x": 500, "y": 680, "rot": 0}]
  }
}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses