Institut de Robòtica i Informàtica Industrial

get

PURPOSE ^

Get function for robots.

SYNOPSIS ^

function out=get(R,field,varargin)

DESCRIPTION ^

 Get function for robots.

 Retrives information about a robot.
 Possible fields to query are:
     - name: The name (or identifier) of the robot.
     - sensors: The set set of sensors of the robot.
     - sensor: One of the sensors of the robot.
     - nSensors: The number of sensors of the robot.
     - time: The current time slice in the robot simulation.

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:

SOURCE CODE ^

0001 function out=get(R,field,varargin)
0002 % Get function for robots.
0003 %
0004 % Retrives information about a robot.
0005 % Possible fields to query are:
0006 %     - name: The name (or identifier) of the robot.
0007 %     - sensors: The set set of sensors of the robot.
0008 %     - sensor: One of the sensors of the robot.
0009 %     - nSensors: The number of sensors of the robot.
0010 %     - time: The current time slice in the robot simulation.
0011 
0012   switch field
0013     case 'name'
0014       out=R.name;
0015     case 'sensors'
0016       out=R.sensors;
0017     case 'sensor'
0018       out=R.sensors{varargin{1}};
0019     case 'nSensors'
0020       out=R.nSensors;
0021     case 'time'
0022       out=R.time;
0023     otherwise
0024       error('Unknow field in Robot get');
0025   end
0026


Institut de Robòtica i Informàtica Industrial

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