## 4 Simulation Analysis
### In the Environment of Human-Robot Interaction
\right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right.\\ \mathbf{n}_{z}=\left[ \begin{array}{c}\theta_{\mathbf{R}}^{0}\left[\begin{array}{ c}0\\ 0\\ 1\\ \end{array}\right]\\ \end{array} \right. The direction cosines of the collision direction vector and each axis of the end effector coordinate system are calculated as follows:  
\[\mathbf{n_{c}}\cdot\mathbf{n_{x}}=-\frac{v_{Rx}}{|v_{Rx}|}\cdot n_{xx}-\frac{v_{Ry}}{|v_{ Rx}|}\cdot n_{xy}-\frac{v_{Rz}}{|v_{Rx}|}\cdot n_{xz} \tag{15}\]  
\[|\mathbf{n_{c}}|=\sqrt{1+\left(\frac{v_{Ry}}{v_{Rx}}\right)^{2}+\left(\frac{v_{Rz}} {v_{Rx}}\right)^{2}} \tag{16}\]  
\[|\mathbf{n_{x}}|=\sqrt{n_{xx}^{2}+n_{xy}^{2}+n_{xz}^{2}} \tag{17}\]  
\[\cos(\mathbf{n_{c}},n_{x})=\frac{\mathbf{n_{c}}\cdot\mathbf{n_{x}}}{|\mathbf{n_{c}}|\cdot|\mathbf{ n_{x}}|} \tag{18}\]  
Similarly, direction cosines \(\cos(\mathbf{n_{c}},\mathbf{n_{y}})\) and \(\cos(\mathbf{n_{c}},\mathbf{n_{z}})\) can be obtained. The collision forces on the end effector of the humanoid manipulator in X, Y, and Z directions are calculated as follows:  
\[\left\{ \begin{array}{l}F_{cx}=F_{c}\cdot\cos(\mathbf{n_{c}},n_{x})\\ F_{cy}=F_{c}\cdot\cos(\mathbf{n_{c}},n_{y})\\ F_{cz}=F_{c}\cdot\cos(\mathbf{n_{c}},\mathbf{n_{z}})\end{array} \right. \tag{19}\]  
Considering the gravitational load in real-time motion, the real-time force/torque of the end effector of the humanoid manipulator are calculated as follows:  
\[\left\{ \begin{array}{l}F_{x}=F_{cx}+G_{x}\\ F_{y}=F_{cy}+G_{y}\\ F_{z}=F_{cz}+G_{z}\\ T_{x}=T_{gx}\\ T_{y}=T_{gy}\\ T_{z}=T_{gz}\end{array} \right.