## 5 Baxter Inverse Kinematics  
The PSO algorithm (shown in Figure 2) to solve the inverse kinematics of the [PERSON] manipulator arm was implemented in MATLAB and is described below. The solution to the inverse kinematics problem is the set of joint angles of the particle with the final global best fitness function. Experiment: Target Pose is [PERSON]'s left arm end effector pose when the arm is at the default untuck configuration. Three runs were performed with 60 particles, which yielded three different sets of solution joint angles corresponding to this Target Pose. This result was expected, since [PERSON]'s arm has seven joints (kinematically redundant); thus, the  
Figure 2: Flowchart of the PSO implementation. number of possible solutions is infinite. The [PERSON] robot (shown in Figure 1 was used to test all obtained results via our algorithm at the University of Houston Clear Lake Robotics and Control Laboratory. The Baxter robot arms have a default joint configuration called \"untuck\" where the arms are deployed and ready to run applications. After adjusting the untuck joint angle values using our results, a python program was run to move the robot's left arm into the untucked position. All communications between the robot and the python code are established using Linux Ubuntu 16.04 and the Robot Operating System software framework. More details can be found in Fairchild and Harman [22]. Table 2 documents the solution joint angles and corresponding final end-effector pose for the three runs. Figures 3 and 4 illustrate how quickly the inverse kinematics solution converges for run 1, after roughly 100 iterations. Although not shown here due to space limitation, runs 2 and 3 have similar speeds of convergence. Figure 5 shows the global best fitness function for run 1, and Figure 6 shows the three [PERSON] left-arm configurations corresponding to the three different sets of solution joint angles from the three runs. Figure 4: Plots of run 1 EE orientation. Figure 5: Best cost (fitness function) for run 1. Figure 6: [PERSON]’s left-arm in joint configurations of runs 1, 2 and 3 (in left to right order). From Figure 6, it is clear that the [PERSON] left--arm end--effector pose is the same even though the three different sets of joint angles are completely different. This is due to the inherent kinematic redundancy of the seven-joint [PERSON] arm and the randomness of the initial configuration of the swarm joint angles. The next paragraph will address how a more customized solution can be obtained for [PERSON] and other kinematically redundant manipulator arms. It must be emphasized that our approach to solving the inverse kinematics for serial robotic manipulators can be applied to manipulators with any number of joints and not restricted to just seven. In the case of manipulators with kinematic redundancy (seven or more joints in six-dimensional space), the algorithm can easily be manipulated to obtain certain desirable solutions by simple modifications such as adding the joint angle error from its desired value for any number of joints to the calculation of particle \(i\)'s fitness function \(f_{i}\), i.e.,  
\[f_{i}=\sqrt{\sum_{j=1}^{7}\bigl{(}X_{Tj}-X_{ij}\bigr{)}^{2}+\sum_{k}\bigl{(} \theta_{k}^{des}-\theta_{ik}\bigr{)}^{2}} \tag{11}\]  
where \(\theta_{k}^{des}\) is the desirable value of joint angle k in the solution of the inverse kinematics problem. As an example, another run was made setting the desired value of the 6 th joint to \(\theta_{6}^{des}=59.014\) deg, which corresponds to that of the default untuck configuration. For this run, the final joint configuration is that of the default untuck configuration as shown below, although the speed of convergence is slower than when the 6 th joint is not constrained to a desired value.