We propose a hybrid combination of active inference and behavior trees (BTs)
for reactive action planning and execution in dynamic environments, showing how
robotic tasks can be formulated as a free-energy minimization problem. The
proposed approach allows to handle partially observable initial states and
improves the robustness of classical BTs against unexpected contingencies while
at the same time reducing the number of nodes in a tree. In this work, the
general nominal behavior is specified offline through BTs, where a new type of
leaf node, the prior node, is introduced to specify the desired state to be
achieved rather than an action to be executed as typically done in BTs. The
decision of which action to execute to reach the desired state is performed
online through active inference. This results in the combination of continual
online planning and hierarchical deliberation, that is an agent is able to
follow a predefined offline plan while still being able to locally adapt and
take autonomous decisions at runtime. The properties of our algorithm, such as
convergence and robustness, are thoroughly analyzed, and the theoretical
results are validated in two different mobile manipulators performing similar
tasks, both in a simulated and real retail environment