PosePURPOSEGeneric pose constructor.
SYNOPSISfunction P=Pose(varargin)
DESCRIPTIONGeneric pose constructor. Uses the size of the arguments to decide which type of pose (2D or 3D) to return. - A Pose2D is defined if the input is a 3-element column vector. - A Pose3D is defined if the input is a 6-element colunm vector. Other kind of poses can be easily defined provided their number of parameters is not the same as already defined poses. TODO: Implement Pose3D. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function P=Pose(varargin) 0002 % Generic pose constructor. 0003 % 0004 % Uses the size of the arguments to decide which type of pose (2D or 3D) to 0005 % return. 0006 % - A Pose2D is defined if the input is a 3-element column vector. 0007 % - A Pose3D is defined if the input is a 6-element colunm vector. 0008 % 0009 % Other kind of poses can be easily defined provided their number of 0010 % parameters is not the same as already defined poses. 0011 % 0012 % TODO: Implement Pose3D. 0013 0014 % First check if we a defining a brand new pose 0015 if isa(varargin{1},'double') 0016 switch size(varargin{1},1) 0017 case 3 0018 P=Pose2D(varargin{1:end}); 0019 case 6 0020 P=Pose3D(varargin{1:end}); 0021 otherwise 0022 error('Wrong number of parameters in Pose constructor'); 0023 end 0024 else 0025 % Now check if we are using a copy constructor 0026 if isa(varargin{1},'Pose2D') 0027 P=varargin{1}; 0028 else 0029 if isa(varargin{1},'Pose3D') 0030 P=varargin{1}; 0031 else 0032 error('Wrong parameter type in Pose constructor'); 0033 end 0034 end 0035 end 0036 |