I can't remember if smach is installed by default with Groovy, but you can try installing it manually like this:
$ sudo apt-get install ros-groovy-executive-smach*
Then you can try import commands like this:
import smach
from smach import State, StateMachine, CBState
from smach_ros import SimpleActionState, IntrospectionServer
--patrick
Originally posted by Pi Robot with karma: 4046 on 2014-03-09
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by Massbuilder on 2014-03-09:
didn't work however I did run rostopic list and confirmed it is on my computer. And I am importing it properly, What could the problem be
Comment by Pi Robot on 2014-03-09:
I'm not sure what you mean by "running rostopic list" to confirm that it is on your computer since this command does not show what is installed. Can you please update your question with the command you actually ran and the output you are seeing that confirms that you have smach installed? Thanks.
Comment by Massbuilder on 2014-03-09:
I noticed something a little funny but don't know what to make of it. There is a file under ros_smach called test with test programs in it. I ran some of these and they work and they import from smach, I even got one running as I write this. Weird huh!
Comment by Pi Robot on 2014-03-09:
OK, that sounds like either your manifest.xml file (rosbuild) or your package.xml file (catkin) is missing the required dependencies on smach. Is your test script inside a package of your own creating? If so, add dependencies for smach, smach_ros and smach_msgs in your manifest.xml or package.xml file. The smach_ros package.xml illustrates the syntax for catkin.
Comment by Massbuilder on 2014-03-10:
In response to the first question I was trying to add the script to a package I made several months ago.
Comment by Pi Robot on 2014-03-10:
Is it a rosbuild package (manifest.xml) or catkin? (package.xml).