Skip to content

Commit f2e1e29

Browse files
committed
Separate network connection and serial connection
1 parent a3186fb commit f2e1e29

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pymycobot/mycobotsocket.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,24 @@ class MyCobotSocket(MyCobotCommandGenerator):
4848
_write = write
4949
_read = read
5050

51-
def __init__(self, ip, netport, serialport="/dev/ttyAMA0", baudrate="1000000", timeout='0.1'):
51+
def __init__(self, ip, netport):
5252
"""
5353
Args:
54-
port : port string
55-
baudrate : baud rate string, default '115200'
56-
timeout : default 0.1
57-
debug : whether show debug info
54+
ip: Server ip
55+
netport: Server port
5856
"""
5957
super(MyCobotSocket, self).__init__()
6058
self.calibration_parameters = calibration_parameters
6159
self.SERVER_IP = ip
6260
self.SERVER_PORT = 9000
63-
self.sock = self.connect()
61+
self.sock = self.connect_socket()
62+
63+
def connect(self, serialport="/dev/ttyAMA0", baudrate="1000000", timeout='0.1'):
6464
self._write(serialport, "socket")
6565
self._write(baudrate, "socket")
6666
self._write(timeout, "socket")
6767

68-
def connect(self):
68+
def connect_socket(self):
6969
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
7070
sock.connect((self.SERVER_IP, self.SERVER_PORT))
7171
return sock

0 commit comments

Comments
 (0)