Behavior Trees and State Machines in Robotics Applications