diff --git a/robowaiter/behavior_tree/obtea/OptimalBTExpansionAlgorithm.py b/robowaiter/behavior_tree/obtea/OptimalBTExpansionAlgorithm.py index 6ec11d5..7f0010f 100644 --- a/robowaiter/behavior_tree/obtea/OptimalBTExpansionAlgorithm.py +++ b/robowaiter/behavior_tree/obtea/OptimalBTExpansionAlgorithm.py @@ -185,10 +185,10 @@ class OptBTExpAlgorithm: elif child.type == 'act': self.ptml_string += 'act '+child.content.name+"\n" elif isinstance(child, ControlBT): - if parnode.type == '?': + if child.type == '?': self.ptml_string += "selector{\n" self.dfs_ptml(parnode=child) - elif parnode.type == '>': + elif child.type == '>': self.ptml_string += "sequence{\n" self.dfs_ptml( parnode=child) self.ptml_string += '}\n' diff --git a/sub_task.ptml b/sub_task.ptml index b8bf4e1..adcea35 100644 --- a/sub_task.ptml +++ b/sub_task.ptml @@ -1,6 +1,6 @@ selector{ cond At(Coffee,Bar) -selector{ +sequence{ cond At(Robot,CoffeeMachine) act MakeCoffee() }