Commit e8db18fb authored by Sam Calisch's avatar Sam Calisch

looping trajectory logggn

parent c979ad7a
...@@ -2,6 +2,7 @@ import socket ...@@ -2,6 +2,7 @@ import socket
import time import time
import struct import struct
from sys import stdout from sys import stdout
from UR10 import *
#Sam Calisch, 2015 #Sam Calisch, 2015
#Center for Bits and Atoms, MIT #Center for Bits and Atoms, MIT
...@@ -73,7 +74,8 @@ values = '>I'+85*'d'+'q'+44*'d' ...@@ -73,7 +74,8 @@ values = '>I'+85*'d'+'q'+44*'d'
struct = struct.Struct(values) struct = struct.Struct(values)
last = time.time() last = time.time()
f = open('trajectory-logging.txt','w') f = open('trajectory-logging.txt','w')
f.write('hello')
def log_dev(packet): def log_dev(packet):
#print "\033[2J" #print "\033[2J"
#print "\033[H" #print "\033[H"
...@@ -81,6 +83,9 @@ def log_dev(packet): ...@@ -81,6 +83,9 @@ def log_dev(packet):
msg = (packet[1],) + tuple(packet[56:62]) + tuple(packet[62:68]) + tuple(packet[74:80]) + tuple(packet[80:86]) + tuple(packet[109:112]) msg = (packet[1],) + tuple(packet[56:62]) + tuple(packet[62:68]) + tuple(packet[74:80]) + tuple(packet[80:86]) + tuple(packet[109:112])
f.write( ("%f,"*(1+4*6+3)+"\n")%msg) f.write( ("%f,"*(1+4*6+3)+"\n")%msg)
roy = UR10("Roy","192.168.1.52")
roy.stream_script('accel_test.script')
try: try:
while(True): while(True):
data = s.recv(1044) data = s.recv(1044)
......
This diff is collapsed.
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