Skip to content

Commit

Permalink
The ADEPT Viper 900 Robot has been added.
Browse files Browse the repository at this point in the history
Support to draw different equipments at the same time has been added. Thus, we can move boxes, pieces or whatever we want by changing the corresponding T0 during simulation.
robot.equipment is now an array of structures.
See RAPID/programs/advanced_examples/viper900_feeds_cat.m for an example. A bowl, a box and a cat are moved during the simulation. Thanks to Vicente Tormo, Alejandro Cazorla y Miriam Plaza.
  • Loading branch information
4rtur1t0 committed Feb 24, 2016
1 parent 24374da commit 824c6ae
Show file tree
Hide file tree
Showing 50 changed files with 308,346 additions and 21 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% OR
% >> robot = load_robot('abb','irb52');
% B) NEXT, LOAD SOME EQUIPMENT.
% >> robot.equipment = load_robot('equipment','tables/table_two_areas');
% >> robot.equipment{1} = load_robot('equipment','tables/table_two_areas');
%
% C) NOW, LOAD AN END TOOL
% >> robot.tool= load_robot('equipment','end_tools/parallel_gripper_0');
Expand Down Expand Up @@ -68,7 +68,8 @@
%please: comment the following lines to avoid loading the robot and equipment in every simulation.
%Feel free to load other robots/equipments... etc.
robot = load_robot('abb','irb140');
robot.equipment = load_robot('equipment','tables/table_two_areas');
%load static equipment, such as tables or
robot.equipment{1} = load_robot('equipment','tables/table_two_areas');
robot.tool= load_robot('equipment','end_tools/parallel_gripper_0');
robot.piece=load_robot('equipment','cylinders/cylinder_tiny');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% OR
% robot = load_robot('abb','irb52');
% B) NEXT, LOAD SOME EQUIPMENT.
% robot.equipment = load_robot('equipment','tables/table_two_areas');
% robot.equipment{1} = load_robot('equipment','tables/table_two_areas');
%
% C) NOW, LOAD AN END TOOL
% robot.tool= load_robot('equipment','end_tools/parallel_gripper_0');
Expand Down Expand Up @@ -50,7 +50,7 @@

%Comment the following lines to avoid loading the robot at every simulation
robot = load_robot('abb','irb140');
robot.equipment = load_robot('equipment','tables/table_two_areas');
robot.equipment{1} = load_robot('equipment','tables/table_two_areas');
robot.tool= load_robot('equipment','end_tools/parallel_gripper_0');
robot.piece=load_robot('equipment','cylinders/cylinder_tiny');

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% OR
% robot = load_robot('abb','irb52');
% B) NEXT, LOAD SOME EQUIPMENT.
% robot.equipment = load_robot('equipment','tables/table_two_areas');
% robot.equipment{1} = load_robot('equipment','tables/table_two_areas');
%
% C) NOW, LOAD AN END TOOL
% robot.tool= load_robot('equipment','end_tools/parallel_gripper_0');
Expand Down Expand Up @@ -115,15 +115,15 @@ function COGER_PIEZA()

%!Ahora abrir pinza
simulation_open_tool; %Reset do1;
Waittime(0.1);!esperar apertura
WaitTime(0.1);!esperar apertura
%!Coger
MoveL(RT_pos_rec,'vmax','fine',TD_gripper, 'wobj0');

%!Ahora cerrar pinza
simulation_close_tool; %Set do1;
simulation_grip_piece;

Waittime(0.1); !esperar cierre
WaitTime(0.1); !esperar cierre
%!Subir por seguridad antes de ir al siguiente punto
MoveL(RT_aprox_rec,'vmax','z50',TD_gripper, 'wobj0');

Expand Down Expand Up @@ -153,7 +153,7 @@ function METER_EN_CAJA()

plot_points;

Waittime(0.5);
WaitTime(0.5);
%Subir por seguridad antes de ir al siguiente punto
MoveL(Offs(RT_pos_dej,0,0,0.105),'v1000','z10',TD_gripper, 'wobj0');

Expand Down
File renamed without changes.
140 changes: 140 additions & 0 deletions RAPID/programs/advanced_examples/viper900_feeds_cat.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
% Matlab script for RAPID equivalent commands
% please note that variables should be
% declared as global as in RAPID syntaxis
% this script demonstrates the use of functions in the matlab script. This
% script can be translated to RAPID by means of the matlab2RAPID script.
%
% This script includes all the robot, equipment, pieces and end tool
% loading necessary. It can't be used with another robot without modifying
% this script.
% For the proper functioning of this script you shall use the modified
% function drawrobot3d so two extra equipment can be added.
% The authors of this scripts are:
% Miriam Plaza Carrasco
% Alejandro Cazorla Sánchez
% Vicente Tormo Moragues
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function viper900_feeds_cat
global robot TD_gripper Pinic Pprec1 PCcaja Pcaja PPcaja Pn1 Pi1 Pi2 PCcuenco Pcuenco PSgato PCgato Pgato1 Pgato2 Pgato3 Pgato4

