Main Content

readAngularVelocity

Read angular velocity measured by the gyroscope along x, y, and z axes

Add-On Required: This feature requires the MATLAB Support Package for Raspberry Pi Hardware add-on.

Description

angularVelocity = readAngularVelocity(mysh) returns the angular velocity measured by the Gyroscope along the x, y, and the z axes. The unit of measurement for the Gyroscope raw data is radians per second (rad/s).

example

[angularVelocity,Ts] = readAngularVelocity(mysh) returns the angular velocity measured by the Gyroscope along the x, y, and the z axes with timestamp. The unit of measurement for the Gyroscope raw data is radians per second (rad/s).

example

angularVelocity = readAngularVelocity(mysh,raw) returns the angular velocity measured by the Gyroscope along the x, y, and the z axes. The ‘raw’ argument is to specify that the output should be uncalibrated raw data.

example

[angularVelocity,Ts]= readAngularVelocity(mysh,raw) returns the angular velocity measured by the Gyroscope along the x, y, and the z axes with timestamp. The ‘raw’ argument is to specify that the output should be uncalibrated raw data.

The full scale range for the Gyroscope is 4.27606 rad/s.

Sense HAT IMU sensor axis information is shown below.

example

Examples

collapse all

You can read angular velocity measured by the Gyroscope.

angularVelocity = readAngularVelocity(mysh) 
angularVelocity =  

      -0.0617   -0.0596   -0.0140  

Read the angular velocity measured by the Gyroscope.

You can read the angular velocity measured by the Gyroscope along with the time stamp at which the data was read.

[angularVelocity,ts] = readAngularVelocity(mysh) 
 
angularVelocity = 

   -0.0665   -0.0612   -0.0142 

ts =  

   09-Aug-2016 15:37:19 

Read the raw uncalibrated angular velocity measured by the Gyroscope.

You can read raw uncalibrated angular velocity measured by the Gyroscope.

angularVelocityRaw = readAngularVelocity(mysh,'raw') 
 
angularVelocityRaw = 
   -9.4754   -9.3532   -1.8322 

You can read the raw uncalibrated angular velocity measured by the Gyroscope along with the time stamp at which the data was read.

[angularVelocityRaw,ts] = readAngularVelocity(mysh,'raw') 
  
angularVelocityRaw = 

   -9.4754   -9.3532   -1.8322 
 
ts =  

   09-Aug-2016 15:37:19 

Read the raw uncalibrated angular velocity measured by the Gyroscope with the timestamp.

Input Arguments

collapse all

Connection to a SenseHAT board, specified as a sensehat object.

Argument to specify that the output should be uncalibrated raw data.

Output Arguments

collapse all

The angular velocity measured by the accelerometer along the x,y, and z axes. This is a 1x3 double data. The unit of measurement for the angular velocity is radians per second (rad/s).

Time at which the data is read.

Extended Capabilities

Version History

Introduced in R2016b