ROS进二阶学习笔记(2)- SMACH:用状态机来管理机器人任务
来源:互联网 发布:云南大学软件学院导师 编辑:程序博客网 时间:2024/06/13 20:05
ROS进二阶学习笔记(2) - SMACH:用状态机来管理机器人任务
http://wiki.ros.org/smach/Tutorials/Getting Started
http://wiki.ros.org/smach/Tutorials好久没有更新关于ROS的笔记,这里进入SMACH的学习和应用,参照rbx2(ros by example volume 2),和ROS官方wiki,进行学习。
====
关于概念
SMACH states是Python类,通过重写execute()方法来返回一个或多个可能的outcomes, 从而扩展smach.State类。 excute() 方法也可以通过可选的参数来来定义一个userdata集合,这个集合可以被用来传递状态之间的信息。本质上讲,状态执行的实际计算基本上可以是任何你想要的。并且,有很多预先定义好的state types ,这可以节省大量的非必须的代码。
- A SMACH state machine is another Python class (smach.StateMachine) that can contain a number of states.
- A state is added to a state machine by defining a set of transitions from the state's outcomes to other states in the machine.
When a state machine is run, these transitions determine the flow of execution from state to state:
input → STATE_1 → {outcome, transition} → STATE_2
input → STATE_2 → {outcome, transition} → STATE_3
etc.
预先实现的状态库
Smach comes with a whole library of pre-implemented states that cover many common usecases:
- 特别是SimpleActionState 类,把一个普通的ROS action 变成了一个SMACH 状态。
- 类似的,MonitorState 类封装了ROS topic;
- ServiceState类处理ROS Services;
- CBState 使用 @smach.cb_interface 装饰器使得你可以将几乎任何函数都变成一个SMACH 状态。
Container
To create a Smach state machine, you first create a number of states, and then add those states to a State Machine container.
There are a number of predefined SMACH containers that can also save you a lot of programming.
- The Concurrence 协作 container returns an outcome that depends on more than one state and allows one state to preempt抢占 another.
- The Sequence 序列 container automatically generates sequential transitions among the states that are added to it.
- The Iterator 迭代 container allows you to loop through one or more states until some condition is met.
We will learn more about these containers as we need them.
- ROS进二阶学习笔记(2)- SMACH:用状态机来管理机器人任务
- ROS smach-----创建层级状态机
- ROS smach-----通过状态机状态SimpleActionState调用action
- ROS学习笔记(二)- ROS驱动机器人实例
- ROS学习笔记(四) 先锋机器人跟随
- ROS学习笔记(三)先锋机器人的使用 — 参考 ROS wiki 和 Mobile wiki
- 学习笔记(2):Qt状态机初识
- ROS smach-----Concurrence state machine
- ROS学习(三)机器人模拟器
- 如何学习机器人Ros?
- ROS(机器人操作系统)学习(一)ROS开发环境搭建
- ROS(机器人操作系统)学习(二)ROS文件系统
- 状态机学习笔记(一)
- ROS进二阶学习笔记(4) - ROS and Multithread
- ROS进二阶学习笔记(6) -- ROS Bag
- ROS with V-rep (2) (ROS学习笔记五)
- FreeRTOS 学习笔记 3 —— 任务状态机之阻塞
- ROS进二阶学习笔记(7) -- Metapackage
- 01-redis学习第一章
- 代码质量之命名(一)[部分看来的部分自己感悟]
- Http响应案例、Http响应编码问题、Servlet项目编码问题总结图
- 初学swift_002
- 记一次写Java项目启动管理脚本
- ROS进二阶学习笔记(2)- SMACH:用状态机来管理机器人任务
- Oracle数据库简单查询的流程
- 协同过滤算法笔记
- noip模拟11.16~11.17总结
- linux kernel总结
- 07-redis学习第七章
- ASP.NET Ajax 三层架构 考试系统实现(试卷模块,考试模块,评分模块,计时模块)
- 当你改变了看世界的方式,你就能改变所看的世界
- 基于WebView的封装,支持原生和腾讯X5内核切换,支持下拉刷新和进度显示并且做了兼容判断