Imagine having a robotic arm that can perform grasping and manipulation tasks at a fixed position or on a tabletop, and a mobile AGV capable of transporting objects across the ground. Individually, their functionality is limited. However, when these two components are combined, they unlock new application scenarios, enhancing the robot's flexibility and automation capabilities.
In this article, I will demonstrate how to combine the myCobot 280 Pi robotic arm with the myAGV Pi mobile AGV to create a powerful compound robot. By following my steps, you will learn how to progress from hardware assembly to programming control, ultimately building a practical intelligent system that integrates a robotic arm with a mobile platform.
PreparationHardware:● Keyboard
● Mouse
● Monitor
● myAGV Pi and accessories (e.g., controller, charging cable, etc.)
● myCobot 280 Pi
Software:● pymycobot (latest version)
● ROS (ensure the latest ROS packages are installed)
Note: The Raspberry Pi system in myCobot 280 Pi comes with a basic environment pre-installed. You only need to update pymycobot and the ROS packages to their latest versions.
Control of the Robotic ArmThe myCobot 280 Pi comes with a pre-installed Ubuntu system, and its control is typically achieved using the pymycobot library in a Python environment. Below is a summary of how to control the myCobot 280 Pi using Python.
Function:
`send_angles(degrees, speed)`
Purpose:
Send target angles to all joints of the robotic arm.
Parameters:
`degrees`: (List[float]) A list containing the angles for all joints, e.g., `[20, 20, 20, 20, 20, 20]`.
`speed`: (int) The movement speed of the robotic arm, ranging from `0` to `100`.
Return Value:
`1`
2. Coordinate ControlFunction:
`send_coords(coords, speed, mode)`
Purpose:
Move the robotic arm’s end-effector to a specific position and orientation in space.
Parameters:
`coords`: (List[float]) A list of six coordinate values representing `[x, y, z, rx, ry, rz]`.
`speed`: (int) The movement speed of the robotic arm, ranging from `0` to `100`.
`mode`: (int) Determines the movement path:
`0`: Non-linear (random planning) path. The end-effector moves to the target point, maintaining the specified posture.
`1`: Linear path. The end-effector moves in a straight line to the target point using intelligent planning.
Return Value:
`1`
3. Delayed ExecutionFunction:
`time.sleep(t)`
Purpose:
Pause the execution for `t` seconds before proceeding to the next command.
4. Gripper ControlFunction:
`set_gripper_value(value, speed, gripper_type=None)`
Purpose:
Rotate the gripper to a specified position at a given speed.
Parameters:
`value`: (int) Target position for the gripper, ranging from `0` to `256`.
`speed`: (int) Speed of gripper movement, ranging from `0` to `100`.
`gripper_type`: (int, optional) Specifies the gripper type:
`1`: Adaptive gripper (default).
`3`: Parallel gripper.
`4`: Flexible gripper.
Return Value:
`1`
Example Codefrom pymycobot.mycobot280 import MyCobot280
import time
# Initialize myCobot 280 Pi
mc = MyCobot280("/dev/ttyAMA0", 1000000)
# Retrieve and print the current coordinates of the end-effector
coords = mc.get_coords()
print(coords)
# Move the end-effector to specific coordinates with linear movement
mc.send_coords([57.0, -107.4, 316.3, -93.81, -12.71, -163.49], 80, 1)
time.sleep(1.5)
# Move the end-effector to another set of coordinates
mc.send_coords([-13.7, -107.5, 223.9, 165.52, -75.41, -73.52], 80, 1)
time.sleep(1.5)
# Adjust a single coordinate with speed 70
mc.send_coord(1, -40, 70)
Notes:● Ensure that the arm’s workspace and environment are clear of obstructions before running the script.
● Always set an appropriate speed to prevent abrupt movements that may damage the hardware.
Control of the AGVThe myAGV 2023 Pi, developed by Elephant Robotics, is a mobile robot designed for research, education, and personal makers. It features the Raspberry Pi 4B core motherboard and runs a customized Ubuntu Mate 20.04 operating system, ensuring smooth and user-friendly operation.
● Equipped with the Raspberry Pi 4B, offering powerful performance and excellent expandability.
● Includes a 360-degree LiDAR for comprehensive scanning and environmental awareness.
● Features a 5-megapixel HD camera for object recognition and precise positioning.
● Sports competition-grade Mecanum wheels for omnidirectional movement, allowing flexibility on complex terrains.
● Supports graphical programming, enabling users to develop and debug through an intuitive visual interface.
The myAGV comes with built-in mapping and navigation functionalities. You only need to call the appropriate scripts to use these features.
The myCobot 280 has two mounting holes for secure attachment.
The choice of mounting location depends on the intended tasks for the robotic arm. It is recommended to mount the arm at the frontmost position of the myAGV, away from the myAGV interface.
The myAGV has a dedicated 12V power output interface to supply power to the robotic arm. This simplifies the setup and ensures the robotic arm has a reliable power source.
Once the robotic arm is mounted and powered, connect the keyboard, mouse, and monitor. With this setup, you can begin programming the integrated compound robot.
To establish communication between the AGV and the robotic arm, follow these steps:
1. Connect to the Same NetworkEnsure that both the AGV and the robotic arm are connected to the same local network (WiFi). This allows for seamless communication between the devices.
2. Start the Server Script on the Robotic ArmRun the server script on the robotic arm to enable communication. Open a terminal on the robotic arm and execute the following command:
python Server.py
3. Test the Connection from the AGVCreate a new Python script on the AGV to check if the connection to the robotic arm is functioning correctly. Use the following sample script:
from pymycobot import MyCobotSocket
import time
# Initialize the connection with the robotic arm
arm = MyCobotSocket("192.168.1.248") # Replace with the actual IP address of the robotic arm
# Send initial angles to the robotic arm
arm.send_angles([0, 0, 0, 0, 0, 0], 50)
time.sleep(2)
# Adjust the angles to test movement
arm.send_angles([0, 0, 0, 0, 0, -90], 50)
Let’s try a simple motion control task to see what this robot can do.
I want to return extra snacks to the snack box. First, I control the mobile platform to move to the location of the extra snacks. Since the myAGV is equipped with omnidirectional wheels, it can rotate on the spot.
The robotic arm's end-effector is fitted with an adaptive gripper, which is then used to grasp the snacks.
After successfully obtaining the target, we proceed to return the snacks to their original place.
The compound robot, which combines the functionalities of a robotic arm and a mobile AGV, offers wide-ranging applications with significant potential.
In smart logistics and warehousing, it can perform intelligent transportation tasks within a warehouse. For example, the robotic arm can handle picking, while the AGV transports items to designated locations.
In agriculture and outdoor applications, compound robots can be used for fruit picking, crop inspection, and more. The robotic arm can handle picking tasks, while the AGV moves to the next picking point.
In this example, we simulated an intelligent warehousing scenario. The mobile AGV, equipped with SLAM algorithms, performed autonomous navigation and inspection while transporting object A to another location.
Comments