Institut de Robòtica i Informàtica Industrial

get

PURPOSE ^

Get function for trajectories.

SYNOPSIS ^

function out=get(T,field)

DESCRIPTION ^

 Get 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 INFORMATION ^

This function calls:
  • size Number of poses in a trajectory.
  • size Size of the state estimated in the filter
  • Interval Interval constructor
  • double Converts an interval to a double.
  • size Size (rows/columns) of an interval matrix.
  • Absolute2Relative Relative displacement between two poses.
  • double Converts a double
  • size Number of parameters of the pose.
  • size Number of readings stored in the Sensor.
This function is called by:

SOURCE CODE ^

0001 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


Institut de Robòtica i Informàtica Industrial

Generated on Fri 24-Jul-2009 12:32:50 by m2html © 2003