## 4 Robot Action Skills
### Manipulation and Admittance Control  
In the medication adherence scenario, the robot has to perform dexterous manipulation in order to reach for, grasp and release the \"pill box\". These manipulation actions (as described in Section 4.3) necessitate environmental contact that demands compliance behavior. In addition, this compliance behavior is required for the safety of the surroundings and the human. In more detail, grasping a \"pill box\" from a table or shelf requires the robot to be compliant in case the robot hand/finger collides with the table surface which potentially causes a damaging level of interaction force. The compliant control of the RAMCIP robot is achieved by means of an admittance controller with a 6 DoF force-torque sensor at the wrist which generates the behavior of a spring-mass-damper system with the following dynamics:  
\[M_{d}\ddot{x}+D_{d}\dot{x}+F_{K}(x,x_{d})=F_{ext}-F_{d} \tag{2}\]  
with the desired virtual mass \(M_{d}\), damping \(D_{d}\), stiffness function \(F_{K}(x,x_{d})\), and external force \(F_{ext}\). The set-point of the controller is given by the desired pose, \(x_{d}\), and the desired force, \(F_{d}\). To bound an excessive interaction force given by a large deviation from the desired pose, the spring component is saturated with a maximum force \(F_{max}\). \[F_{K}(x,x_{d})=\left\{ \begin{array}{cc}F_{max}&K_{d}(x-x_{d})>F_{max}\\ -F_{max}&K_{d}(x-x_{d})<-F_{max}\\ K_{d}(x-x_{d})&\text{otherwise}\end{array} \right. \tag{3}\]  
Figure 7: Example of a weighted utility grid for the distance utility of the dynamic window approach. This grid was recorded when the robot faced an obstacle in the \(x\)-direction. The utility function drops in the direction of the obstacle as the predicted time until collision decreases. A weighted sum of such grids is used to determine an optimal velocity. The RAMCIP robot has a redundant manipulator consisting of an elevation mechanism, a turntable link and a 6 DoF arm. The characteristics of the joints are different in terms of the range (i.e., joint position limits) and type (linear or rotational). Namely, the RAMCIP manipulator has 8 DoF in total which is redundant for Cartesian space motion. Therefore, the control problem can be split into two separate components; end-effector motion and null-space motion. Specifically, mapping of joint velocities \(\dot{q}\) to task velocities \(\dot{x}\) is unique, while mapping of task velocities to joint velocities is not. The joint velocity can thus be considered in terms of operational space velocity and null-space velocity by  
\[\dot{q}_{d}=J^{\#}_{W}(q)\dot{x}+I-(J^{T}J^{\#T}_{W}) \tag{4}\]  
with \(J^{\#}_{W}(q)\) being a pseudo inverse of the Jacobian matrix and the projection matrix to the null-space \(N\). The pseudo inverse is given by  
\[J^{\#}_{W}(q)=WJ(q)^{T}(J(q)WJ(q)^{T})^{-1} \tag{5}\]  
with \(W\) being a symmetric positive definite weighting matrix. Null-space motion is used as a reactive strategy to fulfill low priority tasks. Initial trials with the RAMCIP kinematic structure have shown that avoiding joint limits by pure reactive null-space motion is not sufficient to hold the position constraints while executing the motion with acceptable performance. In addition to the null-space motion, the null-space projection can be modified by adapting the weighting matrix. Changing the weighing matrix does not influence the Cartesian motion of the end-effector but the linear combination of joint velocities. To implicitly avoid limits, we propose online null-space projection shaping to adapt the weighting matrix online. To avoid joint limits, the weighting matrix to favor joint motions which point away from the limit more than motions towards it.