A Generative Partially Specified Finite State Machine Approach to Complex Behaviour Planning

Kalana Ratnayake, Michael Pritchard, David Hinwood, Maleen Jayasuriya, Damith Herath
Collaborative Robotics Laboratory, Faculty of Science and Technology, University of Canberra
Accepted at IROS 2026

Abstract

Autonomous robots operating in dynamic environments require behaviour planning systems that combine reactivity, interpretability, and adaptability. While Large Language Models (LLMs) have been successfully integrated with Behaviour Trees (BTs) for dynamic replanning, Finite State Machines (FSMs)—despite their widespread adoption and computational efficiency—remain unexplored for generative approaches. We propose a Generative Partially Specified Finite State Machine (GPSFSM) neurosymbolic architecture that utilises the symbolic and semantic structure of FSMs, including states and event-triggered transitions, to implement Behaviour Planning. This paper introduces the first GPSFSM framework for robotics, featuring Fabric, an FSM engine that parses, validates, and executes behaviour plans that contain Sequential, Recovery, Parallel-Any, and Parallel-All control structures. We extend the Capabilities2 package in ROS2 with an asynchronous event system for behaviour chaining and runtime parameter injection for configurable execution, addressing the ad-hoc function representations that limit current generative systems. PromptTools provides a unified ROS 2 interface to local and cloud LLMs, with prompt buffering, enabling dynamic asynchronous composition of task and context information. Together, these components enable standardised semantic capability descriptions for robot-agnostic development. Experimental evaluation on navigation tasks demonstrates that our GPSFSM approach achieves consistently higher plan-generation success rates than the state-of-the-art BTGenBot system, particularly excelling in zero-shot scenarios where BTs typically struggle, while maintaining comparable or lower planning latency to frontier LLMs. We also demonstrate that our system can generate complex behaviour through experiments. We release an open-source ROS2 stack that makes generative FSM planning practical and reproducible for robotic systems.

GPSFSM combines Fabric, Capabilities2, and PromptTools to generate, validate, and execute finite state machine behaviour plans for long-horizon robotic tasks in ROS 2.

Based on existing systems and the literature, we identify the following as the minimum requirements for generative behaviour planning using BTs, FSMs, or other approaches.

  1. A textual description of the robot's functionalities.
  2. A textual representation of the behaviour composition based on the robot's functionalities.
  3. Functionality to coordinate with LLMs to generate the textual representation.
  4. Functionality to execute the behaviours as described in the textual representation.

We selected Capabilities2 as our base system because it supports loading and unloading its Runners, which are its basic building blocks, from memory. Its Interface and Provider files also fulfil the first requirement. We augmented the Capabilities2 framework with an Event subsystem and parameter-based instantiation to emulate FSM behaviour and fulfil the fourth requirement.

To fulfil the second requirement, we propose Fabric, a system that supports parsing, validation, and conversion of a Behaviour Plan into Capabilities2-compatible instructions.

To fulfil the third requirement, we present PromptTools, a ROS 2 package that interfaces LLMs with the ROS 2 ecosystem via a standard ROS 2 service interface, along with Runners for Fabric and Capabilities2 that can be used for generative functionality.

Each of the three systems — Fabric, Capabilities2, and PromptTools — addresses specific requirements for generative behaviour planning.

  • Fabric is responsible for parsing, validating, and converting behaviour plans into executable instructions.

    Fabric
  • Capabilities2 provides the execution framework with event handling and parameter injection.

    Capabilities2
  • PromptTools interfaces with LLMs to generate the necessary textual representations of behaviours.

    PromptTools

These systems can be set up independently or in combination, depending on the specific needs of the robotic application. We provide Devcontainers for each system to facilitate easy setup and deployment for both ROS 2 Humble and ROS 2 Jazzy.

To complete the generative framework, we provide Capability Runners for Fabric, Capabilities2, and PromptTools that are used during the plan generation and execution process.

  • Fabric Capabilities is used to load new behaviour plans into the system.

    Fabric Capabilities
  • Capabilities2 Runner supports new behaviour plan generation and contains internal runners for control flow handling.

    Capabilities2 Runner
  • Prompt Capabilities provides capabilities for interacting with the PromptTools stack, allowing information gathering and new behaviour plan generation. It also includes behaviour plans for testing these capabilities.

    Prompt Capabilities

We also provide Capability Runners for the Nav2 and Perception stacks, which allow the generation of plans compatible with robotic navigation and perception tasks. These stacks can be customized to match the specific requirements of the robotic platform and the task at hand.

  • Perception provides vision and audio functions to the robot along with secondary functions such as image analysis, transcription, and speech synthesis.

    Perception
  • Perception Capabilities provides capabilities for interacting with the Perception stack. It also includes execution plans to test these capabilities.

    Perception Capabilities
  • Nav2 Capabilities provides capabilities for interacting with the Nav2 stack, which allows the generation of plans compatible with robotic navigation tasks. It also includes behaviour plans.

    Nav2 Capabilities

We use TurtleBot 4 during our experiments. We therefore also provide Capability Runners for the TurtleBot 4 stack, which allow the generation of plans compatible with the TurtleBot 4 robotic platform in both simulation and on the real robot.

  • TurtleBot 4 Capabilities provides custom configuration used by the capabilities for TurtleBot 4, including configuration for the Nav2 and Perception stacks. It also includes behaviour plans used in the evaluation of this paper.

    Turtlebot4 Capabilities

Supported Control Patterns

"S" is success event, "F" is failure event, and "OnStart" is the event triggered at the beginning of execution.

Plan generation example

We use TurtleBot 4 during our experiments, in both simulation and on the real robot.

Experiment 1

Experiment 2

BibTeX

          
@inproceedings{ratnayake2026gpsfsm,
  title={A Generative Partially Specified Finite State Machine Approach to Complex Behaviour Planning},
  author={Ratnayake, Kalana and Pritchard, Michael and Hinwood, David and Jayasuriya, Maleen and Herath, Damith},
  booktitle={IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
  year={2026},
  url={https://github.com/CollaborativeRoboticsLab/gpsfsm-2026}
}