# Learning and Planning Based on Merged Experience from Multiple Situations for a Service Robot
## 2 Learning and Planning Methods
### Planning Based on Activity Schema with Merging Optimization and Partially Backtracking Techniques
#### 2.4.1 Planning Based on Activity Schema with Merging Optimization
In terms of efficiency, even though the plan-generating time cost for the first recovery of SBOP is greater than SBP's time to check the preconditions of the abstract methods, the total time for plan recovery from failure of SBOP is 59 seconds shorter. As shown in Table 1 below. Demonstration 2: Physical Experiment in the Scenario \"Collect and Deliver Drink Boxes to a Counter\"

In this scenario, the environment is set with 3 tables (Table 1-3) and a counter (Table 4) distributed in a laboratory (as shown in Figure 7). The task for the robot is to move the drink boxes from 3 tables to the counter. Similar to PR2, the Inbot robot has learned an activity schema for collecting a beverage box, including several abstract methods, such as grasp_object, put and move_object. Inbot is a mobile robot equipped with an arm and a gripper, together with sufficient sensors for automated navigation and manipulation. In the experiment, the action sequences generated with SBOP and SBP are presented with three colours in Figure 8. The actions in blue represent the same components in the two plans; the actions in orange represent components in the SBP-generated plan but removed in the SBOP-generated plan; and the actions in green represent the merged components in the SBP-generated plan compared with the SBOP-generated plan. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Method** & **SBOP** & **SBP** \\ \hline Number of intervention instructions during execution & 0 & \(\geq\)2 \\ Recover from the failure automatically & \(\surd\) & \(\times\) \\ Adapt among multiple learned activity schemas during execution & \(\surd\) & \(\times\) \\ Plan-generating time cost for the first recovery & 205 s & 149 s \\ Plan-generating time cost for the second recovery & 223 s & 205 s \\ Total time for plan recovery from failure & 428 s & 487 s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Planners’ performance in serve_a_coffee scenario. SBOP initially generated the same plan as SBP. Then, actions with independence or allowance relations were identified and placed in the same action clique. For example, since actions ob4 and kt11 exhibited independence relation, and kt11 and p14 exhibited allowance relation, the three actions could be placed in the same action clique \(AC_{1}\) to complete the task of transferring drink box 1 to the counter in the order: (ob4, kt11, p14). If multiple drink boxes were on the robot tray, several action cliques, which were independent of each other, would be placed in a larger action clique \(AC\). For example, when \(AC_{1}\) (ob4, kt11, p14) and \(AC_{2}\) (ob4, kt22, pt24) were placed in action clique \(AC\), the repetitive action ob4 would be merged to leave only one in \(AC\). Then, in the optimization modeled as MWCP, the task plan with maximum time savings had the least number of actions, in which the robot collected the maximum number of the boxes at a time. During this process, two ob4 actions were deleted. Actions m14 and m42 were replaced by action m12, since m12 had the same preconditions as m14 and the same effect as m42, with shorter time costs. Actions m24 and m43 were replaced by action m23 accordingly. The execution process with planner SBOP is shown in Figure 9. The performance comparison between SBOP and SBP is presented in Table 2. Although the plan-generating time of SBOP is 18.4%

Figure 8: The action sequences generated by SBOP and SBP. The actions in blue represent the same components among the two plans; the actions in orange represent components in the SBP-generated plan but removed in the SBOP-generated plan; the actions in green represent the merged components in the SBP-generated plan compared with the SBOP-generated plan. Figure 7: The experimental setup in a grid map. longer than SBP, the execution time is 17.4% shorter. In total, the robot can save 178 s to complete all tasks with SBOP, indicating the improvement in efficiency of SBOP compared with SBP.