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

vs_get_offset_pos()

정의

vs_get_offset_pos(vision_posx_meas, vs_pos=1)

기능

비전 시스템에서 측정된 좌표값을 이용하여 옵셋(가이드)된 로봇작업 좌표를 산출한다.

사전에 vs_set_init_pos를 통해 초기값이 입력되어 있어야 한다.

인수

인수명

자료형

기본값

설명

vision_posx_meas

posx

-

vs_trigger를 이용하여 얻어진 비전측정 좌표값

vs_pos

int

1

옵셋 좌표를 계산할 로봇 초기값 pos 번호

리턴

값

자료형

설명

robot_posx_meas

posx

성공

-1

int

실패

예제

Python
vs_set_info(DR_VS_COGNEX)             # Select type of vision sensor
vs_connect("192.168.137.10")             # Vision IP, Default port
 
vis_posx = posx (410,310,300,0,0,0)            # Define the initial posx data - vision
rob_posx = posx (400,300,300,0,180,0)     # Define the initial posx data - robot
 
vs_set_init_pos(vis_posx, rob_posx, VS_POS1) # Enter the initial posx data to Vision
 
for i in range(10):
   pos, var_list = vs_trigger()               # Execute the vision meausrement
   if var_list[0] == 1:                      # Check the inspection result
       robot_posx_meas = vs_get_offset_pos(pos, VS_POS1) # offset the robot pose
       movel(robot_posx_meas)           # move the robot pose
   else:
       tp_popup("Inspection Fail")
 
vs_disconnect()

Keyword

vs / vs_get / offset_pos / set_offset_pos