Advertisement
Original software publication| Volume 15, 100477, March 2023

MERLIN2: MachinEd Ros 2 pLanINg

Open AccessPublished:February 08, 2023DOI:https://doi.org/10.1016/j.simpa.2023.100477

      Highlights

      • Service robots should have the ability to make decisions and schedule tasks.
      • Introduced a bioinspired hybrid cognitive architecture based on PDDL symbolic planning and state machines.
      • The proposed architecture is divided into two systems: deliberative and behavioral.
      • Each system of the architecture is composed of two layers.

      Abstract

      Any service robot should be able to make decisions and schedule tasks to reach predefined goals such as opening a door or assisting users at home. However, these processes are not single short-term tasks anymore and it is required to set long-term skills for establishing a control architecture that allows robots to perform daily tasks. This paper presents MERLIN2, a hybrid cognitive architecture based on symbolic planning and state machine decision-making systems that allows performing robot behaviors. The architecture can run in any robot running ROS 2, the latest version of the Robot Operative System. MERLIN2 is available at https://github.com/MERLIN2-ARCH/merlin2.

      Keywords

      Code metadata
      Tabled 1
      Current code versionv1.0
      Permanent link to code/repository used for this code versionhttps://github.com/SoftwareImpacts/SIMPAC-2023-26
      Permanent link to Reproducible Capsulehttps://codeocean.com/capsule/9822103/tree/v1
      Legal Code LicenseGPL-3.0 License
      Code versioning system usedGit
      Software code languages, tools, and services usedROS 2, Python3
      Compilation requirements, operating environments & dependenciesDocker OR ROS 2, Python3
      If available Link to developer documentation/manualhttps://merlin2.readthedocs.io/en/latest/
      Support email for questions[email protected]

      1. Introduction

      A social robot requires a considerable number of components working together for assisting a person in daily tasks. There are a number of challenges to overcome in a real scenario. The dynamics of environment such as humans walking randomly, long-term operations periods or managing multiple goals complicate decision making on the robot.
      Under these circumstances, behavior generation in autonomous robots is an open problem associated with artificial intelligence systems. Several paradigms gave rise to what is known as control architectures [
      • Nakhaeinia Danial
      • Tang S. Hong
      • Noor S.B. Mohd
      • Motlagh O.
      A review of control architectures for autonomous navigation of mobile robots.
      ], particularly the authors’ approach focus on those cognitively inspired. For instance, we can find deliberative architecture [
      • Ingrand Félix
      • Ghallab Malik
      Deliberation for autonomous robots: A survey.
      ], focused on planning approaches or subsumption architecture [
      • Brooks Rodney A.
      New approaches to robotics.
      ] and reactive architectures [
      • Peter Bonasso R.
      • James Firby R.
      • Gat Erann
      • Kortenkamp David
      • Miller David P.
      • Slack Mark G.
      Experiences with an architecture for intelligent, reactive agents.
      ], which face quick behavior generation. These architectures and their combination have had more impact on the community: the three-layer architecture of Gat [
      • Gat Erann
      • Bonnasso R. Peter
      • Murphy Robin
      • et al.
      On three-layer architectures.
      ], which organizes the decision-making component of the architecture in three different layers; and the hybrid architectures [
      • Arkin Ronald
      • Balch Tucker
      AuRA: Principles and practice in review.
      ], which merges deliberative and reactive concepts in order to fulfill short and long-term goals. As a result, it is possible to find in the research community several implementations of similar approaches, each one developed for its own purpose with issues for repeatability, making the picture of cognitive architectures [
      • Ye Peijun
      • Wang Tao
      • Wang Fei-Yue
      A survey of cognitive architectures in the past 20 years.
      ] hard to follow and to deploy in real robots.
      These days we can find specific approaches for previous paradigms developed in ROS [
      • Quigley Morgan
      • Conley Ken
      • Gerkey Brian
      • Faust Josh
      • Foote Tully
      • Leibs Jeremy
      • Wheeler Rob
      • Ng Andrew Y
      • et al.
      ROS: an open-source robot operating system.
      ]. From a deliberative perspective, planning approaches such as ROSPlan [

      Michael Cashmore, Maria Fox, Derek Long, Daniele Magazzeni, Bram Ridder, Arnau Carrera, N. Palomeras, N. Hurtós, Marc Carreras, ROSplan: Planning in the robot operating system, in: Proceedings International Conference on Automated Planning and Scheduling, ICAPS, vol. 2015, 2015, pp. 333–341.

      ] or PlanSys2 [
      • Martín Francisco
      • Ginés Jonatan
      • Rodríguez Francisco J.
      • Matellán Vicente
      PlanSys2: A planning system framework for ROS2.
      ] can be used to produce plans to achieve the high-level goals of the robot. These applications are based on the Planning Domain Definition Language (PDDL) [
      • Fox Maria
      • Long Derek
      PDDL2.1: An extension to PDDL for expressing temporal planning domains.
      ] that has been used to represent the environment of the robot using symbolic knowledge. However, these approaches do not give an easy way to modify the knowledge and do not provide persistence.
      From a reactive perspective, there are several solutions, for instance, SMACH the hierarchical state machine generator [
      • Bohren Jonathan
      • Cousins Steve
      The SMACH high-level executive.
      ] or behavior trees [
      • Colledanchise Michele
      • Natale Lorenzo
      On the implementation of behavior trees in robotics.
      ]. The former has alternatives such as FlexBee and the later has become the most extended paradigm in behavior generation in 2022. However, to integrate all these solutions in a single architecture can be difficult and for its own, some of them lack of functionalities such as visualization or symbolic knowledge manipulation.
      This work posed the software implementation of a cognitive architecture called MERLIN2 (evolution of MERLIN [
      • González-Santamarta Miguel Á.
      • Rodríguez-Lera Francisco J.
      • Álvarez-Aparicio Claudia
      • Guerrero-Higueras Ángel M.
      • Fernández-Llamas Camino
      MERLIN a cognitive architecture for service robots.
      ]) fully compatible with ROS 2, the standard de facto in software development. It provides a cognitive architecture framework that suits the hybrid architecture paradigm but it also includes generic architectural tools for managing symbolic knowledge and scheduling robot behaviors.

      2. Architecture

      MERLIN2, which comes from MachinEd Ros 2 pLannINg, is a software architecture that represents the paradigm of a hybrid cognitive architecture for robots composed of four layers [
      • González-Santamarta Miguel Á.
      • Rodríguez-Lera Francisco J.
      • Álvarez-Aparicio Claudia
      • Guerrero-Higueras Ángel M.
      • Fernández-Llamas Camino
      MERLIN a cognitive architecture for service robots.
      ]. It comprises the main software functionalities for generating robot behaviors: knowledge manipulation, for world model representation; deliberative decision making system, for accomplish missions and behavior generation for answering dynamic environments. This organization of MERLIN2 resemble human cognitive capacities.
      In nature, cognitive capacities such as short memory, perception or sensory-motor; are performed by some cerebrum lobes of the human brain [
      • Frackowiak Richard S.J.
      Human Brain Function.
      ,
      • Kolb Bryan
      • Whishaw Ian Q.
      • Teskey G. Campbell
      An Introduction to Brain and Behavior.
      ]. Organizing MERLIN2 components as cerebrum cognitive functions gave us the sketch presented in Fig. 1. The human cerebrum is composed of four structures called prefrontal, temporal, occipital and parietal [
      • Dawson Geraldine Ed
      • Fischer Kurt W.
      Human Behavior and the Developing Brain.
      ]. The prefrontal lobe has most of the modules from MERLIN2. It is in charge of memory, which is divided into long-term and short-term. The long-term memory, which represents the state of the environment, corresponds with the knowledge base managed by KANT. The short-term memory corresponds with the blackboards of the state machines of YASMIN. Besides, long-term memory is used in the planning process to choose the actions that the robot has to use to achieve its goals. These actions are implemented with YASMIN state machines and can also manage the knowledge of long-term memory. Finally, actions can use the navigation, text-to-speech and speech-to-text modules to interact with the environment and humans. The prefrontal lobe is also in charge of motor control, navigation, and speech production, text-to-speech; while the temporal lobe is in charge of the audio processing, speech-to-text.
      These cognitive functions are translated to the classic cognitive architecture depicted in Fig. 2. It presents in detail the MERLIN2 architecture technically divided into four layers classically associated with hybrid architectures and multi-layer cognitive proposals.

      2.1 Mission layer

      This layer is in charge of generating the high-level goals of the robots. These goals are related to robot duty, particular works that are internally or externally motivated, which means that are bred from the proprioceptive or exteroceptive stimulus (low battery status or human request).
      The software component at this layer sets the goals of the robot in a given instant. That goal starts from an initial state made of current environment facts and sets the facts that the robots want to be true.

      2.2 Planning layer

      This layer is in charge of generating plans to achieve high-level goals previously created. It is associated with the classic Deliberative subsystem and requires formal representation of the environment, plan solvers, task dispatcher, and execution [
      • Ingrand Félix
      • Ghallab Malik
      Deliberation for autonomous robots: A survey.
      ].
      MERLIN2 proposes a set of five components for this layer:
      • Knowledge Base: this component is the knowledge base of KANT, which corresponds with long-term memory. It stores the knowledge of the environment. There are two types of knowledge base depending on the storage type: a ROS 2 node that stores in process memory the knowledge and a MongoDB [
        • Bradshaw S.
        • Chodorow K.
        • Brazil E.
        ] database, which is more persistent.
      • PDDL Generator: this component is in charge of generating the PDDL text from the knowledge base.
      • Planner: this component uses the PDDL text to create plans. Several PDDL planners can be used. The available planners are POPF [

        Amanda Coles, Andrew Coles, Maria Fox, Derek Long, Forward-Chaining Partial-Order Planning, in: ICAPS 2010 - Proceedings of the 20th International Conference on Automated Planning and Scheduling, 2010, pp. 42–49.

        ], SMTP [

        Michael Cashmore, Maria Fox, Derek Long, Daniele Magazzeni, A compilation of the full PDDL+ language into SMT, in: Workshops at the Thirtieth AAAI Conference on Artificial Intelligence, 2016.

        ], unified-planning [

        aiplan4eu, AIPLAN4EU/unified-planning: The AIPLAN4EU Unified Planning Library, GitHub.

        ] and VHPOP [
        • Younes Håkan L.S.
        • Simmons Reid G.
        VHPOP: Versatile heuristic partial order planner.
        ].
      • Plan Dispatcher: this component is in charge of executing the actions of the generated plan. It also has to cancel the current action if needed.
      • Executor: this component is a facade between this layer and the Mission Layer. It executed its component of this layer and cancel the Plan Dispatcher.

      2.3 Executive layer

      This layer is composed of the actions that the robot can carry out. When an action is instantiated, its associated knowledge is saved in the knowledge base. Besides, these actions are implemented as YASMIN state machines. As has been mentioned before, the blackboard of the state machines is the short-term memory, that stores the initial objects needed by the PDDL action and the partial solution of the state machine. Besides, YASMIN has a viewer that can be used to monitor the actions at a high level. Finally, new actions can be developed so that the robot can perform other tasks. As a result, more complex behaviors can be implemented.

      2.4 Reactive layer

      This layer provides the set of software components that bring bounded and specific applications that would be considered robot skills such as navigation (world exploration), text-to-speech (talking) or sound recognition (listening). This version of MERLIN2 includes three specific components that are suitable for validating the use of the cognitive architecture:
      • Navigation: this component corresponds with Nav2 [

        Steve Macenski, Francisco Martín, Ruffin White, Jonatan Ginés Clavero, The Marathon 2: A Navigation System, in: 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS, 2020.

        ], which is the navigation system of ROS 2.
      • Speech-to-text: this component is in charge of listening for speech and converting it to text.
      • Text-to-speech: this component is in charge of producing speech from a sentence.

      3. Software impact

      Cognitive architectures in robotics face the development and organization of software components to imitate the human mind. It is an active field of research where different software technologies and mechanisms can be found together. Some of them have been presented before, such as state machines and planning systems.
      MERLIN2 cognitive architecture contains the elements that can be beneficial to research conducted in robotics competitions, in real and simulated environments, including but not limited to RoboCup or SciRoc. It allows the management of symbolic and sub-symbolic information through the use of KANT, generating Finite State Machine with YASMIN, and a mechanism for integrating robot tasks.
      • 1.
        MERLIN2 aims to speed up the process of producing robot behaviors to face the daily short and long-term tasks of a service robot using ROS 2.
      • 2.
        MERLIN2 combines four high-value tools for robotics developers: YASMIN, KANT, a Generic Planner System and a visual monitoring engine for mission and action tracking.
      • 3.
        The four layers of MERLIN2 allow the generation of behaviors for performing complex robot tasks. The Mission Layer is supported by a mission engine which allows to the creation of an initial problem and the capability to create and execute goals as a consequence of developed actions. The Planning Layer manages symbolic task-solving. The Executive Layer has the actions, which are the result of associating and grouping skills based on two concepts: YASMIN Finite State Machine and (2) skill reuse. The Reactive Layer deploys the robot’s skills, adding a new one is a straightforward process. The current repository has examples with three basic robot skills: Navigation, STT and TTS.
      • 4.
        MERLIN2 adds the feature for symbolic knowledge manipulation through KANT supported on DTO and DAO patterns. KANT provides two approaches: one for bringing knowledge persistence, using MongoDB; while the other uses in-memory storage. KANT engine makes it accessible to the developer to update/change the technology used.
      • 5.
        MERLIN2 includes a generic planning system based on PDDL (Planning Layer). This planning system automatically extracts PDDL from the knowledge base, generates plans and executes the actions in a transparent manner for the developer. The solver motor includes simplified access to a set of PDDL solvers attending the version required.
      The results enabled by the software individually and the whole architecture have been reported in the following academic publications:
      • Miguel Á. González-Santamarta, Francisco J. Rodríguez-Lera, Francisco Martín, Camino Fernández, and Vicente Matellán. Kant: A tool for grounding and knowledge management. In Josá Manuel Ferrán- dez Vicente, José Ramón Álvarez-Sánchez, Félix de la Paz López, and Hojjat Adeli, editors, Bio-inspired Systems and Applications: from Robotics to Ambient Intelligence, pages 452–461, Cham, 2022. Springer International Publishing. [
        • González-Santamarta Miguel Á.
        • Rodríguez-Lera Francisco J.
        • Martín Francisco
        • Fernández Camino
        • Matellán Vicente
        KANT: A tool for grounding and knowledge management.
        ]
      • Miguel Á. González-Santamarta, Francisco J. Rodríguez-Lera, Vicente Matellán-Olivera, and Camino Fernández-Llamas. Yasmin: Yet another state machine. In Danilo Tardioli, Vicente Matellán, Guillermo Heredia, Manuel F. Silva, and Lino Marques, editors, ROBOT2022: Fifth Iberian Robotics Conference, pages 528–539, Cham, 2023. Springer International Publishing. [
        • González-Santamarta Miguel Á.
        • Rodríguez-Lera Francisco J.
        • Matellán-Olivera Vicente
        • Fernández-Llamas Camino
        YASMIN: Yet another state machine.
        ]
      • Miguel Á. González-Santamarta, Francisco J. Rodríguez-Lera, Claudia Álvarez-Aparicio, Ángel M. Guerrero-Higueras, and Camino Fernández-Llamas. MERLIN a cognitive architecture for service robots. Applied Sciences, 10(17):5989, aug 2020. [
        • González-Santamarta Miguel Á.
        • Rodríguez-Lera Francisco J.
        • Álvarez-Aparicio Claudia
        • Guerrero-Higueras Ángel M.
        • Fernández-Llamas Camino
        MERLIN a cognitive architecture for service robots.
        ]

      4. Limitations and further improvements

      Finally, several future works are taken into account. MERLIN2 needs a perception module that enables more complex behaviors. Besides, it can be used to perform grounding and anchoring [
      • Coradeschi Silvia
      • Loutfi Amy
      • Wrede Britta
      A short review of symbol grounding in robotic and intelligent systems.
      ] improving the long-term and short-term memory of MERLIN2.

      Declaration of Competing Interest

      The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

      Acknowledgement

      This work has been partially funded by an FPU fellowship provided by the Spanish Ministry of Universities (FPU21/01438) and the Grant PID2021-126592OB-C21 funded by MCIN/AEI/10.13039/501100011033 and by ERDF A way of making Europe.

      References

        • Nakhaeinia Danial
        • Tang S. Hong
        • Noor S.B. Mohd
        • Motlagh O.
        A review of control architectures for autonomous navigation of mobile robots.
        Int. J. Phys. Sci. 2011; 6: 169-174
        • Ingrand Félix
        • Ghallab Malik
        Deliberation for autonomous robots: A survey.
        Artificial Intelligence. 2017; 247: 10-44
        • Brooks Rodney A.
        New approaches to robotics.
        Science. 1991; 253: 1227-1232
        • Peter Bonasso R.
        • James Firby R.
        • Gat Erann
        • Kortenkamp David
        • Miller David P.
        • Slack Mark G.
        Experiences with an architecture for intelligent, reactive agents.
        J. Exp. Theoret. Artif. Intell. 1997; 9: 237-256
        • Gat Erann
        • Bonnasso R. Peter
        • Murphy Robin
        • et al.
        On three-layer architectures.
        Artif. Intell. Mob. Robots. 1998; 195: 210
        • Arkin Ronald
        • Balch Tucker
        AuRA: Principles and practice in review.
        J. Exp. Theoret. Artif. Intell. 1970; 9
        • Ye Peijun
        • Wang Tao
        • Wang Fei-Yue
        A survey of cognitive architectures in the past 20 years.
        IEEE Trans. Cybern. 2018; 48: 3280-3290
        • Quigley Morgan
        • Conley Ken
        • Gerkey Brian
        • Faust Josh
        • Foote Tully
        • Leibs Jeremy
        • Wheeler Rob
        • Ng Andrew Y
        • et al.
        ROS: an open-source robot operating system.
        in: ICRA Workshop on Open Source Software, vol. 3, no. 3.2. Kobe, Japan2009: 5
      1. Michael Cashmore, Maria Fox, Derek Long, Daniele Magazzeni, Bram Ridder, Arnau Carrera, N. Palomeras, N. Hurtós, Marc Carreras, ROSplan: Planning in the robot operating system, in: Proceedings International Conference on Automated Planning and Scheduling, ICAPS, vol. 2015, 2015, pp. 333–341.

        • Martín Francisco
        • Ginés Jonatan
        • Rodríguez Francisco J.
        • Matellán Vicente
        PlanSys2: A planning system framework for ROS2.
        in: IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS 2021, Prague, Czech Republic, September 27 - October 1, 2021. IEEE, 2021
        • Fox Maria
        • Long Derek
        PDDL2.1: An extension to PDDL for expressing temporal planning domains.
        J. Artif. Intell. Res. (JAIR). 2003; 20: 61-124
        • Bohren Jonathan
        • Cousins Steve
        The SMACH high-level executive.
        IEEE Robot. Autom. Mag. 2011; 17: 18-20
        • Colledanchise Michele
        • Natale Lorenzo
        On the implementation of behavior trees in robotics.
        IEEE Robot. Autom. Lett. 2021; 6: 5929-5936
        • González-Santamarta Miguel Á.
        • Rodríguez-Lera Francisco J.
        • Álvarez-Aparicio Claudia
        • Guerrero-Higueras Ángel M.
        • Fernández-Llamas Camino
        MERLIN a cognitive architecture for service robots.
        Appl. Sci. 2020; 10: 5989
        • Frackowiak Richard S.J.
        Human Brain Function.
        Elsevier, 2004
        • Kolb Bryan
        • Whishaw Ian Q.
        • Teskey G. Campbell
        An Introduction to Brain and Behavior.
        Worth New York, 2001
        • Dawson Geraldine Ed
        • Fischer Kurt W.
        Human Behavior and the Developing Brain.
        The Guilford Press, 1994
        • Bradshaw S.
        • Chodorow K.
        • Brazil E.
        MongoDB: The Definitive Guide: Powerful and Scalable Data Storage. The Expert’s Voice in Open Source. O’Reilly Media, Incorporated, 2019
      2. Amanda Coles, Andrew Coles, Maria Fox, Derek Long, Forward-Chaining Partial-Order Planning, in: ICAPS 2010 - Proceedings of the 20th International Conference on Automated Planning and Scheduling, 2010, pp. 42–49.

      3. Michael Cashmore, Maria Fox, Derek Long, Daniele Magazzeni, A compilation of the full PDDL+ language into SMT, in: Workshops at the Thirtieth AAAI Conference on Artificial Intelligence, 2016.

      4. aiplan4eu, AIPLAN4EU/unified-planning: The AIPLAN4EU Unified Planning Library, GitHub.

        • Younes Håkan L.S.
        • Simmons Reid G.
        VHPOP: Versatile heuristic partial order planner.
        J. Artificial Intelligence Res. 2003; 20: 405-430
      5. Steve Macenski, Francisco Martín, Ruffin White, Jonatan Ginés Clavero, The Marathon 2: A Navigation System, in: 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS, 2020.

        • González-Santamarta Miguel Á.
        • Rodríguez-Lera Francisco J.
        • Martín Francisco
        • Fernández Camino
        • Matellán Vicente
        KANT: A tool for grounding and knowledge management.
        in: Ferrández Vicente José Manuel Álvarez-Sánchez José Ramón de la Paz López Félix Adeli Hojjat Bio-Inspired Systems and Applications: From Robotics to Ambient Intelligence. Springer International Publishing, Cham2022: 452-461
        • González-Santamarta Miguel Á.
        • Rodríguez-Lera Francisco J.
        • Matellán-Olivera Vicente
        • Fernández-Llamas Camino
        YASMIN: Yet another state machine.
        in: Tardioli Danilo Matellán Vicente Heredia Guillermo Silva Manuel F. Marques Lino ROBOT2022: Fifth Iberian Robotics Conference. Springer International Publishing, Cham2023: 528-539
        • Coradeschi Silvia
        • Loutfi Amy
        • Wrede Britta
        A short review of symbol grounding in robotic and intelligent systems.
        KI-Künstliche Intelligenz. 2013; 27: 129-136