摘要
随着人工智能技术持续高速发展,机器视觉与嵌入式控制逐渐成为智能制造产业的重要基础技术。为了满足高校人工智能教育改革背景下对于教学实验平台的迫切需求,本文提出并实现了一套基于ROS2框架的智能分拣系统。该系统以树莓派作为视觉采集与推理的上位机平台,通过USB摄像头收集实时视频流,并利用OpenCV实现视频帧格式解码、颜色空间转换、尺寸缩放等预处理操作;随后,采用ONNX Runtime完成深度学习模型的部署与推理。在执行层面,系统利用ESP32微控制器作为 ROS2下位节点,通过micro‑ROS在局域网中与树莓派建立稳定通信,实现传送带电机控制与推杆机构动作控制。所有节点均运行在同一无线局域网内,通过DDS协议进行快速节点发现与可靠消息传输。本文不仅从硬件结构、视觉处理流程、通信架构、执行机构控制等方面详细介绍系统的设计方法,还通过多轮实验验证了系统的稳定性、实时性与可扩展性。此外,本文还围绕教学平台建设需求,分析了该系统在实验教学中的价值,并进一步探讨其在智能制造及高校实验平台中的未来应用前景。
Abstract
With the continuous and rapid development of Artificial Intelligence (AI), machine vision and embedded control have progressively become foundational technologies for the intelligent manufacturing industry. To meet the urgent demand for teaching and experimental platforms amidst the reform of AI education in universities, this paper proposes and implements an intelligent sorting system based on the Robot Operating System 2 (ROS2) framework. The system utilizes a Raspberry Pi as the upper-computer platform for vision acquisition and inference. Real-time video streams are collected via a USB camera, and OpenCV is employed for preprocessing operations, including video frame decoding, color space conversion, and scaling. Subsequently, ONNX Runtime is utilized for the deployment and inference of deep learning models. At the execution level, the system employs an ESP32 microcontroller as the ROS2 lower-level node. It establishes stable communication with the Raspberry Pi over a Local Area Network (LAN) via micro-ROS, enabling precise control of the conveyor belt motor and the pusher mechanism. All nodes operate within the same Wireless LAN (WLAN) and utilize the DDS protocol for rapid node discovery and reliable message transmission. This paper provides a detailed introduction to the system's design, covering hardware structure, vision processing workflows, communication architecture, and actuator control. Furthermore, the stability, real-time performance, and scalability of the system are validated through multiple rounds of experiments. Finally, centering on the requirements of educational platform construction, this paper analyzes the value of the system in experimental teaching and discusses its future application prospects in intelligent manufacturing and university laboratory platforms.
关键词
ROS2 /
树莓派 /
micro-ROS /
ESP32 /
ONNX模型 /
OpenCV
Key words
ROS2 /
Raspberry Pi /
micro-ROS /
ESP32 /
ONNX Model /
OpenCV
刘鹏飞, 杨可扬, 张宇, 梁楠.
基于ROS2框架的机器视觉与机械控制实验系统设计与实现[J]. 集成电路与嵌入式系统. 0 https://doi.org/10.20193/j.ices2097-4191.2026.0003
Design and Implementation of ROS2 based Machine Vision Control Experimental Platform[J]. Integrated Circuits and Embedded Systems. 0 https://doi.org/10.20193/j.ices2097-4191.2026.0003
{{custom_sec.title}}
{{custom_sec.title}}
{{custom_sec.content}}
基金
吉林省高教科研课题(JGJX25D0020)