Releases: robosoft-ai/SMACC2
SMACC2 3.1.0 - Major refactor of cl_ros2_timer
Major refactor of cl_ros2_timer to use std::chrono literals
This commit refactors the cl_ros2_timer client library to replace its raw integer tick-count API with a duration-based API using C++ std::chrono literals, resolving Issue #61. The change improves timing accuracy, eliminates period-dependent behavior, and removes a significant amount of now-unnecessary infrastructure.
The Problem
Previously, CbTimerCountdownOnce and CbTimerCountdownLoop accepted integer tick counts, making their behavior dependent on the ClRos2Timer constructor's tick period. A call like configure_orthogonal<OrTimer, CbTimerCountdownOnce>(10) would wait 10 ticks — meaning 5 seconds with a 500ms timer, or 10 seconds with a 1-second timer. This made state machine timing fragile and non-obvious to read. Additionally, the implementation counted ticks internally, producing up to one full tick period of undershoot.
The Solution
CbTimerCountdownOnce and CbTimerCountdownLoop now accept rclcpp::Duration directly via C++ chrono literals (5s, 500ms, 4min). Each behavior creates its own dedicated rclcpp::WallTimer on entry and cancels it on exit, giving exact, period-independent timing. The residual timing error is now ~50ms, which is the irreducible floor imposed by the SMACC2 SignalDetector's 20Hz polling loop — not the timer period. The new API reads as intended: configure_orthogonal<OrTimer, CbTimerCountdownOnce>(10s) waits exactly 10 seconds regardless of how the orthogonal is configured.
Infrastructure Removed
Because the behaviors now own their own wall timers, the entire tick-passing stack became unnecessary. ClRos2Timer is now a pure marker client with no constructor arguments and no component creation. CpTimerListener1, which previously bridged CpRos2Timer tick signals to behavior callbacks, has been deleted. CbRos2Timer, a generic tick-based behavior that was present in documentation but unused in any state machine, has also been removed. CpRos2Timer is retained in the smacc2 core library as a generic reusable component.
Scope of Changes
All 22 or_timer.hpp files across the reference library have been updated to createClient() with no arguments. All configure_orthogonal call sites — spanning over 300 state files — have been updated from integer tick counts to chrono literals. CbTimerWithWorkSimulation in sm_multithread_test_1 has been rewritten to own its own wall timer with an explicit tickPeriod parameter. The cl_ros2_timer README and the smacc2_docs how-to guide and tutorials have been updated to reflect the new API. All 38 packages have been bumped to version 3.1.0.
SMACC2 3.0.1 - ROS2 Jazzy Jalisco Support
SMACC2 3.0.1 - ROS2 Jazzy Jalisco Support
This release introduces official support for ROS2 Jazzy Jalisco,
making it the primary development branch for SMACC2 on Ubuntu 24.04 Noble.
What's New
ROS2 Jazzy Support
- Default Branch: Jazzy is now the primary development branch
- Ubuntu 24.04: Full compatibility with Ubuntu Noble Numbat
- LTS Support: Aligned with ROS2's latest Long-Term Support release
CI/CD Improvements
- PEP 668 Compliance: Fixed CI format pipeline for Ubuntu 24.04
- Robust Tooling: Migrated to apt-based pre-commit and clang-format
installation - Future-Proof: Eliminates externally-managed-environment errors
Installation
For Ubuntu 24.04 (Jazzy):
# Add ROS2 repository (if not already added)
sudo apt update && sudo apt install software-properties-common
sudo add-apt-repository universe
sudo curl -sSL
https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o
/usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture)
signed-by=/usr/share/keyrings/ros-archive-keyring.gpg]
http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo
$UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list >
/dev/null
# Install SMACC2 (available 3-5 days after rosdistro PR merge)
sudo apt update
sudo apt install ros-jazzy-smacc2
Build from source:
cd ~/ros2_ws/src
git clone https://github.com/robosoft-ai/SMACC2.git
cd SMACC2
git checkout 3.0.1
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
colcon build
### Full Changelog
See https://github.com/robosoft-ai/SMACC2/blob/3.0.1/smacc2/CHANGELOG.rst
for complete details.
### Contributors
- @brettpac (Brett Aldrich)
### Documentation
- https://smacc2.robosoft.ai/
- https://robosoft-ai.github.io/smacc2_doxygen/jazzy/html/index.html
- https://github.com/robosoft-ai/SMACC2