2.12.4 2.12.3 2.12.2 2.12.1 2.12 2.11.2 2.11.0.1 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish
2.12.4 2.12.3 2.12.2 2.12.1 2.12 2.11.2 2.11.0.1 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish

Integrated example - DR_VS_COGNEX, DR_VS_SICK

Example

Python
vs_set_info(DR_VS_COGNEX)                     # Select type of vision sensor
if ( vs_connect("192.168.137.10") != 0 ):           # Vision IP, Default port
   tp_popup("connection fail",DR_PM_MESSAGE)   
   exit() 

vis_posx_init = posx (410,310,300,0,0,0)           # Define the initial posx data - vision
rob_posx_init1 = posx (400,300,300,0,180,0)       # Define the initial posx data - robot
rob_posx_init2 = posx (420,320,300,0,180,0)       # Define the initial posx data - robot

vs_set_init_pos(vis_posx_init, rob_posx_init1, VS_POS1) # Enter the initial posx data to Vision 
vs_set_init_pos(vis_posx_init, rob_posx_init2, VS_POS2)

for i in range(10):
   pos_meas, var_list = vs_trigger()       # Execute the vision meausrement 
   if pos_meas==-1:                   # Vision Fail to measure the object
       tp_popup("Vision measure fail")
       continue
   if var_list[0] == 1:                    # Check the inspection result
       # Get guided posx data
       rob_posx1_meas = vs_get_offset_pos(pos_meas, VS_POS1) # offset the robot pose 
       rob_posx2_meas = vs_get_offset_pos(pos_meas, VS_POS2) # offset the robot pose
       movel(rob_posx1_meas)
       movel(rob_posx2_meas)
   else:
       tp_popup("Inspection Fail")
       continue

vs_disconnect()