Institut de Robòtica i Informàtica Industrial

Pose2D

PURPOSE ^

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:
  • size Number of poses in a trajectory.
  • size Size of the state estimated in the filter
  • pi2pi Moves an angle to the -pi,pi range.
  • pi2pi Forces an angular interval to be in [-pi,pi].
  • size Size (rows/columns) of an interval matrix.
  • size Number of parameters of the pose.
  • size Number of readings stored in the Sensor.
This function is called by:
  • Pose Generic pose constructor.

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


Institut de Robòtica i Informàtica Industrial

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