Go to the documentation of this file.00001
00002
00003 PKG = 'cob_3d_mapping_pipeline'
00004 import roslib; roslib.load_manifest(PKG)
00005 import rospy
00006 import smach
00007 import smach_ros
00008
00009
00010 from generic_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 = 3.14
00021
00022 SM.userdata.scan_pose = [0.515, -0.614, 1.583]
00023
00024
00025 with SM:
00026 smach.StateMachine.add('APPROACH', ApproachScanPose(),
00027 transitions={'succeeded':'UPDATE', 'failed':'overall_failed'})
00028 smach.StateMachine.add('UPDATE', UpdateEnvMap(),
00029 transitions={'succeeded':'overall_succeeded', 'failed':'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()