# Research on Rapid Recognition of Moving Small Targets by Robotic Arms Based on Attention Mechanisms
## 4 Experimental Results and Discussion  
The improved algorithm was tested on the robotic arm's control system through practical experiments. The entire system was divided into two parts: hardware construction, and algorithm development with software implementation. In terms of hardware construction, the hardware used in our experiments is listed in Table 2.  
The entire system was designed to identify three types of fruits--bananas, apples, and oranges--on a conveyor belt using the RealSense D435I depth camera. The process involved target detection through image data captured by the camera, ultimately pinpointing the central pixel coordinates (X, Y) of the small fruit targets, along with the depth information (Z) of point O. These coordinates were then transformed and transmitted to the Franka Emika Panda robotic arm. Upon receiving the instructions, the robotic arm moved to the location of the identified small target fruits and executed fruit sorting through its end effector. The actual experimental environment is shown in Figure 7. \begin{table}
\begin{tabular}{c c} \hline \hline
**Configuration Name** & **Version Parameters** \\ \hline Camera & RealSense-D435i \\ Robotic arm & Franka Emika Panda \\ GPU & GeForce RTX 4090 24 GB \\ CPU & AMD EPYC 9654 96-Core Processor \\ operating system & Ubuntu 20.04 \\ GPU acceleration library & Cudali1.0 \\ programming language & Python3.8.10 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Configuration parameters. Figure 6: Structure diagram of the improved YOLOv8 network. In the execution of target detection and grasping tasks, real-time detection of the color image stream captured by the camera was required to meet the demands of real-time grasping. Once the vision-based grasping system was calibrated and the central pixel coordinates of the target objects were known, the position information in the base coordinate system was obtained through a series of coordinate transformations. Grasping operations were then carried out using inverse kinematics solutions and motion planning algorithms available in the ROS (robot operating system). This intelligent sorting system integrates various functional modules on the ROS platform. Based on ROS's topic subscription and publishing communication mechanism, the main functional modules of the system are designed as nodes, which communicate with each other by subscribing to or publishing relevant topics, ultimately achieving target grasping. Figure 8 shows an overall control diagram combining the robotic arm's hardware and software, with the control system's upper layer based on Franka_ros. Franka ROS integrates Franka Emika robots into the ROS system and incorporates Libfranka into ROS Control for controlling the robotic arm. The robotic arm's real-time transmission rate was 1 kHz, satisfying the requirements for real-time grasping. To address these issues, we utilized built-in tools in ROS for monitoring and diagnostics. For example, we used 'rostopic hz' to monitor the publishing frequency of topics, 'rosnode ping' to test the communication delay between nodes, 'rqt_graph' to view the relationship graph between nodes and topics, and 'roswft' to detect issues within the system. Figure 8: Overall diagram of robotic arm control. Figure 7: Experimental Scene Display. We ensured that all of the devices in the ROS network were on the same local network to reduce network delays. We used wired connections instead of wireless, because wireless can be unstable and have higher latency. During system operation, we closed or uninstalled unnecessary processes to reduce computer load. We optimized algorithms and data processing workflows to ensure code efficiency. We adjusted the 'ros::Rate' object to control the running frequency of nodes and modified the message queue sizes to prevent the accumulation of too many messages in nodes. Through these practices, our designed system underwent multiple iterations, adjustments, and tests to achieve optimal system performance.