A Method for Obtaining Optimal Path in Angle and Avoiding Collision for Robotic Belt Grinding
Algorithm 1
Recurse search function (RobotTrackList).
Extract the last node structure in the RobotTrackList, and get the variable i of this structure.
IF (i = N)
The track search is complete. The search function is terminated and returns to the function call point.
ELSE
Traverse all nodes of the (i + 1)th column of the NodeMatrix. The total joint variation ∆θ of the robot grinding path is calculated when these nodes act as Nodei+1. The nodes of the (i + 1)th column of NodeMatrix are sorted in ascending order of ∆θ.
A variable k is created, and k = 1.
Fork = 1 to M
The kth node of the (i + 1)th column of NodeMatrix is searched. Make this node Nodei+1, and the intermediate nodes are generated. Then, collision is detected for Nodei+1 and the intermediate nodes.
IF (no collision occurs)
The search function for this round is complete. Insert the Nodei+1 into the RobotTrackList at the end. Exit this function and call for the next round of search.
ELSE
IF (k < M)
Nodei+1 and the intermediate nodes in the RobotTrackList are abandoned.
ELSE
The algorithm cannot search the proper node from the (i + 1)th column of NodeMatrix. Nodei, Nodei+1, and the corresponding intermediate nodes of two nodes in the RobotTrackList are abandoned. The ith layer of the search function is terminated and returns to the (i − 1)th layer of the search function.