BlinkenArea - GitList
Repositories
Blog
Wiki
stage_director
Code
Commits
Branches
Tags
Search
Tree:
473c70e
Branches
Tags
master
stage_director
posy_packet.py
small script to send PoSy packet for debugging
Stefan Schuermans
commited
473c70e
at 2018-09-30 16:32:04
posy_packet.py
Blame
History
Raw
#! /usr/bin/python3 import socket import struct import sys import time dest = ("127.0.0.1", 5740) name = "name_H23_X42" pos = 0.0 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.connect(dest) flags = 0 name_b = name.encode("utf-8") while True: pos_ms = round(pos * 1000) data = b"PoSy" + struct.pack("!I64sI", flags, name_b, pos_ms) sock.send(data) pos += 1.0 time.sleep(1) sock.close()