function [absPoseMatrix] = exampleHelperComputeTrajPose(relPose, trajPoses, i)
% This helper function is to compute the absolute trajectory poses using
% relative poses obtained from scan matching.

%   Copyright 2019 The MathWorks, Inc.

    translationInX = trajPoses(i-1, 1);
    translationInY = trajPoses(i-1, 2);
    theta = trajPoses(i-1, 3);
    transMatrix = [cos(theta), -sin(theta), translationInX; sin(theta), cos(theta), translationInY; 0, 0, 1];
    relPoseMatrix = [relPose(1,1); relPose(1,2); 1];
    absPoseMatrix = transMatrix * relPoseMatrix;
end

