%% Create Default imuSensor System object
% The imuSensor System object™ enables you to model the data received from an inertial measurement unit consisting of a combination of gyroscope, accelerometer, and magnetometer.
% Create a default imuSensor object.

IMU = imuSensor

%
% The imuSensor object, IMU, contains an idealized gyroscope and accelerometer. Use dot notation to view properties of the gyroscope.

IMU.Gyroscope

%
% Sensor properties are defined by corresponding parameter objects. For example, the gyroscope model used by the imuSensor is defined by an instance of the gyroparams class. You can modify properties of the gyroscope model using dot notation. Set the gyroscope measurement range to 4.3 rad/s.

IMU.Gyroscope.MeasurementRange = 4.3;

%
% You can also set sensor properties to preset parameter objects. Create an accelparams object to mimic specific hardware, and then set the IMU Accelerometer property to the accelparams object. Display the Accelerometer property to verify the properties are correctly set.

SpecSheet1 = accelparams( ...
    'MeasurementRange',19.62, ...
    'Resolution',0.00059875, ...
    'ConstantBias',0.4905, ...
    'AxesMisalignment',2, ...
    'NoiseDensity',0.003924, ...
    'BiasInstability',0, ...
    'TemperatureBias', [0.34335 0.34335 0.5886], ...
    'TemperatureScaleFactor', 0.02);

IMU.Accelerometer = SpecSheet1;

IMU.Accelerometer

%
% Copyright 2018 The MathWorks, Inc.
%