
Vision System

gforkner
✭
I am trying to implement a robot mounted Cognex vision system. The problem I am having is, because of the locations of the parts I am checking, axis 6 has to rotate to various angles. All I need is the x, y component, but because of the rotation, the coordinate system isn't the same as the work object. This is what I'm doing to convert the camera point, but I cant get it to convert to the new work object:
PROC rCNV_Point(INOUT robtarget point,PERS tooldata told,PERS tooldata tnew,PERS wobjdata wold,PERS wobjdata wnew)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!! This converts a point from one workobject to another workobject..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
VAR pose ppnt:=[[0,0,0],[1,0,0,0]];
VAR pose ppntnew:=[[0,0,0],[1,0,0,0]];
VAR pose pb:=[[0,0,0],[1,0,0,0]];
VAR pose pa:=[[0,0,0],[1,0,0,0]];
VAR jointtarget jP1:=[[0,0,0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
!Move Information
ppnt.trans:=point.trans;
ppnt.rot:=point.rot;
!Calculate Conversion Info.
ppntnew:=PoseMult(PoseMult(wold.uframe,wold.oframe),ppnt);
ppntnew:=PoseMult(PoseInv(PoseMult(wnew.uframe,wnew.oframe)),ppntnew);
!Convert Data.
ppntnew:=PoseMult(pa,pb);
!Overwrite Point.
point.trans:=ppntnew.trans;
point.rot:=ppntnew.rot;
I can verify that the first Pose shifts the point to WOBJ0, but i cant get it to shift to the new work object.
Thoughts??
0
Categories
- All Categories
- 5.5K RobotStudio
- 398 UpFeed
- 19 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 323 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 812 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings