---
url: /dyad/dev/stdlib/MultibodyComponents/components/PlanarMechanics.AbsolutePosition.md
description: >-
  Dyad PlanarMechanics.AbsolutePosition docs.  Measures absolute position and
  orientation of the origin of a frame connector.
---

# `PlanarMechanics.AbsolutePosition` {#PlanarMechanics.AbsolutePosition}

Measures absolute position and orientation of the origin of a frame connector.

This is a sensor component: it reads kinematic quantities without exerting forces. Use `connect` to attach to a body frame (sensor forces are zero, so the force balance is unaffected).

## Usage {#Usage}

`MultibodyComponents.PlanarMechanics.AbsolutePosition()`

## Parameters: {#Parameters:}

|               Name | Description | Units |             Default value |
| ------------------:| -----------:| -----:| -------------------------:|
| `resolve_in_frame` |             |     – | MultibodyCo...me.FrameA() |

## Connectors {#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`](/stdlib/Dyad/connectors/Frame2D#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`](/stdlib/Dyad/connectors/Frame2D#Frame2D))

* `x` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

* `y` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

* `phi` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Behavior {#Behavior}

$$ \begin{align}
x\left( t \right) &= \mathtt{pos.x}\left( t \right) \\
y\left( t \right) &= \mathtt{pos.y}\left( t \right) \\
\mathtt{phi}\left( t \right) &= \mathtt{pos.phi}\left( t \right) \\
0 &= \mathrm{connect}\left( frame\_{a}, pos\_{+}frame\_{a} \right) \\
\mathtt{pos.frame_a.fx}\left( t \right) &= 0 \\
\mathtt{pos.frame_a.fy}\left( t \right) &= 0 \\
\mathtt{pos.frame_a.tau}\left( t \right) &= 0 \\
\mathtt{pos.x}\left( t \right) &= \mathtt{pos.r}\_{1}\left( t \right) \\
\mathtt{pos.y}\left( t \right) &= \mathtt{pos.r}\_{2}\left( t \right) \\
\mathtt{pos.phi}\left( t \right) &= \mathtt{pos.r}\_{3}\left( t \right) \\
\mathtt{pos.rotation_matrix}\_{1,1}\left( t \right) &= \cos\left( \mathtt{pos.frame_a.phi}\left( t \right) \right) \\
\mathtt{pos.rotation_matrix}\_{2,1}\left( t \right) &= \sin\left( \mathtt{pos.frame_a.phi}\left( t \right) \right) \\
\mathtt{pos.rotation_matrix}\_{3,1}\left( t \right) &= 0 \\
\mathtt{pos.rotation_matrix}\_{1,2}\left( t \right) &=  - \sin\left( \mathtt{pos.frame_a.phi}\left( t \right) \right) \\
\mathtt{pos.rotation_matrix}\_{2,2}\left( t \right) &= \cos\left( \mathtt{pos.frame_a.phi}\left( t \right) \right) \\
\mathtt{pos.rotation_matrix}\_{3,2}\left( t \right) &= 0 \\
\mathtt{pos.rotation_matrix}\_{1,3}\left( t \right) &= 0 \\
\mathtt{pos.rotation_matrix}\_{2,3}\left( t \right) &= 0 \\
\mathtt{pos.rotation_matrix}\_{3,3}\left( t \right) &= 1 \\
\mathtt{pos.r}\_{1}\left( t \right) &= \mathtt{pos.frame_a.phi}\left( t \right) ~ \mathtt{pos.rotation_matrix}\_{3,1}\left( t \right) + \mathtt{pos.frame_a.x}\left( t \right) ~ \mathtt{pos.rotation_matrix}\_{1,1}\left( t \right) + \mathtt{pos.frame_a.y}\left( t \right) ~ \mathtt{pos.rotation_matrix}\_{2,1}\left( t \right) \\
\mathtt{pos.r}\_{2}\left( t \right) &= \mathtt{pos.frame_a.phi}\left( t \right) ~ \mathtt{pos.rotation_matrix}\_{3,2}\left( t \right) + \mathtt{pos.frame_a.x}\left( t \right) ~ \mathtt{pos.rotation_matrix}\_{1,2}\left( t \right) + \mathtt{pos.frame_a.y}\left( t \right) ~ \mathtt{pos.rotation_matrix}\_{2,2}\left( t \right) \\
\mathtt{pos.r}\_{3}\left( t \right) &=  - \mathtt{pos.frame_a.phi}\left( t \right) + \mathtt{pos.frame_a.phi}\left( t \right) ~ \mathtt{pos.rotation_matrix}\_{3,3}\left( t \right) + \mathtt{pos.frame_a.x}\left( t \right) ~ \mathtt{pos.rotation_matrix}\_{1,3}\left( t \right) + \mathtt{pos.frame_a.y}\left( t \right) ~ \mathtt{pos.rotation_matrix}\_{2,3}\left( t \right)
\end{align}
$$

## Source {#Source}

```dyad
# ── Public sensors ───────────────────────────────────────────────────────────
"""
Measures absolute position and orientation of the origin of a frame connector.

This is a sensor component: it reads kinematic quantities without exerting forces.
Use `connect` to attach to a body frame (sensor forces are zero, so the force
balance is unaffected).
"""
component AbsolutePosition
  frame_a = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_resolve = Frame2D() if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameResolve() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  # x-position
  x = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 970, "y1": 150, "x2": 1070, "y2": 250, "rot": 0}
      },
      "tags": []
    }
  }
  # y-position
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  # rotation angle (counterclockwise)
  phi = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 760, "x2": 1060, "y2": 860, "rot": 0}
      },
      "tags": []
    }
  }
  pos = BasicAbsolutePosition(resolve_in_frame = resolve_in_frame)
  structural parameter resolve_in_frame::MultibodyComponents.ResolveInFrame = MultibodyComponents.ResolveInFrame.FrameA()
relations
  connect(frame_a, pos.frame_a)
  if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameResolve()
    connect(frame_resolve, pos.frame_resolve)
  end
  x = pos.x
  y = pos.y
  phi = pos.phi
metadata {
  "Dyad": {"icons": {"default": "dyad://MultibodyComponents/OneFrameSensor.svg"}}
}
end
```

```dyad
"""
Measures absolute position and orientation of the origin of a frame connector.

This is a sensor component: it reads kinematic quantities without exerting forces.
Use `connect` to attach to a body frame (sensor forces are zero, so the force
balance is unaffected).
"""
component AbsolutePosition
  frame_a = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_resolve = Frame2D() if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameResolve() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  # x-position
  x = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 970, "y1": 150, "x2": 1070, "y2": 250, "rot": 0}
      },
      "tags": []
    }
  }
  # y-position
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  # rotation angle (counterclockwise)
  phi = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 760, "x2": 1060, "y2": 860, "rot": 0}
      },
      "tags": []
    }
  }
  pos = BasicAbsolutePosition(resolve_in_frame = resolve_in_frame)
  structural parameter resolve_in_frame::MultibodyComponents.ResolveInFrame = MultibodyComponents.ResolveInFrame.FrameA()
relations
  connect(frame_a, pos.frame_a)
  if resolve_in_frame == MultibodyComponents.ResolveInFrame.FrameResolve()
    connect(frame_resolve, pos.frame_resolve)
  end
  x = pos.x
  y = pos.y
  phi = pos.phi
metadata {
  "Dyad": {"icons": {"default": "dyad://MultibodyComponents/OneFrameSensor.svg"}}
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`SensorsTest`](PlanarMechanics.AbsolutePosition.md)
