Go to the documentation of this file.00001
00002
00003 PKG = 'srs_states'
00004 import roslib; roslib.load_manifest(PKG)
00005 import rospy
00006 import smach
00007 import smach_ros
00008
00009
00010 from mapping_states import *
00011
00012 class TestStates:
00013 def __init__(self, *args):
00014 rospy.init_node('test_states')
00015
00016 def test_update_map(self):
00017
00018 SM = smach.StateMachine(outcomes=['overall_succeeded','overall_failed'])
00019
00020 SM.userdata.angle_range = 0.6
00021
00022 SM.userdata.scan_pose = [0.0, 0.0, 0.0]
00023
00024
00025 with SM:
00026
00027
00028 smach.StateMachine.add('UPDATE', UpdateEnvMap(),
00029 transitions={'succeeded':'overall_succeeded', 'failed':'overall_failed', 'preempted':'overall_failed'})
00030
00031
00032 try:
00033 SM.execute()
00034 except:
00035 error_message = "Unexpected error:", sys.exc_info()[0]
00036 self.fail(error_message)
00037
00038
00039 if __name__ == '__main__':
00040 test = TestStates()
00041 test.test_update_map()