[Documentation] [TitleIndex] [WordIndex

SMACH 教程

学习 SMACH

如果你想要查看代码,尝试学习示例代码。如果倾向遵循循序渐进指南,查看循序渐进教程。

循序渐进学习

学习示例代码

  1. 开始使用smach

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

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

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

  3. 创建分级状态机

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

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

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

  5. 查看状态机(ROS)

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

  1. 简单状态机

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

  2. 传递用户数据

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

  3. 嵌套状态机

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

  4. 并行状态机

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

  5. 简单行为状态 (ROS)

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

SMACH 容器

  1. StateMachine容器

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

  2. Concurrence容器

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

  3. Sequence容器

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

  4. Iterator容器

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

  5. 用actionlib封装容器

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

SMACH 状态

  1. 通用状态

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

  2. CBState

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

  3. SimpleActionState (ROS)

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

  4. ServiceState (ROS)

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

  5. MonitorState (ROS)

    监视状态

高级 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:

测试你对SMACH的认知

如果你有兴趣测试你的SMACH认知, 这个界面有一个循序渐进的测试/样例来测试你对不同状态和容器的认知。


2024-03-23 12:29