def relayboard_sim(): rospy.init_node('cob_relayboard_sim') # emergency_stop topic pub_em_stop = rospy.Publisher('/emergency_stop_state', EmergencyStopState) msg_em = EmergencyStopState() msg_em.emergency_button_stop = False msg_em.scanner_stop = False msg_em.emergency_state = 0 # power_board/state topic pub_power_board = rospy.Publisher('/power_board/state', PowerBoardState) msg_power_board = PowerBoardState() msg_power_board.header.stamp = rospy.Time.now() msg_power_board.run_stop = True msg_power_board.wireless_stop = True #for cob the wireless stop field is misused as laser stop field # power_board/voltage topic pub_voltage = rospy.Publisher('/power_board/voltage', Float64) msg_voltage = Float64() msg_voltage.data = 48.0 # in simulation battery is always full while not rospy.is_shutdown(): pub_em_stop.publish(msg_em) pub_power_board.publish(msg_power_board) pub_voltage.publish(msg_voltage) rospy.sleep(1.0)
def talker(): pub = rospy.Publisher('/emergency_stop_state', EmergencyStopState) rospy.init_node('cob_relayboard_sim') em = EmergencyStopState() em.emergency_button_stop = False em.scanner_stop = False em.emergency_state = 0 while not rospy.is_shutdown(): pub.publish(em) rospy.sleep(1.0)
def relayboard_sim(): rospy.init_node('cob_relayboard_sim') # emergency_stop topic pub_em_stop = rospy.Publisher('/emergency_stop_state', EmergencyStopState) msg_em = EmergencyStopState() msg_em.emergency_button_stop = False msg_em.scanner_stop = False msg_em.emergency_state = 0 # power_state topic #pub_power = rospy.Publisher('/power_state', PowerState) #msg_power = PowerState() #msg_power.header.stamp = rospy.Time.now() #msg_power.time_remaining.secs = 1000 #msg_power.relative_capacity = 70 while not rospy.is_shutdown(): pub_em_stop.publish(msg_em) #pub_power.publish(msg_power) comes already out of gazebo rospy.sleep(1.0)
def relayboard_sim(): rospy.init_node("cob_relayboard_sim") # emergency_stop topic pub_em_stop = rospy.Publisher("/emergency_stop_state", EmergencyStopState) msg_em = EmergencyStopState() msg_em.emergency_button_stop = False msg_em.scanner_stop = False msg_em.emergency_state = 0 # power_state topic # pub_power = rospy.Publisher('/power_state', PowerState) # msg_power = PowerState() # msg_power.header.stamp = rospy.Time.now() # msg_power.time_remaining.secs = 1000 # msg_power.relative_capacity = 70 while not rospy.is_shutdown(): pub_em_stop.publish(msg_em) # pub_power.publish(msg_power) comes already out of gazebo rospy.sleep(1.0)