%% Show Noise Distribution Effects for Odometry Motion Model
% This example shows how to visualize the effect of different noise parameters on the odometryMotionModel class. An odometryMotionModel object contains the motion model noise parameters for a differential drive vehicle. Use showNoiseDistribution to visualize how changing these values affect the distribution of predicted poses.
% Create a motion model object.

motionModel = odometryMotionModel;

%
% Show the distribution of particles with the existing noise parameters. Each particle is a hypothesis for the predicted pose.

showNoiseDistribution(motionModel);

%
% Show the distribution with a specified odometry pose change and number of samples. The change in odometry is used as the final pose with hypotheses distributed around based on the Noise parameters.

showNoiseDistribution(motionModel, ...
            'OdometryPoseChange', [0.5 0.1 0.25], ...
            'NumSamples', 1000);

%
% Change the Noise parameters and visualize the effects. Use the same odometry pose change and number of samples.

 motionModel.Noise = [0.2 1 0.2 1];
 
 showNoiseDistribution(motionModel, ...
            'OdometryPoseChange', [0.5 0.1 0.25], ...
            'NumSamples', 1000);

% Copyright 2019 The MathWorks, Inc.