Package Summary

Version 2.3.20
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version humble
Last Updated 2026-08-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Pablo Inigo Blasco

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.launch.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.launch.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678) [Timer-C] Tick 1 START (Thread: 11223344) - simulating 150ms work ← Concurrent! [Timer-A] Tick 2 START (Thread: 12345678) - simulating 50ms work

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange

Package symbol

sm_multithread_test_1 package from SMACC2 repo

smacc2 cl_foundation_pose cl_gcalcli cl_generic_sensor cl_http cl_keyboard cl_lifecycle_node cl_mission_tracker cl_modbus_tcp_relay cl_moveit2z cl_nav2z backward_global_planner backward_local_planner forward_global_planner forward_local_planner nav2z_planners_common pure_spinning_local_planner undo_path_global_planner cl_px4_mr cl_ros2_timer eg_conditional_generator eg_random_generator smacc2_msgs sm_atomic_performance_trace_1 sm_atomic_subscribers_performance_test sm_coretest_action_client_1 sm_coretest_callback_rate_1 sm_coretest_exceptions_1 sm_coretest_features_1 sm_coretest_forced_finish_1 sm_coretest_idle_load_1 sm_coretest_object_churn_1 sm_coretest_poll_shutdown_1 sm_coretest_post_during_exit_1 sm_coretest_reactor_order_1 sm_coretest_signal_key_1 sm_coretest_timer_handoff_1 sm_coretest_transition_speed_1 sm_advanced_recovery_1 sm_atomic sm_atomic_http sm_atomic_lifecycle sm_atomic_mode_states sm_branching sm_cl_gcalcli_test_1 sm_cl_keyboard_unit_test_1 sm_cl_px4_mr_test_1 sm_cl_px4_mr_test_2 sm_cl_px4_mr_test_3 sm_cl_px4_mr_test_4 sm_cl_px4_mr_test_5 sm_cl_ros2_timer_unit_test_1 sm_data_sharing_1 sm_data_sharing_2 sm_modbus_tcp_relay_test_1 sm_mode_state_behavior_1 sm_multi_stage_1 sm_multithread_test_1 sm_nav2_gazebo_test_1 sm_nav2_gazebo_test_2 sm_nav2_gazebo_test_3 sm_pack_ml sm_panda_cl_moveit2z_cb_inventory sm_panda_cl_moveit2z_cb_inventory_isaacsim sm_retry_logic_1 sm_simple_action_client sm_three_some sr_all_events_go sr_conditional sr_event_countdown

ROS Distro
jazzy

Package Summary

Version 3.1.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version jazzy
Last Updated 2026-11-15
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Brett Aldrich

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

sm_multithread_test_1

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678)

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange

No version for distro kilted showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.3.20
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version humble
Last Updated 2026-08-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Pablo Inigo Blasco

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.launch.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.launch.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678) [Timer-C] Tick 1 START (Thread: 11223344) - simulating 150ms work ← Concurrent! [Timer-A] Tick 2 START (Thread: 12345678) - simulating 50ms work

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange

No version for distro lyrical showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.3.20
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version humble
Last Updated 2026-08-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Pablo Inigo Blasco

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.launch.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.launch.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678) [Timer-C] Tick 1 START (Thread: 11223344) - simulating 150ms work ← Concurrent! [Timer-A] Tick 2 START (Thread: 12345678) - simulating 50ms work

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange

No version for distro rolling showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.3.20
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version humble
Last Updated 2026-08-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Pablo Inigo Blasco

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.launch.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.launch.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678) [Timer-C] Tick 1 START (Thread: 11223344) - simulating 150ms work ← Concurrent! [Timer-A] Tick 2 START (Thread: 12345678) - simulating 50ms work

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange

No version for distro github showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.3.20
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version humble
Last Updated 2026-08-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Pablo Inigo Blasco

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.launch.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.launch.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678) [Timer-C] Tick 1 START (Thread: 11223344) - simulating 150ms work ← Concurrent! [Timer-A] Tick 2 START (Thread: 12345678) - simulating 50ms work

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange

