# A Virtual Reality Soldier Simulator with Body Area Networks for Team Training
## 4 Performance Analysis
### Error Analysis  
The analysis in Section 4.1 focuses on the quaternion error. Here we further explore the sensing measurement errors, which consist of the elements of the error quaternion.  
\[\begin{array}{rl}\mathrm{Roll}-\Phi:&\text{rotation about the X-axis}\\ \mathrm{Pitch}-\theta:&\text{rotation about the Y-axis}\\ \mathrm{Heading}-\psi:&\text{rotation about the Z-axis}\end{array}\]  
Now we associate a quaternion with Euler angles, which yields  
\[\hat{\mathbf{q}}=\begin{bmatrix}&-\sin\frac{\Phi}{2}\sin\frac{\Phi}{2}\sin\frac {\Psi}{2}+\cos\frac{\Phi}{2}\cos\frac{\Phi}{2}\cos\frac{\Psi}{2}\\ &+\sin\frac{\Phi}{2}\cos\frac{\Phi}{2}\cos\frac{\Psi}{2}+\cos\frac{\Phi}{2}\sin \frac{\Psi}{2}\sin\frac{\Psi}{2}\sin\frac{\Psi}{2}\\ &-\sin\frac{\Phi}{2}\cos\frac{\Phi}{2}\sin\frac{\Psi}{2}+\cos\frac{\Phi}{2}\sin \frac{\Psi}{2}\cos\frac{\Psi}{2}\sin\frac{\Psi}{2}\\ &+\sin\frac{\Phi}{2}\sin\frac{\Phi}{2}\cos\frac{\Psi}{2}+\cos\frac{\Phi}{2}\cos \frac{\Psi}{2}\sin\frac{\Psi}{2}\end{bmatrix}\end{bmatrix} \tag{28}\]  
Denote the pitch angle measurement as \(\theta+\Delta\theta\), where \(\theta\) is the true pitch angle information and \(\Delta\theta\) is the measurement error. To simplify the error analysis, assume the rotation errors are neglectedin roll angle and heading angle measurements. Let \(\sin(\Phi/2)=A\) and \(\sin(\psi/2)=B\). Accordingly, considering the measurement error in the pitch angle, the quaternion can be rewritten as  
\[q^{\prime}=\left[\begin{array}{c}-AB\sin\frac{\theta+\Delta\theta}{2}+\sqrt{(1 -A^{2})(1-B^{2})}\cos\frac{\theta+\Delta\theta}{2}\\ +A\sqrt{1-B^{2}}\cos\frac{\theta+\Delta\theta}{2}+B\sqrt{1-A^{2}}\sin\frac{ \theta+\Delta\theta}{2}\\ -AB\cos\frac{\theta+\Delta\theta}{2}+\sqrt{(1-A^{2})(1-B^{2})}\sin\frac{ \theta+\Delta\theta}{2}\\ +A\sqrt{1-B^{2}}\sin\frac{\theta+\Delta\theta}{2}+B\sqrt{1-A^{2}}\cos\frac{ \theta+\Delta\theta}{2}\end{array}\right] \tag{29}\]  
Assuming that the measurement error in the pitch angle is small, we obtain  
\[\begin{array}{rcl}\sin\frac{\theta+\Delta\theta}{2}&=&\sin\frac{\theta}{2} \cos\frac{\Delta\theta}{2}+\cos\frac{\theta}{2}\sin\frac{\Delta\theta}{2}\\ &\simeq&\sin\frac{\theta}{2}+\cos\frac{\theta}{2}\cdot\frac{\Delta\theta}{2} \end{array} \tag{30}\]  
\[\begin{array}{rcl}\cos\frac{\theta+\Delta\theta}{2}&=&\cos\frac{\theta}{2} \cos\frac{\Delta\theta}{2}-\sin\frac{\theta}{2}\sin\frac{\Delta\theta}{2}\\ &\simeq&\cos\frac{\theta}{2}-\sin\frac{\theta}{2}\cdot\frac{\Delta\theta}{2}.\end{array} \tag{31}\]  
According to Equation (29), the quaternion with measurement error in the pitch angle can be further approximated by  
\[q^{\prime} \simeq \left[\begin{array}{c}-AB\sin\frac{\theta}{2}+\sqrt{(1-A^{2})(1 -B^{2})}\cos\frac{\theta}{2}-AB\cos\frac{\theta}{2}\cdot\frac{\Delta\theta}{2} -\sqrt{(1-A^{2})(1-B^{2})}\sin\frac{\theta}{2}\cdot\frac{\Delta\theta}{2}\\ +A\sqrt{1-B^{2}}\cos\frac{\theta}{2}+B\sqrt{1-A^{2}}\sin\frac{\theta}{2}-A \sqrt{1-B^{2}}\sin\frac{\theta}{2}\cdot\frac{\Delta\theta}{2}+B\sqrt{1-A^{2}} \cos\frac{\theta}{2}\cdot\frac{\Delta\theta}{2}\\ -AB\cos\frac{\theta}{2}+\sqrt{(1-A^{2})(1-B^{2})}\sin\frac{\theta}{2}+AB\sin \frac{\theta}{2}\cdot\frac{\Delta\theta}{2}+\sqrt{(1-A^{2})(1-B^{2})}\cos \frac{\theta}{2}\cdot\frac{\Delta\theta}{2}\\ +A\sqrt{1-B^{2}}\sin\frac{\theta}{2}+B\sqrt{1-A^{2}}\cos\frac{\theta}{2}+A \sqrt{1-B^{2}}\cos\frac{\theta}{2}\cdot\frac{\Delta\theta}{2}-B\sqrt{1-A^{2}} \sin\frac{\theta}{2}\cdot\frac{\Delta\theta}{2}\end{array}\right] \tag{32}\] \[= \hat{\boldsymbol{q}}\otimes q_{err}\]  
Note that, given a measurement error in the pitch angle, and the roll, pitch, and heading angle measurements, the error quaternion \(\boldsymbol{q_{err}}\) can be approximately derived by Equation (32). Therefore, the measurement relation with the quaternion error between the earth frame and the sensor frame can be further described using Equation (27).