## 2 Materials and Methods
### Dataset Generation  
To apply a supervised learning approach to the challenge at hand, the first step consists of the creation of a labeled dataset. Two different generation methods are proposed and implemented for this purpose: random pose generation with motor babbling in a simulated environment and random pose generation with Forward Kinematics (FK). The output of both methods will be a CSV file containing joint space positions and the corresponding Cartesian space poses of the robot arm end-effector. No data on trajectories or joint velocities were collected, as this is not in the scope of this project, which solely focuses on the static IK transformation. Motor babbling is the process of repeatedly performing random joint space commands for a short duration. In this particular case, the action is performed in a simulated environment using the Gazebo robot simulator [26] as seen in Figure 3, which emulates the \begin{table}
\begin{tabular}{c c c c c c c c} \hline
**DOF** & \(\mathbf{\theta}\) & **D** & **A** & \(\mathbf{\kappa}\) & \(\mathbf{\theta}\) & **D** & **A** & \(\mathbf{\kappa}\) \\ \hline
1 & 0 & \(-31\) & 125 & \(\frac{\pi}{2}\) & 0 & \(-31\) & 125 & \(-\frac{\pi}{2}\) \\
2 & \(\frac{\pi}{2}\) & \(-21\) & 0 & \(-\frac{\pi}{2}\) & \(\frac{\pi}{2}\) & \(-21\) & 0 & \(-\frac{\pi}{2}\) \\
3 & 0 & \(-311.5\) & \(-20\) & \(-\frac{\pi}{2}\) & 0 & \(-311.5\) & \(-20\) & \(-\frac{\pi}{2}\) \\
4 & 0 & 0 & 20 & \(-\frac{\pi}{2}\) & 0 & 0 & 20 & \(-\frac{\pi}{2}\) \\
5 & \(-\frac{\pi}{2}\) & 312 & 0 & \(-\frac{\pi}{2}\) & \(-\frac{\pi}{2}\) & 312 & 0 & \(-\frac{\pi}{2}\) \\
6 & 0 & 0 & 0 & \(\frac{\pi}{2}\) & 0 & 0 & 0 & \(\frac{\pi}{2}\) \\
7 & 0 & 46 & 0 & 0 & 0 & 46 & 0 & 0 \\ \hline \end{tabular}
\end{table} 
Table 1: Denavit–Hartenberg parameters for TIAGo and TIAGo++ right arm (25). Figure 2: Denavit–Hartenberg coordinate frames for TIAGo (left) and TIAGo++ right arm (right) [25]. The color of the axes follows the usual convention (red for \(x\), green for \(y\) and blue for \(z\)). environment's physics and implements the robot's low-level software components known as ROS controllers. The first generation method is based on creating an ROS controller that generates random joint space goals and records the robotic arm's end-effector poses as it moves towards them. The joint space positions and end-effector poses thus generated are more realistic than those generated by other means, as they do not depend on the ideal implementation of Forward Kinematics but on the readings of the simulated poses themselves. The software ROS controller is implemented using the ros_control framework [27]. TIAGo's default arm ROS controller is stopped and a custom one is loaded in its place. This one writes the CSV header upon starting depending on the orientation representation, and generates a pose by sampling random joint space positions between each of their upper and lower limits. A command is then generated and followed until a joint is close to its destination, in which case a new goal is generated for it. The end-effector position is read from the simulator at each point, with readings too close to the floor being discarded and not included in the dataset. When the desired number of points is reached, the ROS controller is stopped and the default arm ROS controller is loaded again. The second generation method makes use of an FK module to transform random joint space positions into end-effector poses. This method is less reliable as it depends on an ideal FK module which may not give as realistic a result as provided directly from the simulator readings. On the other hand, it is considerably faster and less resource consuming.