< >
Home » Ailibot实体机器人入门教程 » Ailibot入门教程-应用-SMACH状态机

Ailibot入门教程-应用-SMACH状态机

Ailibot入门教程-应用-SMACH状态机

说明

  • 介绍如何在Ailibot上应用SMACH状态机

相关设备:

前提准备

  • [Remote PC] 安装
$ sudo apt-get install ros-kinetic-executive-smach ros-kinetic-executive-smach-visualization

操作步骤

  • [Remote PC] 运行roscore
$ roscore
  • [Remote PC] 在ailibot_apps包中存放着一些例子,现在运行其中的一个
$ rosrun ailibot_apps concurrence.py 
[INFO] [1567066342.777881]: State machine starting in initial state 'FOO' with userdata: 
    ['sm_counter']
[INFO] [1567066342.778256]: Executing state FOO
[INFO] [1567066342.778475]: State machine transitioning 'FOO':'outcome1'-->'BAR'
[INFO] [1567066342.778760]: Executing state BAR
[INFO] [1567066342.778947]: Counter = 1.000000
[INFO] [1567066342.779121]: State machine transitioning 'BAR':'outcome1'-->'FOO'
[INFO] [1567066342.779356]: Executing state FOO
[INFO] [1567066342.779545]: State machine transitioning 'FOO':'outcome1'-->'BAR'
[INFO] [1567066342.779833]: Executing state BAR
[INFO] [1567066342.780011]: Counter = 2.000000
[INFO] [1567066342.780181]: State machine transitioning 'BAR':'outcome1'-->'FOO'
[INFO] [1567066342.780410]: Executing state FOO
[INFO] [1567066342.780651]: State machine transitioning 'FOO':'outcome1'-->'BAR'
[INFO] [1567066342.780922]: Executing state BAR
[INFO] [1567066342.781096]: Counter = 3.000000
[INFO] [1567066342.781264]: State machine transitioning 'BAR':'outcome1'-->'FOO'
[INFO] [1567066342.781488]: Executing state FOO
[INFO] [1567066342.781713]: State machine terminating 'FOO':'outcome2':'outcome4'
  • [Remote PC] 启动smach_viewer可视化界面
$ rosrun smach_viewer smach_viewer.py

请输入图片描述

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: ailibot入门教程