getPURPOSEGet function for robots.
SYNOPSISfunction out=get(R,field,varargin)
DESCRIPTIONGet 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 INFORMATIONThis function calls:
SOURCE CODE0001 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 |