No version for distro galactic showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.3.20
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version humble
Last Updated 2026-08-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Pablo Inigo Blasco

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.launch.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.launch.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678) [Timer-C] Tick 1 START (Thread: 11223344) - simulating 150ms work ← Concurrent! [Timer-A] Tick 2 START (Thread: 12345678) - simulating 50ms work

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange

No version for distro iron showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.3.20
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version humble
Last Updated 2026-08-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Pablo Inigo Blasco

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.launch.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.launch.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678) [Timer-C] Tick 1 START (Thread: 11223344) - simulating 150ms work ← Concurrent! [Timer-A] Tick 2 START (Thread: 12345678) - simulating 50ms work

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange

No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.3.20
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version humble
Last Updated 2026-08-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Pablo Inigo Blasco

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.launch.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.launch.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678) [Timer-C] Tick 1 START (Thread: 11223344) - simulating 150ms work ← Concurrent! [Timer-A] Tick 2 START (Thread: 12345678) - simulating 50ms work

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange

No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 2.3.20
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/robosoft-ai/SMACC2.git
VCS Type git
VCS Version humble
Last Updated 2026-08-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

SMACC2 multi-threaded executor demonstration state machine. This state machine demonstrates the use of ExecutionModel::MULTI_THREAD_SPINNER for concurrent ROS2 callback processing. Addresses GitHub issue #571.

Maintainers

  • Pablo Inigo Blasco

Authors

No additional authors.

sm_multithread_test_1 - SMACC2 Multi-threaded Executor Demonstration

A reference implementation demonstrating SMACC2’s multi-threaded executor capability.

🎯 Addresses GitHub Issue #571: “Multithread executor example”


📋 Table of Contents


What is This?

This state machine demonstrates SMACC2’s multi-threaded executor feature by running four concurrent timers with simulated work. The logs clearly show the difference between single-threaded and multi-threaded execution through thread IDs and overlapping timestamps.

Key Features:

  • ✅ Multi-threaded ROS2 callback processing
  • ✅ Visual demonstration of concurrency via logs
  • ✅ Side-by-side comparison with single-threaded mode
  • ✅ Comprehensive documentation of usage and limitations

Quick Start

Run Multi-threaded Version (Main Demo)

# Build the package
colcon build --packages-select sm_multithread_test_1

# Source the workspace
source install/setup.bash

# Launch multi-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1.launch.py

Run Single-threaded Version (For Comparison)

# Launch single-threaded version
ros2 launch sm_multithread_test_1 sm_multithread_test_1_single.launch.py

The state machine runs for 15 seconds then enters a terminal state. Press Ctrl+C to exit.


The Problem This Solves

Background

By default, SMACC2 uses a single-threaded executor where ROS2 callbacks (timers, subscribers, action clients) execute sequentially. This is simple and deterministic, but can be a bottleneck when:

  • Multiple callbacks have significant processing time
  • Callbacks involve I/O operations (network, disk, sensors)
  • You want maximum throughput for concurrent operations

Solution

SMACC2 supports ROS2’s Multi-threaded Executor which allows callbacks to execute concurrently on multiple threads, improving throughput for I/O-bound and concurrent operations.

Enabling it is trivial – just one parameter change:

// Single-threaded (default)
smacc2::run<MyStateMachine>();

// Multi-threaded
smacc2::run<MyStateMachine>(smacc2::ExecutionModel::MULTI_THREAD_SPINNER);
                            //  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            //  THIS IS THE ONLY CHANGE NEEDED!


What You’ll Observe

Multi-threaded Mode Output

``` [Timer-A] Tick 1 START (Thread: 12345678) - simulating 50ms work [Timer-B] Tick 1 START (Thread: 87654321) - simulating 100ms work ← Different thread! [Timer-A] Tick 1 END (Thread: 12345678) [Timer-C] Tick 1 START (Thread: 11223344) - simulating 150ms work ← Concurrent! [Timer-A] Tick 2 START (Thread: 12345678) - simulating 50ms work

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged sm_multithread_test_1 at Robotics Stack Exchange