# Sampling-Based Motion Planning for Free-Floating Space Robot without Inverse Kinematics
## 3 Motion Planning Algorithm for FFSRs
Repeat the above process until the termination condition of local planning is triggered, then exit local planning and return to the new configuration and trajectory. * **Collision detection mechanism**: The collision detection mechanism corresponds to Lines 2 and 10-12 of the pseudo-code. In the second line of the algorithm, \(\mathbf{q}_{Extended}\) is selected from the tree and is collision-free. Therefore, \(\mathbf{q}_{Extended}\) is recorded as the last detected free configuration. During iterative local planning, the configuration is gradually changed. The algorithm determines whether collision detection is required, corresponding to the 10 th line of the algorithm. The judgment condition is whether the difference between the current configuration and the last detected free configuration reaches a certain threshold. If collision detection is performed after the judgment, the current configuration is recorded as the new last-detected free configuration. * **Termination conditions and return for iterative local planning**: (1) The collision detection program detects a collision; (2) the configuration exceeds the limit, that is, the base attitude disturbance exceeds the limit or the joint angle exceeds the range; (3) among the configuration parameters, the maximum expansion value reaches a certain threshold. When any one of these three conditions is met, iterative local planning is terminated. Then, in Line 17 of the pseudo-code, the algorithm tests if the tree is extended far enough from the initial \(\mathbf{q}_{Extended}\). If the generated new configuration is very close to \(\mathbf{q}_{Extended}\), then we let Is_Extend equal to false, and the local planning results will not be added to the tree. * **Remark of parameter setting**: In Algorithm 2, there are some parameters that need to be set. (1) Collision_Check_Tresh_Hold: This is a threshold that decides the number of collision detections when running the algorithm. It cannot be set too large or the collision detection will miss some configurations in collision. Additionally, it cannot be set too small or unnecessary collision detection will be carried out and the algorithm will be too slow. This threshold is set at 1 degree in the simulation study, and it worked well. (2) is_Extend_over_Tresh_hold: This is a mark that indicates whether the extend is far enough from the node to be extended. Additionally, it relates to a threshold. This threshold is similar to the step length in geometric path planning using RRTs. Unlike RRTs for geometric path planning, choosing this threshold properly is not very important. In geometric path planning using RRTs, we should choose a proper step length for the local planner. If the step length is too large, the collision is easy to detect and local planning will easily fail. If the step length is too small, the algorithm will be slow. Collision detection in this paper is different from that of geometric path planning using RRTs, which is based on dichotomy. Therefore, we can choose a large value for this threshold. This threshold is set at 90 degrees in the simulation study, and it worked well. #### 3.2.2 Local Planner for Goal EE Pose Guiding Growth

The local planner for GEE-GG is similar to the local planner for RC-GG in Section 3.2.1. Both planners are run in an iterative manner. The action is generated based on the error in each iteration. However, it is different from the latter in terms of termination conditions and the mechanism of generating actions for each iteration. In addition, local planning for GEE-GG tries to extend \(\mathbf{q}_{Extended}\) as close as possible towards the goal EE pose. The pseudo-code of this algorithm is shown in Algorithm 3, the variables and functions used in Algorithm 3 are defined in Table 3. The basic principle of the algorithm is as follows: First, among all the existing nodes on the tree, the node \(q_{Extended}\) is found, and the EE pose of \(q_{Extended}\) has the smallest difference from the target EE pose.