Measure rate of rotation around X, Y, and Z axes
Simulink Support Package for Android Devices / Sensors
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:
Z. Each port outputs a
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.
During simulations without hardware, this block outputs zeros. See Block Produces Zeros or Does Nothing in Simulation.
- 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.