Control the most compact compound robot to do intelligent sorting project

A project log for myAGV a robotic platform

The highest cost-performance mobile robotic platform for individual developers.

Elephant Robotics - Robotic ArmsElephant Robotics - Robotic Arms 09/23/2022 at 09:190 Comments


Our theme is to break the distance limit of the collaborative robotic arm and connect it with the mobile robot (myAGV) to realize a case.
The two devices we are going to use today are:
1 mechArm 270-M5Stack:
mechArm 270-M5Stack is the most compact six-axis robotic arm with an industrial-like configuration launched by Elephant Robotics. It's tough but reliable for its centrosymmetric structure, and its effectiveness enables users to increase programming efficiency with reliability.
myAGV is the first mobile robot of Elephant Robotics. It adopts competition-grade Mecanum wheels and fully wraps the metal frame. The ROS development platform has two built-in slam algorithms ta o meet the learning of mapping and navigation directions. It provides rich expansion interfaces and can be equipped with robotic arms(myCobot280,mechArm270,myPalletizer260).


What we want to achieve today is the case of the combination of mechArm270-M5Stack and myAGV as a compound robot by controlling the myAGV to move to the designated position and then controlling the mechArm270 M5Stack to grab the wooden block myAGV and move it to the designated position.



To bring two robots together, they must first be connected. There are two ways to establish the connection:
● Wireless connection (TCP/IP)
Let myAGV establish contact through the IP address of the mechArm 270-M5Stack. First, set them in the same WiFi network environment, and obtain the IP address of the mechArm 270 M5Stack. When the team designed the M5Stack Basic, Elephant Robot designed the function of displaying the IP address, which can quickly obtain the IP address. (Port defaults to 9000)
Briefly introduce the socket method: a function used to establish communication in python, which can send information to each other.
The elephant robot has an open source library, pymycobot, which encapsulates a MyCobotSocket() method, similar to the socket method, to send instructions to the robotic arm.

from pymycobot import MyCobotSocket
# MyCobotSocket(ip,port) port defaults to 9000
mc = MyCobotSocket("","9000")

#After the normal connection, you can send commands to the robot arm, such as returning the robot arm to the origin.
#Get the angle information of the current robotic arm.
res = mc.get_angles()

● Wired connection
The wired connection is relatively easy. Plug in a type-C data cable to connect to myAGV, then we can control the robotic arm.
Note: After connecting, because of the rules of the Ubuntu system, we need to grant permissions to the robotic arm's serial port to operate normally. Type in the terminal

sudo chmod 777 /dev/tty***(***refers to the serial port number of the robotic arm)



Let myAGV move
Once connected, we can start controlling this compound robot.
In the movement of myAGV, the elephant robotics provides two control methods: keyboard control and PS2 handler control.
The ROS language controls it. (below is how to do it)
Keyboard control:
Start Node:

Enter the command in the terminal.

roslaunch myagv_odometry myagv_active.launch


Open the keyboard control interface
Enter the command in the terminal.

roslaunch myagv_teleop myagv_teleop.launch

Press the corresponding button on the keyboard to make myAGV move.
myAGV uses a Mecanum wheel that can move in all directions and an IMU for positioning compensation. It can be turned around on the spot, and the control is very easy.
PS2 handler control:
The first step is to start the node, and the second control program is to open the PS2 handler.
Enter the command in the terminal.

roslaunch myagv_ps2 myagv_ps2.launch

After running, can freely control myAGV through the PS2 handler.
Implementation of the case
Grab the block with the robotic arm and put it into the corresponding bucket.
Combining the control of the mobile robot and the control of the robotic arm, this project can be realized.
First, start the mobile control of myAGV with either keyboard control or PS2 handler control. I choose PS2 handler control here. Move the robotic arm in front of the small piece of wood, send code to mechArm to control its movement, and control the gripper to grab the piece of wood. It is placed in the corresponding location.
Code for mechArm:

from pymycobot import MyCobotSocket

mc = MyCobotSocket("","9000")

mc.set_gripper_state(0, 80)
mc.set_gripper_state(0, 80)



I don't know what you think about this case, if you have any ideas or opinions, please leave a message below! I'll take interesting suggestions to try!
More information:
Home | Elephantrobotics
Gitbook | Elephantrobotics
GitHub| Open-Source