## 4 Experimental Setup  
### KULKA LWR Robot  
The KUKA LWR is a Torque-controlled Flexible Robot with 7 degrees of freedom. The design and control concepts of the robot have been discussed in [26; 27]. There are two control modes available. The joint position control is implemented at a frequency of 3 kHz (decentralized control) [28]. Inverse kinematics and the cartesian impedance control mode run at a frequency of 1 kHz. The KUKA LWR has a torque sensor at each joint that enables torque control and impedance control. It also has motor side position sensors, as well as link side position sensors. Due to friction it is difficult for robots to implement torque control only with motor current commands [28].  
The default coordinate system of the KUKA LWR is Right Handed System for which det(R) = 1. The dimensions of the robot can be retrieved from the official manufacturer documentation. Using these dimensions we can obtain the DH parameters (refer Table 1). To simulate the robot, an alternate form of representation called URDF is shown in Table 2 and its corresponding 3D model is shown in Figure 7. The Unified Robotic Description Format (URDF) is an XML file format used in ROS to describe all elements of a robot. The robot interacts with the external PC through the Fast Research Interface [29] through three modes--(a) Joint position control (b) Joint impedance control mode and (c) Cartesian impedance control mode.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline  & **Joints** & \(\mathbf{d_{i}(\text{m})}\) & \(\mathbf{q_{i}(\text{rad})}\) & \(\mathbf{a_{i}}\) & \(\mathbf{\alpha_{i}(\text{rad})}\) & \(\mathbf{q_{min}}\) & \(\mathbf{q_{max}}\) & \(\mathbf{\tau_{max}(\text{Nm})}\) \\ \hline J1 & A1 & 0.3105 & \(q_{1}\) & 0 & \(\pi/2\) & \(-170\) & 170 & 176 \\ \hline J2 & A2 & 0 & \(q_{2}\) & 0 & \(-\pi/2\) & \(-120\) & 120 & 176 \\ \hline J3 & E1 & 0.4 & \(q_{3}\) & 0 & \(-\pi/2\) & \(-170\) & 170 & 100 \\ \hline J4 & A3 & 0 & \(q_{4}\) & 0 & \(\pi/2\) & \(-120\) & 120 & 100 \\ \hline J5 & A4 & 0.39 & \(q_{5}\) & 0 & \(\pi/2\) & \(-170\) & 170 & 100 \\ \hline J6 & A5 & 0 & \(q_{6}\) & 0 & \(-\pi/2\) & \(-120\) & 120 & 38 \\ \hline J7 & A6 & 0.078 & \(q_{7}\) & 0 & 0 & \(-170\) & 170 & 38 \\ \hline \end{tabular}
\end{table}
Table 1: DH parameters of KUKA LWR 4+ robot.  
Figure 7: Exoscarne 3D simulated model with the KUKA LWR arm in Home configuration.  
To fulfill our objectives we used the cartesian impedance control mode available with the KUKA LWR robot. The KUKA manual [30] states that the control law for the cartesian impedance controller is  
\[\tau_{cmd}=J^{T}(K_{c}(x_{desired}-x_{current})+F_{cmd})+D(d_{c})+f_{dynamics}(q, \dot{q},\ddot{q}) \tag{15}\]  
where \(q\in\Re^{m}\) is the joint position vector, \(K_{d}\) is the stiffness matrix in the end-effector frame, \(D_{d}\) is the normalized damping parameter in the end-effector frame, \(x\) and \(x_{d}\) are the current and the desired pose of the end-effector respectively in the global frame. The translational stiffness \(K_{x},K_{y},K_{z}\in[0.01,5000]\) N/m and rotational stiffness \(K_{A_{z}},K_{B_{y}},K_{C_{x}}\in[0.01,300]\) N/m-rad.  
The KUKA LWR has an inbuilt external tool calibration functionality. Using this feature the robot can account for external tool dynamics as well, thereby enabling gravity compensation for the tool.  
In this work we used the KUKA Fast Research Interface (FRI [29]), ROS [31], Kinematics and Dynamics library (KDL [32]), the MATLAB toolbox by [PERSON] (RCV [33]), and the MATLAB Robotics Toolbox (RTB [34]). For the intent prediction strategy, the high level program was written in MATLAB and connected to the network via ROS (Robot Operating System), by using the MATLAB Robotics Toolbox.