Our theme is to break the distance limit of the collaborative robotic arm(mechArm) and connect it with the mobile robot (myAGV) to realize a case.
The two devices we are going to use today are:
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.
2. myAGV:
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.
DemoConnectionTo 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 Robotics has an open source library, pymycobot, which encapsulates a MyCobotSocket() method, similar to the socket method, to send instructions to the robotic arm.
Code:
from pymycobot import MyCobotSocket
# MyCobotSocket(ip,port) port defaults to 9000
mc = MyCobotSocket("192.168.10.22","9000")
#After the normal connection, you can send commands to the robot arm, such as returning the robot arm to the origin.
mc.send_angles([0,0,0,0,0,0],20)
#Get the angle information of the current robotic arm.
res = mc.get_angles()
print(res)
● 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 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 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 caseGrab 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 by 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("192.168.10.22","9000")
mc.send_angles([0,0,0,0,0,0],50)
time.sleep(2)
mc.send_angles([1.75,58.53,29.44,4.92,(-77.69),5.09],50)
time.sleep(2)
mc.send_angles([1.75,76.02,(-25.31),12.3,(-61.61),(-2.81)],50)
time.sleep(2)
mc.set_gripper_state(0, 80)
time.sleep(1)
mc.set_gripper_value(50,80)
time.sleep(1)
mc.send_angles([2.37,(-2.1),(-9.66),9.66,68.64,(-33.13)],50)
time.sleep(2)
mc.send_angles([2.81,48.77,(-10.1),2.63,(-55.72),(-30.32)],50)
time.sleep(1)
mc.set_gripper_state(0, 80)
I don't know what do you think about this case, if you have any ideas or opinions, please leave a message below! I'll take interesting suggestions to try!
Comments