# Transform Sensor

Sensor that measures the relative spatial relationship between two frames

**Libraries:**

Simscape /
Multibody /
Frames and Transforms

## Description

The Transform Sensor block measures the relative spatial
relationship between frames connected to ports **F** and
**B** of the block. The measured quantities includes the relative pose,
velocity, and acceleration. To measure the absolute translational or rotational quantities of
a frame, connect the frame ports **F** and **B** of the
block to this frame and the world frame of the model, respectively.

### Measurement Frame

The **Measurement Frame** parameter setting affects all the outputs of
the block except the ones listed in the table.

Outputs | Ports |
---|---|

Rotation measurements | q, axs, Q,
R, seq |

Quaternion derivatives | Q and Qdd |

Rotation-matrix derivatives | Rd and Rdd |

Rotation sequence derivatives | seqd |

Distance and its derivatives | dst, vdst, and
adst |

The Transform Sensor block has five different selections
for the **Measurement Frame** parameter: `World`

,
`Base`

, `Follower`

,
`Non-Rotating Base`

, and ```
Non-Rotating
Follower
```

. When you set **Measurement Frame** to
`World`

, all the measurements are resolved in the world frame.
When you set **Measurement Frame** to `Base`

or
`Follower`

, the resolved acceleration measurements include
centripetal and Coriolis terms if the corresponding base or follower frame rotates. When you
set **Measurement Frame** parameter to ```
Non-Rotating
Base
```

or `Non-Rotating Follower`

, the measurements
do not satisfy the standard derivative relationship if the corresponding base or follower
frame rotates. For example, the relative linear velocity does not equal the time derivative
of the relative translation. See Selecting a Measurement Frame for more information.

### Rotational and Translational Measurements

The block has four parameterizations to express the measured rotations: angle-axis,
quaternion, rotation matrix, and rotation sequence. To enable these parameterizations, in
the block dialog box, under **Rotation**, select corresponding parameters.
For example, select the **Angle** and **Axis** parameters
to use the angle-axis parameterization or select the **Quaternion**,
**Transform**, or **Rotation Sequence** parameter to use
the quaternion, rotation matrix, or rotation sequence parameterization.

Also, the block has various parameterizations to express rotational velocities and
accelerations: *X-*, *Y-*, and *Z-*
coordinates; the time derivatives of a quaternion or rotation sequence; or matrix. To enable
these parameterizations, you can select the corresponding parameters under **Angular
Velocity** or **Angular Acceleration**. See Rotational Measurements for more
information.

The settings of the **Measurement Frame** parameter and coordinate
systems affect the translational measurements. The block has three coordinate systems to
express the translational measurements: Cartesian, cylindrical, and spherical. You can
select one or more of them at the same time. See Translational Measurements for more
information.

The tables summarize the coordinates of the cylindrical and spherical systems, and the
images show the diagrams of these coordinate systems. For simplicity purpose, in the images,
specify the **Measurement Frame** parameter as
`Base`

.

**Cylindrical Coordinates**

Coordinate | Description |
---|---|

Radius | The length of the projection of the vector `BF` , in the
X-Y plane of the measurement frame. |

Azimuth | The angle of the `Radius` with respect to the positive
X-axis of the measurement frame. The angle falls in the range
of [-π, π). |

Z | The projection of the vector `BF` on the
Z-axis of the measurement frame. |

**Spherical Coordinates**

Coordinate | Description |
---|---|

Distance | The distance between origins of the base and follower frames. |

Azimuth | The angle of the projection of the vector `BF` in the
X-Y plane with respect to the positive
X-axis. The angle is resolved in the measurement frame and falls
in the range of [-π, π). |

Inclination | The angle of the vector `BF` with respect to the
X-Y plane of the measurement frame. The angle falls in the
range of [-π/2, π/2]. |

To use a specific coordinate system, select the corresponding parameters. For example,
if you want to use the Cartesian system to express the measured relative linear velocity of
the follower frame, under **Velocity**, select the **X**,
**Y**, and **Z** parameters.

The output ports remain hidden until you select their corresponding parameters. Each
port outputs a time-varying physical signal. You can use the PS-Simulink Converter block to set the units of the outputs when you connect the
Transform Sensor block to Simulink^{®} blocks.

## Examples

## Ports

### Frame

### Output

## Parameters

## Extended Capabilities

## Version History

**Introduced in R2012a**