13 parser = argparse.ArgumentParser(
"start_test_publisher")
15 parser.add_argument(
"--topic|-t",
17 help=
"Topic on which messages will be published",
21 args = parser.parse_args()
26 context = zmq.Context()
27 server_socket = context.socket(zmq.PUB)
28 server_socket.bind(
"tcp://*:" + str(PORT))
35 "cos": math.cos(ticks),
36 "sin": math.sin(ticks),
37 "floor": np.floor(np.cos(ticks)),
38 "ceil": np.ceil(np.cos(ticks))
43 print(f
"[{topic}] - " + json.dumps(data))
44 server_socket.send_multipart(
45 [topic.encode(), json.dumps(data).encode()])
47 print(json.dumps(data))
48 server_socket.send(json.dumps(data).encode())
55 if __name__ ==
'__main__':