%Comment the following lines to avoid loading the robot at every simulation
robot = load_robot('ADEPT','Viper_900');
robot.equipment{1} = load_robot('equipment','tables/table_two_areas');
robot.equipment{2} = load_robot('equipment','miscelanea/cat_bowl');
robot.equipment{2}.T0(1:3,4)=[0.5 0.25 0]';
robot.equipment{3} = load_robot('equipment','miscelanea/pink_cat');
robot.equipment{3}.T0(1:3,4)=[1.3 0 0]';
robot.tool= load_robot('equipment','end_tools/parallel_gripper_0');
robot.piece=load_robot('equipment','miscelanea/cereal_box');

%init the position of the piece at the beginning of the simulation
robot.piece.T0(1:3,4)=[0.2 -0.3 0.2]';
%%robot.equipment.cat.T0(1:3,4)=[1.3 0 0]';
%robot.tool.piece_gripped=0;
drawrobot3d(robot, robot.q);
adjust_view(robot)
%mover gato %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

drawrobot3d(robot, robot.q);
%define the tool
%In RAPID this is done by means of the tooldata structure
TD_gripper=[1,[[0,0,0.125],[1,0,0,0]],[0.1,[0,0,0.100],[1,0,0,0],0,0,0]];

%define target points FOR SIMULATION
Pinic=[[0.6880, -0.0000, 0.8100],[0.7071, -0.0000, 0.7071, -0.0000], [0, -1, 0, 0], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pprec1=[[0.0880, -0.3000, 0.5100],[0.7071, -0.0000, 0.7071, 0.0000], [-1, -1, 0, 1], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PCcaja=[[0.0891, -0.2969, 0.2947],[0.7159, 0.0255, 0.6972, 0.0255], [-1, -1, 0, 1], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pcaja=[[0.2159, -0.2980, 0.2980],[0.7147, -0.0215, 0.6978, 0.0418], [-1, -1, 0, 1], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PPcaja=[[0.2159, -0.2980, 0.3980],[0.7147, -0.0215, 0.6978, 0.0418], [-1, -1, 0, 1], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pn1=[[0.2319, -0.2830, 0.3999],[0.6885, 0.0136, 0.7248, -0.0221], [-1, -1, 0, 1], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pi1=[[0.4819, -0.0830, 0.3999],[0.6885, 0.0136, 0.7248, -0.0221], [-1, -1, 0, 1], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pi2=[[0.5319, 0.2170, 0.3999],[0.6885, 0.0136, 0.7248, -0.0221], [0, 0, -1, 1], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PCcuenco=[[0.4732, 0.2653, 0.2871],[0.6701, -0.0386, 0.7410, 0.0199], [0, 0, -1, 1], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pcuenco=[[0.3761, 0.2804, 0.1386],[0.2670, -0.0933, 0.9575, 0.0560], [0, 0, 0, 1], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PSgato=[[0.5417, 0.3480, 0.6089],[0.0030, 0.0030, 0.7091, 0.7051], [0, 1, -1, 0], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PCgato=[[0.5917, 0.3480, 0.4589],[0.6401, -0.6462, -0.2920, -0.2958], [0, 1, 0, 0], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pgato1=[[0.5917, 0.3480, 0.4089],[0.6401, -0.6462, -0.2920, -0.2958], [0, 1, 0, 0], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pgato2=[[0.6284, 0.3449, 0.3425],[0.6429, -0.6557, -0.2795, -0.2803], [0, 1, 0, 0], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pgato3=[[0.6784, 0.3449, 0.2925],[0.6429, -0.6557, -0.2795, -0.2803], [0, 1, 0, 0], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
Pgato4=[[0.6784, 0.3449, 0.3425],[0.6429, -0.6557, -0.2795, -0.2803], [0, 1, 0, 0], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

main
end

function main()

global robot TD_gripper Pinic Pprec1 PCcaja Pcaja PPcaja Pn1 Pi1 Pi2 PCcuenco Pcuenco PSgato PCgato Pgato1 Pgato2 Pgato3 Pgato4
%open the tool
simulation_open_tool; %Set do1;

%move to the initial point
MoveJ(Pprec1, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveL(PCcaja, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveL(Pcaja, 'v1000' , 'fine' , TD_gripper, 'wobj0');

% Now open the tool
simulation_close_tool; %Reset do1;
simulation_grip_piece;

MoveL(PPcaja, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveL(Pn1, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveC(Pi1, Pi2, 'vmax' , 'fine' , TD_gripper, 'wobj0');


%semueve a cuenco
MoveJ(PCcuenco, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveL(Pcuenco, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveL(PCcuenco, 'vmax' , 'fine' , TD_gripper, 'wobj0');

%camino inverso
MoveC(Pi2, Pi1, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveL(Pn1, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveL(PPcaja, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveL(Pcaja, 'vmax' , 'fine' , TD_gripper, 'wobj0');
%abrir gripper
simulation_open_tool; %Set do1;
simulation_release_piece;

MoveL(PCcaja, 'vmax' , 'fine' , TD_gripper , 'wobj0');

MoveL(Pprec1, 'vmax' , 'fine' , TD_gripper , 'wobj0');

%cerrar gripper
simulation_close_tool; %Set do1;
%%%EL GATO SE MUEVE!!! TAMOS LOCOS
robot.equipment{3}.T0(1:3,4)=[1.15 0.05 0]';
drawrobot3d(robot, robot.q);
robot.equipment{3}.T0(1:3,4)=[1.05 0.1 0]';
drawrobot3d(robot, robot.q);
robot.equipment{3}.T0(1:3,4)=[1 0.12 0]';
drawrobot3d(robot, robot.q);
robot.equipment{3}.T0(1:3,4)=[0.9 0.15 0]';
drawrobot3d(robot, robot.q);
robot.equipment{3}.T0(1:3,4)=[0.75 0.2 0]';
drawrobot3d(robot, robot.q);
robot.equipment{3}.T0(1:3,4)=[0.7 0.25 0]';
drawrobot3d(robot, robot.q);


MoveJ(PSgato, 'vmax' , 'fine' , TD_gripper , 'wobj0');
MoveL(PCgato, 'vmax' , 'fine' , TD_gripper , 'wobj0');

for i=1:3
MoveL(Pgato1, 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveC(Pgato2, Pgato3 , 'vmax' , 'fine' , TD_gripper, 'wobj0');
MoveL(Pgato4, 'vmax' , 'fine' , TD_gripper , 'wobj0');
MoveL(Pgato1, 'vmax' , 'fine' , TD_gripper , 'wobj0');
end

MoveJ(Pinic, 'vmax' , 'fine', TD_gripper, 'wobj0');

robot.equipment{3}.T0=[1 0 0 0.2;
0 -1 0 0;
0 0 1 0.4
0 0 0 1];
drawrobot3d(robot, robot.q);



end
Binary file modified RAPID/programs/beta/test_packaging.m
Binary file not shown.
4 changes: 2 additions & 2 deletions RAPID/programs/list_of_files.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- basic_robot_program.m: Just go to four different target points in simulation.
- basic.prg: The above script translated to a RAPID program.
- simple_examples/basic_robot_program.m: Just go to four different target points in simulation.
- simple_examples/basic.prg: The above script translated to a RAPID program.

- practice_1_programming.m: in order to run the program. Type:
>> init_lib
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
% A) FIRST, LOAD A ROBOT
% robot = load_robot('abb','irb140');
% B) NEXT, LOAD SOME EQUIPMENT.
% robot.equipment = load_robot('equipment','tables/table_small');
% robot.equipment{1} = load_robot('equipment','tables/table_small');
% OR
% robot.equipment = load_robot('equipment','bumper_cutting');
% robot.equipment{1} = load_robot('equipment','bumper_cutting');
% C) NOW, LOAD AN END TOOL
% robot.tool= load_robot('equipment','end_tools/parallel_gripper_0');
% D) FINALLY, LOAD A PIECE TO GRAB BY THE ROBOT
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions demos/manufacturing_demo.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
% >> adjust_view(robot);
%
% fprintf('\nNOW LOAD AUXILIAR EQUIPMENT')
% >> robot.equipment=load_robot('equipment', 'bumper_cutting');
% >> robot.equipment{1}=load_robot('equipment', 'bumper_cutting');
%
% >> drawrobot3d(robot, q)
%
Expand All @@ -73,7 +73,7 @@


fprintf('\nNOW LOAD AUXILIAR EQUIPMENT')
robot.equipment=load_robot('equipment', 'bumper_cutting');
robot.equipment{1}=load_robot('equipment', 'bumper_cutting');

%draw the robot
drawrobot3d(robot, q)
Expand Down
4 changes: 2 additions & 2 deletions demos/spot_welding_demo.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
% adjust_view(robot);
%
% fprintf('\nNOW LOAD AUXILIAR EQUIPMENT')
% robot.equipment=load_robot('equipment', 'bodywork');
% robot.equipment{1}=load_robot('equipment', 'bodywork');
%
% drawrobot3d(robot, q)
%
Expand All @@ -68,7 +68,7 @@


fprintf('\nNOW LOAD AUXILIAR EQUIPMENT')
robot.equipment=load_robot('equipment', 'bodywork');
robot.equipment{1}=load_robot('equipment', 'bodywork');

fprintf('\nNOW LOAD A GRIPPER')
robot.tool=load_robot('equipment/end_tools', 'spot_welding');
Expand Down
Loading

0 comments on commit 824c6ae

Please sign in to comment.