Skip to content
LIBRARY
PlanarMechanics.BasicAbsolutePosition.md

PlanarMechanics.BasicAbsolutePosition

Measures absolute position and orientation resolved in a configurable frame. Internal helper used by AbsolutePosition and by velocity/acceleration sensors to obtain world-frame positions for differentiation.

Usage

MultibodyComponents.PlanarMechanics.BasicAbsolutePosition()

Parameters:

NameDescriptionUnitsDefault value
resolve_in_frameMultibodyComponents.ResolveInFrame.FrameA()

Connectors

  • frame_a - Coordinate system (2-dim.) fixed to the component with one cut-force and cut-torque.

All variables are resolved in the planar world frame. (Frame2D)

  • frame_resolve - Coordinate system (2-dim.) fixed to the component with one cut-force and cut-torque.

All variables are resolved in the planar world frame. (Frame2D)

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

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

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

Variables

NameDescriptionUnits
rotation_matrix
r

Behavior

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

Source

dyad
"""
Measures absolute position and orientation resolved in a configurable frame.
Internal helper used by AbsolutePosition and by velocity/acceleration sensors
to obtain world-frame positions for differentiation.
"""
component BasicAbsolutePosition
  frame_a = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_resolve = Frame2D() if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameResolve() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 960, "x2": 550, "y2": 1060, "rot": 0}
      },
      "tags": []
    }
  }
  x = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 100, "x2": 1060, "y2": 200, "rot": 0}
      },
      "tags": []
    }
  }
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  phi = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 780, "x2": 1060, "y2": 880, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter resolve_in_frame::MultibodyComponents.ResolveInFrame = MultibodyComponents.ResolveInFrame.FrameA()
  variable rotation_matrix::Real[3, 3] if resolve_in_frame != MultibodyComponents.ResolveInFrame.World()
  variable r::Real[3]
relations
  frame_a.fx = 0
  frame_a.fy = 0
  frame_a.tau = 0
  if resolve_in_frame == MultibodyComponents.ResolveInFrame.World()
    r = [frame_a.x, frame_a.y, frame_a.phi]
  end
  if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameA()
    rotation_matrix = [[cos(frame_a.phi), -sin(frame_a.phi), 0], [sin(frame_a.phi), cos(frame_a.phi), 0], [0, 0, 1]]
    r = transpose(rotation_matrix) * [frame_a.x, frame_a.y, frame_a.phi] - [0, 0, frame_a.phi]
  end
  if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameResolve()
    frame_resolve.fx = 0
    frame_resolve.fy = 0
    frame_resolve.tau = 0
    rotation_matrix = [[cos(frame_resolve.phi), -sin(frame_resolve.phi), 0], [sin(frame_resolve.phi), cos(frame_resolve.phi), 0], [0, 0, 1]]
    r = transpose(rotation_matrix) * [frame_a.x, frame_a.y, frame_a.phi] - [0, 0, frame_resolve.phi]
  end
  [x, y, phi] = r
end
Flattened Source
dyad
"""
Measures absolute position and orientation resolved in a configurable frame.
Internal helper used by AbsolutePosition and by velocity/acceleration sensors
to obtain world-frame positions for differentiation.
"""
component BasicAbsolutePosition
  frame_a = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_resolve = Frame2D() if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameResolve() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 960, "x2": 550, "y2": 1060, "rot": 0}
      },
      "tags": []
    }
  }
  x = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 100, "x2": 1060, "y2": 200, "rot": 0}
      },
      "tags": []
    }
  }
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  phi = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 780, "x2": 1060, "y2": 880, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter resolve_in_frame::MultibodyComponents.ResolveInFrame = MultibodyComponents.ResolveInFrame.FrameA()
  variable rotation_matrix::Real[3, 3] if resolve_in_frame != MultibodyComponents.ResolveInFrame.World()
  variable r::Real[3]
relations
  frame_a.fx = 0
  frame_a.fy = 0
  frame_a.tau = 0
  if resolve_in_frame == MultibodyComponents.ResolveInFrame.World()
    r = [frame_a.x, frame_a.y, frame_a.phi]
  end
  if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameA()
    rotation_matrix = [[cos(frame_a.phi), -sin(frame_a.phi), 0], [sin(frame_a.phi), cos(frame_a.phi), 0], [0, 0, 1]]
    r = transpose(rotation_matrix) * [frame_a.x, frame_a.y, frame_a.phi] - [0, 0, frame_a.phi]
  end
  if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameResolve()
    frame_resolve.fx = 0
    frame_resolve.fy = 0
    frame_resolve.tau = 0
    rotation_matrix = [[cos(frame_resolve.phi), -sin(frame_resolve.phi), 0], [sin(frame_resolve.phi), cos(frame_resolve.phi), 0], [0, 0, 1]]
    r = transpose(rotation_matrix) * [frame_a.x, frame_a.y, frame_a.phi] - [0, 0, frame_resolve.phi]
  end
  [x, y, phi] = r
metadata {}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses