SimOdometryPURPOSESimulated Odometry sensor constructor.
SYNOPSISfunction O=SimOdometry(varargin)
DESCRIPTIONSimulated Odometry sensor constructor. Simulated odometry sensors are useful to test algorithm with ground truth available. The possible parameters are: - Another simulated odometry sensor. - The sensor noise and a noiless trajectory from where to generate the noisy simulated sensor readings. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function O=SimOdometry(varargin) 0002 % Simulated Odometry sensor constructor. 0003 % 0004 % Simulated odometry sensors are useful to test algorithm with ground truth 0005 % available. 0006 % 0007 % The possible parameters are: 0008 % - Another simulated odometry sensor. 0009 % - The sensor noise and a noiless trajectory from where to generate the 0010 % noisy simulated sensor readings. 0011 0012 switch nargin 0013 case 1 0014 % Copy constructor 0015 if isa(varargin{1},'SimOdometry') 0016 O=varargin{1}; 0017 else 0018 error('Sensor copy constructor used with an non SimOdometry object'); 0019 end 0020 0021 case 2 % noise + trajectory 0022 noise=varargin{1}; 0023 0024 Tn=AddNoise2Trajectory(varargin{2},noise); 0025 0026 n=size(Tn)-1; 0027 data=cell(1,n); 0028 for i=1:n 0029 data{i}=Absolute2Relative(Tn{i},Tn{i+1}); 0030 end 0031 0032 S=RelPosSensor(noise,data); 0033 0034 O=class(struct([]),'SimOdometry',S); 0035 0036 otherwise 0037 error('Defining a SimOdometry sensor with the wrong number of parameters'); 0038 end |