The form of the message is:
["node_name", {"robot_name": [[x , y, z], [roll, pitch, yaw]]}]\n
(rotation order is 'XYZ' see doc)
$ telnet localhost 65000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
["telnet", {"cat": [[1, 2, 3], [0.1, 0.2, 0.4]]}]
python3
from pymorse import StreamJSON, PollThread
node_stream = StreamJSON('localhost', 65000)
poll_thread = PollThread()
poll_thread.start()
node_stream.publish(['py3', {'cat': [(1, 2, 3), (0.1, 0.2, 0.3)]}])
tcpobj = tcpip('localhost', 65000)
fopen(tcpobj)
fprintf(tcpobj, '["matlab", {"cat": [[1, 2, 3], [0.1, 0.2, 0.4]]}]\n')
fprintf(tcpobj, sprintf('["matlab", {"cat": [[%7.3f, %7.3f, %7.3f], [%7.3f, %7.3f, %7.3f]]}]\n', x, y, z, roll, pitch, yaw))
see: http://www.openrobots.org/morse/doc/latest/user/middlewares/socket.html
uncomment the Teleport actuator in the builder script
$ telnet localhost 60000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"x": 1, "y": 2, "z": 5, "roll": 0, "pitch": 0, "yaw": 6}
python3
from pymorse import Morse
sim = Morse()
sim.cat.teleport.publish({'x': 1, 'y': 2, 'z': 5, 'roll': 0, 'pitch': 0, 'yaw': 6})
tcpobj = tcpip('localhost', 60000)
fopen(tcpobj)
fprintf(tcpobj, '{"x": 1, "y": 2, "z": 4, "roll": 0, "pitch": 0, "yaw": 6}\n')
fprintf(tcpobj, sprintf('{"x": %7.3f, "y": %7.3f, "z": %7.3f, "roll": %7.3f, "pitch": %7.3f, "yaw": %7.3f}\n', x, y, z, roll, pitch, yaw))