image acquisition and robotstudio
kauzy
✭
in RobotStudio
Dear all,
I am doing my MSc project on the ABB IRB140 manipulator. The outline of my project is that the camera attached to the robot gripper will detect the position of the ball,pick it up and place it on the tray. I have done my image acquisition and processing in MATLAB. But I had some issues on integrating MATLAB with RobotStudio. Is there anything which can be done?
Thanking in anticipation.
Kind regards.
Kaustubh
0
Comments
-
I tried to save the co-ordinates given by MATLAB into .txt files. But I am unable to open these files in the RobotStudio. Any help guys.0
-
As far as i know u can only open files which have *.mod, *.sys or *.prg extension in RobotStudio.Of course your file must have correct syntax and headers.
%%%
VERSION:1
LANGUAGE:ENGLISH
%%%
MODULE ABC
.
.
.
ENDMODULE
What kinds of coordinates did u create at MATLAB?
Just x,y,z(posdata) or x,y,z+rotation(posedata)? I guess u can write a simple C# code to read those data from .txt file and create an executable RAPID file which have correct syntax for RobotStudio.
Erdem Karaçeper0 -
Hi,I do not have any experiance in this particular area but I have used the following to load data from files on the controller before.I am sure there are many other ways but this may get you started.In the *.mod file that is loaded you will need to put the robtartgets in the normal format ie:MODULE prog_dataPROC the_prog_data()p1:= [[2060.85,1096.91,1905.49],[8.79169E-007,0.99999,-0.00465967,-1.59443E-006],[-1,0,-2,0],[9E+009,9E+009,9E+009,9E+009,9E+009,9E+009]];ENDPROCENDMODULEAdd the following code to your RAPID program to load the data (you can read more about the commands in the RAPID manual):%%%VERSION:1LANGUAGE:ENGLISH%%%MODULE Load_DataVAR dir Directory;VAR string Filename;VAR string ShortFileName;VAR iodev PartFile;VAR num StepCount;VAR num NameLength;PROC load_the_data()!// Open the directory ready for loadingOpenDir Directory,"HOME:/Parts";StepCount:=1;WHILE ReadDir(Directory,Filename) DO!// This skips the first two files in the directory(. and ..)IF StepCount>2 THENLoad "Home/parts/"File:=FileName;!// to remove the.mod extentionNamelength:=StrLen(FileName);Namelength:=Namelength-4;ShortFileName:=StrPart(FileName,1,Namelength);%"the_" + ShortFileName%;UnLoad "Home/parts/"File:=FileName;ENDIFStepCount:= StepCount + 1;ENDWHILEClose PartFile;CloseDir Directory;TPwrite ValToStr(StepCount - 3) + " files loaded ";ENDPROCRegardsGraeme0
-
thnx guys for the replies.. I will try the codes mentioned by you.the text files contain the co-ordinates in x and y direction. I went through the RAPID manual. I found the "Open" command. but had some issues opening the .txt files. Always gave me some error. And since I am from Mechanical background, have no prior experience with C#. Maybe I should try using PickMaster 3.0
-
Hi,If you have only the x and y co-ordinates then you will need to put them in a pos type variable (instead of the robtarget as in the example), or you could use num type to store each part separately then in RAPID put them into the RobTarget.You can find out more information in the Instruction, Functions & Data Types manualRegardsGraeme0
-
Hi,Thank you for the reply. The thing is that the robot should automatically identify the targets. So the position of X and Y will change with every object. So is there any way by which it can update the position with each target?Also, I tried working with the program you provided. It gave me an error which said "missing RAPID symbol". I am trying to locate which symbol exactly is missing.0
-
Hi,Sorry missed the ENDMODULE off the end when I copied it.If your vision system can out put the x,y data in the correct file format and save it automatically, then you can load the data with the code supplied when required in the robot program (probably just before moving to pick up the item).RegardsGraeme0
-
Hi Graeme,thanks for the reply again. what are the suggested file formats? because then I have to work on how to save them. And I just noticed ur tag as "Pickmaster and service". Do you think using PickMaster 3 would be suitable for this purpose?Apologies for the inconvenience.0
-
Hi,You would need to do some programing work to use a external vision source with PickMaster (as standard it uses cognex vision acuisition and processing with a Gig E camera).Use a standard text file but with .mod instead of .txt file extension.You need to have the module and procedure decrelations, then list your x and y co-ordinates. For example:MODULE Load_dataPROC Load_the_data()X1 :=123;Y1 := 456;etcENDPROCENDMODULEThe variables x1, y1, etc must already be declared (as num) in the RAPID program, they will get assigned the values from the file when you load it.RegardsGraeme0
-
Hi,I used the LOAD command to load the mod file saved in HOME directory of the controller. But it is giving me certain error."The source file to be loaded contains RAPID syntax errors. Correct the source file"0
-
Hi,Send me the file and I will have a look.CheersGraeme0
-
Hi,Attached is sample pack&go (and seperate modules in case of problems) for those that are interested.
0 -
Is there any way of setting up a user coordinate system? because it is getting really difficult for me to give the offsets.For example,the origin of my workspace is 450,0,280is this the right way of doing it?PERS wobjdata wobj1 :=[ FALSE, TRUE, "", [ [450, 0, 280], [1, 0,0 ,0] ], [ [0, 0, 0], [1, 0, 0 ,0] ] ];sorry for asking too much.0
-
ok.. figured it out.. thnx..0
-
i am trying to separate out the objects wrt their colors. For eg. red one will be saved as 1 in col.modnow i have to pick it up and place in the respective colored tray. I defined col.mod asPERS num color;now, I am trying to use the IF and ELSE if commands. But, the problem is robot never goes to the process. It loops till the previous one.if (color = 1) thenMoveJ Target_30,v100,z50,tool0WObj:=wobj1;elseif....endifam I going somewhere wrong??
kauzy2010-08-06 00:28:390 -
Done.. just had to define some variables.I had another small query though. The files that have been processed in MATLAB are being stored on the PC. And for making the robot follow them, I have to manually transfer those files using "file transfer" option in the Online tab. Is there any way I can automatically transfer the files? and since I come from mechanical background, I am not acquainted with .net language. So other than working in the SDK, is there any other method which can help me do this?thanks for the help.0
-
any help guys??0
-
hello , i am trying to write and read a txt file into my rapid program, can somebody help me in that it shows no errors but i dont know where it is saved or how it is read by rapidthis is my code:ROC write_to_file()VAR iodev file;!Open "HOME:/file.doc", infile\Read;!reg1 := ReadNum(infile);VAR num number:= 8;Open "Desktop:/SAJJ.TXT", file \Read;Write file, "The number is :"\Num:=number;Close file;ENDPROCPROC read_from_file()VAR iodev file;VAR num number;VAR string text;Open "Desktop:/SAJJ.TXT", file \Read;TPWrite ReadStr(file);Rewind file;text := ReadStr(file\Delim:=":");number := ReadNum(file);Close file;TPWrite text \Num:=number;ENDPROC0
-
Hi,
You can use TCP/IP communication between yor PC -MATALAB as Server and robot as client and the send the coordinates to Robot.
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings