# Grasping Assisting Algorithm in Tele-Operated Robotic Gripper
## 3 Optimal Grasp Search Algorithm
### Finding the Optimal Grasp  
The algorithm of the optimal grasp is given in Figure 1.  
The algorithm receives the entire data on the object \(\mathcal{B}\) and other relevant data (finger force assumption, number of contact points, external forces if exists). First, we randomly chose a specified number of contact points from surface \(\mathcal{S}\) and checked for force-closure. We used the chosen set of contact points \(\underline{p}_{i}\) to build the grasp wrench space and pre-defined finger force directed normally to the surface \(\mathcal{S}\) at the points \(\underline{p}_{i}\). Once we computed our grasp wrench space, we could check for force-closure using Algorithm 1. ```
0:\(G,\underline{w}_{external}\)
0:\(FC,\underline{a}_{reg}\)
1. Initialize FC = true, stating that we have a force-closure grasp. 2. Define, \(\underline{q}=\underline{0}\) as the origin. 3. Create the 6D convex hull of G, \(K=CH(G)\). 4. Define \(\underline{L}\), a point inside K as the average of all primitive wrenches. 5. for number of hyper facets in K
6. Find the points that lie on the facet. Organize them in \(A\). 7. Compute the signed distance between the facet to \(\underline{o}\underline{r}\). 8. Put both results in \(s(i)\)
9. endfor
10. for length of s
11. if the sign of both results in s is not equal
12. then FC = false
13. break
14. endif
15. endfor
16. repeat from 5 with \(\underline{q}=-\underline{w}_{external}\)
```  
**Algorithm 1** FC grasp. A success in the force-closure test will give us a quality measure to rank our current grasp. The quality measure is computed as described in Section 2 and will be noted as \(q_{i}\). A failure in the test will result in the algorithm searching for another suitable grasp, choosing another random points in \(\mathcal{S}\). At this stage a set of specific grasps that maintain force-closure on object \(\mathcal{B}\) is sorted in a table called a Grasp Generation List, or \(GGL\) for short. The sorting is based on the  
Figure 1: Optimal grasp finding workflow. quality measure \(q_{i}\), where \(q_{1}>q_{2}>\ldots>q_{end}\) and the index represents the number of the row (in the case of precision grasp, \(q_{i}\) is ordered in ascending order). Each row includes information about the contact points' locations and contact forces. Using a genetic algorithm, we optimize the table to receive the optimal grasp for the object. The algorithm is inspired by the evolution of species in biology, where desirable genes are inherited by the next generation. For each generation we define a set of parent grasps, \(P_{1},P_{2}\), that contain the information from the best two grasps from the _GGL_ table; these are the first two rows. The \"genome\" of the grasp contains the set of contact points of the grasp, \(p_{1}\) to \(p_{n}\). For each child grasp we mix the \"genomes\" of \(P_{1},P_{2}\) to create a new genome strain. The mixing occurs at a random cross section and is called a \"crossover\". The next phase would be the \"mutation\" phase. A mutation can occur in a genetic sequence describing our new child grasp, with low probability. The mutation is performed by switching one of our contact points \(p_{i}\) with a randomly selected point from the surface \(\mathcal{S}\). Once we created a new grasp we check if it satisfies a force-closure on the object and rank it among the grasps in _GGL_. After creating a child grasp, and reorganizing the table, we move forward to the next generation of grasps, using the currant parent grasps. By carrying out this iterative process we improve the received grasps. After 40 generations we find our optimal grasp, with the quality measure noted as \(Q_{opt}\). The initial population of the genetic algorithm is fixed in size, in our case six grasps at the start of each generation. after the \"crossover\" and \"mutation\" phases we add two new child grasps to the table (assuming they sustain force-closure), and delete the two least fitting grasps from the population.