| SimMechanics | ![]() |
Library
Description
The Body Sensor block detects the position, velocity, and/or acceleration of a body represented by a Body block.
The Body Sensor measures the motion in the reference coordinate system (CS) specified in the block dialog box.
You can measure one, two, or all three of these motion types:
The input is the connector port connected to the Body being sensed. The outport is a set of Simulink signals or one bundled Simulink signal of the position, velocity, and/or acceleration vector(s) and/or the rotation matrix of the body.
A body's orientation rotation matrix R relates vector components measured in the body CS and in the inertial World CS by [R]
vb = vs. The column vector vb lists the vector v's three components measured in the body CS. The column vector vs lists the vector v's three components measured in the World CS.
Dialog Box and Parameters
The dialog box has one active area, Measurements.
Measurements
Local (Body CS) to which the Sensor is connected or the default Absolute (World).Absolute case, the rotation matrix R and the motion vectors have components measured relative to the inertial World CS axes. In the Local case, the same body motion signals are premultiplied by the body's inverse orientation rotation matrix R-1 = RT.Select the check box(es) for each of the possible measurements you want to make:
representing rotational orientation and satisfying RTR = RRT = I. The components are output column-wise as a 9-component row vector: (R11, R21, R31, R12, ... ).
Absolute (World), the Rotation matrix measures the body's rotational orientation with respect to the World CS, relative to its initial orientation. If you choose the With respect to coordinate system above as Local (Body CS), the Rotation matrix returns the 3-by-3 identity matrix: RTR = I.
Each vector measurement is a row vector in the Simulink output signal. The selected signals are ordered in the same sequence as the dialog box.
In the pull-down menus, choose the units for each of the measurements you want:
m (meters), m/s (meters/second), m/s2 (meters/second2), and N (Newtons), respectively, for Position, Velocity, and Acceleration.
deg/s (degrees/second) and deg/s2 (degrees/second2), respectively, for Angular velocity and Angular acceleration. The Rotation matrix is dimensionless.
Example
Here is a Body Sensor connected to a Body:

You must connect the Body Sensor to the Body at one of that Body's attached Body CSs, at the corresponding Body CS Port. The sensor measures the motion of that Body CS.
See Also
Body, Body Actuator, Constraint & Driver Sensor, Joint Sensor, Mechanical Branching Bar
See Representing Body Positions and Orientations for more details on body coordinate system rotations.
See Representing Body Positions and Orientations and Modeling Sensors.
In Simulink, see the Signal Routing Library and the Sinks Library.
| Body Actuator | Body Spring & Damper | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2008 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |