def pub_info(name,now_emo,estimation_s): global current_emotion_value global pub global pub_vis msg = Bayesian() msg.estimation_value = [0] * 7 msg.emotion = now_emo msg.name = name for var in range(0,7): msg.estimation_value[var] = current_emotion_value[name][estimation_s[var]] time.sleep(0.4) pub.publish(msg) pub_vis.publish(msg)