<< Prev        Next >>

ID : 7232

HandEyeInitPos

Function

The robot initial posture which has been set for EVP at the shipment is returned.

Syntax

HandEyeInitPos ()

Return Value

The robot initial posture which has been set for EVP at the shipment is returned by Position type data.

Description

When EVP is used with other than COBOTTA, in general, a camera is installed and fixed in a different position from the robot position. When EVP is used with COBOTTA, a camera is mounted near the tool end of COBOTTA; therefore COBOTTA needs to take snapshots with the same posture at any time.

If COBOTTA is purchased with AF camera (N10-W02) as a set, the COBOTTA and AF camera (N10-W02) are calibrated with the following posture and recorded the result before the shipment.

This command returns that posture data. To use EVP, move your robot to the posture that is obtained with this command execution, and then take snapshots.

The axis of COBOTTA

angle(Degree)
1

0

2

0

3

90

4 0
5 90
6 Arbitrary

Attention

  • This command is used in EVP execution and is available only when COBOTTA and AF camera (N10-W02) are purchased together.
  • When using COBOTTA Ver. 2.7.* or higher and EVP Ver. 1.3.1 or higher, if [Use the Hand-eye calibration data in COBOTTA] is enabled in EVP guidance, do not use this command. Refer to the sample in the Appendix 1 of "EVP User Guide".

Example

!TITLE "PlainHandEyeEVP"

' Approach distance 100mm
' Depart distance  100mm

' Position to place a workpiece      P[PlaceNumber]

' With EVPRun, take snapshots, process image data, read  workpiece position,
'              and then set these values into the following data.
' The number of detected workpieces  I[NumberOfWorks]
' Position of detected workpieces    P[WorkPlaceNumber], P[WorkPlaceNumber +1], ... ,
'                                    P[WorkPlaceNumber + the number of detected workpieces -1]
' The type of detected workpieces    I[WorkTypeNumber], I[WorkTypeNumber +1], ... , 
'                                    I[WorkTypeNumber + the number of detected workpieces -1]

' Flow of program
' Move to HandEyeInitPos()
'  -> Making snapshots & processing images.
'  -> Moving between the position of detected workpiece and P[PlaceNumber] repeatedly. 
'        (Repeat the motion up to the number of detected workpieces)
'  -> Move to HandEyeInitPos()

'------------Setting-------------

' EVP project file name
#Define EVPProjectFileName "project.evp"

' Height from the workpiece (safety margin for test run) [mm]
#Define WorkHeight 20

' P-type variable number of the robot position at the image acquisition.
#Define RobotImageAquisitionNumber 0

'P-type variable number of the place position.
#Define PlaceNumber 1

'I-type variable number of the number of detected workpieces.
#Define NumberOfWorks 0

'The start number among P-type variable numbers to store detected workpiece positions.
#Define WorkPlaceNumber 10

'The start number among I-type variable numbers to store the detected workpiece types.
#Define WorkTypeNumber 10

'-----------------------------

#Include "Variant.h"
Dim ctrl as Object

Sub Main
  Dim index As Long

  TakeArm Keep = 0

  ' EVP initial setting (selecting an EVP project file)
  EVPInitialize EVPProjectFileName
  
  ' Posture at the calibration 
  Dim initPos as Position
  initPos = HandEyeInitPos()
  
  Move P, initPos
  
  ' Taking snapshots & image processing& acquiring workpieces
  EVPRun
  
  'Repeat this operation to the number of detected workpieces.
  For index = 0 To I[NumberOfWorks] - 1
    
    '------- Move to the detected workpiece position -------------------------
    'Approach motion.  Move to 100mm above of P[10 + index].
    Approach P, P[WorkPlaceNumber + index], @0 100
    'Descending motion.  Go down to P[10 + index].
    Move L, @C P[WorkPlaceNumber + index] 
    'Write gripping or releasing motion here, if necessary.
    Delay 500
    'Ascending motion.  100mm
    Depart L, @0 100
    
    '------- Robot motion at the place position  -------------------------
    'Approach motion.  Move to 100mm above of P[1] position.
    Approach P, P[PlaceNumber], @0 100
    ' Descending motion.  Go down to P[1].
    Move L, @C P[PlaceNumber] 
    'Write gripping or releasing motion here, if necessary.
    Delay 500
    ' Ascending motion    100mm
    Depart L, @0 100
    
  Next
  
  'Move to the robot position where snapshots have been taken.
  Move P, initPos
  
End Sub

Sub EVPInitialize (EVPProjectFile as string)
  ctrl = Cao.AddController("Runner", "CaoProv.DENSO.EVP", "",_
         "project=" & EVPProjectFile)
End Sub

Sub EVPRun

  Dim index As Long
  Dim ReturnValue As Variant
  Dim vntWorks As Variant
  Dim vntWork As Variant

  ' Taking snapshots & image processing
  ' =======================================
  ' Detailed information : Specifications of the return value of Run command
  ' Return value of Run Command.
  ' result <VT_VARIANT | VT_ARRAY> =
  '     Work Count    ... <VT_I4>
  '     Work Datas    ... <Work Data | VT_ARRAY>
  '     Work Data     ... <VT_VARIANT | VT_ARRAY>
  '                        (classId, P(x, y, z, rx, ry, rz, fig))
  '     Feeder Action	... <VT_I4>
  ' =======================================
  ReturnValue = ctrl.Run()

  'Store the number of detected workpieces into I[0].
  I[NumberOfWorks] = ReturnValue( 0 )

  ' Store the workpiece position into P[10], P[11], ..., P[10+the number of detected workpieces-1].
  vntWorks = ReturnValue( 1 )
  For index = 0 To I[NumberOfWorks] - 1
    vntWork = vntWorks(index)

    'Read the workpiece position
    P[WorkPlaceNumber + index] = vntWork( 1 )

    'Store the height of workpieces to P[10], P[11], ..., P[10+the number of detected workpieces-1].
    LetZ P[WorkPlaceNumber + index] = PosZ(P[WorkPlaceNumber + index]) + WorkHeight
  Next
End Sub

ID : 7232

<< Prev        Next >>