TCP/IP
TCP/IP, or Transmission Control Protocol/Internet Protocol, is one of the most fundemental communicative protocol on Internet, which stipulates the standard and methods of the Internet communication. Users can control robotic arms remotely through connecting with IP address instead of the USB port.
In this chapter, myCobot 320 PI is used as an example for explanation.
Make sure that M5Stack-basic and Atom are both burnt before using.
Connection
1.4 Raspberry Pi Connections
- When using Raspberry Pi for remote connection, you need to pay attention to the following points
- The Raspberry Pi and the control end need to be on the same network
- The server file (change to Server_320.py) needs to be executed first in the Raspberry Pi (For specific operations, see the gif operation diagram)
- After the server file is executed, the prompt "Binding succeeded and waiting connect" indicates that the opening is successful, and the control terminal can refer to Simple Demo
specific operation is:
clone our project library:git clone https://github.com/elephantrobotics/pymycobot.git
find the Server.py file in the demo folder and execute it with python
Instructions for use:
Please update pymycobot to the latest version before use.
pip install pymycobot --upgrade
Please change the parameters passed in the last line of the Server_320.py file, Mycobot320Server, based on your model.
The default model is the 320 PI.
The default parameters are:
serial_num: /dev/ttyAMA0
baud: 115200
Simple Demo
from pymycobot import MyCobot320Socket
# Use port 9000 by default
# Where "192.168.10.22" is the IP of the robot arm
mc = MyCobot320Socket("192.168.10.22",9000)
#After the connections is normal, the robot arm can be controlled.
res = mc.get_angles()
print(res)
mc.send_angles([0,0,0,0,0,0],20)
...