Skip to content

Software

Sugarcoat

By Automatika Robotics, France (checked on github.com/automatika-robotics (opens in a new tab)), from github.com/automatika-robotics/sugarcoat (opens in a new tab)

  • Middleware
  • Framework
  • MIT

Sugarcoat is a Python orchestration layer for event-driven ROS 2 systems, part of the EMOS ecosystem. It helps build lifecycle-managed components and combine them into self-healing systems.

Facts

GitHub stars
39read on 29 Nov 2026
Last update
21 Oct 2026Newest commit on main
Maintenance
Activea commit in the last 90 days
Difficulty
Intermediate

Checked on GitHub on 29 Nov 2026.

Licenses

Code
MIT (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (MIT) at commit 5d64e01 (opens in a new tab), on 25 Oct 2026.

Commercial use
Yes

At a glance

What it is
  • Components are managed lifecycle nodes with type-safe configuration and declarative auto-wiring of inputs and outputs.
  • Components report health status and trigger distributed fallbacks to recover from failures without crashing.
  • Global events and actions are defined in Python and monitor ROS 2 topics to trigger responses.
  • A Launcher offers a Python alternative to ros2 launch, supervising component lifecycles with threads or processes.
  • Robot plugins translate generic automation recipes so they can run on different robots.
  • A dynamic web UI is generated automatically for topics, parameters, events, and recipes.

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

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
MIT. 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 21 Oct 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 5d64e01

Robotheca read the repository at two versions: the summary at e700847 and the facts and the README at 5d64e01 (read on 29 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 Automatika Robotics, at commit 5d64e01, under MIT (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

Sugarcoat is the foundation of EMOS (opens in a new tab), the Embodied Operating System. A ROS 2 application tends to end up as a pile of nodes, launch files and glue, with what the robot actually does scattered across all of them. Sugarcoat gives the robot a nervous system instead. A modern robot drives, watches, listens, speaks and grasps at the same time, in a world that rarely goes to plan, and what it does next has to come from all of it, the moment it happens. A recipe is one Python script in which you declare the components, say which events matter and what happens when they fire, and hand the lot to a launcher that brings the system up, keeps it healthy and takes it down again.

Building Blocks
BlockWhat it gives you
ComponentA ROS 2 lifecycle node with the plumbing done: declared inputs and outputs, a typed configuration that also loads from YAML, JSON or TOML, a health status, fallbacks, and actions callable by name. Driven by a timer, a trigger topic, a service or an action server.
TopicA named, typed stream. Conversion between ROS messages and Python objects is done for you, spatial inputs arrive in the frame the algorithm needs, and use_plugin serves a topic from the robot's plugin instead of ROS.
EventA condition on live data in plain Python, Event(battery.msg.data < 20.0). Conditions combine across topics with and, or and not, fire on change, once or debounced, and any function returning bool can be polled as one.
ActionAnything callable with its arguments, ready to run when an event fires: a component method, a system action such as restart, reconfigure, publish or log, a plain function, or a plugin action. Arguments can come from topics at run time. A monitored action waits for a success condition, times out, retries and can be cancelled.
RoutineA named sequence of monitored steps with a retry and failure policy per step. It can be paused, resumed and aborted, publishes its progress, and is started by an event, from the web UI, or by an agent as a tool.
FallbacksRecovery a component runs on its own when its health status turns bad. An algorithm failure, a component failure and a system failure each get their own answer, from a retry to a restart.
LauncherTurns the recipe into a running system: configures and activates components as threads or as processes, starts the drivers and external nodes the recipe needs, runs the Monitor that evaluates events and dispatches actions, and supervises until the recipe ends. No launch files.
Robot pluginAdapts one robot or sensor to the interfaces recipes use: transports over ROS, UDP, HTTP or a vendor SDK, feedback decoders and command encoders, the robot's own actions and events, drivers to start, sensor mounts published to TF, and how the robot maps.
Web UI and APIOne call serves the recipe's inputs, outputs, settings, actions and routines to a browser, and the same over a JSON and WebSocket API guarded by HTTPS and API keys.
Key Features
  • Recipes, not launch files. A whole system is one Python file. It names the components, attaches the robot's plugin, and says which events matter and what should happen when they fire. The launcher does the rest. It configures and activates every component, as threads of one process or as processes of their own, keeps an eye on them while the recipe runs, and shuts the lot down cleanly when it is told to.
  • Events in plain Python. Event(battery.msg.data < 20.0) is a complete event. Field paths are checked against the message type when the recipe is imported, so a typo fails on your desk rather than on the robot. A condition can span several topics, fire only when something changes or only once, and a topic can be given a timeout so that an event never fires on a reading that stopped arriving a minute ago.
  • Actions that know whether they worked. Give an action a success condition, a timeout, a retry budget and a cancel method, and the Monitor that every launcher runs will dispatch it, wait for the verdict and try again if it has to. Nothing in a component's loop blocks for any of this.
  • Routines for behaviours that take steps. Detect, approach, grasp, lift. A routine says a sequence like that in one place, with a policy for each step, and can be paused, resumed and aborted from an event, from the web UI, or by an agent that plans with it as a tool. Its progress is published while it runs.
  • Components that heal. A component reports how it is doing rather than merely that it is alive, and when its status turns bad it runs the fallbacks it was given, whether that means a retry, a simpler algorithm, a reconnect or a restart. Nobody has to be watching.
  • One recipe, any robot. A robot plugin adapts the hardware to the interfaces recipes use, whether the robot speaks ROS, UDP, HTTP or a vendor SDK, and brings the robot's own actions and events along with it. Large feeds such as images and point clouds travel through shared memory.
  • An interface for free. One call serves the recipe in the browser and over a JSON and WebSocket API, behind HTTPS and API keys, with every asset served from the robot, so it works wherever the robot is, internet or not.

Behaviour trees had their day. A tree is one structure ticked by one node, so everything the robot does has to be squeezed into it, and it notices the world only when the tick reaches a condition node someone remembered to put there. A sugarcoated system is richer on every count. Any topic, any component's health or any reading from the robot can be an event, written in Python and checked against the message types before anything runs. Any event can trigger any action or routine anywhere in the system, and every event is watched at once, whatever the robot happens to be doing. Sequences live in routines where they belong, with a success test and a retry policy for each step and the means to pause, resume or abort them, while recovery lives with the component that needs it rather than in a branch of a tree. The robot reacts the moment something happens, not when the tick gets round to it.

Quick Start

A component that drives forward, and an event that slows it down when the battery runs low:

from ros_sugar import Launcher
from ros_sugar.core import Action, BaseComponent, Event
from ros_sugar.io import Topic
from ros_sugar.utils import ActionReturnType, component_action

battery = Topic(name="battery", msg_type="Float32")
cmd_vel = Topic(name="cmd_vel", msg_type="Twist")


class Patrol(BaseComponent):
    """Drives forward at a speed the recipe can change at run time."""

    def init_variables(self):
        self.speed = 0.5

    def _execution_step(self):
        self.publishers_dict["cmd_vel"].publish([self.speed, 0.0, 0.0])

    @component_action
    def slow_down(self, factor: float) -> ActionReturnType:
        self.speed *= factor
        return True, f"speed is now {self.speed:.2f} m/s"


patrol = Patrol(component_name="patrol", outputs=[cmd_vel])
low_battery = Event(battery.msg.data < 20.0, on_change=True)

launcher = Launcher()
launcher.add_pkg(components=[patrol])
launcher.on(low_battery, Action(patrol.slow_down, kwargs={"factor": 0.5}))
launcher.bringup()

Actions compose into routines. Here the same event starts a procedure whose steps are the component's actions, declared like slow_down above, each with its own test for success, and the routine is served in the web UI with its steps checked off as it runs:

from ros_sugar.actions import wait
from ros_sugar.core import Routine

docked = Topic(name="docked", msg_type="Bool")

return_to_dock = Routine(
    "return_to_dock",
    steps=[
        Action(patrol.slow_down, kwargs={"factor": 0.5}),
        Action(patrol.go_to_dock, success=docked.msg.data.is_true(),
               timeout=60.0, cancel_method=patrol.stop),
        wait(duration=2.0),
        Action(patrol.start_charging, max_retries=3, retry_delay=1.0),
    ],
    on_abort=Action(patrol.stop),
    description="Slow down, drive to the dock and start charging",
)

launcher.on(low_battery, return_to_dock)
launcher.enable_ui(inputs=[battery], outputs=[cmd_vel], routines=[return_to_dock])
launcher.bringup()

Open https://localhost:5001, publish a battery reading under 20, and watch the routine go. The EMOS documentation (opens in a new tab) covers components (opens in a new tab), events and actions (opens in a new tab), routines (opens in a new tab) and fallbacks (opens in a new tab) in depth, with worked recipes.

Any Robot

A recipe is written against standard interfaces. A plugin adapts one robot or sensor to them, so the recipe runs on new hardware without a change, and the robot's own actions and events are there to use by name:

from myrobot_plugin import MyRobot

robot = MyRobot()
launcher.add_plugin(robot)

odom = Topic(name="odom", msg_type="Odometry", use_plugin=True)
launcher.on(robot.events.low_battery(20.0), robot.actions.dock())

A plugin declares where its data comes from and how commands go out, the drivers it needs started, where its sensors sit, and how the robot maps. Ready-made plugins install with one command from the EMOS catalog, and writing one (opens in a new tab) is a Python class with no I/O in it.

Dynamic Web UI and API

Every recipe gets a web interface generated from its components: inputs and outputs, settings panels, task cards for action servers and routines, and a live graph of the running system, with no front-end code. Underneath it, a JSON and WebSocket API gives scripts, control centers and fleet managers the same access without ROS. The UI is served over HTTPS by default, the API is guarded by keys managed with ros2 run automatika_ros_sugar ui_security, and enable_ui(serve_browser=False) serves the API alone.

A navigation recipe

Packages add cards for their own message types; see UI Elements (opens in a new tab) and the Web UI and API (opens in a new tab) guide.

Installation

The easiest way to get Sugarcoat with the rest of the stack is the EMOS CLI (opens in a new tab). See the installation docs (opens in a new tab) for details.

With your package manager (Ubuntu, ROS 2 Humble or later):

sudo apt install ros-$ROS_DISTRO-automatika-ros-sugar

From source:

mkdir -p sugarcoat_ws/src && cd sugarcoat_ws/src
git clone https://github.com/automatika-robotics/sugarcoat
cd ..

pip install numpy opencv-python-headless 'attrs>=23.2.0' jinja2 \
            msgpack msgpack-numpy setproctitle pyyaml toml cryptography

colcon build
source install/setup.bash

The web UI is optional and needs two more packages on top of either install: pip install python-fasthtml monsterui.

Development

Build and source a workspace containing Sugarcoat, then run the suite from the repository root, as CI does:

pip install pytest
python3 -m pytest test/ -p no:anyio

Launch-based tests pick a ROS_DOMAIN_ID of their own, so they never share the graph with a stack running on the machine. For contributors and package authors building on Sugarcoat:

Part of the EMOS Ecosystem

Sugarcoat is one of three core open-source components in EMOS (opens in a new tab), the unified orchestration layer for Physical AI. The other two are written on it, and so is anything you build on them:

Write a recipe once. Deploy it on any robot. No code changes.

Resources
Copyright & Contributions

Sugarcoat is a collaboration between Automatika Robotics (opens in a new tab) and Inria (opens in a new tab). Contributions are welcome, as issues or pull requests.

The web UI is built on FastHTML (opens in a new tab) and MonsterUI (opens in a new tab) by Answer.AI, with thanks.

The code is available under the MIT License. See LICENSE (opens in a new tab) for details. Copyright (c) 2024 Automatika Robotics unless explicitly indicated otherwise.

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