![]() |
ConcatTrajectoriesPURPOSE
Concats two trajectories.
SYNOPSIS
function T=ConcatTrajectories(T1,T2)
DESCRIPTION
Concats two trajectories. Returns the trajectory, T, resulting from the concatenation of the two input trajectories, T1 and T2. Note that the T2 is displaced and rotated so that its first pose is coincident with the last pose of T1. CROSS-REFERENCE INFORMATION
This function calls:
SOURCE CODE
0001 function T=ConcatTrajectories(T1,T2) 0002 % Concats two trajectories. 0003 % 0004 % Returns the trajectory, T, resulting from the concatenation of the two 0005 % input trajectories, T1 and T2. 0006 % 0007 % Note that the T2 is displaced and rotated so that its first pose is 0008 % coincident with the last pose of T1. 0009 0010 nT1=size(T1); 0011 if nT1>0 0012 nT2=size(T2); 0013 0014 T.type='mixed'; 0015 TR=cell(1,nT2-1); 0016 0017 ref=T1.data{nT1}; 0018 for i=2:nT2 0019 d=Absolute2Relative(T2.data{i-1},T2.data{i}); 0020 TR{i-1}=Relative2Absolute(ref,d); 0021 ref=TR{i-1}; 0022 end 0023 0024 T.data=[T1.data TR]; 0025 T=class(T,'Trajectory'); 0026 else 0027 T=T2; 0028 end 0029 |