发送控制指令控制机器人
以Movel指令为例:
import socket
HOST = "192.168.2.23" # The remote host
PORT = 30003 # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
strL = b"movel(p[-0.143,-0.435,0.200,0.001,-3.166,-0.04],a=0.5,v=0.3)\n"
s.send(strL)
s.close()
需要注意的是,send发送的指令需要为bytes型的,而不是直接的str型,所以加上‘b’