Commit be12923c authored by Sam Calisch's avatar Sam Calisch

added some outdated stuff

parent 8edad989
......@@ -41,7 +41,7 @@ class UR10(object):
self.ip = ip
self.last_packet_time = 0
self.socket_opened = False
self.tool_vector = 0
self.tool_vector = []
def open_socket(self,port):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.connect((self.ip, port))
......
from UR10 import *
from numpy import *
#Sam Calisch, 2015
#Center for Bits and Atoms, MIT
siegfried = UR10("Siegfried","192.168.1.51")
siegfried.stream_script('weld_test_roller.script')
import numpy as np
import cv2
from UR10 import *
roy = UR10("Roy","192.168.1.52")
roy.open_socket(30002)
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
h,w,d = np.shape(frame)
while(True):
ret, frame = cap.read()
roy.read_packet_secondary()
# Our operations on the frame come here
#gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
tv = roy.tool_vector
if len(tv):
cv2.putText(frame,"%.4f, %.4f, %.4f"%tuple(tv[:3]),(0,h-40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0,255,0),2)
cv2.putText(frame,"%.4f, %.4f, %.4f"%tuple(tv)[3:],(0,h-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0,0,255),2)
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment