%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% init_lib Initialization file The script creates the global variables: configuration and robot The configuration variable stores parameters related to the simulation, such as: configuration.delta_time: Is the step time in seconds used to move the robot. The time is thus discretized in small steps of size delta_time. Selecting configuration.delta_time=0.01 usually results in a fair simulation. Select larger values, such as delta_time=0.1 if you experience that the simulation is too slow. configuration.time_delay: During a simulation, the robot is drawn at different positions at the Matlab's plot. For example, to simulate a trajectory, the robot is drawn with different joint values at a particular sequence. After drawing the robot at a particular pose, the system waits for time_delay seconds, so that the figure can be observed by the user. Depending on the system, values near configuration.time_delay=0.001 are correct. Please, increase configuration.delta_time and configuration.time_delay if you are not able to visualize the simulation smoothly. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0002 % init_lib 0003 % Initialization file 0004 % The script creates the global variables: configuration and robot 0005 % 0006 % The configuration variable stores parameters related to the simulation, 0007 % such as: 0008 % configuration.delta_time: Is the step time in seconds used to move the 0009 % robot. The time is thus discretized in small steps of size delta_time. 0010 % Selecting configuration.delta_time=0.01 usually results in a fair 0011 % simulation. Select larger values, such as delta_time=0.1 if you 0012 % experience that the simulation is too slow. 0013 % 0014 % configuration.time_delay: During a simulation, the robot is drawn at different 0015 % positions at the Matlab's plot. For example, to simulate a trajectory, 0016 % the robot is drawn with different joint values at a particular sequence. 0017 % After drawing the robot at a particular pose, the system waits for time_delay 0018 % seconds, so that the figure can be observed by the user. Depending 0019 % on the system, values near configuration.time_delay=0.001 are 0020 % correct. Please, increase configuration.delta_time and configuration.time_delay 0021 % if you are not able to visualize the simulation smoothly. 0022 % 0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0024 0025 % Copyright (C) 2012, by Arturo Gil Aparicio, arturo.gil@umh.es 0026 % 0027 % This file is part of ARTE (A Robotics Toolbox for Education). 0028 % 0029 % http://arvc.umh.es/arte 0030 % 0031 % ARTE is free software: you can redistribute it and/or modify 0032 % it under the terms of the GNU Lesser General Public License as published by 0033 % the Free Software Foundation, either version 3 of the License, or 0034 % (at your option) any later version. 0035 % 0036 % ARTE is distributed in the hope that it will be useful, 0037 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0038 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0039 % GNU Lesser General Public License for more details. 0040 % 0041 % You should have received a copy of the GNU Leser General Public License 0042 % along with ARTE. If not, see <http://www.gnu.org/licenses/>. 0043 0044 0045 %presentation 0046 0047 echo on 0048 % ARTE (A Robotics Toolbox for Education) 0049 % Copyright (C) 2012 Arturo Gil Aparicio, arturo.gil@umh.es 0050 % http://arvc.umh.es/arte 0051 % 0052 % This program is free software: you can redistribute it and/or modify 0053 % it under the terms of the GNU Lesser General Public License as published by 0054 % the Free Software Foundation, either version 3 of the License, or 0055 % any later version. 0056 % 0057 % This program is distributed in the hope that it will be useful, 0058 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0059 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0060 % GNU Lesser General Public License for more details. 0061 % 0062 % You should have received a copy of the GNU Lesser General Public License 0063 % along with this program. If not, see <http://www.gnu.org/licenses/>. 0064 % 0065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0066 % 0067 % To begin with, try loading a robot: 0068 % >> robot = load_robot('ABB','IRB140'); 0069 % 0070 % Next, draw it on its zero position: 0071 % >> drawrobot3d(robot,[0 0 0 0 0 0]) 0072 % 0073 % Next, try a different pose: 0074 % >> drawrobot3d(robot,[0 pi/2 -pi/2 0 0 0]) 0075 % 0076 % Finally, use the teach pendant to move the robot: 0077 % >> teach 0078 % 0079 % Please, type: 0080 % >> configuration.delta_time=0.1 0081 % if you find that the simulation is running too slow. 0082 % 0083 % Please, type: 0084 % >> configuration.time_delay = 0.01; 0085 % if the simulation plot does not show the robot correctly. 0086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0087 echo off 0088 0089 %initialize variables 0090 global configuration robot 0091 0092 %base directory for the library 0093 configuration.libpath = pwd(); 0094 0095 configuration.delta_time = 0.01; %minimum time between two consecutive poses of the robot. Adjust this time from 0.01 to 0.2, according to your processor 0096 configuration.time_delay = 0.001; %delay in seconds between frames when animating a robot. see animate.m for more information 0097 0098 configuration.min_resolution=0.0001; 0099 0100 %Number each of the figures to plot everything 0101 configuration.figure.robot=1; 0102 configuration.figure.q=2; 0103 configuration.figure.qd=3; 0104 configuration.figure.qdd=4;