2013/11/15

smach 狀態機安裝筆記

http://wiki.ros.org/smach/Tutorials/Getting%20Started
這個狀態機似乎蠻好用的,而且還可以顯示各種不同狀況。決定來試試看。
一開始是在hydro下面,可是怎麼都找不到smach-viewer這個東西,這樣要怎麼看那個漂亮的圖呢?
最後是自己下載了一份hydro的版本,rosmake後卻又沒有smach-tutorial可以試,到底還有沒有人在用smach呢?唉!

一氣之下,轉回groovy,這下子內建smach_viewer應該就沒問題了吧。哈哈!

但是呢,還是沒有smach_tutorial可用,這到底怎麼了呢!!!?

最後呢,自己去弄一份來吧,反正都走到這步田地了。
http://ros-users.122217.n3.nabble.com/How-to-install-smach-tutorials-package-td1284493.html
svn co https://code.ros.org/svn/ros-pkg/stacks/executive_smach_tutorials/trunk/ executive_smach_tutorials
rosmake executive_smach_tutorials

結束後進去先跑個範例試試看。
ipython state_machine_simple.py
什麼!!!居然不行,這太誇張了吧!
action_server_wrapper.py", line 9, in <module> from actionlib.simple_action_server import SimpleActionServer ImportError: No module named simple_action_server
這是什麼狀況?怎麼連自家人的程式都這樣搞內鬨呢?

http://answers.ros.org/question/44062/smach-tutorial-importerror-no-module-named-msg/
最後找到這裡一看,
There is a file called examples/actionlib.py in the same folder. Rename the file actionlib.py to actionlib1.py and delete the file actionlib.pyc.
居然是這個問題啊!
開個smach_viewer,跑iterator_tutorial.py,終於看到想看到的狀態機啦!


No comments:

Post a Comment