# Contingent Task and Motion Planning under Uncertainty for Human-Robot Interactions
## 3 A Proposal for Contingent Task and Motion Planning
### Planning Formulation  
Our planning system domain \(\mathcal{D}\) is a tuple \(\langle\mathcal{A},\Omega,\mathcal{F},\mathcal{W},S_{g}\rangle\) where \(\mathcal{A}\) is the action space, \(\Omega\) is the sensing action space, \(\mathcal{F}\) is a set of literals, \(\mathcal{W}\) is a workspace involving a mobile manipulator \(\mathbf{\mathcal{R}}\) (described by the pose of the base \(Pos_{rob}\) along the arm configuration \(Q_{rob}\)) and a number of objects \(\mathcal{O}\), and, \(S_{g}\) is a set of grasping poses described for objects. Objects are denoted as: \(\mathbf{\mathcal{O}}\)=\(\{\mathcal{O}_{1}^{m}\)(_pos/fe_) \(\ldots\)\(\mathcal{O}_{j}^{m}\)(_pos/fe_), \(\mathcal{O}_{1}^{f}\)(_pos/fe_) \(\ldots\)\(\mathcal{O}_{k}^{f}\)(_pos/fe_)}, where \(j\) and \(k\) are the number of _Movable_ and _Fixed_ objects respectively, whose initial position and orientation are denoted by _pos_, and whose features are denoted by _fe_. An action \(a\in\mathcal{A}\) is a tuple \(\langle\)_name(a)_, _pre(a)_, _effect(a)_, _confect(a)_, _geom(a)_, \(\mathcal{Q}(a)\)), where _name(a)_ is the action symbolic name, _pre(a)_ is a propositional formula which must hold for the action to be applied,geom(a)_ is the numerical counterpart of an action containing geometric information, _effect(a)_ represents the negative and positive effects of \(a\) on the state it is applied to, and \(\mathcal{Q}(a)\) is a query function to the motion planner which computes a motion between two robot configurations and stores the solution if any. A relaxed action \(a^{\prime}\in\mathcal{A}^{\prime}\) (where \(\mathcal{A}^{\prime}\) is the relaxed action space) is similar to the action despite it does not consider any negative effects. Actions refer to executable actions, i.e., requiring motion, and can be done by either the robot or a person. The following actions types are considered to deal with some examples of mobile robot manipulation:  
* _Transit_: an action done by the robot to travel from one configuration to another one without an attached object. * _Transfer_: an action done by the robot to move an attached object from one pose to another one. * _Push_: an action done by the robot to push an object from one pose to another one. * _Open_: an action done by the robot to open a box-like container (articulated cap with prismatic joint is assumed with two positions corresponding to fully closed and fully opened, the state being stored in the containers objects features). * _HumanTransfer_: an action done by a person to transfer/push an object to the robot workspace. * _HumanOpen_: an action done by a person to open a box-like container. Each sensing action is a tuple \(\langle\textit{pre}(a),\textit{o}(a)\rangle\), where _o(a)_ is a literal with uncertainty. These are actions not involving motion, devoted to observing the value of _o(a)_. The observation is done in run-time. Some sample sensing actions are considered in the proposed planning system. They are the following:  
* _SenseColor_: a sensing action is done by a perception module to determine the color of an object. * _SensePose_: a sensing action is done by a perception module to determine the pose of an object. * _CheckContainer_: a sensing action is done by a person to evaluate whether a container is open or not. * _CheckCan_: a sensing action is done by a person to evaluate whether can-like objects are filled or not. A belief state \(S\) is a tuple \(S=\langle\mathcal{P},\mathcal{V}\rangle\) where \(\mathcal{P}\) includes a set of known literals which hold in that state and a set of uncertain literals which may hold or not in the state, and \(\mathcal{V}\) represents a full geometric description of the scene, i.e., configurations of robots and poses of objects corresponding to certain and uncertain literals. An executable action from a state \(S_{1}\) results in a new world state using the state transition functions \(S_{2}.\mathcal{P}:=S_{1}.\mathcal{P}-\textit{effect}^{-}(a)+\textit{effect}^ {+}(a)\) and \(S_{2}.\mathcal{V}:=S_{1}.\mathcal{V}-geom^{-}(a)+geom^{+}(a)\).