I need help rotating an axis for the integrated vision system.

My robot detects and sends the coordinates to rapid but the axis of how it moves are rotated. If the detected point is on the left it moves up and if its on the right it moves down same with if its up or down it goes left and right. But im not sure whats rotated. The work object when its declared or the camera calibration. Is there any way to manually rotate it if not? help would be greatly appreciated thank you very much.

Answers

  • Yes, you can "Manually rotate" the workobject to match the camera. What this sounds like is the camera coordinate system was taught differently than the robot work object. I would recommend redoing the calibration and verifyinig that the camera and workobject x axis and Y axis point in the same direction.

    The code below will rotate the camera workobject about its z axis of the user frame. Please make sure when you taught the camera workobject that you taught the user frame, not the object frame.

    MODULE DemoMod
    PERS wobjdata CameraWorkobject:=[FALSE, TRUE, "",[[100, 220, 150],[.707104, 0, 0, .707104]],[[0,0,0],[1,0,0,0]]];

    PROC Rotateworkobjectby90()
    VAR pose TempOffsetPose:=[[0,0,0],[.707104,0,0,.707104]];
    CameraWorkobject.uframe:=PoseMult(CameraWorkobject.uframe,TempOffsetPose);
    ENDPROC
    ENDMODULE