Institut de Robòtica i Informàtica Industrial

Robot

PURPOSE ^

Simulated robot constructor.

SYNOPSIS ^

function R=Robot(varargin)

DESCRIPTION ^

 Simulated robot constructor.

 Defines a simulated robot that is latter on move and, after each motion,
 delivers the corresponding sensor readings. The sensor readings can be
 purely simulated or obtained from a log file resulting from a data
 collection with a real robot.

 The possible parameters are
      - Another robot.
      - A name for the robot plus a cell array with the sensors to be
        added to the sensor.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Number of poses in a trajectory.
  • size Size of the state estimated in the filter
  • 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:

SOURCE CODE ^

0001 function R=Robot(varargin)
0002 % Simulated robot constructor.
0003 %
0004 % Defines a simulated robot that is latter on move and, after each motion,
0005 % delivers the corresponding sensor readings. The sensor readings can be
0006 % purely simulated or obtained from a log file resulting from a data
0007 % collection with a real robot.
0008 %
0009 % The possible parameters are
0010 %      - Another robot.
0011 %      - A name for the robot plus a cell array with the sensors to be
0012 %        added to the sensor.
0013 
0014   switch nargin
0015     case 1
0016       % Copy constructor
0017       if isa(varargin{1},'Robot')
0018         R=varargin{1};
0019       else
0020         error('Robot copy constructor used with an non-robot object');
0021       end
0022     case 2
0023       R.name=varargin{1};
0024       R.sensors=varargin{2};
0025       
0026       R.nSensors=size(R.sensors,2);
0027       R.time=0;
0028       R.nReadings=min(cellfun(@size,R.sensors));
0029             
0030       R=class(R,'Robot');
0031     otherwise
0032       error('Wrong number of input arguments in Robot constructor');
0033   end
0034   
0035   
0036


Institut de Robòtica i Informàtica Industrial

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