Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/env python
- import serial
- from socket import socket, AF_INET, SOCK_STREAM
- if __name__ == "__main__":
- sock = socket(AF_INET, SOCK_STREAM)
- sock.connect(('localhost',9090))
- sock.send('raw\r\n\r\n');
- port = serial.Serial('/dev/ttyACM0', 9600, timeout=1)
- line = port.readline() #skip the junk
- while True:
- line = port.readline()
- if line:
- usecs = int(line)
- sock.send('\x00{"receiver":"\/echoTime","msg":{"data":%d},"type":"std_msgs\/Int64"}\xff/' % (usecs,))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement