Main Content

Transform Sensor

R2026b

Sensor that measures the relative spatial relationship between two frames

  • Transform Sensor block

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 include the relative pose, velocity, and acceleration, which are time-varying physical signals.

You can measure the absolute translational or rotational quantities of a frame by connecting the frame ports F and B of the block to this frame and the world frame of the model, respectively, and setting the Observation Frame parameter to World.

Observation Frame and Expressed-In Frame

The Observation Frame and Expressed-In Frame parameters control how the block reports measurements. The Observation Frame parameter specifies the reference frame for computing time derivatives. The Expressed-In Frame parameter specifies the coordinate axes for expressing vector outputs. For details on how these parameters affect each output, see the Output Dependency section.

Rotational and Translational Measurements

The block supports four rotation parameterizations: angle-axis, quaternion, rotation matrix, and rotation sequence. The block also supports three translational coordinate systems: Cartesian, cylindrical, and spherical. For details on these coordinate systems, see the Coordinate Systems section.

Examples

Ports

Frame

expand all

Frame port associated with the base frame.

Frame port associated with the follower frame.

Output

expand all

Angle of rotation, returned as a scalar. The angle indicates the rotation of the follower frame with respect to the base frame about the axis specified by the vector output by port axs. The angle falls in the range [0, π].

Use ports q and axs to output the rotation signals using the axis-angle parameterization. For more information, see Rotational Measurements.

Dependencies

To enable this port, under Rotation, select Angle.

Axis of rotation, returned as a 3-by-1 unit vector. Use ports q and axs to output the rotation signals using the axis-angle parameterization.

Dependencies

To enable this port, under Rotation, select Axis.

Relative rotation, returned as a quaternion. For more information about the quaternions, see Rotational Measurements.

Dependencies

To enable this port, under Rotation, select Quaternion.

Relative rotation, returned as a 3-by-3 matrix. For more information about the rotation matrix, see Rotational Measurements.

Dependencies

To enable this port, under Rotation, select Transform.

Relative rotation, returned as a 3-by-1 vector. The vector contains the angles for the three successive elementary rotations that represent the rotation of the follower frame with respect to the base frame.

The three rotations are about an intermediate frame and can be one of 12 different rotation sequences. The setting of the Sequence for Rotation Sequence parameter affects the output value. For more information about the rotation sequence measurements, see Rotational Measurements.

Dependencies

To enable this port, under Rotation, select Rotation Sequence.

X-component of the relative angular velocity between the two frames, returned as a scalar. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Angular Velocity, select Omega X.

Y-component of the relative angular velocity between the two frames, returned as a scalar. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Angular Velocity, select Omega Y.

Z-component of the relative angular velocity between the two frames, returned as a scalar. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Angular Velocity, select Omega Z.

Angular velocity of the follower frame with respect to the base frame, returned as a 3-by-1 vector. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Angular Velocity, select Omega XYZ.

Relative angular velocity, returned as a 4-by-1 vector that equals the time derivative of the signal from port Q.

Dependencies

To enable this port, under Angular Velocity, select Quaternion.

Relative angular velocity, returned as a 3-by-3 matrix. The matrix equals the time derivative of the signal from port R.

Dependencies

To enable this port, under Angular Velocity, select Transform.

Relative angular velocity, returned as a 3-by-1 vector. The vector equals the time derivative of the output from the port seq. The Sequence for Rotation Sequence parameter setting affects the output value.

Dependencies

To enable this port, under Angular Velocity, select Rotation Sequence.

X-component of the relative angular acceleration between the two frames, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Angular Acceleration, select Alpha X.

Y-component of the relative angular acceleration between the two frames, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Angular Acceleration, select Alpha Y.

Z-component of the relative angular acceleration between the two frames, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Angular Acceleration, select Alpha Z.

Angular acceleration of the follower frame with respect to the base frame, returned as a 3-by-1 vector. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Angular Acceleration, select Alpha XYZ.

Relative angular acceleration, returned as a 4-by-1 vector.

Dependencies

To enable this port, under Angular Acceleration, select Quaternion.

Relative angular acceleration, returned as a 3-by-3 matrix.

Dependencies

To enable this port, under Angular Acceleration, select Transform.

X-component of the relative translation between the two frames, returned as a scalar. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Translation, select X.

Y-component of the relative translation between the two frames, returned as a scalar. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Translation, select Y.

Z-component of the relative translation between the two frames, returned as a scalar. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Because both the Cartesian and cylindrical coordinate systems have the z-axis, the Transform Sensor block has only one output port for both coordinate systems.

Dependencies

