Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 import roslib; roslib.load_manifest('srs_user_tests')
00029 import rospy
00030 from simple_script_server import *
00031 from std_msgs.msg import Empty as EmptyMsg
00032
00033 sss = simple_script_server()
00034
00035
00036 def main():
00037
00038 rospy.init_node('prepare_robot_for_nav_test_node')
00039 rospy.sleep(2)
00040
00041 sim = rospy.get_param('/use_sim_time')
00042
00043 if sim is True:
00044
00045 rospy.loginfo('Waiting until end of spawning...')
00046 rospy.wait_for_message('/sim_spawned',EmptyMsg)
00047 rospy.sleep(5)
00048
00049 sss.init('head', True)
00050 sss.init('tray', True)
00051 sss.init('arm', True)
00052 sss.init('torso', True)
00053
00054 rospy.loginfo('Moving camera...')
00055 sss.move('head', 'front', True)
00056
00057 rospy.loginfo('Moving tray...')
00058 sss.move('tray', 'down', True)
00059
00060 rospy.loginfo('Moving arm...')
00061 sss.move('arm', 'folded', True)
00062
00063 rospy.loginfo('Moving torso...')
00064 sss.move('torso', 'front_extreme', True)
00065
00066 rospy.loginfo('Ready!')
00067
00068 rospy.loginfo('Ready!')
00069
00070
00071
00072 if sim is True:
00073
00074 rospy.loginfo('Running in simulation, publishing to /sim_robot_init topic')
00075
00076 pub = rospy.Publisher('/sim_robot_init', EmptyMsg,latch=True)
00077 pub.publish(EmptyMsg())
00078 pub.publish(EmptyMsg())
00079 pub.publish(EmptyMsg())
00080
00081 rospy.spin()
00082
00083
00084 if __name__ == '__main__':
00085 try:
00086 main()
00087 except rospy.ROSInterruptException: pass