automatika_ros_sugar
Syntactic sugar for ROS2 nodes creation and management
README
The Sweetest Way to Build ROS2 Systems
Sugarcoat is a meta-framework that injects a whole lot of syntactic sugar into building complex, event-driven multinode systems in ROS2, all through an intuitive Python API.
Key Features
Feature |
Description |
|---|---|
Event-Driven Core |
Built-in primitives for Events and Actions enables dynamic runtime configuration and control over your system’s Components. |
Built-in Resilience |
Fallbacks and Fault Tolerance are core design concepts, ensuring your systems are robust and reliable. |
Intuitive Python API |
Design your entire system—nodes, events, and actions—using clean, readable Python code. |
Dynamic Web UI (NEW!) |
Automatically generate a fully dynamic, extensible web interface for monitoring and configuring your system. |
Launch Replacement |
A more pythonic alternative to the ROS2 Launch API, providing greater flexibility and runtime control for real-world applications. |
Packages Built with Sugarcoat
Kompass: A framework for building robust and comprehensive event-driven navigation stacks using an easy-to-use and intuitive Python API.
EmbodiedAgents: A fully-loaded framework for creating interactive physical agents that can understand, remember, and act upon contextual information from their environment.
Get Started
Learn more about the design concepts in Sugarcoat 📚
Learn how to create your own ROS2 package using Sugarcoat 🚀
(NEW!) Introducing Dynamic Web UI for Sugarcoat Recipes
The new Dynamic Web UI feature takes system visibility and control to the next level. Built with FastHTML and MonsterUI, it is designed to automatically generate a fully dynamic, extensible web interface for any Sugarcoat recipe, completely eliminating the need for manual front-end development.
This feature instantly transforms your complex, multinode ROS2 system into a monitorable and configurable web application.
Automatic UI Generation in Action
See how the Web UI effortlessly generates interfaces for different types of Sugarcoat recipes:
Example 1: General Q&A MLLM Recipe A fully functional interface generated for an MLLM agent recipe from EmbodiedAgents, automatically providing controls for settings and real-time text I/O with the robot.
Example 2: Vision Follower Recipe A complex system using components from both Kompass and EmbodiedAgents to control the robot motion and follow a visual target. The UI automatically renders image data, detections, and robot action commands, demonstrating its ability to handle multimedia and complex component interactions.
What’s Inside?
Automatic Settings UI: Interfaces for configuring the settings of all Components used in your recipe are generated on the fly.
Auto I/O Visualization: Front-end controls and data visualizations for UI Inputs and Outputs are created automatically.
WebSocket-Based Streaming: Features bidirectional, low-latency communication for streaming text, image, and audio messages.
Responsive Layouts: Input and output elements are presented in clear, adaptable grid layouts.
Extensible Design: Easily add support for new message types and custom visualizations through extensions.
How Sugarcoat Works
The core of Sugarcoat revolves around a few concepts:
Component: The main execution unit (a ROS2 lifecycle node abstraction) configured with Inputs/Outputs and Fallback behaviors. Each component reports its Health Status. Learn More about Components
Events & Actions: Mechanisms to handle and reconfigure components dynamically at runtime. Learn More about Events | Learn More about Actions
Launcher: Takes your defined Components, Events, and Actions, and executes the system using multi-threaded or multi-process execution. It works with an internal Monitor to manage component lifecycles and track events. Learn More about the Launcher
🛠️ Installation
Sugarcoat is available for ROS versions $\ge$ Humble.
Using your Package Manager (Recommended)
On Ubuntu, for example:
sudo apt install ros-$ROS_DISTRO-automatika-ros-sugar
Alternatively, you can install a specific deb package from the release page:
sudo dpkg -i ros-$ROS_DISTRO-automatica-ros-sugar_$version$DISTRO_$ARCHITECTURE.deb
Note: If your package manager’s version of
attrsis older than 23.2, you may need to update it via pip:pip install 'attrs>=23.2.0'
Building from Source
mkdir -p ros-sugar-ws/src
cd ros-sugar-ws/src
git clone [https://github.com/automatika-robotics/sugarcoat](https://github.com/automatika-robotics/sugarcoat) && cd ..
# Install dependencies (ensure attrs>=23.2.0 is included)
pip install numpy opencv-python-headless 'attrs>=23.2.0' jinja2 msgpack msgpack-numpy setproctitle pyyaml toml
colcon build
source install/setup.bash
Copyright
The code in this distribution is Copyright (c) 2024 Automatika Robotics unless explicitly indicated otherwise.
Sugarcoat is made available under the MIT license. Details can be found in the LICENSE file.
Contributions
Sugarcoat has been developed in collaboration between Automatika Robotics and Inria. Contributions from the community are most welcome.
🎩 Hat Tip
The Dynamic Web UI is powered by two cool open-source projects. A big thank you to Answers.ai for their work on: