spadmeter.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import roslib; roslib.load_manifest('zyonz_apps_base')
00004 import rospy
00005 import smach
00006 import smach_ros
00007 
00008 from zyonz_msgs.msg            import chlorophyll_sampleAction, chlorophyll_sampleGoal
00009 from iri_common_smach.st_sleep import WaitSeconds
00010 
00011 class SM_ZYONZ_CloseGripper():
00012     def __init__(self):
00013         self.sm = smach.StateMachine(outcomes=['succeeded','preempted','aborted'])
00014 
00015     def build_sm(self):
00016         with self.sm:
00017             smach.StateMachine.add('DO_SPADMETER_TEST_CLOSE',
00018                          smach_ros.SimpleActionState('/zyonz/skills/chlorophyll_meter/take_sample',
00019                          chlorophyll_sampleAction,
00020                          goal = chlorophyll_sampleGoal(close=True)),
00021                                    {'succeeded': 'WAIT_SPADMETER',
00022                                     'preempted': 'preempted',
00023                                     'aborted'  : 'aborted'})
00024 
00025             smach.StateMachine.add('WAIT_SPADMETER', WaitSeconds(1),
00026                          transitions={'finish': 'DO_SPADMETER_TEST_OPEN'})
00027 
00028             smach.StateMachine.add('DO_SPADMETER_TEST_OPEN',
00029                          smach_ros.SimpleActionState('/zyonz/skills/chlorophyll_meter/take_sample',
00030                          chlorophyll_sampleAction,
00031                          goal = chlorophyll_sampleGoal(close=False)),
00032                                    {'succeeded': 'succeeded',
00033                                     'preempted': 'preempted',
00034                                     'aborted'  : 'aborted'})
00035         return self.sm
00036 


zyonz_apps_base
Author(s): Jose Luis Rivero
autogenerated on Fri Dec 6 2013 22:53:18