vs_result()
Features
This function retrieves the processing result of the vision system.
(*VS_TYPE: DR_VS_CUSTOM)
Return
Value | Description |
---|---|
cnt (>=1) | Success The number of objects detected by the vision system |
result | Position list as a result of the vision system (x coordinate, y coordinate, rotation value) |
- | cnt =-2 and res = empty list if failed |
Example
vs_set_info(DR_VS_CUSTOM)
res = vs_connect("192.168.137.200", 9999) #Vision and communication connection attempt
if res !=0: #Check the result of communication connection
tp_popup("connection fail",DR_PM_MESSAGE) #If connection fails, program ends
exit()
ret = vs_request(1) #Request for object vision measurement information
cnt, result = vs_result() # Get object measurement result information
for i in range(cnt):
x = result[i][0]
y = result[i][1]
t = result[i][2]
tp_popup("x={0},y={1}, t={2}".format(result[i][0], result[i][1], result[i][2]),DR_PM_MESSAGE)