Skip to content

Software

SMACC2

By ROBOSOFT AI, from github.com/robosoft-ai/SMACC2 (opens in a new tab)

  • Middleware
  • Framework
  • Apache-2.0

A C++ library for building event-driven, asynchronous behavioral state machines that control multi-component robots on ROS 2.

Facts

GitHub stars
385read on 22 Nov 2026
Last update
22 Nov 2026Newest commit on jazzy
Maintenance
Activea commit in the last 90 days
Difficulty
Advanced

Checked on GitHub on 22 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit 0db0057 (opens in a new tab), on 22 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Built for ROS 2 and supports its topics, services and actions out of the box.
  • Uses orthogonal states so a robot's separate hardware components can each be modeled cleanly.
  • Checks state machines at compile time, inheriting this from Boost Statechart.
  • Ships a reference library of ready-to-run state machines to start from.
  • Includes a client library with components such as a Nav2 action client (MoveBaseZ) and a keyboard client for debugging.
  • Has Doxygen documentation and works with a closed-source runtime analyzer for visualization and debugging.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's website (opens in a new tab)
Maintenance
Active, last commit on 22 Nov 2026.

Use it

How to install it, in the creator's words: The project's website (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 0db0057

Robotheca read the repository at two versions: the summary at 932da4d and the facts and the README at 0db0057 (read on 22 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by ROBOSOFT AI, at commit 0db0057, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

SMACC2

SMACC2 is an event-driven, asynchronous, behavioral state machine library for real-time ROS 2 (Robotic Operating System) applications written in C++, designed to allow programmers to build robot control applications for multicomponent robots, in an intuitive and systematic manner.

Repository Status, Packages and Documentation

NOTE: There are three build stages checking current and future compatibility of the package.

  1. Binary builds - against released packages (main and testing) in ROS distributions. Shows that direct local build is possible.

    Uses repos file: src/SMACC2/.github/SMACC2-not-released.<ros-distro>.repos

  2. Semi-binary builds - against released core ROS packages (main and testing), but the immediate dependencies are pulled from source. Shows that local build with dependencies is possible and if fails there we can expect that after the next package sync we will not be able to build.

    Uses repos file: src/SMACC2/.github/SMACC2.repos

  3. Source build - also core ROS packages are build from source. It shows potential issues in the mid future.

Getting started - ROS Jazzy
  1. Install ROS 2 Jazzy (opens in a new tab).

  2. Make sure that colcon, its extensions, vcs, and development tools are installed:

    sudo apt install python3-colcon-common-extensions python3-vcstool clang-format pre-commit
    
  3. Create a new ROS 2 workspace if necessary:

    export COLCON_WS=~/workspace/jazzy_ws
    mkdir -p $COLCON_WS/src
    
  4. Or just navigate to your workspace source folder:

    cd ~/workspace/jazzy_ws/src
    
  5. Clone the repo:

    git clone https://github.com/robosoft-ai/SMACC2.git
    
  6. Checkout the Jazzy branch:

    cd ~/workspace/jazzy_ws/src/SMACC2
    git checkout jazzy
    
  7. Navigate to the workspace:

    cd ~/workspace/jazzy_ws
    
  8. Update System:

    sudo apt update
    sudo apt upgrade
    
  9. Source the workspace:

    source /opt/ros/jazzy/setup.bash
    
  10. Update dependencies:

rosdep update
  1. Pull relevant packages and install dependencies:
vcs import src --skip-existing --input src/SMACC2/.github/SMACC2.jazzy.repos
rosdep install --ignore-src --from-paths src -y -r
  1. Compile:
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Features
  • Powered by ROS 2: SMACC2 has been developed specifically to work with ROS 2. It supports ROS 2 topics, services and actions, right out of the box.
  • Written in C++: Until now, ROS 2 has lacked a library to develop task-level behavioral state machines in C++. Although libraries have been developed in scripting languages such as python, these are unsuitable for real-world industrial environments where real-time requirements are demanded.
  • Orthogonals: Originally conceived by David Harel in 1987, orthogonality is absolutely crucial to developing state machines for complex robotic systems. This is because complex robots are always a collection of hardware devices which require communication protocols, start-up determinism, etc. With orthogonals, it is an intuitive and relatively straight forward exercise (at least conceptually;) to code a state machine for a robot comprising a mobile base, a robotic arm, a gripper, two lidar sensors, a gps transceiver and an imu, for instance.
  • Static State Machine Checking: One of the features that SMACC2 inherits from Boost Statechart is that you get compile time validation checking. This benefits developers in that the amount of runtime testing necessary to ship quality software that is both stable and safe is dramatically reduced. Our philosophy is "Wherever possible, let the compiler do it".
  • State Machine Reference Library: With a constantly growing library of out-of-the-box reference state machines, (found in the folder sm_reference_library (opens in a new tab)) guaranteed to compile and run, you can jumpstart your development efforts by choosing a reference machine that is closest to your needs, and then customize and extend to meet the specific requirements of your robotic application. All the while knowing that the library supports advanced functionalities that are practically universal among actual working robots.
  • SMACC2 Client Library: SMACC2 also features a constantly growing library of clients (opens in a new tab) that support ROS 2 Action Servers, Service Servers and other nodes right out-of-the box. The clients within the SMACC2 Client library have been built utilizing a component based architecture that allows for developer to build powerful clients of their own. Current clients of note include MoveBaseZ, a full featured Action Client built to integrate with Nav2, the cl_ros2_timer, the multi_role_sensor_client, and a cl_keyboard used extensively for state machine drafting & debugging.
  • Extensive Documentation: Although many ROS users are familiar with doxygen, our development team has spent a lot of time researching the more advanced features of doxygen such as uml style class diagrams and call graphs, and we've used them to document the SMACC2 library. Have a look to our doxygen sites (opens in a new tab) and we think you'll be blown away at what Doxygen looks like when it's done right (opens in a new tab) and it becomes a powerful tool to research a codebase.
  • SMACC2 Runtime Analyzer: The SMACC2 library works out of the box with the SMACC2 RTA. This allows developers to visualize and runtime debug the state machines they are working on. The SMACC2 RTA is closed source, but is free for individual and academic use. It can be found here (opens in a new tab).
Repository Structure
  • smacc2 - core library of SMACC2.
  • smacc2_client_library - client libraries for SMACC2, e.g., Navigation2 (nav2z_client), MoveIt2 (moveit2z_client).
  • smacc2_event_generators - ...
  • smacc2_msgs - ROS 2 messages for SMACC2 framework.
  • smacc2_sm_reference_library - libraries with reference implementations of state-machines used for demonstration and testing of functionalities.
  • ↓smacc2_state_reactor_library - ...
  • smacc2_performance_tools - ...
SMACC2 applications

From it's inception, SMACC2 was written to support the programming of multi-component, complex robots. If your project involves small, solar-powered insect robots, that simply navigate towards a light source, then SMACC2 might not be the right choice for you. But if you are trying to program a robot with a mobile base, a robotic arm, a gripper, two lidar sensors, a gps transceiver and an imu, then you've come to the right place.

Run a State Machine

The easiest way to get started is by selecting one of the state machines in our reference library (opens in a new tab), and then hacking it to meet your needs.

Each state machine in the reference library comes with it's own README.md file, which contains the appropriate operating instructions, so that all you have to do is simply copy & paste some commands into your terminal.

Operating instructions can be found in each reference state machines readme file.

Happy Coding!

Support

If you are interested in getting involved or need a little support, feel free to contact us by emailing techsupport@robosoft.ai (opens in a new tab)

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.