![]() |
Pose2DPURPOSE
2D Pose constructor.
SYNOPSIS
function P=Pose2D(varargin)
DESCRIPTION
2D Pose constructor. Possible parameters are: - another 2D pose - a column-wise array with 3 reals giving the x, y and orientation components of the pose. See also Pose, Pose3D. CROSS-REFERENCE INFORMATION
This function calls:
SOURCE CODE
0001 function P=Pose2D(varargin) 0002 % 2D Pose constructor. 0003 % 0004 % Possible parameters are: 0005 % - another 2D pose 0006 % - a column-wise array with 3 reals giving the x, y and orientation 0007 % components of the pose. 0008 % 0009 % See also Pose, Pose3D. 0010 0011 switch nargin 0012 0013 case 1 0014 if isa(varargin{1},'Pose2D') 0015 P=varargin{1}; 0016 else 0017 if isa(varargin{1},'double') && (size(varargin{1},1)==3) 0018 P.data=[varargin{1}(1);varargin{1}(2);pi2pi(varargin{1}(3))]; 0019 P=class(P,'Pose2D'); 0020 else 0021 error('Wrong parameter type in Pose2D constructor'); 0022 end 0023 end 0024 0025 otherwise 0026 error('Wrong number of parameteres in Pose2D constructor'); 0027 0028 end |