## 5 Framework
### Stage 2: Kinematic Mapping Algorithm of Human to Robot Thumb
The mapped \(H_{cmc}\) joint angles (\(\theta_{m,FE},\theta_{m,AA}\)) are determined by linearly remapping the estimated CMC joint angles to the mapped workspace bounds using Equation (6):  
\[\theta_{m,i}=\frac{(\theta_{e,i}-\theta_{e,i,min})}{(\theta_{e,i,max}-\theta_ {e,i,min})}\Delta\theta_{m,i}+\theta_{m,i,min} \tag{6}\]  
where \(i=\{FE,AA\}\) with \(min\) and \(max\) representing their respective minimum and maximum values, \(\Delta\theta_{m,i}=(\theta_{m,i,max}-\theta_{m,j,min})\) represents the angular range of the mapped joint angles, and \(\theta_{e,i}\) and \(\theta_{m,i}\) are the estimated and mapped human thumb joint angles, respectively. Using the mapped CMC joint angles, the position of the distal end of the CMC joint, \(P_{m,h}\), is determined through forward kinematics [50] using Equations (7)-(9):  
\[P_{m,hx}=L_{mp}\cos(\theta_{FE})\cos\theta_{AA} \tag{7}\] \[P_{m,hy}=L_{mp}\sin\theta_{AA}\] (8) \[P_{m,hz}=-L_{mp}\sin(\theta_{FE})\cos(\theta_{AA}) \tag{9}\]  
Figure 6: Radial projection of a desired point from human, \(P_{h}\), to robot, \(P_{r}\), space reference to the base frame. Since the \(H_{cmc}\) mapped workspace encapsulates the entire projection of the \(R_{cmc}\) workspace, \(P_{m,h}\) can guide \(P_{r}\) throughout the \(R_{cmc}\) workspace using the RPA. The RPA imposes a constraint between \(P_{m,h}\) and \(P_{r}\) such that these vectors become aligned and pass through the base frame origin. This constraint is realized by satisfying Equation (10):  
\[\vec{P}_{m,h}\times\vec{P}_{r}=0 \tag{10}\]  
The position of the distal point of the robot thumb, \(P_{r}\), is evaluated using forward kinematics and the mDH kinematic parameters in Table 2 and is shown in Equations (11)-(13). \[P_{rx}=K_{1}\cos\theta_{1}-K_{2}\sin\theta_{1} \tag{11}\] \[P_{ry}=K_{1}\sin\theta_{1}+K_{2}\cos\theta_{1}\] (12) Figure 6.0  
where \(K_{1}=L_{1}+L_{2}cos(\theta_{2}-\pi/2)\), and \(K_{2}=L_{2}cos(0.38\pi)sin(\theta_{2}-\pi/2)\). The robot thumb (\(R_{cmc}\)) joint angles \((\theta_{1},\theta_{2})\) cannot be evaluated in closed form. Therefore, an optimization\(-\)based inverse kinematics approach was followed using Equations (7)-(13) as presented in Algorithm 1. ```
Input (\(L_{mp}\), \(\theta_{m,FE}\), \(\theta_{m,AA}\), \(L_{1}\), \(L_{2}\))
1: Define constraints \((\theta_{1},\theta_{2})\in[0,\pi/2]\)
2: Initialize \((\theta_{1},\theta_{2})=0\)
3: Define optimization cost function \(C_{f}(\theta_{1},\theta_{2})=\left\|P_{m,h}\times P_{r}\right\|^{2}\)
4: Calculate \(\left(P_{m,hx},P_{m,hy},P_{m,hz}\right)\) using Equations (7)-(9)
5: Calculate \(\left(P_{rx},P_{ry},P_{rz}\right)\) using Equations (11)-(13)
6: Evaluate the optimization cost function \(C_{f}(\theta_{1},\theta_{2})\)
7: Minimize \(C_{f}(\theta_{1},\theta_{2})\) using _fmincon_ (MATLAB constrained optimization function) Output \((\theta_{1},\theta_{2})\)
```  
**Algorithm 1** Optimization\(-\)based inverse kinematics procedure. The estimated MCP and IP joint angles were linearly mapped to the third and fourth joints of the robot thumb using Equation (14). Figure 6.1 **(a)** Workspace comparison of the CMC joint and \(R_{cmc}\). **(b)** Radial Projection of \(R_{cmc}\) workspace onto the mapped workspace of CMC joint. **(c)** Projected bounds of \(H_{cmc}\) in configuration space based on the \(R_{cmc}\) workspace boundary. The hand model is not to scale but is shown to facilitate the understanding of the workspace orientation. Figure 6.2  
where \(\theta_{r,i}\) and \(\theta_{h,j}\) are the robot and human thumb joint angles with \(i=\{3,4\}\) and \(j=\{MCP,IP\}\) representing the associated robot and human thumb joint, respectively, and \(\Delta\theta_{r,i}=(\theta_{r,i,max}-\theta_{r,j,min})\) represents the angular range of the respective robot joint.