function copy_all(varargin) %COPY_ALL Copies all executable to target robot. % % COPY_ALL(TURTLE) copies all executables to TURTLE. Valid values for % TURTLE are 'turtle#', where 1 <= # <= MAX_TURTLES, or a combination of % multiple numbers. E.g. 'turtle135' copies the executable to turtle1, % turtle3 and turtle5. % % COPY_ALL(TURTLE,BACKUP) copies all executables to TURTLE as a backup. % This will not work if the backup software is running! %% INIT cd /home/robocup/svn/trunk/src/Turtle2 if nargin==0 error('specify a turtle: e.g.: ''copy_worldmodel turtle1'''); elseif nargin==1, copyTarget=varargin{1}; backupflag=0; elseif nargin==2, copyTarget=varargin{1}; backupflag=1; end if length(copyTarget)<7 || ~strcmp(copyTarget(1:6),'turtle'), error('Wrong syntax for the input!') end %% SHOW ROBOT TARGETS turtleNrs = copyTarget(7:end); %display tgt = 'turtle'; if length(turtleNrs)>1, tgt = [tgt, 's']; end for i1=1:length(turtleNrs), if (i1>1) && (length(turtleNrs)==i1), tgt = [tgt, ' and']; elseif i1>1, tgt = [tgt, ',']; end tgt=[tgt, ' ', num2str(turtleNrs(i1))]; end disp(['selected turtles: ', tgt]); %% COPYING %ssh keys disp(' ') cd Tools/scripts/General; copy_keys(copyTarget); cd ../..; %motion if backupflag, disp(sprintf('\nCOPY ALL BACKUP EXECUTABLES')) else disp(sprintf('\nCOPY ALL EXECUTABLES')) end cd ../Motion; if backupflag, motion_success = copy_motion(copyTarget,'backup'); else motion_success = copy_motion(copyTarget); end %strategy disp(' ') cd ../Strategy; if backupflag, strategy_success = copy_strategy(copyTarget,'backup'); else strategy_success = copy_strategy(copyTarget); end %vision disp(' ') cd ../Vision; if backupflag, vision_success = copy_vision(copyTarget,'backup'); else vision_success = copy_vision(copyTarget); end %worldmodel disp(' ') cd ../WorldModel; if backupflag, worldmodel_success = copy_worldmodel(copyTarget,'backup'); else worldmodel_success = copy_worldmodel(copyTarget); end cd ..; copysummary(motion_success,strategy_success,vision_success,worldmodel_success);