Main Content

reset

Reset state and state estimation error covariance

    Description

    example

    reset(slamObj) resets the state and state estimation error covariance to their default values, and resets the internal states.

    Examples

    collapse all

    Specify the initial vehicle state.

    initialState = [1; -2; 0.1];

    Specify the initial vehicle state covariance.

    initialStateCovar = 0.1*eye(3);

    Create an ekfSLAM object with initial state and initial state covariance.

    ekfSlamObj = ekfSLAM('State',initialState, ...
                         'StateCovariance',initialStateCovar);

    Get the state and the state covariance from the ekfSLAM object.

    ekfSlamObj.State
    ans = 3×1
    
        1.0000
       -2.0000
        0.1000
    
    
    ekfSlamObj.StateCovariance
    ans = 3×3
    
        0.1000         0         0
             0    0.1000         0
             0         0    0.1000
    
    

    Reset the state and state estimation error covariance to the default value.

    reset(ekfSlamObj)

    Get the state and the state covariance from the ekfSLAM object.

    ekfSlamObj.State
    ans = 3×1
    
         0
         0
         0
    
    
    ekfSlamObj.StateCovariance
    ans = 3×3
    
         1     0     0
         0     1     0
         0     0     1
    
    

    Input Arguments

    collapse all

    EKF SLAM object, specified as an ekfSLAM object.

    Extended Capabilities

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

    Introduced in R2021b