getPURPOSEGet function for trajectories.
SYNOPSISfunction out=get(T,field)
DESCRIPTIONGet function for trajectories. Retrives data from a trajectory. The possible fields to retrive are - type: Type of trajectory (line, ellipse, mixed). - data: The cell array of poses defining the trajectory. - averageDisplacement: The average displacement between poses. This is used to compute the amount of error to use when corrupting the ground truth trajectories. For example, odometry sensors usually produce an error that is aboud 5% of the displacement. The average displacement is used to define a constant error for the odometry. - boundingBox: The interval vector bounding the area where the trajectory is defined. This is used to define the area where to robot is supposed to move. This is sometimes used to plot. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function out=get(T,field) 0002 % Get function for trajectories. 0003 % 0004 % Retrives data from a trajectory. The possible fields to retrive are 0005 % - type: Type of trajectory (line, ellipse, mixed). 0006 % - data: The cell array of poses defining the trajectory. 0007 % - averageDisplacement: The average displacement between poses. This 0008 % is used to compute the amount of error to use when corrupting the 0009 % ground truth trajectories. For example, odometry sensors usually 0010 % produce an error that is aboud 5% of the displacement. The average 0011 % displacement is used to define a constant error for the odometry. 0012 % - boundingBox: The interval vector bounding the area where the 0013 % trajectory is defined. This is used to define the area where to 0014 % robot is supposed to move. This is sometimes used to plot. 0015 0016 switch field 0017 case 'type' 0018 out=T.type; 0019 case 'data' 0020 out=T.data; 0021 case 'averageDisplacement' 0022 n=size(T.data,2); 0023 d=zeros(size(T.data{1}),1); 0024 for i=2:n 0025 d=d+abs(double(Absolute2Relative(T.data{i-1},T.data{i}))); 0026 end 0027 out=d/(n-1); 0028 case 'boundingBox' 0029 n=size(T.data,2); 0030 ma=double(T.data{1}); 0031 mi=ma; 0032 for i=2:n 0033 p=double(T.data{i}); 0034 ma=max(ma,p); 0035 mi=min(mi,p); 0036 end 0037 out=1.5*Interval(mi,ma); 0038 out(3)=Interval(-pi,pi); 0039 otherwise 0040 error('Unknow field in Trajectory get'); 0041 end |