readAngularVelocity
Read one sample of angular velocity from BNO055 sensor
Add-On Required: This feature requires the MATLAB Support Package for Arduino Hardware add-on.
Description
[
returns angular velocity along x, y, and z axes of the BNO055 sensor as a 3-by-1
vector in units of rad/s along with the gyroReadings
,timestamp
] = readAngularVelocity(bno055
)timestamp
. In
ndof
mode, the elements of the vector represent calibrated
values, whereas in amg
mode, the elements represent raw
values.
Examples
Read Angular Velocity from Sensor in NDOF Mode
Create an arduino
object
a = arduino('COM4', 'Uno', 'Libraries', 'I2C');
Create the BNO055 sensor object.
imu = bno055(a,'OperatingMode','ndof');
Calibrate the sensor using steps mentioned in Calibrate BNO055 Sensors
tic; while (toc < 50) [status,timestamp] = readCalibrationStatus(imu); if strcmpi(status.Gyroscope,'full') break; %If Gyroscope is calibrated proceed further end pause(1); end
Read angular velocity data.
[gyroReadings,timestamp] = readAngularVelocity(imu)
gyroReadings = 3×1 0.0011 0.0011 0 timestamp = datetime 21-Jul-2020 14:53:36.836
Read Angular Velocity from Sensor in AMG Mode
Create an arduino
object
a = arduino('COM4', 'Uno', 'Libraries', 'I2C');
Create the BNO055 sensor object.
imu = bno055(a,'OperatingMode','amg');
Read angular velocity data.
[gyroReadings,timestamp] = readAngularVelocity(imu)
gyroReadings = 3×1 0.0138 0.0092 0.0034 timestamp = datetime 21-Jul-2020 14:53:36.836
Input Arguments
Output Arguments
More About
Version History
Introduced in R2019a
See Also
bno055
| flush
| info
| read
| readAcceleration
| readCalibrationStatus
| readMagneticField
| readOrientation
| release