## 3 Overall System
### Path Planning System  
The objective of the path planning problem in this paper is to visit each intersection point in a grid environment without obstacles, ensuring both completeness and efficiency. Because the detected 2D pixel coordinates of the intersection points must be transformed into 3D coordinates in the robot arm's coordinate system, the original path planning problem is effectively reduced to a sorting problem of the detected pixel points, with tying operations executed sequentially. Another challenge is to determine the optimal traversal route between the start and end points as quickly as possible while maintaining the robot arm's motion stability [31]. To address this, a greedy algorithm is employed to optimize a serpentine path, which achieves efficient area coverage for repetitive tasks, offers a simple implementation, keeps computational complexity low, and ensures high stability during robot motion [32].  
The traditional serpentine path starts at the origin and progresses in a specific direction (e.g., from left to right). When the end of a grid row is reached, the direction is reversed (e.g., from right to left), and the robot continues along the next row. This process is repeated until all grid cells are covered. Each time the direction changes, the robot must ensure that the path remains continuous and does not revisit previously scanned areas. Since the initial direction of the path is fixed, this can lead to a situation where, as shown in Figures 9 and 10, the total path length increases due to the differing horizontal and vertical spacing between the grid cells.  
The basic idea of the greedy algorithm in solving path planning problems is as follows: starting from a point, repeatedly select the nearest unvisited point until all points have been visited. The greedy algorithm assumes that, by selecting the locally optimal solution at each step, a globally optimal solution will eventually be reached. However, this is not always the case. For simple rectangular grid-based path planning problems, the greedy algorithm typically chooses the current optimal solution at each step, avoiding multiple searches and backtracking. This results in faster computation and generally yields a shorter path. In most greedy algorithms, the Euclidean distance is used to calculate the nearest point. However, since the robot arm in this paper typically moves only along the x-axis and y-axis, Manhattan distance is more suitable for grid-based path calculations, especially when the allowed movement directions are limited to horizontal and vertical directions. For two points in a 2D plane, \((x_{1},y_{1})\) and \((x_{2},y_{2})\), the formula for calculating the Manhattan distance is shown in Equation (8).  
\[D_{\text{Manhattan}}=|x_{1}-x_{2}|+|y_{1}-y_{2}| \tag{8}\]  
Manhattan distance does not involve square roots or multiplication, making it simpler and faster to compute. Compared to Euclidean distance, using Manhattan distance as a heuristic function in the greedy algorithm [33] allows the algorithm to efficiently guide the path toward the target, particularly in grid-based path planning problems where only horizontal and vertical movements are allowed. After completing the tying task for the current grid, the robotic arm and camera are moved to the next grid to perform the same tying operation.