To enable this port, under Translation, select Z.

Translation of the follower frame with respect to the base frame, returned as a 3-by-1 vector expressed in the Cartesian coordinate system. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Translation, select XYZ.

Cylindrical radius coordinate of the relative translation vector, returned as a nonnegative scalar. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Translation, select Radius.

Azimuth of the relative translation vector, returned as scalar. The angle falls in the range of [-π, π). The azimuth is undefined if the origins of the base and follower frames coincide with each other. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Because the azimuth exists in both the cylindrical and spherical coordinate systems, the Transform Sensor block has only one output port for both coordinate systems.

Dependencies

To enable this port, under Translation, select Azimuth.

Spherical radius coordinate of the relative translation vector, returned as a scalar. The value equals the distance between the origins of the base and follower frames.

Dependencies

To enable this port, under Translation, select Distance.

Inclination of the relative translation vector, expressed in the spherical coordinate system, returned as a scalar. The angle falls in the range of [-π/2, π/2]. The Expressed-In Frame parameter affects this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Translation, select Inclination.

X-component of the relative linear velocity between the two frames, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Velocity, select X.

Y-component of the relative linear velocity between the two frames, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Velocity, select Y.

Z-component of the relative linear velocity between the two frames, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Because both the Cartesian and cylindrical coordinate systems have the z-axis, the Transform Sensor block has only one output port for both coordinate systems.

Dependencies

To enable this port, under Velocity, select Z.

Linear velocity of the follower frame with respect to the base frame, returned as a 3-by-1 vector expressed in Cartesian coordinate system. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Velocity, select XYZ.

Cylindrical radius coordinate of the relative linear velocity, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Velocity, select Radius.

Azimuth coordinate of the relative linear velocity, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Because the azimuth coordinate exists in both the cylindrical and spherical coordinate systems, the Transform Sensor block has only one output port for both coordinate systems.

Dependencies

To enable this port, under Velocity, select Azimuth.

Spherical radius coordinate of the relative linear velocity, returned as a scalar.

Dependencies

To enable this port, under Velocity, select Distance.

Inclination coordinate of the relative linear velocity, expressed in the spherical coordinate system, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Velocity, select Inclination.

X-component of the relative linear acceleration between the two frames, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Acceleration, select X.

Y-component of the relative linear acceleration between the two frames, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Acceleration, select Y.

Z-component of the relative linear acceleration between the two frames, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Because both the Cartesian and cylindrical coordinate systems have the z-axis, the Transform Sensor block has only one output port for both coordinate systems.

Dependencies

To enable this port, under Acceleration, select Z.

Linear acceleration of the follower frame with respect to the base frame, returned as a 3-by-1 vector expressed in Cartesian coordinate system. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Acceleration, select XYZ.

Cylindrical radius coordinate of the relative linear acceleration, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Acceleration, select Radius.

Azimuth coordinate of the relative linear acceleration, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Because the azimuth coordinate exists in both cylindrical and spherical coordinate systems, the Transform Sensor block has only one output port for both coordinate systems.

Dependencies

To enable this port, under Acceleration, select Azimuth.

Spherical radius coordinate of the relative linear acceleration, returned as a scalar.

Dependencies

To enable this port under Acceleration, select Distance.

Inclination coordinate of the relative linear acceleration, expressed in the spherical coordinate system, returned as a scalar. The Observation Frame and Expressed-In Frame parameters affect this signal. For details, see the Output Dependency section.

Dependencies

To enable this port, under Acceleration, select Inclination.

Parameters

expand all

Reference frame with respect to which the block computes time derivatives. Use this parameter to specify from whose perspective the block observes motion when computing velocity and acceleration.

SettingDescription
WorldThe block computes time derivatives with respect to the world frame.
BaseThe block computes time derivatives with respect to the base frame.
FollowerThe block computes time derivatives with respect to the follower frame.

This parameter affects linear velocity, linear acceleration, and angular acceleration outputs. For details, see the Output Dependency section.

Coordinate frame whose axes the block uses to express vector outputs. Use this parameter to specify the x-, y-, and z-axes that the block projects vectors onto.

SettingDescription
WorldThe block expresses vector outputs in world frame axes.
BaseThe block expresses vector outputs in base frame axes.
FollowerThe block expresses vector outputs in follower frame axes.

This parameter affects translation, linear velocity, linear acceleration, angular velocity, angular acceleration, and rotation axis outputs. For details, see the Output Dependency section.

Sequence of the rotation axis for three successive elementary rotations. See Rotation Sequence Measurements for more information.

More About

expand all

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2012a

expand all