$search
00001 #!/usr/bin/env python 00002 import roslib; roslib.load_manifest('cob_relayboard') 00003 import rospy 00004 import time 00005 from cob_relayboard.msg import EmergencyStopState 00006 #from pr2_msgs.msg import PowerState 00007 00008 def relayboard_sim(): 00009 rospy.init_node('cob_relayboard_sim') 00010 00011 # emergency_stop topic 00012 pub_em_stop = rospy.Publisher('/emergency_stop_state', EmergencyStopState) 00013 msg_em = EmergencyStopState() 00014 msg_em.emergency_button_stop = False 00015 msg_em.scanner_stop = False 00016 msg_em.emergency_state = 0 00017 00018 # power_state topic 00019 #pub_power = rospy.Publisher('/power_state', PowerState) 00020 #msg_power = PowerState() 00021 #msg_power.header.stamp = rospy.Time.now() 00022 #msg_power.time_remaining.secs = 1000 00023 #msg_power.relative_capacity = 70 00024 00025 while not rospy.is_shutdown(): 00026 pub_em_stop.publish(msg_em) 00027 #pub_power.publish(msg_power) comes already out of gazebo 00028 rospy.sleep(1.0) 00029 00030 if __name__ == '__main__': 00031 try: 00032 relayboard_sim() 00033 except rospy.ROSInterruptException: 00034 print "Interupted" 00035 pass