Skip to content
LIBRARY
TransformAbsoluteVector.md

TransformAbsoluteVector

Rotates a pure-rotation 3-vector (e.g. a force, velocity, or angular velocity; never a position) between frames via a two-step rotation through the world frame: frame_r_in -> world -> frame_r_out.

frame_a supplies only an orientation (frame_a.R); its position is never used, so this component is quantity-agnostic – it works identically for any 3-vector that transforms as a pure rotation.

Usage

MultibodyComponents.TransformAbsoluteVector()

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_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 (e.g. a force, velocity, or angular velocity;
never a position) between frames via a two-step rotation through the world
frame: `frame_r_in -> world -> frame_r_out`.

`frame_a` supplies only an orientation (`frame_a.R`); its position is never
used, so this component is quantity-agnostic -- it works identically for any
3-vector that transforms as a pure rotation.
"""
component TransformAbsoluteVector
  frame_a = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 450, "y1": 950, "x2": 550, "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": {"iconName": "default", "x1": -40, "y1": 140, "x2": 60, "y2": 240, "rot": 0}
      },
      "tags": []
    }
  }
  r_in_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -40, "y1": 450, "x2": 60, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_in_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -40, "y1": 760, "x2": 60, "y2": 860, "rot": 0}
      },
      "tags": []
    }
  }
  r_out_x = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 140, "x2": 1060, "y2": 240, "rot": 0}
      },
      "tags": []
    }
  }
  r_out_y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_out_z = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 760, "x2": 1060, "y2": 860, "rot": 0}
      },
      "tags": []
    }
  }
  "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]
  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 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 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/OneFrameSensor.svg"},
    "labels": [{"label": "transform abs", "x": 500, "y": 680, "rot": 0}]
  }
}
end
Flattened Source
dyad
"""
Rotates a pure-rotation 3-vector (e.g. a force, velocity, or angular velocity;
never a position) between frames via a two-step rotation through the world
frame: `frame_r_in -> world -> frame_r_out`.

`frame_a` supplies only an orientation (`frame_a.R`); its position is never
used, so this component is quantity-agnostic -- it works identically for any
3-vector that transforms as a pure rotation.
"""
component TransformAbsoluteVector
  frame_a = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 450, "y1": 950, "x2": 550, "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": {"iconName": "default", "x1": -40, "y1": 140, "x2": 60, "y2": 240, "rot": 0}
      },
      "tags": []
    }
  }
  r_in_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -40, "y1": 450, "x2": 60, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_in_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -40, "y1": 760, "x2": 60, "y2": 860, "rot": 0}
      },
      "tags": []
    }
  }
  r_out_x = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 140, "x2": 1060, "y2": 240, "rot": 0}
      },
      "tags": []
    }
  }
  r_out_y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_out_z = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 760, "x2": 1060, "y2": 860, "rot": 0}
      },
      "tags": []
    }
  }
  "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]
  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 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 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/OneFrameSensor.svg"},
    "labels": [{"label": "transform abs", "x": 500, "y": 680, "rot": 0}]
  }
}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses