# Design of Advanced Human-Robot Collaborative Cells for Personalized Human-Robot Collaborations
## 5 Integration and Deployment: A Case Study
### Task Planning and Scheduling  
A timeline-based task planning model is synthesized by the knowledge base to \"operationalize\" production procedures and coordinate human and robot behaviors. A number of _state variables_ are defined to characterize states and/or actions that relevant domain features assume and/or perform over time. Four state variables \(SV_{p0}\), \(SV_{p1}\), \(SV_{p2}\), \(SV_{p3}\) describe the state of the working positions of the pallets. Since these physical locations are modeled as BinaryProductionLocation in the knowledge base, these variables are associated with two values, \(V_{p0}\), \(V_{p1}\), \(V_{p2}\), \(V_{p3}=\{Free,Busy\}\). Then, we define transitions \(T_{p0}(Free)\), \(T_{p1}(Free)\), \(T_{p2}(Free)\), \(T_{p3}(Free)=Busy\), \(T_{p0}(Busy)\), \(T_{p1}(Busy)\), \(T_{p2}(Busy)\), \(T_{p3}(Busy)=Free\) and duration \((1,+\infty)\) for all of them. These state variables are used to encode _binary resource constraints_ and, thus, enforce a mutually exclusive use of the associated physical locations. Other two state variables describe possible behaviors of the human and the robot in terms of the set of Function that they can perform over time. These functions are the _inferred_ instances of low-level operations the human and the robot can perform in the considered scenario. The state variable of the robot \(SV_{R}\) is thus a associated with the set of values denoting the function it is supposed to perform \(V_{R}=\{Idle,Release\_p1,Release\_p2,Pick\_p1,Pick\_p2,Assembly\_p1,Assembly\_p2,Disassembly\_p1,Disassembly\_p2\}\). The values \(Release\_p1,Release\_p2\) and \(Pick\_p1,Pick\_p2\) are instances of the function PickPlace and denote respectively the operations of removing a worked piece from the pallet (i.e., _release piece_) and placing a new raw piece into the pallet (i.e., _pick piece_). The transition function requires all value changes to pass through the idle state as follows: \(T_{R}(Idle)\in\{Release\_p1,\ldots,\)\(Disassembly\_p2\};T_{R}(Release\_p1)=\{Idle\};\ldots;\)\(T_{R}(Disassembly\_p2)=\{Idle\};\ldots;\)\(\{ldle\}\). All the values of the robot \(v_{R,i}\in\ V_{R}\) are tagged as _partially controllable_ (\(\gamma_{R}(v_{R,i})=pc\)) because the actual duration of their execution can interfere with the worker. The duration bounds of these values instead is set according to the average observed execution time. The state variable of the human \(SV_{H}\) is structured similarly to \(SV_{R}\). In this case, it is necessary to consider the additional operations the worker can perform and robot can not. These are modeled with additional values \(V_{H}=\{PickPlace\_p0p1,\ PickPlace\_p1p2,\ PickPlace\_p2p3,\ldots\}\). The value transition function follows the same \"pattern\" of \(SV_{R}\). However, in this case, all the values \(v_{H,i}\in\ V_{H}\) of the state variable \(SV_{H}\) are tagged as _uncontrollable_ (\(\gamma_{H}(v_{H,i})=u\)) since the system cannot control the behavior of the worker. Furthermore the duration bounds of the values are defined according to Equation (4) and thus they depends on both the average duration of their execution and on the _uncertainty index_\(\delta\) set according to the _expertise level_ of the worker. To synthesize production operations, it is necessary to define \"functional\" state variables encapsulating abstract production tasks. Such state variables are directly associated with the production procedure extracted from the knowledge base. The actual number of these variables (and their values) depend on the complexity of the modeled procedure. In general, each \"production\" state variable is associated with a specific _abstraction level_ of the extracted hierarchical procedure. A _goal state variable_\(SV_{G}\) encapsulates high-level production requests and is associated with the individuals of ProductionGoal. Individuals of this concept are generally root elements of the production procedure and are mapped to the values of \(SV_{G}\).