www.gusucode.com > robotics 案例源码程序 matlab代码 > robotics/ShowNoiseDistributionEffectsForOdometryMotionModelExample.m

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

%%
% Create a motion model object.
motionModel = robotics.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);