#!/usr/bin/env python
import rospy
import sys
from std_msgs.msg import String, Bool
import os
import time


state = True
faces = 0

pub_speak = rospy.Publisher('system_status_node/face', Bool, queue_size=10)


def face_cloud_callback(data):
	global faces
	#Si tiene que detectar, pasa la info
	if state:
		print(faces)
		if faces > 2:
			pub_speak.publish(data.data)
			faces = 0
		else:
			faces += 1

def speak_stat_callback(data):
	global state
	#Pasa a modo False
	state = data.data


def comprehension_stat_callback(data):
    global state
    #Pasa a modo True
    state = data.data


def main():

	rospy.init_node('system_status_node', anonymous=True)

	rospy.sleep(1)
	#Subscribe to the /face_detector/faces_cloud topic
	rospy.Subscriber('detection_node/face', Bool, face_cloud_callback)
	rospy.Subscriber('speak_node/speak_stat', Bool, speak_stat_callback)
	rospy.Subscriber('comprension_node/comprension_stat', Bool, comprension_stat_callback)

	#Return control to ROS
	rospy.spin()

if __name__ == '__main__':
	try:
		main()
	except rospy.ROSInterruptException:
		pass
	except KeyboardInterrupt:
		sys.exit(0)

e57a405c1671b338feb4a308bc013a45634babd4
<mask token>


def face_cloud_callback(data):
    global faces
    if state:
        print(faces)
        if faces > 2:
            pub_speak.publish(data.data)
            faces = 0
        else:
            faces += 1


def speak_stat_callback(data):
    global state
    state = data.data


def comprehension_stat_callback(data):
    global state
    state = data.data


def main():
    rospy.init_node('system_status_node', anonymous=True)
    rospy.sleep(1)
    rospy.Subscriber('detection_node/face', Bool, face_cloud_callback)
    rospy.Subscriber('speak_node/speak_stat', Bool, speak_stat_callback)
    rospy.Subscriber('comprension_node/comprension_stat', Bool,
        comprension_stat_callback)
    rospy.spin()


<mask token>

<mask token>


def face_cloud_callback(data):
    global faces
    if state:
        print(faces)
        if faces > 2:
            pub_speak.publish(data.data)
            faces = 0
        else:
            faces += 1


def speak_stat_callback(data):
    global state
    state = data.data


def comprehension_stat_callback(data):
    global state
    state = data.data


def main():
    rospy.init_node('system_status_node', anonymous=True)
    rospy.sleep(1)
    rospy.Subscriber('detection_node/face', Bool, face_cloud_callback)
    rospy.Subscriber('speak_node/speak_stat', Bool, speak_stat_callback)
    rospy.Subscriber('comprension_node/comprension_stat', Bool,
        comprension_stat_callback)
    rospy.spin()


if __name__ == '__main__':
    try:
        main()
    except rospy.ROSInterruptException:
        pass
    except KeyboardInterrupt:
        sys.exit(0)

<mask token>
state = True
faces = 0
pub_speak = rospy.Publisher('system_status_node/face', Bool, queue_size=10)


def face_cloud_callback(data):
    global faces
    if state:
        print(faces)
        if faces > 2:
            pub_speak.publish(data.data)
            faces = 0
        else:
            faces += 1


def speak_stat_callback(data):
    global state
    state = data.data


def comprehension_stat_callback(data):
    global state
    state = data.data


def main():
    rospy.init_node('system_status_node', anonymous=True)
    rospy.sleep(1)
    rospy.Subscriber('detection_node/face', Bool, face_cloud_callback)
    rospy.Subscriber('speak_node/speak_stat', Bool, speak_stat_callback)
    rospy.Subscriber('comprension_node/comprension_stat', Bool,
        comprension_stat_callback)
    rospy.spin()


if __name__ == '__main__':
    try:
        main()
    except rospy.ROSInterruptException:
        pass
    except KeyboardInterrupt:
        sys.exit(0)

import rospy
import sys
from std_msgs.msg import String, Bool
import os
import time
state = True
faces = 0
pub_speak = rospy.Publisher('system_status_node/face', Bool, queue_size=10)


def face_cloud_callback(data):
    global faces
    if state:
        print(faces)
        if faces > 2:
            pub_speak.publish(data.data)
            faces = 0
        else:
            faces += 1


def speak_stat_callback(data):
    global state
    state = data.data


def comprehension_stat_callback(data):
    global state
    state = data.data


def main():
    rospy.init_node('system_status_node', anonymous=True)
    rospy.sleep(1)
    rospy.Subscriber('detection_node/face', Bool, face_cloud_callback)
    rospy.Subscriber('speak_node/speak_stat', Bool, speak_stat_callback)
    rospy.Subscriber('comprension_node/comprension_stat', Bool,
        comprension_stat_callback)
    rospy.spin()


if __name__ == '__main__':
    try:
        main()
    except rospy.ROSInterruptException:
        pass
    except KeyboardInterrupt:
        sys.exit(0)

#!/usr/bin/env python
import rospy
import sys
from std_msgs.msg import String, Bool
import os
import time


state = True
faces = 0

pub_speak = rospy.Publisher('system_status_node/face', Bool, queue_size=10)


def face_cloud_callback(data):
	global faces
	#Si tiene que detectar, pasa la info
	if state:
		print(faces)
		if faces > 2:
			pub_speak.publish(data.data)
			faces = 0
		else:
			faces += 1

def speak_stat_callback(data):
	global state
	#Pasa a modo False
	state = data.data


def comprehension_stat_callback(data):
    global state
    #Pasa a modo True
    state = data.data


def main():

	rospy.init_node('system_status_node', anonymous=True)

	rospy.sleep(1)
	#Subscribe to the /face_detector/faces_cloud topic
	rospy.Subscriber('detection_node/face', Bool, face_cloud_callback)
	rospy.Subscriber('speak_node/speak_stat', Bool, speak_stat_callback)
	rospy.Subscriber('comprension_node/comprension_stat', Bool, comprension_stat_callback)

	#Return control to ROS
	rospy.spin()

if __name__ == '__main__':
	try:
		main()
	except rospy.ROSInterruptException:
		pass
	except KeyboardInterrupt:
		sys.exit(0)
