一款基于zcode,opencv的树莓派机械臂控制方案 (robot_control-with-Opencv)

 

最后更新时间:2023年8月(2023.8 the last time update)

为我和其他支持者(for myself and other supporters)

-成功开发出一套完整的系统,该系统能够识别形状和Z码,并控制机器人手臂系统。(Successfully developed a complete system that can recognize shapes and Z-codes, and control the robot arm system.)

e09354b84c711a332494bdc5414aa11

-使用Python编程语言,配合树莓派4B实现。(Using Python programming language, combined with Raspberry Pi 4B implementation.)

-使用中凌科技公司的舵机和Uno微控制器。(Use Zhongling Technology's servo and Uno microcontroller.)

-机器人手臂具有六自由度,包括2个PWM舵机和4个步进舵机。(The robot arm has six degrees of freedom, including two PWM servos and four stepper servos.)

## 包含两个解决方案:(Includes two solutions:)

-1:通过最终坐标点的逆运算导出动作,即逆向运动学。这种方法可以精确控制机器人手臂的每一个动作。(Option 1: Derive the action through the inverse operation of the final coordinate point, that is, inverse kinematics. This method can precisely control every action of the robot arm.)

-2.正向运动学,直接调整每个舵机的角度进行控制。这种方法相对简单,但舵机只能旋转固定角度,灵活性较低。(Option 2: Forward kinematics, directly adjust the angle of each servo for control. This method is relatively simple, but the servo can only rotate at a fixed angle, resulting in lower flexibility.)

文件结构(The file structure)

arm_control.py展示如何通过逆运动学控制机器人手臂。这个文件包含了控制机器人手臂运动的核心逻辑。(Show how to control a robot arm through inverse kinematics. This file contains the core logic for controlling the movement of robot arms.)

cluster.py 介绍使用OpenCV的基础方法。在这个程序中,我使用了Python-OpenCV库进行调用。它还展示了如何通过RGB值检测不同颜色。(Introduce the basic methods of using OpenCV. In this program, I used the Python OpenCV library for calling. It also demonstrates how to detect different colors through RGB values.)

shapes.py展示如何使用霍夫圆算法和边缘点算法检测三角形和矩形。这个文件对于识别物体形状至关重要。(Show how to use the Hough circle algorithm and edge point algorithm to detect triangles and rectangles. This file is crucial for recognizing the shape of objects.)

uart.py讲解UART协议使用方法。我提供了两种使用方式:单线程和多线程。这个文件确保了机器人手臂与电脑之间的稳定通信。(Explain the usage of UART protocol. I offer two usage options: single threaded and multi-threaded. This file ensures stable communication between the robot arm and the computer)

zcode.py使用pyzbar库来检测Z码。这个文件使得机器人能够识别和处理Z码信息。(Use the pyzbar library to detect Z-codes. This file enables robots to recognize and process Z-code information.)

word_detect.py这是最终解决方案。由于我在比赛中的使用场景已经不再对其他程序开放,所以我没有展示全部内容。(This is the ultimate solution. Since my usage scenarios in the competition are no longer open to other programs, I did not showcase all the content.)

进度与特性:(The progress and features:)

  • [√] 程序开发已完成。(finish the program)
  • [√] 支持通过UART进行通信,确保了与其他设备的兼容性。(can use with uart)
  • [√] 可以在所有树莓派系列上使用,包括树莓派3、3B、3B+、4、4B和40。(can use with raspberry pi all series)
  • [√]支持Python >=3.8,这是目前最常用的Python版本之一。( support python >=3.8)
  • [√] 支持OpenCV >=4.0,这是开源计算机视觉库的最新版本。(support cv >=4.0)
  • [√] 由于使用了通用的库,因此也可以在其他品牌的ARM开发板上使用。这增加了系统的可移植性。(can use with other brands of ARM development board as it uses general libs.)
  • 点击此处下载

 

GITHUB项目链接:https://github.com/kouge0510/robot_control-with-Opencv

作者:抠哥

最后于 2月前 被夜行者老鱼编辑 ,原因: