Gyroscope

Measure rate of rotation around X, Y, and Z axes

Library

Simulink Support Package for Android Devices / Sensors

Description

Get the rate of rotation measurement in rad/s around the X, Y, and Z axes from the gyroscope on the Android™ device.

The Gyroscope block has three output ports: X, Y, and Z. Each port outputs a single-precision scalar value.

For any positive axis on the device, clockwise rotation outputs negative values, and counterclockwise rotation outputs positive values. For example, if you place the device face up on a table and spin it clockwise, the block outputs negative values for the Z-axis.

The following illustration shows the orientation of the positive X, Y, and Z axes for a typical Android mobile phone.

The following illustration shows the orientation of the positive X, Y, and Z axes for a typical Android tablet.

Note

During simulations without hardware, this block outputs zeros. See Block Produces Zeros or Does Nothing in Simulation (Simulink).

Parameters

Sample time

Specify how often the block reads the sensor.

Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.

Introduced in R2014a