Main Content

factorIMUParameters

Factor IMU parameters

Since R2023a

    Description

    Use a factorIMUParameters object to specify factor IMU parameters to a factorIMU object.

    Creation

    Description

    params = factorIMUParameters returns a default factor IMU parameters object, params.

    example

    params = factorIMUParameters(Name=Value) specifies properties using one or more name-value arguments.

    Properties

    expand all

    IMU sampling rate, in Hz, specified as a numeric scalar greater than or equal to 100.

    Example: SampleRate=400

    Data Types: single | double

    Gyroscope bias process noise covariance, specified as a 3-by-3 matrix, three-element row vector, or numeric scalar in (rad/s)2.

    Example: GyroscopeBiasNoise=1.5e-9*eye(3)

    Data Types: single | double

    Accelerometer bias process noise covariance, specified as a 3-by-3 matrix, three-element row vector, or numeric scalar in (m/s2)2.

    Example: AccelerometerBiasNoise=diag([9.62e-9,9.62e-9,2.17e-8])

    Data Types: single | double

    Gyroscope measurement noise covariance, specified as a 3-by-3 matrix, three-element row vector, or numeric scalar in (rad/s)2.

    Example: GyroscopeNoise=6.93e-5*eye(3)

    Data Types: single | double

    Accelerometer measurement noise covariance, specified as a 3-by-3 matrix, three-element row vector, or numeric scalar in (m/s2)2.

    Example: AccelerometerNoise=2.9e-6*eye(3)

    Data Types: single | double

    Reference frame for the local coordinate system, specified as "ENU" (east-north-up) or "NED" (north-east-down).

    Data Types: string | char

    Examples

    collapse all

    Specify IMU parameters for sample rate and the gyroscope and accelerometer measurement bias and noises.

    sampleRate = 400; % Hz
    gyroBiasNoise = 1.5e-9*eye(3);
    accelBiasNoise = diag([9.62e-9 9.62e-9 2.17e-8]);
    gyroNoise = 6.93e-5*eye(3);
    accelNoise = 2.9e-6*eye(3);

    Create a factorIMUParameters object using the specified IMU parameters.

    imuparams = factorIMUParameters(SampleRate=sampleRate, ...
                                    GyroscopeBiasNoise=gyroBiasNoise, ...
                                    AccelerometerBiasNoise=accelBiasNoise, ...
                                    GyroscopeNoise=gyroNoise, ...
                                    AccelerometerNoise=accelNoise, ...
                                    ReferenceFrame="NED");

    Specify the gyroscope and accelerometer readings.

    gyroReadings = [-0.0151    0.0299    0.0027
                    -0.0079    0.0370   -0.0014
                    -0.0320    0.0306    0.0035
                    -0.0043    0.0340   -0.0066
                    -0.0033    0.0331   -0.0011];
    accelReadings = [1.0666    0.0802    9.9586
                     1.1002    0.0199    9.6650
                     1.0287    0.3071   10.1864
                     0.9077   -0.2239   10.2989
                     1.2322    0.0174    9.8411];
      

    Create a factorIMU object using the factorIMUParameters object and the readings.

    nodeID = 1:6;
    f = factorIMU(nodeID,gyroReadings,accelReadings,imuparams);

    Create a default factor graph and add the factor to the graph using the addFactor function.

    g = factorGraph;
    addFactor(g,f);

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2023a