typora-root-url |
---|
./picture |
Chinese version of the README -> please click here
Dobot TCP-IP-4Axis-Python-CMD secondary development API interface ( TCP-IP-MG400-Python English README )
MG400Robot is a software development kit designed by Dobot based on the ROS of TCP/IP protocol. It is developed based on ROS language, follows the Dobot-TCP-IP control communication protocol, connects to the device terminal via socket, and provides users with an easy-to-use API interface. Through MG400 robot, users can quickly connect to the Dobot device and carry out secondary development to control and use the device.
-
You can connect your computer to the network interface of the controller with a network cable, and then set the fixed IP to be in the same network segment as the controller IP. You can also connect your computer to the controller via wireless connection.
When connected to LAN1 via wired connection: IP: 192.168.1.6; When connected to LAN2 via wired connection: IP: 192.168.2.6; Wireless connection: IP: 192.168.9.1
-
Try pinging the controller IP to make sure it is under the same network segment.
-
This API interface and Demo are applicable to V1.5.6.0 and above controller version of MG400/M1Pro series
Version | Date |
---|---|
V1.0.0.0 | 2024-03-06 |
If you have any questions or suggestions, you can contact Dobot's technical support:
- Send an email to futingxing@dobot-robots.com with a detailed description of the problem you are experiencing and the scenario in which you are using it.
- Send an email to wuyongfeng@dobot-robots.com with a detailed description of the problem you are experiencing and the scenario in which you are using it.
As the communication based on TCP/IP has high reliability, strong practicability and high performance with low cost, many industrial automation projects have a wide demand for controlling robots based on TCP/IP protocol. Therefore, the MG400/M1Pro robot is designed to provide rich interfaces for interaction with external devices based on the TCP/IP protocol. For more details, see TCP_IP Remote Control Interface Guide (4axis).
-
Obtain the secondary development API program of Dobot TCP-IP-4Axis-Python-CMD from GitHub.
git clone https://github.com/Dobot-Arm/MG400_ROS.git
-
Refer to the corresponding README.md file for use.
Problem 1: TCP connection. Port 29999/30003 cannot be connected or cannot deliver commands after connecting.
Solution: If the controller version is below V1.6.0.0, you can try to upgrade the controller to V1.6.0.0 or above. If the controller version is already V1.6.0.0 or above, you can feedback the problem to technical support.
Problem 2: During TCP connection, the commands can be delivered via port 29999, but the commands cannot be delivered via port 30003.
Solution: If motion queue is blocked, you can try to reopen the queue by delivering clearerror() and continue() commands via port 29999.
Problem 3: How to judge whether the Robot motion command is in place or not
Solution: It can be judged by delivering a sync command; It can be judged by comparing the Cartesian coordinates of the target point with the actual Cartesian coordinates of the Robot.
cd $HOME/catkin_ws/src
git clone https://github.com/Dobot-Arm/MG400_ROS.git
cd $HOME/catkin_ws
catkin_make
source $HOME/catkin_ws/devel/setup.bash
-
roslaunch mg400_description display.launch
You can adjust the angle of each joint via joint_state_publisher and see it displayed on rviz.
-
Use the following command to connect to the robot, robot_ip is the IP address of the actual robot.
roslaunch bringup bringup.launch robot_ip:=192.168.1.6
The bringup defines msgs and srvs, and you can use these underlying msgs and srvs to control the robot.
- Dobot-Demo realizes TCP control of the robot and other interactions. It connects to the control port, motion port, and feedback port of the robot respectively. It delivers motion commands to robot, and handles the abnormal status of the robot, etc.
- Main thread: Connect to the control port, motion port, and feedback port of the robot respectively. Enable the robot.
- Feedback status thread: Real-time feedback of robot status information.
- Robot motion thread: Deliver motion commands to Robot
- Exception handling thread: Judge and handle the abnormal status of the robot
Steps to run the Demo:
-
Obtain the secondary development API program of Dobot MG400Robot from GitHub.
git clone https://github.com/Dobot-Arm/MG400_ROS.git
-
Connect to the robot via LAN1 interface, and set the local IP address to 192.168.1.X
Control Panel >> Network and Internet >> Network Connections
Select the connected Ethernet >> Right click >> Properties >> Internet Protocol Version (TCP/IPV4)
Modify the IP address to 192.168.1.X
-
Open the DobotStudio Pro, connect to the robot, and set the robot mode to TCP/IP secondary development.
-
Run the program, making sure that the source code has been downloaded and compiled in hardware. Steps:
cd $HOME/catkin_ws/src
git clone https://github.com/Dobot-Arm/MG400_ROS.git
cd $HOME/catkin_ws
catkin_make
source $HOME/catkin_ws/devel/setup.bash
roslaunch bringup bringup
cd $HOME/catkin_ws
source $HOME/catkin_ws/devel/setup.bash
run rosdemo rosdemo
Common problem
Problem 1: Cartesian coordinates of different models (MG400/M1pro) in Demo
Solution: Confirm the Cartesian coordinates of the model and modify the coordinates in Demo.
Make sure the robot is in a safe position before running the Demo to prevent unnecessary collisions.