getPURPOSEGeneric get for relative positioning sensors
SYNOPSISfunction out=get(S,field,varargin)
DESCRIPTIONGeneric get for relative positioning sensors Retrives information about a relative positioning sensor. The possible fields to retive are: - relativeDisplacements: The relative displacements of the robot according to this sensor. - absolutePoses: The pose of the robot along time according to this sensor. - all the fields in a generic sensor. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function out=get(S,field,varargin) 0002 % Generic get for relative positioning sensors 0003 % 0004 % Retrives information about a relative positioning sensor. 0005 % 0006 % The possible fields to retive are: 0007 % - relativeDisplacements: The relative displacements of the robot 0008 % according to this sensor. 0009 % - absolutePoses: The pose of the robot along time according to this 0010 % sensor. 0011 % - all the fields in a generic sensor. 0012 % 0013 0014 switch field 0015 0016 case 'relativeDisplacements' 0017 out=get(SB.RawSensor,'allReadings'); 0018 0019 case 'absolutePoses' 0020 n=size(S); 0021 if n==0 0022 out=0; 0023 else 0024 out=cell(1,n+1); 0025 if nargin>2 0026 out{1}=Pose(varargin{1}); 0027 else 0028 d=size(get(S,'reading',1)); % dim of the poses 0029 out{1}=Pose(zeros(d,1)); 0030 end 0031 for i=1:n 0032 out{i+1}=Relative2Absolute(out{i},get(S,'reading',i)); 0033 end 0034 end 0035 otherwise 0036 out=get(S.Sensor,field,varargin{1:end}); 0037 end 0038 |