%% Predict Poses Based On An Odometry Motion Model
% This example shows how to use the robotics.OdometryMotionModel class to predict the pose of a robot. An OdometryMotionModel object contains the motion model parameters for a differential drive robot. Use the object to predict the pose of a robot based on its current and previous poses and the motion model parameters.
% Create odometry motion model object.

motionModel = robotics.OdometryMotionModel;

%
% Define previous poses and the current odometry reading. Each pose prediction corresponds to a row in previousPoses vector.

previousPoses =  rand(10,3);
currentOdom = [0.1 0.1 0.1];

%
% The first call to the object initializes values and returns the previous poses as the current poses.

currentPoses = motionModel(previousPoses, currentOdom);

%
% Subsequent calls to the object with updated odometry poses returns the predicted poses based on the motion model.

currentOdom = currentOdom + [0.1 0.1 0.05];
predPoses = motionModel(previousPoses, currentOdom);

% Copyright 2012 The MathWorks, Inc.