Home > arte3.2.0 > demos > more_demos > draw_errors_scara_monte_carlo.m

draw_errors_scara_monte_carlo

PURPOSE ^

THE DEMO PRESENTS AN ERROR PROPAGATION USING A MONTE-CARLO METHOD

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 THE DEMO PRESENTS AN ERROR PROPAGATION USING A MONTE-CARLO METHOD
 The error in the positioning of the joints is propagated to an error
 in the position of the end effector

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % THE DEMO PRESENTS AN ERROR PROPAGATION USING A MONTE-CARLO METHOD
0002 % The error in the positioning of the joints is propagated to an error
0003 % in the position of the end effector
0004 
0005 % Copyright (C) 2012, by Arturo Gil Aparicio
0006 %
0007 % This file is part of ARTE (A Robotics Toolbox for Education).
0008 %
0009 % ARTE is free software: you can redistribute it and/or modify
0010 % it under the terms of the GNU Lesser General Public License as published by
0011 % the Free Software Foundation, either version 3 of the License, or
0012 % (at your option) any later version.
0013 %
0014 % ARTE is distributed in the hope that it will be useful,
0015 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 % GNU Lesser General Public License for more details.
0018 %
0019 % You should have received a copy of the GNU Leser General Public License
0020 % along with ARTE.  If not, see <http://www.gnu.org/licenses/>.
0021 
0022 close all
0023 
0024 M=500; %number of particles
0025 
0026 %load arm parameters
0027 robot =  load_robot('example', 'scara')
0028 
0029 %standard deviation in each of the three joints
0030 sigmaq1=0.017;%rad
0031 sigmaq2=0.017;%rad
0032 sigmaq3=0.01;% m
0033 
0034 
0035 %find errors around this pose
0036 q=[pi/2 -pi/2 0 0];
0037 
0038 puntos=[];
0039 for i=1:M,
0040     qi = q + [normrnd(0, sigmaq1) normrnd(0, sigmaq2) normrnd(0, sigmaq3) 0];
0041     T=directkinematic(robot, qi);
0042     puntos=[puntos; T(1,4) T(2,4) T(3,4)];
0043 end
0044 
0045 
0046 adjust_view(robot)
0047 drawrobot3d(robot,q), hold on
0048 plot3(puntos(:,1),puntos(:,2), puntos(:,3),'r.')

Generated on Fri 03-Jan-2014 12:20:01 by m2html © 2005