Institut de Robòtica i Informàtica Industrial

RelPosSensor

PURPOSE ^

Relative Position Sensor constructor.

SYNOPSIS ^

function S=RelPosSensor(varargin)

DESCRIPTION ^

 Relative Position Sensor constructor.

 A sensors whose data give relative positioning information (such as 
 encoder odometry).

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Number of poses in a trajectory.
  • size Size of the state estimated in the filter
  • size Size (rows/columns) of an interval matrix.
  • size Number of parameters of the pose.
  • Pose Generic pose constructor.
  • Sensor Sensor constructor.
  • size Number of readings stored in the Sensor.
This function is called by:

SOURCE CODE ^

0001 function S=RelPosSensor(varargin)
0002 % Relative Position Sensor constructor.
0003 %
0004 % A sensors whose data give relative positioning information (such as
0005 % encoder odometry).
0006 
0007   switch nargin
0008     
0009     case 1
0010       % Copy constructor
0011       if isa(varargin{1},'RelPosSensor')
0012         S=varargin{1};
0013       else
0014         error('Sensor copy constructor used with an non-sensor object');
0015       end
0016       
0017     case 2
0018       % Base sensor (stores the noise)
0019       if isa(varargin{2},'char') || isa(varargin{2},'double')
0020         if isa(varargin{2},'char')
0021           rawData=load(varargin{2});
0022         else
0023           rawData=varargin{2};
0024         end
0025         n=size(rawData,1);
0026         data=cell(1,n);
0027         for i=1:n
0028           data{i}=Pose(rawData(i,:)');
0029         end
0030       else
0031         if isa(varargin{2},'cell')
0032           data=varargin{2};
0033         else
0034           error('Wrong parameter type in RelPoseSensor constructor.');
0035         end
0036       end
0037       
0038       SB=Sensor(varargin{1},data);
0039       
0040       S=class(struct([]),'RelPosSensor',SB);
0041       
0042     otherwise
0043       error('Wrong number of parameters in RelPosSensor creation');
0044   end


Institut de Robòtica i Informàtica Industrial

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