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 280 M5 is used as an example for explanation.
Make sure that M5Stack-basic and Atom are both burnt before using.
- 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 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 2 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
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.py file, MycobotServer, based on your model.
The default model is the 320 PI.
The default parameters are:
serial_num: /dev/ttyUSB
baud: 115200
from pymycobot import MyCobotSocket
# Use port 9000 by default
# Where "192.168.10.22" is the IP of the robot arm
mc = MyCobotSocket("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)
...