[Documentation] [TitleIndex] [WordIndex

SMACH Tutorials

Learning SMACH

If you just want to look at code, try out the learning by example. If you rather follow a step-by-step guide, choose the step-by-step tutorials.

Learning Step-by-Step

Learning by Example

  1. Calling Actions from a State Machine (ROS)

    This tutorial teaches you how to call action servers from within a SMACH state machine.

  2. Create a Hierarchical State Machine

    This tutorial teaches you how to nest different state machines, creating a hierarchical state machine.

  3. Getting Started with smach

    This tutorial guides you through the very first steps of using smach.

  4. Passing User Data between States

    This tutorial teaches you how to pass data from one state(machine) to the next state(machine).

  5. 开始使用smach

    这个教程是指导你使用smach的第一步。

  6. 在状态间传递用户数据

    这个教程将教会你如何从一个状态(机)传递数据到下一个状态(机)。

  7. 创建分级状态机

    本教程教你如何嵌套不同的状态机,创建分级状态机。

  8. 从状态机调用行为(ROS)

    本教程将教会你如何从SMACH状态机内部调用行为服务。

  9. 查看状态机(ROS)

    本教程向你展示如何使用smach查看器,这是一种简单的工具,可以监视状态机并对状态之间的数据流进行内省。

  10. Getting Started with smach

    This tutorial guides you through the very first steps of using smach.

  11. Passing User Data between States

    This tutorial teaches you how to pass data from one state(machine) to the next state(machine).

  12. Create a Hierarchical State Machine

    This tutorial teaches you how to nest different state machines, creating a hierarchical state machine.

  13. Calling Actions from a State Machine (ROS)

    This tutorial teaches you how to call action servers from within a SMACH state machine.

  14. Viewing State Machines (ROS)

    This tutorial shows you how to use the smach viewer, a simple tool to monitor state machines and get introspection into the data flow between states.

  15. Viewing State Machines (ROS)

    This tutorial shows you how to use the smach viewer, a simple tool to monitor state machines and get introspection into the data flow between states.

  1. Concurrent State Machine

    This tutorial shows an example of running two states in parallel.

  2. Simple State Machine

    This tutorial shows how to put together a simple state machine with two states.

  3. 简单状态机

    本教程介绍如何将一个简单的状态机与两个状态组合在一起。

  4. 传递用户数据

    本教程给出了两个将用户数据传递给对方的例子。

  5. User Data Passing

    This tutorial gives an example of two states passing user data to each other.

  6. Simple State Machine

    This tutorial shows how to put together a simple state machine with two states.

  7. User Data Passing

    This tutorial gives an example of two states passing user data to each other.

  8. Nesting State Machines

    This tutorial gives an example of nesting a state machine in another state machine, creating a hierarchical state machine.

  9. 嵌套状态机

    本教程给出了在另一个状态机中嵌套状态机的示例,并创建了分级状态机。

  10. 并行状态机

    本教程展示了一个并行运行两个状态的示例。

  11. 简单行为状态 (ROS)

    本教程展示了一个直接调用actionlib接口的状态示例。

  12. Nesting State Machines

    This tutorial gives an example of nesting a state machine in another state machine, creating a hierarchical state machine.

  13. Concurrent State Machine

    This tutorial shows an example of running two states in parallel.

  14. Simple Action State (ROS)

    This tutorial shows an example of states that call directly into the actionlib interface.

  15. Simple Action State (ROS)

    This tutorial shows an example of states that call directly into the actionlib interface.

SMACH Containers

  1. Concurrence container

    This tutorial teaches you how to use the Concurrence container.

  2. Iterator container

    This tutorial teaches you how to use the Iterator container.

  3. StateMachine容器

    本教程教会你如何使用StateMachine容器.

  4. Concurrence容器

    本教程教会你如何使用Concurrence容器

  5. Sequence容器

    本教程将教会你如何使用Sequence容器。

  6. Iterator容器

    本教程将教会你如何使用Iterator容器。

  7. 用actionlib封装容器

    本教程介绍如何通过actionlib使用SMACH作为行为分发任务。

  8. StateMachine container

    This tutorial teaches you how to use the StateMachine container.

  9. Sequence container

    This tutorial teaches you how to use the Sequence container.

  10. StateMachine container

    This tutorial teaches you how to use the StateMachine container.

  11. Concurrence container

    This tutorial teaches you how to use the Concurrence container.

  12. Sequence container

    This tutorial teaches you how to use the Sequence container.

  13. Iterator container

    This tutorial teaches you how to use the Iterator container.

  14. Wrapping a Container With actionlib

    This tutorial explains how to serve out a SMACH plan as an action over actionlib.

  15. Wrapping a Container With actionlib

    This tutorial explains how to serve out a SMACH plan as an action over actionlib.

SMACH States

  1. ServiceState (ROS)

    This tutorial shows how to represent the execution of a service as a SMACH state.

  2. CBState

    This tutorial gives an example of how to use CBState, a state that simply executes a callback when it is active.

  3. SimpleActionState (ROS)

    This tutorial show how to use the SimpleActionState to directly call an action interface using SMACH

  4. Generic State

    This tutorial show how to implement a generic SMACH State

  5. 通用状态

    本教程将展示如何实现一个通用SMACH状态

  6. CBState

    本教程给出了一个如何使用CBState的示例,该状态在激活时简单地执行回调。

  7. SimpleActionState (ROS)

    本教程展示如何使用SimpleActionState直接调用SMACH的行为接口。

  8. Generic State

    This tutorial show how to implement a generic SMACH State

  9. CBState

    This tutorial gives an example of how to use CBState, a state that simply executes a callback when it is active.

  10. SimpleActionState (ROS)

    This tutorial show how to use the SimpleActionState to directly call an action interface using SMACH

  11. ServiceState (ROS)

    This tutorial shows how to represent the execution of a service as a SMACH state.

  12. MonitorState (ROS)

    Monitor a state!

  13. ServiceState (ROS)

    本教程展示如何将服务的执行表示为一个SMACH状态。

  14. MonitorState (ROS)

    监视状态

  15. MonitorState (ROS)

    Monitor a state!

Advanced SMACH

  1. Writing Custom Container Classes

    Most tasks can be performed without writing new types of container classes, but this tutorial explains how to write a new one.

  2. State Preemption Implementation

    This tutorial shows how to implement simple flag-based preemption in SMACH states.

  3. StateMachinePreemption

    Example of a state machine that implements preemption, using a concurrence container and monitor state.

  4. Writing Custom State Classes with User-defined Callbacks

    Sometimes you want to create a state class like smach.SimpleActionState which receives user callbacks as arguments. If these callbacks change the SMACH interface of a state (outcomes, userdata keys), then the callbacks need to be annotated with this information.

  5. State Preemption Implementation

    This tutorial shows how to implement simple flag-based preemption in SMACH states.

  6. Writing Custom Container Classes

    Most tasks can be performed without writing new types of container classes, but this tutorial explains how to write a new one.

  7. Writing Custom State Classes with User-defined Callbacks

    Sometimes you want to create a state class like smach.SimpleActionState which receives user callbacks as arguments. If these callbacks change the SMACH interface of a state (outcomes, userdata keys), then the callbacks need to be annotated with this information.

  8. StateMachinePreemption

    Example of a state machine that implements preemption, using a concurrence container and monitor state.

Create a new tutorial:

Test your SMACH knowledge

If you're interested in testing your SMACH knowledge, this page has a step-by-step test/example to test your knowledge of different states and containers.


2024-12-28 15:06